linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf record of multiple events: disable callgraph for some events
@ 2015-10-04 11:48 Milian Wolff
  2015-10-04 20:40 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Milian Wolff @ 2015-10-04 11:48 UTC (permalink / raw)
  To: perf group

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

Hey all,

would it be possible to add a feature to perf to only grab callgraphs for a 
certain selection of events? E.g. thinking about a lock contention profile of 
a Qt application, I'd listen to 

-e syscalls:sys_enter_futex,syscalls:sys_exit_futex

Now, with the dwarf unwinder this easily produces huge data files in the order 
of gigabytes. This cost could easily be reduced by a factor of two, as one 
only needs the callgraphs for syscalls:sys_enter_futex - the TID should be 
enough to find the callgraph for the enter event from the exit trace point.

Could someone guide me in implementing such a feature to make it possible to 
filter the events which trigger the collection of a callgraph? Or is that 
already possible somehow?

Thanks
-- 
Milian Wolff | milian.wolff@kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5903 bytes --]

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

* Re: perf record of multiple events: disable callgraph for some events
  2015-10-04 11:48 perf record of multiple events: disable callgraph for some events Milian Wolff
@ 2015-10-04 20:40 ` Arnaldo Carvalho de Melo
  2015-10-09 14:08   ` Milian Wolff
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-04 20:40 UTC (permalink / raw)
  To: Milian Wolff; +Cc: perf group

Em Sun, Oct 04, 2015 at 01:48:21PM +0200, Milian Wolff escreveu:
> Hey all,
> 
> would it be possible to add a feature to perf to only grab callgraphs for a 
> certain selection of events? E.g. thinking about a lock contention profile of 
> a Qt application, I'd listen to 
> 
> -e syscalls:sys_enter_futex,syscalls:sys_exit_futex
> 
> Now, with the dwarf unwinder this easily produces huge data files in the order 
> of gigabytes. This cost could easily be reduced by a factor of two, as one 
> only needs the callgraphs for syscalls:sys_enter_futex - the TID should be 
> enough to find the callgraph for the enter event from the exit trace point.
> 
> Could someone guide me in implementing such a feature to make it possible to 
> filter the events which trigger the collection of a callgraph? Or is that 
> already possible somehow?

Can you please check if this suits you, it is already in the tree:

commit e637d17757a10732fa5d573c18f20b3cd4d31245
Author: He Kuang <hekuang@huawei.com>
Date:   Mon Sep 28 03:52:16 2015 +0000

    perf tools: Enable event_config terms to tracepoint events
    
    This patch enables config terms for tracepoint perf events. Valid terms
    for tracepoint events are 'call-graph' and 'stack-size', so we can use
    different callgraph settings for each event and eliminate unnecessary
    overhead.
    
    Here is an example for using different call-graph config for each
    tracepoint.
    
      $ perf record -e syscalls:sys_enter_write/call-graph=fp/
                    -e syscalls:sys_exit_write/call-graph=no/
                    dd if=/dev/zero of=test bs=4k count=10
    
      $ perf report --stdio
    
      #
      # Total Lost Samples: 0
      #
      # Samples: 13  of event 'syscalls:sys_enter_write'
      # Event count (approx.): 13
      #
      # Children      Self  Command  Shared Object       Symbol
      # ........  ........  .......  ..................  ......................
      #
          76.92%    76.92%  dd       libpthread-2.20.so  [.] __write_nocancel
                       |
                       ---__write_nocancel
    
          23.08%    23.08%  dd       libc-2.20.so        [.] write
                       |
                       ---write
                          |
                          |--33.33%-- 0x2031342820736574
                          |
                          |--33.33%-- 0xa6e69207364726f
                          |
                           --33.33%-- 0x34202c7320393039
      ...
    
      # Samples: 13  of event 'syscalls:sys_exit_write'
      # Event count (approx.): 13
      #
      # Children      Self  Command  Shared Object       Symbol
      # ........  ........  .......  ..................  ......................
      #
          76.92%    76.92%  dd       libpthread-2.20.so  [.] __write_nocancel
          23.08%    23.08%  dd       libc-2.20.so        [.] write
           7.69%     0.00%  dd       [unknown]           [.] 0x0a6e69207364726f
           7.69%     0.00%  dd       [unknown]           [.] 0x2031342820736574
           7.69%     0.00%  dd       [unknown]           [.] 0x34202c7320393039
    
    Signed-off-by: He Kuang <hekuang@huawei.com>
    Acked-by: Jiri Olsa <jolsa@kernel.org>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Kan Liang <kan.liang@intel.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Wang Nan <wangnan0@huawei.com>
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1443412336-120050-4-git-send-email-hekuang@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

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

* Re: perf record of multiple events: disable callgraph for some events
  2015-10-04 20:40 ` Arnaldo Carvalho de Melo
@ 2015-10-09 14:08   ` Milian Wolff
  2015-10-09 14:31     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Milian Wolff @ 2015-10-09 14:08 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: perf group

[-- Attachment #1: Type: text/plain, Size: 1702 bytes --]

On Sonntag, 4. Oktober 2015 17:40:59 CEST Arnaldo Carvalho de Melo wrote:
> Em Sun, Oct 04, 2015 at 01:48:21PM +0200, Milian Wolff escreveu:
> > Hey all,
> > 
> > would it be possible to add a feature to perf to only grab callgraphs for
> > a
> > certain selection of events? E.g. thinking about a lock contention profile
> > of a Qt application, I'd listen to
> > 
> > -e syscalls:sys_enter_futex,syscalls:sys_exit_futex
> > 
> > Now, with the dwarf unwinder this easily produces huge data files in the
> > order of gigabytes. This cost could easily be reduced by a factor of two,
> > as one only needs the callgraphs for syscalls:sys_enter_futex - the TID
> > should be enough to find the callgraph for the enter event from the exit
> > trace point.
> > 
> > Could someone guide me in implementing such a feature to make it possible
> > to filter the events which trigger the collection of a callgraph? Or is
> > that already possible somehow?
> 
> Can you please check if this suits you, it is already in the tree:
> 
> commit e637d17757a10732fa5d573c18f20b3cd4d31245
> Author: He Kuang <hekuang@huawei.com>
> Date:   Mon Sep 28 03:52:16 2015 +0000

<snip>

Perfect, Thanks Arnaldo for pointing me in that direction, and many thanks to 
He for implementing it! Works like a charm.

Does anyone have a suggestion on where to put documentation for this? I'll try 
to add that then next week, together with the other stuff I've noticed and 
couldn't find before. Otherwise, I'll put it into the docs for `perf record`'s 
`--call-graph`.

Cheers

-- 
Milian Wolff | milian.wolff@kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5903 bytes --]

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

* Re: perf record of multiple events: disable callgraph for some events
  2015-10-09 14:08   ` Milian Wolff
@ 2015-10-09 14:31     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-09 14:31 UTC (permalink / raw)
  To: Milian Wolff; +Cc: perf group

Em Fri, Oct 09, 2015 at 04:08:10PM +0200, Milian Wolff escreveu:
> On Sonntag, 4. Oktober 2015 17:40:59 CEST Arnaldo Carvalho de Melo wrote:
> > Em Sun, Oct 04, 2015 at 01:48:21PM +0200, Milian Wolff escreveu:

> > > would it be possible to add a feature to perf to only grab
> > > callgraphs for a certain selection of events? E.g. thinking about
> > > a lock contention profile of a Qt application, I'd listen to

> > > -e syscalls:sys_enter_futex,syscalls:sys_exit_futex

> > > Now, with the dwarf unwinder this easily produces huge data files in the
> > > order of gigabytes. This cost could easily be reduced by a factor of two,
> > > as one only needs the callgraphs for syscalls:sys_enter_futex - the TID
> > > should be enough to find the callgraph for the enter event from the exit
> > > trace point.

> > > Could someone guide me in implementing such a feature to make it possible
> > > to filter the events which trigger the collection of a callgraph? Or is
> > > that already possible somehow?

> > Can you please check if this suits you, it is already in the tree:
> > 
> > commit e637d17757a10732fa5d573c18f20b3cd4d31245
> > Author: He Kuang <hekuang@huawei.com>
> > Date:   Mon Sep 28 03:52:16 2015 +0000
 
> <snip>
 
> Perfect, Thanks Arnaldo for pointing me in that direction, and many thanks to 
> He for implementing it! Works like a charm.
> 
> Does anyone have a suggestion on where to put documentation for this? I'll try 
> to add that then next week, together with the other stuff I've noticed and 
> couldn't find before. Otherwise, I'll put it into the docs for `perf record`'s 
> `--call-graph`.

Works for me. Glad that it worked for you. :-)

- Arnaldo

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

end of thread, other threads:[~2015-10-09 14:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-04 11:48 perf record of multiple events: disable callgraph for some events Milian Wolff
2015-10-04 20:40 ` Arnaldo Carvalho de Melo
2015-10-09 14:08   ` Milian Wolff
2015-10-09 14:31     ` Arnaldo Carvalho de Melo

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