On 27/05/11 14:46, Pádraig Brady wrote: > On 27/05/11 13:01, Francis Moreau wrote: >> Hello, >> >> Is there a mean to select all counters of a certain type ? >> >> For example I'd like to select all generalized hw counter with >> perf-stat, is this possible ? > > I was looking for that too. > I didn't look too hard, but there was nothing obvious. > It would be very useful for example, to print all hardware counters > that are supported by the current system as you say. > To do that, I'm using this perf-hw script: > > #!/bin/sh > hw_events=$( > for i in $(perf list | sed -n 's/\[Hardware.*event\]//; T; s/ OR .*//; p'); > do > perf stat -e $i true >/dev/null 2>&1 && > printf -- "-e %s \n" $i > done | tr -d '\n' > ) > perf stat $hw_events $*
I've also just noticed the -ddd option recently added with: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2cba3ffb I've attached some more documentation which might be useful? cheers, Pádraig.
>From 50273f3c531b2111343326a22dd76a9c1d893338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]> Date: Tue, 31 May 2011 16:16:59 +0100 Subject: [PATCH] perf stat: better document the -d option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document fully the -d option from commit 2cba3ffb * Documentation/perf-stat.txt: Detail the -d option * builtin-stat.c: Document that -d can be repeated Signed-off-by: Pádraig Brady <[email protected]> --- tools/perf/Documentation/perf-stat.txt | 6 ++++++ tools/perf/builtin-stat.c | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt index 918cc38..36a6a00 100644 --- a/tools/perf/Documentation/perf-stat.txt +++ b/tools/perf/Documentation/perf-stat.txt @@ -50,6 +50,12 @@ OPTIONS --scale:: scale/normalize counter values +-d:: + print more detailed statistics - repeat for more + -d: detailed events, L1 and LLC data cache + -dd: more detailed events, dTLB and iTLB events + -ddd: very detailed events, adding prefetch events + -r:: --repeat=<n>:: repeat command and print average + stddev (max: 100) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index a9f0671..a99be46 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1044,7 +1044,7 @@ static const struct option options[] = { OPT_BOOLEAN('n', "null", &null_run, "null run - dont start any counters"), OPT_INCR('d', "detailed", &detailed_run, - "detailed run - start a lot of events"), + "detailed run - start a lot of events - repeat for more"), OPT_BOOLEAN('S', "sync", &sync_run, "call sync() before starting a run"), OPT_CALLBACK_NOOPT('B', "big-num", NULL, NULL, -- 1.7.5.1
