linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 05/11] perf annotate: Add number of samples to the header
Date: Thu, 30 Jun 2016 19:16:53 -0300	[thread overview]
Message-ID: <1467325019-18785-6-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1467325019-18785-1-git-send-email-acme@kernel.org>

From: "Peter Zijlstra (Intel)" <peterz@infradead.org>

Staring at annotations of large functions is useless if there's only a
few samples in them. Report the number of samples in the header to make
this easier to determine.

Committer note:

The change amounts to:

  - Percent | Source code & Disassembly of perf-vdso.so for cycles:u
  ------------------------------------------------------------------
  + Percent | Source code & Disassembly of perf-vdso.so for cycles:u (3278 samples)
  +--------------------------------------------------------------------------------

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20160630082955.GA30921@twins.programming.kicks-ass.net
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 78e5d6f3ff61..e9825fe825fd 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1522,6 +1522,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
 	const char *d_filename;
 	const char *evsel_name = perf_evsel__name(evsel);
 	struct annotation *notes = symbol__annotation(sym);
+	struct sym_hist *h = annotation__histogram(notes, evsel->idx);
 	struct disasm_line *pos, *queue = NULL;
 	u64 start = map__rip_2objdump(map, sym->start);
 	int printed = 2, queue_len = 0;
@@ -1544,8 +1545,8 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
 	if (perf_evsel__is_group_event(evsel))
 		width *= evsel->nr_members;
 
-	graph_dotted_len = printf(" %-*.*s|	Source code & Disassembly of %s for %s\n",
-	       width, width, "Percent", d_filename, evsel_name);
+	graph_dotted_len = printf(" %-*.*s|	Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n",
+	       width, width, "Percent", d_filename, evsel_name, h->sum);
 
 	printf("%-*.*s----\n",
 	       graph_dotted_len, graph_dotted_len, graph_dotted_line);
-- 
2.7.4

  parent reply	other threads:[~2016-06-30 22:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 22:16 [GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 01/11] perf tools: Add documentation for perf.data on disk format Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 02/11] tools lib bpf: Fix spelling mistake: "missmatch" -> "mismatch" Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 03/11] perf evsel: Utility function to fetch arch Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 04/11] perf annotate: Simplify header dotted line sizing Arnaldo Carvalho de Melo
2016-06-30 22:16 ` Arnaldo Carvalho de Melo [this message]
2016-06-30 22:16 ` [PATCH 06/11] perf trace beauty sched_policy: Define SCHED_RESET_ON_FORK for older systems Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 07/11] perf trace beauty eventfd: No need to include eventfd.h Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 08/11] perf tools: Allow to reset open files counter Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 09/11] perf tests: Fix thread map test for -F option Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 10/11] perf test: Add -F/--dont-fork option Arnaldo Carvalho de Melo
2016-06-30 22:16 ` [PATCH 11/11] perf tools: Change cpu_map__fprintf output Arnaldo Carvalho de Melo
2016-07-01  6:43 ` [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar
2016-07-01 13:18   ` Arnaldo Carvalho de Melo

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=1467325019-18785-6-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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).