diff options
| author | Jiri Olsa <jolsa@kernel.org> | 2016-06-14 14:19:18 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-15 09:48:02 -0400 |
| commit | d05e3aaeea56d7cd23976cb1fa626faf1a8bfbed (patch) | |
| tree | cf3e9bd1525fe0c41503e1a1af47f4215a10e83e /tools | |
| parent | 8f1d1b4452ce71a231d1a22e6357285fb773c551 (diff) | |
perf stdio: Add use_callchain parameter to hists__fprintf
It will be convenient in following patches to display hists entries
without callchains even if they are defined.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1465928361-2442-9-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/builtin-diff.c | 3 | ||||
| -rw-r--r-- | tools/perf/builtin-report.c | 3 | ||||
| -rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
| -rw-r--r-- | tools/perf/ui/stdio/hist.c | 10 | ||||
| -rw-r--r-- | tools/perf/util/hist.h | 3 |
5 files changed, 13 insertions, 8 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index f7645a42708e..69bad45deadd 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c | |||
| @@ -666,7 +666,8 @@ static void hists__process(struct hists *hists) | |||
| 666 | hists__precompute(hists); | 666 | hists__precompute(hists); |
| 667 | hists__output_resort(hists, NULL); | 667 | hists__output_resort(hists, NULL); |
| 668 | 668 | ||
| 669 | hists__fprintf(hists, true, 0, 0, 0, stdout); | 669 | hists__fprintf(hists, true, 0, 0, 0, stdout, |
| 670 | symbol_conf.use_callchain); | ||
| 670 | } | 671 | } |
| 671 | 672 | ||
| 672 | static void data__fprintf(void) | 673 | static void data__fprintf(void) |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index a87cb338bdf1..9f36b236f0f9 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
| @@ -370,7 +370,8 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist, | |||
| 370 | continue; | 370 | continue; |
| 371 | 371 | ||
| 372 | hists__fprintf_nr_sample_events(hists, rep, evname, stdout); | 372 | hists__fprintf_nr_sample_events(hists, rep, evname, stdout); |
| 373 | hists__fprintf(hists, true, 0, 0, rep->min_percent, stdout); | 373 | hists__fprintf(hists, true, 0, 0, rep->min_percent, stdout, |
| 374 | symbol_conf.use_callchain); | ||
| 374 | fprintf(stdout, "\n\n"); | 375 | fprintf(stdout, "\n\n"); |
| 375 | } | 376 | } |
| 376 | 377 | ||
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 2a6cc254ad0c..81dba80a42b5 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
| @@ -295,7 +295,7 @@ static void perf_top__print_sym_table(struct perf_top *top) | |||
| 295 | hists__output_recalc_col_len(hists, top->print_entries - printed); | 295 | hists__output_recalc_col_len(hists, top->print_entries - printed); |
| 296 | putchar('\n'); | 296 | putchar('\n'); |
| 297 | hists__fprintf(hists, false, top->print_entries - printed, win_width, | 297 | hists__fprintf(hists, false, top->print_entries - printed, win_width, |
| 298 | top->min_percent, stdout); | 298 | top->min_percent, stdout, symbol_conf.use_callchain); |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | static void prompt_integer(int *target, const char *msg) | 301 | static void prompt_integer(int *target, const char *msg) |
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 150c4de33b22..9a972cb00458 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
| @@ -492,7 +492,8 @@ out: | |||
| 492 | } | 492 | } |
| 493 | 493 | ||
| 494 | static int hist_entry__fprintf(struct hist_entry *he, size_t size, | 494 | static int hist_entry__fprintf(struct hist_entry *he, size_t size, |
| 495 | char *bf, size_t bfsz, FILE *fp) | 495 | char *bf, size_t bfsz, FILE *fp, |
| 496 | bool use_callchain) | ||
| 496 | { | 497 | { |
| 497 | int ret; | 498 | int ret; |
| 498 | struct perf_hpp hpp = { | 499 | struct perf_hpp hpp = { |
| @@ -512,7 +513,7 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size, | |||
| 512 | 513 | ||
| 513 | ret = fprintf(fp, "%s\n", bf); | 514 | ret = fprintf(fp, "%s\n", bf); |
| 514 | 515 | ||
| 515 | if (symbol_conf.use_callchain) | 516 | if (use_callchain) |
| 516 | ret += hist_entry_callchain__fprintf(he, total_period, 0, fp); | 517 | ret += hist_entry_callchain__fprintf(he, total_period, 0, fp); |
| 517 | 518 | ||
| 518 | return ret; | 519 | return ret; |
| @@ -709,7 +710,8 @@ static int hists__fprintf_headers(struct hists *hists, FILE *fp) | |||
| 709 | } | 710 | } |
| 710 | 711 | ||
| 711 | size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, | 712 | size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, |
| 712 | int max_cols, float min_pcnt, FILE *fp) | 713 | int max_cols, float min_pcnt, FILE *fp, |
| 714 | bool use_callchain) | ||
| 713 | { | 715 | { |
| 714 | struct perf_hpp_fmt *fmt; | 716 | struct perf_hpp_fmt *fmt; |
| 715 | struct rb_node *nd; | 717 | struct rb_node *nd; |
| @@ -755,7 +757,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, | |||
| 755 | if (percent < min_pcnt) | 757 | if (percent < min_pcnt) |
| 756 | continue; | 758 | continue; |
| 757 | 759 | ||
| 758 | ret += hist_entry__fprintf(h, max_cols, line, linesz, fp); | 760 | ret += hist_entry__fprintf(h, max_cols, line, linesz, fp, use_callchain); |
| 759 | 761 | ||
| 760 | if (max_rows && ++nr_rows >= max_rows) | 762 | if (max_rows && ++nr_rows >= max_rows) |
| 761 | break; | 763 | break; |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 7b54ccf1b737..a73fde0a5dd8 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
| @@ -159,7 +159,8 @@ void events_stats__inc(struct events_stats *stats, u32 type); | |||
| 159 | size_t events_stats__fprintf(struct events_stats *stats, FILE *fp); | 159 | size_t events_stats__fprintf(struct events_stats *stats, FILE *fp); |
| 160 | 160 | ||
| 161 | size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, | 161 | size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, |
| 162 | int max_cols, float min_pcnt, FILE *fp); | 162 | int max_cols, float min_pcnt, FILE *fp, |
| 163 | bool use_callchain); | ||
| 163 | size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp); | 164 | size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp); |
| 164 | 165 | ||
| 165 | void hists__filter_by_dso(struct hists *hists); | 166 | void hists__filter_by_dso(struct hists *hists); |
