All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip:perf/urgent] perf annotate: Add comment about annotated_src->nr_histograms
@ 2018-06-07  8:08 tip-bot for Arnaldo Carvalho de Melo
  0 siblings, 0 replies; only message in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2018-06-07  8:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, wangnan0, jolsa, namhyung, adrian.hunter, dsahern, acme,
	mingo, linux-kernel, tglx

Commit-ID:  9132d3d92d8953ee79690408a9a24d938be22cd8
Gitweb:     https://git.kernel.org/tip/9132d3d92d8953ee79690408a9a24d938be22cd8
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Fri, 25 May 2018 11:27:38 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 4 Jun 2018 10:28:52 -0300

perf annotate: Add comment about annotated_src->nr_histograms

When we have multiple groups in an evlist, say:

  $ perf stat -e '{cycles,instructions},{cache-references,cache-misses}' sleep 1

   Performance counter stats for 'sleep 1':

           343,134      cycles:u
           249,292      instructions:u            #    0.73  insn per cycle
            15,556      cache-references:u
             8,925      cache-misses:u            #   57.373 % of all cache refs

       1.000957550 seconds time elapsed

  $

Then the perf_evsel instances for the two group leaders ("cycles" and
"cache-references") will have evsel->nr_members set to 2, while all the
evsel->evlist->nr_entries will be set to 4, so we can't use
evsel->evlist->nr_entries everywhere, as event groups need to be taken
into account.

But this probably requires us to audit at least the forced-group code,
where we want all of the events to be in a "group", to see them all in
the screen, one column for each, even knowing that they were not
necessarily scheduled to count at the same time by the kernel perf
subsystem.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-2g0vwqnc49wl4ttjk8dvpgcc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 7ad503fbff74..3dc4ca1d6c08 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -202,6 +202,10 @@ struct cyc_hist {
 /** struct annotated_source - symbols with hits have this attached as in sannotation
  *
  * @histograms: Array of addr hit histograms per event being monitored
+ * nr_histograms: This may not be the same as evsel->evlist->nr_entries if
+ * 		  we have more than a group in a evlist, where we will want
+ * 		  to see each group separately, that is why symbol__annotate2()
+ * 		  sets src->nr_histograms to evsel->nr_members.
  * @lines: If 'print_lines' is specified, per source code line percentages
  * @source: source parsed from a disassembler like objdump -dS
  * @cyc_hist: Average cycles per basic block

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-07  8:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-07  8:08 [tip:perf/urgent] perf annotate: Add comment about annotated_src->nr_histograms tip-bot for Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.