summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/counts.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2017-07-26 14:02:06 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-26 14:25:44 -0300
commit82bf311e15d22e2fa45423b1fb4a21cf925381fe (patch)
treeed6f171f8cd8f07e3e2966a0116cae3a75929d02 /tools/perf/util/counts.h
parentf7794d525447f1e4e4b2228dd29dba084005e6bf (diff)
downloadlinux-stable-82bf311e15d22e2fa45423b1fb4a21cf925381fe.tar.gz
linux-stable-82bf311e15d22e2fa45423b1fb4a21cf925381fe.tar.bz2
linux-stable-82bf311e15d22e2fa45423b1fb4a21cf925381fe.zip
perf stat: Use group read for event groups
Make perf stat use group read if there are groups defined. The group read will get the values for all member of groups within a single syscall instead of calling read syscall for every event. We can see considerable less amount of kernel cycles spent on single group read, than reading each event separately, like for following perf stat command: # perf stat -e {cycles,instructions} -I 10 -a sleep 1 Monitored with "perf stat -r 5 -e '{cycles:u,cycles:k}'" Before: 24,325,676 cycles:u 297,040,775 cycles:k 1.038554134 seconds time elapsed After: 25,034,418 cycles:u 158,256,395 cycles:k 1.036864497 seconds time elapsed The perf_evsel__open fallback changes contributed by Andi Kleen. 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: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20170726120206.9099-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/counts.h')
-rw-r--r--tools/perf/util/counts.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/counts.h b/tools/perf/util/counts.h
index 34d8baaf558a..cb45a6aecf9d 100644
--- a/tools/perf/util/counts.h
+++ b/tools/perf/util/counts.h
@@ -12,6 +12,7 @@ struct perf_counts_values {
};
u64 values[3];
};
+ bool loaded;
};
struct perf_counts {