Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719395

[PATCH 09/10] perf report: Group stat values on global event id

From Jiri Olsa <jolsa@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 09/10] perf report: Group stat values on global event id
Date 2017-08-24 18:30 +0200
Message-ID <ui3b4-tc-31@gated-at.bofh.it> (permalink)
References <ui3b3-tc-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 tools/perf/builtin-report.c | 2 +-
 tools/perf/util/values.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 9e4004b08f55..f9dff652dcbd 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -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);
 
diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c
index 3b56aeaa8cbb..8a32bb0095e5 100644
--- a/tools/perf/util/values.c
+++ b/tools/perf/util/values.c
@@ -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;
 }
 
-- 
2.9.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] perf: inherit_stat related fixes Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 07/10] perf values: Fix allocation check Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 08/10] perf values: Zero value buffers Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 10/10] perf stat: Support inherit/no-inherit terms Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
    Re: [PATCH 10/10] perf stat: Support inherit/no-inherit terms Andi Kleen <andi@firstfloor.org> - 2017-08-24 18:40 +0200
      Re: [PATCH 10/10] perf stat: Support inherit/no-inherit terms Jiri Olsa <jolsa@redhat.com> - 2017-08-24 18:50 +0200
  [PATCH 02/10] perf: Fix leader for removed sibling event in perf_group_detach Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 09/10] perf report: Group stat values on global event id Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 05/10] perf report: Add dump_read function Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 06/10] perf values: Fix thread index bug Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 01/10] perf/x86: Add warning on proper cpu during event's update Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:40 +0200
  [PATCH 03/10] perf: Make sure we read only scheduled events Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:40 +0200

csiph-web