From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974AbcFPIiL (ORCPT ); Thu, 16 Jun 2016 04:38:11 -0400 Received: from terminus.zytor.com ([198.137.202.10]:33562 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751640AbcFPIiG (ORCPT ); Thu, 16 Jun 2016 04:38:06 -0400 Date: Thu, 16 Jun 2016 01:37:53 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: tglx@linutronix.de, acme@redhat.com, namhyung@kernel.org, mingo@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, dsahern@gmail.com, hpa@zytor.com, a.p.zijlstra@chello.nl Reply-To: namhyung@kernel.org, acme@redhat.com, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, jolsa@kernel.org, mingo@kernel.org, a.p.zijlstra@chello.nl In-Reply-To: <1465928361-2442-9-git-send-email-jolsa@kernel.org> References: <1465928361-2442-9-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf stdio: Add use_callchain parameter to hists__fprintf Git-Commit-ID: d05e3aaeea56d7cd23976cb1fa626faf1a8bfbed X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d05e3aaeea56d7cd23976cb1fa626faf1a8bfbed Gitweb: http://git.kernel.org/tip/d05e3aaeea56d7cd23976cb1fa626faf1a8bfbed Author: Jiri Olsa AuthorDate: Tue, 14 Jun 2016 20:19:18 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 15 Jun 2016 10:48:02 -0300 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/builtin-diff.c | 3 ++- tools/perf/builtin-report.c | 3 ++- tools/perf/builtin-top.c | 2 +- tools/perf/ui/stdio/hist.c | 10 ++++++---- 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 f7645a4..69bad45 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -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) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index a87cb33..9f36b23 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, 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"); } diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 2a6cc25..81dba80 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) 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) diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 150c4de..9a972cb 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; diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 7b54ccf..a73fde0 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); 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);