Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349915
b: refs/heads/master
c: 66f97ed
h: refs/heads/master
i:
  349913: d759de6
  349911: 3df6b0c
v: v3
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Jan 24, 2013
1 parent 30f1e82 commit 55217d0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce74f60eab3cc8b7a3b0cb9c29ec9b1e1abac7d2
refs/heads/master: 66f97ed3ac44c24958171bbc5cc04896147752b7
31 changes: 21 additions & 10 deletions trunk/tools/perf/builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,19 +414,30 @@ static void insert_hist_entry_by_compute(struct rb_root *root,

static void hists__compute_resort(struct hists *hists)
{
struct rb_root tmp = RB_ROOT;
struct rb_node *next = rb_first(&hists->entries);
struct rb_root *root;
struct rb_node *next;

if (sort__need_collapse)
root = &hists->entries_collapsed;
else
root = hists->entries_in;

hists->entries = RB_ROOT;
next = rb_first(root);

hists->nr_entries = 0;
hists->stats.total_period = 0;
hists__reset_col_len(hists);

while (next != NULL) {
struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node);
struct hist_entry *he;

next = rb_next(&he->rb_node);
he = rb_entry(next, struct hist_entry, rb_node_in);
next = rb_next(&he->rb_node_in);

rb_erase(&he->rb_node, &hists->entries);
insert_hist_entry_by_compute(&tmp, he, compute);
insert_hist_entry_by_compute(&hists->entries, he, compute);
hists__inc_nr_entries(hists, he);
}

hists->entries = tmp;
}

static void hists__process(struct hists *old, struct hists *new)
Expand All @@ -438,11 +449,11 @@ static void hists__process(struct hists *old, struct hists *new)
else
hists__link(new, old);

hists__output_resort(new);

if (sort_compute) {
hists__precompute(new);
hists__compute_resort(new);
} else {
hists__output_resort(new);
}

hists__fprintf(new, true, 0, 0, stdout);
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template)
return he;
}

static void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h)
void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h)
{
if (!h->filtered) {
hists__calc_col_len(hists, h);
Expand Down
1 change: 1 addition & 0 deletions trunk/tools/perf/util/hist.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ void hists__decay_entries_threaded(struct hists *hists, bool zap_user,
bool zap_kernel);
void hists__output_recalc_col_len(struct hists *hists, int max_rows);

void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h);
void hists__inc_nr_events(struct hists *self, u32 type);
size_t hists__fprintf_nr_events(struct hists *self, FILE *fp);

Expand Down

0 comments on commit 55217d0

Please sign in to comment.