* A shortcut to select generalized hw events
@ 2011-05-27 12:01 Francis Moreau
2011-05-27 13:46 ` Pádraig Brady
0 siblings, 1 reply; 4+ messages in thread
From: Francis Moreau @ 2011-05-27 12:01 UTC (permalink / raw)
To: linux-perf-users
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 ?
Thanks
--
Francis
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A shortcut to select generalized hw events
2011-05-27 12:01 A shortcut to select generalized hw events Francis Moreau
@ 2011-05-27 13:46 ` Pádraig Brady
2011-05-31 15:21 ` Pádraig Brady
0 siblings, 1 reply; 4+ messages in thread
From: Pádraig Brady @ 2011-05-27 13:46 UTC (permalink / raw)
To: Francis Moreau; +Cc: linux-perf-users
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 $*
cheers,
Pádraig.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A shortcut to select generalized hw events
2011-05-27 13:46 ` Pádraig Brady
@ 2011-05-31 15:21 ` Pádraig Brady
2011-05-31 19:03 ` Francis Moreau
0 siblings, 1 reply; 4+ messages in thread
From: Pádraig Brady @ 2011-05-31 15:21 UTC (permalink / raw)
To: Francis Moreau; +Cc: linux-perf-users, Ingo Molnar
[-- Attachment #1: Type: text/plain, Size: 990 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: perf-stat-ddd.diff --]
[-- Type: text/x-patch; name="perf-stat-ddd.diff", Size: 1916 bytes --]
From 50273f3c531b2111343326a22dd76a9c1d893338 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
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 <P@draigBrady.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: A shortcut to select generalized hw events
2011-05-31 15:21 ` Pádraig Brady
@ 2011-05-31 19:03 ` Francis Moreau
0 siblings, 0 replies; 4+ messages in thread
From: Francis Moreau @ 2011-05-31 19:03 UTC (permalink / raw)
To: Pádraig Brady; +Cc: linux-perf-users, Ingo Molnar
Hello,
2011/5/31 Pádraig Brady <P@draigbrady.com>:
> 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?
Probably more useful is to update the man pages too with a '-d -d -d'
verbosity :)
BTW, can't this new option be part to perf-record too ?
Thanks
--
Francis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-31 19:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 12:01 A shortcut to select generalized hw events Francis Moreau
2011-05-27 13:46 ` Pádraig Brady
2011-05-31 15:21 ` Pádraig Brady
2011-05-31 19:03 ` Francis Moreau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).