aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-04-24 03:25:19 -0400
committerJiri Olsa <jolsa@kernel.org>2014-04-24 10:30:58 -0400
commitae993efc9c6bd109b027d2799a442892067e9230 (patch)
tree4a4ab931c3451d0cb406113dab40b3cf8b5ee66e
parent6263835a1b1ad137f3c26a1383c0487a9388d06e (diff)
perf hists: Move column length calculation out of hists__inc_stats()
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>
-rw-r--r--tools/perf/builtin-diff.c3
-rw-r--r--tools/perf/util/hist.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 0e46fa1b5ca0..c9cc771f182a 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -587,6 +587,9 @@ static void hists__compute_resort(struct hists *hists)
587 587
588 insert_hist_entry_by_compute(&hists->entries, he, compute); 588 insert_hist_entry_by_compute(&hists->entries, he, compute);
589 hists__inc_stats(hists, he); 589 hists__inc_stats(hists, he);
590
591 if (!he->filtered)
592 hists__calc_col_len(hists, he);
590 } 593 }
591} 594}
592 595
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 12d6c1bd761d..f5b388e50265 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -320,7 +320,6 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template)
320void hists__inc_stats(struct hists *hists, struct hist_entry *h) 320void hists__inc_stats(struct hists *hists, struct hist_entry *h)
321{ 321{
322 if (!h->filtered) { 322 if (!h->filtered) {
323 hists__calc_col_len(hists, h);
324 hists->nr_non_filtered_entries++; 323 hists->nr_non_filtered_entries++;
325 hists->stats.total_non_filtered_period += h->stat.period; 324 hists->stats.total_non_filtered_period += h->stat.period;
326 } 325 }
@@ -687,6 +686,9 @@ void hists__output_resort(struct hists *hists)
687 686
688 __hists__insert_output_entry(&hists->entries, n, min_callchain_hits); 687 __hists__insert_output_entry(&hists->entries, n, min_callchain_hits);
689 hists__inc_stats(hists, n); 688 hists__inc_stats(hists, n);
689
690 if (!n->filtered)
691 hists__calc_col_len(hists, n);
690 } 692 }
691} 693}
692 694