From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbcGAGsA (ORCPT ); Fri, 1 Jul 2016 02:48:00 -0400 Received: from terminus.zytor.com ([198.137.202.10]:59768 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751460AbcGAGr6 (ORCPT ); Fri, 1 Jul 2016 02:47:58 -0400 Date: Thu, 30 Jun 2016 23:47:28 -0700 From: "tip-bot for Peter Zijlstra (Intel)" Message-ID: Cc: tglx@linutronix.de, acme@redhat.com, peterz@infradead.org, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, jolsa@kernel.org Reply-To: hpa@zytor.com, jolsa@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, acme@redhat.com, peterz@infradead.org In-Reply-To: <20160630082955.GA30921@twins.programming.kicks-ass.net> References: <20160630082955.GA30921@twins.programming.kicks-ass.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf annotate: Add number of samples to the header Git-Commit-ID: 135cce1bf12bd30d7d66360022f9dac6ea3a07cd 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: 135cce1bf12bd30d7d66360022f9dac6ea3a07cd Gitweb: http://git.kernel.org/tip/135cce1bf12bd30d7d66360022f9dac6ea3a07cd Author: Peter Zijlstra (Intel) AuthorDate: Thu, 30 Jun 2016 10:29:55 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 30 Jun 2016 18:27:42 -0300 perf annotate: Add number of samples to the header 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) Cc: Jiri Olsa 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 --- 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 78e5d6f..e9825fe 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);