linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: perf script and raw events?
       [not found] <20110322224116.GA3794@dev1756.snc6.facebook.com>
@ 2011-03-22 23:17 ` David Ahern
  2011-03-23  0:44   ` Lin Ming
  2011-03-23  1:25   ` 陳韋任
  0 siblings, 2 replies; 3+ messages in thread
From: David Ahern @ 2011-03-22 23:17 UTC (permalink / raw)
  To: Arun Sharma; +Cc: linux-perf-users



On 03/22/11 16:41, Arun Sharma wrote:
> David,
> 
> # perf record -agR -e cycles -- sleep 1
> # perf script
> 
> gives me nice list of stack traces. However if I use
> a raw event such as:
> 
> # perf record -agR -e r53003c -- sleep 1
> # perf script

Works fine for me (with your raw patch for perf-script):

# /tmp/build-perf/perf record -agR -e r53003c -- sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.147 MB perf.data (~6438 samples) ]

# /tmp/build-perf/perf script

perf 27684 [000] 180983.511378: raw 0x53003c:
        ffffffff810d696b put_mems_allowed ([kernel.kallsyms])
        ffffffff810cbfa9 perf_mmap_alloc_page ([kernel.kallsyms])
        ffffffff810ccd13 perf_mmap ([kernel.kallsyms])
        ffffffff810f1772 mmap_region ([kernel.kallsyms])
        ffffffff810f1c02 do_mmap_pgoff ([kernel.kallsyms])

...

What is that raw event? Where do you find the encodings for raw events?

David

> 
> I get no traces and perf script immediately exits. Do you know why?
> 
>  -Arun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: perf script and raw events?
  2011-03-22 23:17 ` perf script and raw events? David Ahern
@ 2011-03-23  0:44   ` Lin Ming
  2011-03-23  1:25   ` 陳韋任
  1 sibling, 0 replies; 3+ messages in thread
From: Lin Ming @ 2011-03-23  0:44 UTC (permalink / raw)
  To: David Ahern; +Cc: Arun Sharma, linux-perf-users

On Wed, Mar 23, 2011 at 7:17 AM, David Ahern <daahern@cisco.com> wrote:
>
>
> On 03/22/11 16:41, Arun Sharma wrote:
>> David,
>>
>> # perf record -agR -e cycles -- sleep 1
>> # perf script
>>
>> gives me nice list of stack traces. However if I use
>> a raw event such as:
>>
>> # perf record -agR -e r53003c -- sleep 1
>> # perf script
>
> Works fine for me (with your raw patch for perf-script):
>
> # /tmp/build-perf/perf record -agR -e r53003c -- sleep 1
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.147 MB perf.data (~6438 samples) ]
>
> # /tmp/build-perf/perf script
>
> perf 27684 [000] 180983.511378: raw 0x53003c:
>        ffffffff810d696b put_mems_allowed ([kernel.kallsyms])
>        ffffffff810cbfa9 perf_mmap_alloc_page ([kernel.kallsyms])
>        ffffffff810ccd13 perf_mmap ([kernel.kallsyms])
>        ffffffff810f1772 mmap_region ([kernel.kallsyms])
>        ffffffff810f1c02 do_mmap_pgoff ([kernel.kallsyms])
>
> ...
>
> What is that raw event? Where do you find the encodings for raw events?

raw event starts with a 'r' character and followed by the encoding of the event.
You can find the encoding from cpu spec, for Intel CPU, it's Intel® 64
and IA-32 Architectures Software Developer's Manuals.
http://www.intel.com/products/processor/manuals/

For example,

perf top -e cpu-cycles
is equivalent with
perf top -e r003c

Lin Ming

>
> David
>
>>
>> I get no traces and perf script immediately exits. Do you know why?
>>
>>  -Arun
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: perf script and raw events?
  2011-03-22 23:17 ` perf script and raw events? David Ahern
  2011-03-23  0:44   ` Lin Ming
@ 2011-03-23  1:25   ` 陳韋任
  1 sibling, 0 replies; 3+ messages in thread
From: 陳韋任 @ 2011-03-23  1:25 UTC (permalink / raw)
  To: David Ahern; +Cc: Arun Sharma, linux-perf-users

Hi,

> What is that raw event? Where do you find the encodings for raw events?

  You can try libpfm4.

$ git clone git://perfmon2.git.sourceforge.net/gitroot/perfmon2/libpfm4

  `showevtinfo` in libpfm4/examples/ lists all events supported by the
CPU, including raw events.

  `evt2raw` in libpfm4/perf_examples converts event names into raw event
recognized by perf.

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-23  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20110322224116.GA3794@dev1756.snc6.facebook.com>
2011-03-22 23:17 ` perf script and raw events? David Ahern
2011-03-23  0:44   ` Lin Ming
2011-03-23  1:25   ` 陳韋任

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).