perf report: Group stat values on global event id
authorJiri Olsa <jolsa@kernel.org>
Thu, 24 Aug 2017 16:27:36 +0000 (18:27 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 28 Aug 2017 19:44:44 +0000 (16:44 -0300)
There's no big value on displaying counts for every event ID, which is
one per every CPU. Rather than that, displaying the whole sum for the
event.

  $ perf record -c 100000 -e cycles:u -s test
  $ perf report -T

Before:
  #  PID   TID  cycles:u  cycles:u  cycles:u  cycles:u  ... [20 more columns of 'cycles:u']
    3339  3339         0         0         0         0
    3340  3340         0         0         0         0
    3341  3341         0         0         0         0
    3342  3342         0         0         0         0

Now:
  #  PID   TID  cycles:u
    3339  3339     19678
    3340  3340     18744
    3341  3341     17335
    3342  3342     26414

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20170824162737.7813-10-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-report.c
tools/perf/util/values.c

index 9e4004b08f559222641fdd2067eaeee06a3aeef9..f9dff652dcbdb01854ad8478c2218acc5caaf2ae 100644 (file)
@@ -241,7 +241,7 @@ static int process_read_event(struct perf_tool *tool,
                const char *name = evsel ? perf_evsel__name(evsel) : "unknown";
                int err = perf_read_values_add_value(&rep->show_threads_values,
                                           event->read.pid, event->read.tid,
-                                          event->read.id,
+                                          evsel->idx,
                                           name,
                                           event->read.value);
 
index 3b56aeaa8cbb5ceba357a4baa99c1446b186500e..8a32bb0095e5e61616319c4145124948f9bfb21c 100644 (file)
@@ -192,7 +192,7 @@ int perf_read_values_add_value(struct perf_read_values *values,
        if (cindex < 0)
                return cindex;
 
-       values->value[tindex][cindex] = value;
+       values->value[tindex][cindex] += value;
        return 0;
 }