Skip to content

Commit

Permalink
perf hists: Move column length calculation out of hists__inc_stats()
Browse files Browse the repository at this point in the history
It's not the part of logic of hists__inc_stats() so it'd be better to
move it out of the function.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1398327843-31845-4-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
  • Loading branch information
Namhyung Kim authored and Jiri Olsa committed Apr 24, 2014
1 parent 6263835 commit ae993ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tools/perf/builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ static void hists__compute_resort(struct hists *hists)

insert_hist_entry_by_compute(&hists->entries, he, compute);
hists__inc_stats(hists, he);

if (!he->filtered)
hists__calc_col_len(hists, he);
}
}

Expand Down
4 changes: 3 additions & 1 deletion tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template)
void hists__inc_stats(struct hists *hists, struct hist_entry *h)
{
if (!h->filtered) {
hists__calc_col_len(hists, h);
hists->nr_non_filtered_entries++;
hists->stats.total_non_filtered_period += h->stat.period;
}
Expand Down Expand Up @@ -687,6 +686,9 @@ void hists__output_resort(struct hists *hists)

__hists__insert_output_entry(&hists->entries, n, min_callchain_hits);
hists__inc_stats(hists, n);

if (!n->filtered)
hists__calc_col_len(hists, n);
}
}

Expand Down

0 comments on commit ae993ef

Please sign in to comment.