From d05e3aaeea56d7cd23976cb1fa626faf1a8bfbed Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Tue, 14 Jun 2016 20:19:18 +0200 Subject: 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 Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1465928361-2442-9-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/ui/stdio/hist.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools/perf/ui/stdio/hist.c') 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: } 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; -- cgit v1.2.3-59-g8ed1b