linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 08/11] perf tools stdio: Add use_callchain parameter to hists__fprintf
Date: Tue, 14 Jun 2016 20:19:18 +0200	[thread overview]
Message-ID: <1465928361-2442-9-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1465928361-2442-1-git-send-email-jolsa@kernel.org>

It will be convenient in following patches to display
hists entries without callchains even if they are
defined.

Link: http://lkml.kernel.org/n/tip-7bb2d5qkzr6l14iexf58f4qw@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 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 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)
 	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 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,
 			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 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)
 	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 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;
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);
 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);
-- 
2.4.11

  parent reply	other threads:[~2016-06-14 18:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 18:19 [PATCH 00/11] perf tools: Various fixes Jiri Olsa
2016-06-14 18:19 ` [PATCH 01/11] perf mem: Add --ldlat option Jiri Olsa
2016-06-16  8:34   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 02/11] perf tools: Fix Data Object sort entry width index Jiri Olsa
2016-06-16  8:34   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 03/11] perf tools tui: Separate hierarchy and standard headers output Jiri Olsa
2016-06-16  8:35   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 04/11] perf tools stdio: Separate " Jiri Olsa
2016-06-16  8:35   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 05/11] perf tools stdio: Separate hierarchy " Jiri Olsa
2016-06-16  8:36   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 06/11] perf tools stdio: Separate standard " Jiri Olsa
2016-06-16  8:36   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 07/11] perf tools stdio: Do not pass hists in hist_entry__fprintf Jiri Olsa
2016-06-16  8:37   ` [tip:perf/core] perf " tip-bot for Jiri Olsa
2016-06-14 18:19 ` Jiri Olsa [this message]
2016-06-16  8:37   ` [tip:perf/core] perf stdio: Add use_callchain parameter to hists__fprintf tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 09/11] perf tools: Replace perf_evsel arg perf_hpp_fmt's header callback Jiri Olsa
2016-06-16  8:38   ` [tip:perf/core] perf hists: " tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 10/11] perf tools: Replace perf_evsel arg perf_hpp_fmt's width callback Jiri Olsa
2016-06-16  8:38   ` [tip:perf/core] perf hists: " tip-bot for Jiri Olsa
2016-06-14 18:19 ` [PATCH 11/11] perf tools: Rename __hists__add_entry to hists__add_entry Jiri Olsa
2016-06-22  7:41   ` [tip:perf/core] perf hists: " tip-bot for Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465928361-2442-9-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).