perf stdio: Add use_callchain parameter to hists__fprintf
authorJiri Olsa <jolsa@kernel.org>
Tue, 14 Jun 2016 18:19:18 +0000 (20:19 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 15 Jun 2016 13:48:02 +0000 (10:48 -0300)
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>
tools/perf/builtin-diff.c
tools/perf/builtin-report.c
tools/perf/builtin-top.c
tools/perf/ui/stdio/hist.c
tools/perf/util/hist.h

index f7645a42708eb2223069b3555df0a325c2c635d8..69bad45deadd38ed9386e97f4031788f6fb693b4 100644 (file)
@@ -666,7 +666,8 @@ static void hists__process(struct hists *hists)
        hists__precompute(hists);
        hists__output_resort(hists, NULL);
 
-       hists__fprintf(hists, true, 0, 0, 0, stdout);
+       hists__fprintf(hists, true, 0, 0, 0, stdout,
+                      symbol_conf.use_callchain);
 }
 
 static void data__fprintf(void)
index a87cb338bdf14b2d49c19b840fb99b3265e68997..9f36b236f0f9b883e07dfbc6eca33a95f8abfe2d 100644 (file)
@@ -370,7 +370,8 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
                        continue;
 
                hists__fprintf_nr_sample_events(hists, rep, evname, stdout);
-               hists__fprintf(hists, true, 0, 0, rep->min_percent, stdout);
+               hists__fprintf(hists, true, 0, 0, rep->min_percent, stdout,
+                              symbol_conf.use_callchain);
                fprintf(stdout, "\n\n");
        }
 
index 2a6cc254ad0c3e09f65f49b5b0169890a5579ac0..81dba80a42b55f0a476b106fd9056e02f2d40e8c 100644 (file)
@@ -295,7 +295,7 @@ static void perf_top__print_sym_table(struct perf_top *top)
        hists__output_recalc_col_len(hists, top->print_entries - printed);
        putchar('\n');
        hists__fprintf(hists, false, top->print_entries - printed, win_width,
-                      top->min_percent, stdout);
+                      top->min_percent, stdout, symbol_conf.use_callchain);
 }
 
 static void prompt_integer(int *target, const char *msg)
index 150c4de33b226fe93eddccb6ea38efda2895116b..9a972cb00458f4fe1c15232222925025bee7355e 100644 (file)
@@ -492,7 +492,8 @@ out:
 }
 
 static int hist_entry__fprintf(struct hist_entry *he, size_t size,
-                              char *bf, size_t bfsz, FILE *fp)
+                              char *bf, size_t bfsz, FILE *fp,
+                              bool use_callchain)
 {
        int ret;
        struct perf_hpp hpp = {
@@ -512,7 +513,7 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size,
 
        ret = fprintf(fp, "%s\n", bf);
 
-       if (symbol_conf.use_callchain)
+       if (use_callchain)
                ret += hist_entry_callchain__fprintf(he, total_period, 0, fp);
 
        return ret;
@@ -709,7 +710,8 @@ static int hists__fprintf_headers(struct hists *hists, FILE *fp)
 }
 
 size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
-                     int max_cols, float min_pcnt, FILE *fp)
+                     int max_cols, float min_pcnt, FILE *fp,
+                     bool use_callchain)
 {
        struct perf_hpp_fmt *fmt;
        struct rb_node *nd;
@@ -755,7 +757,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
                if (percent < min_pcnt)
                        continue;
 
-               ret += hist_entry__fprintf(h, max_cols, line, linesz, fp);
+               ret += hist_entry__fprintf(h, max_cols, line, linesz, fp, use_callchain);
 
                if (max_rows && ++nr_rows >= max_rows)
                        break;
index 7b54ccf1b7370ab2336bd16a1c18a7c932b7e41d..a73fde0a5dd864c5d43dd396cb837824bb95e6c8 100644 (file)
@@ -159,7 +159,8 @@ void events_stats__inc(struct events_stats *stats, u32 type);
 size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);
 
 size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
-                     int max_cols, float min_pcnt, FILE *fp);
+                     int max_cols, float min_pcnt, FILE *fp,
+                     bool use_callchain);
 size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp);
 
 void hists__filter_by_dso(struct hists *hists);