Re: [PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

2017-03-20 Thread Masami Hiramatsu
Hello Alexis and Arnaldo,

I think this series is now good to go.
Could you pick these? 

Acked-by: Masami Hiramatsu 

for this series.

Thank you,

On Wed, 14 Dec 2016 01:07:30 +0100
Alexis Berlemont  wrote:

> Hi Masami,
> 
> Many thanks for your mail.
> 
> Here is another patch set which tries to fix the points you mentioned:
> 
> * Skip the arguments containing a constant ($123); 
> * Review the code in charge of the register renaming (search for '%'
>   and parse it);
> * Minor changes (print the argument in case of error, skipping, check
>   the sdt arg type index);
> 
> Many thanks,
> 
> Alexis.
> 
> Alexis Berlemont (2):
>   perf sdt: add scanning of sdt probles arguments
>   perf probe: add sdt probes arguments into the uprobe cmd string
> 
>  tools/perf/arch/x86/util/perf_regs.c |  83 +
>  tools/perf/util/perf_regs.c  |   6 ++
>  tools/perf/util/perf_regs.h  |   6 ++
>  tools/perf/util/probe-file.c | 170 
> ++-
>  tools/perf/util/symbol-elf.c |  25 +-
>  tools/perf/util/symbol.h |   1 +
>  6 files changed, 285 insertions(+), 6 deletions(-)
> 
> -- 
> 2.10.2
> 


-- 
Masami Hiramatsu 


Re: [PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

2017-02-22 Thread Alexis Berlemont
Ravi Bangoria wrote:
> 
> 
> On Wednesday 14 December 2016 01:06 PM, Ingo Molnar wrote:
> > * Alexis Berlemont  wrote:
> >
> >> Hi Masami,
> >>
> >> Many thanks for your mail.
> >>
> >> Here is another patch set which tries to fix the points you mentioned:
> >>
> >> * Skip the arguments containing a constant ($123); 
> >> * Review the code in charge of the register renaming (search for '%'
> >>   and parse it);
> >> * Minor changes (print the argument in case of error, skipping, check
> >>   the sdt arg type index);
> >>
> >> Many thanks,
> >>
> >> Alexis.
> >>
> >> Alexis Berlemont (2):
> >>   perf sdt: add scanning of sdt probles arguments
> >>   perf probe: add sdt probes arguments into the uprobe cmd string
> > I'd like to hijack this thread to report an SDT oddity - one of my boxen 
> > reports 
> > lots of SDT tracepoints in 'perf list':
> >
> >   mem:[/len][:access]  [Hardware breakpoint]
> >
> >   sdt_libc:lll_lock_wait_private [SDT event]
> >   sdt_libc:longjmp   [SDT event]
> >   sdt_libc:longjmp_target[SDT event]
> >   sdt_libc:memory_arena_new  [SDT event]
> >   sdt_libc:memory_arena_retry[SDT event]
> >   sdt_libc:memory_arena_reuse[SDT event]
> >   sdt_libc:memory_arena_reuse_free_list  [SDT event]
> >   sdt_libc:memory_arena_reuse_wait   [SDT event]
> >   sdt_libc:memory_calloc_retry   [SDT event]
> >   sdt_libc:memory_heap_free  [SDT event]
> >   ...
> >
> > But none of them work:
> >
> >   Error:  No permissions to read 
> > /sys/kernel/debug/tracing/events/sdt_libc/longjmp
> >   Hint:   Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
> >
> >   ...
> >
> >   Error:  File /sys/kernel/debug/tracing/events/sdt_libc/longjmp not found.
> >   Hint:   Perhaps this kernel misses some CONFIG_ setting to enable this 
> > feature?.
> >
> > What kind of patches are required for SDT probes to work?
> 
> Hi Ingo,
> 
> Works for me on my x86 Fedora 25 box. May be some permission issue?
> 
> @Alexis, Planning to progress on it :) ? I would like to prepare patch for
> powerpc.

Hi,

Just a quick mail to apologize. After a few weeks without answer, I
forgot to regularly poll this thread during my free time.

I've just noticed the patches you sent meanwhile...

Once more sorry,

Alexis.

> 
> Thanks,
> Ravi
> 
> > Thanks,
> >
> > Ingo
> >
> 


Re: [PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

2017-01-24 Thread Ravi Bangoria


On Tuesday 24 January 2017 01:52 PM, Ingo Molnar wrote:
> * Ravi Bangoria  wrote:
>
>>
>> On Wednesday 14 December 2016 01:06 PM, Ingo Molnar wrote:
>>> * Alexis Berlemont  wrote:
>>>
 Hi Masami,

 Many thanks for your mail.

 Here is another patch set which tries to fix the points you mentioned:

 * Skip the arguments containing a constant ($123); 
 * Review the code in charge of the register renaming (search for '%'
   and parse it);
 * Minor changes (print the argument in case of error, skipping, check
   the sdt arg type index);

 Many thanks,

 Alexis.

 Alexis Berlemont (2):
   perf sdt: add scanning of sdt probles arguments
   perf probe: add sdt probes arguments into the uprobe cmd string
>>> I'd like to hijack this thread to report an SDT oddity - one of my boxen 
>>> reports 
>>> lots of SDT tracepoints in 'perf list':
>>>
>>>   mem:[/len][:access]  [Hardware breakpoint]
>>>
>>>   sdt_libc:lll_lock_wait_private [SDT event]
>>>   sdt_libc:longjmp   [SDT event]
>>>   sdt_libc:longjmp_target[SDT event]
>>>   sdt_libc:memory_arena_new  [SDT event]
>>>   sdt_libc:memory_arena_retry[SDT event]
>>>   sdt_libc:memory_arena_reuse[SDT event]
>>>   sdt_libc:memory_arena_reuse_free_list  [SDT event]
>>>   sdt_libc:memory_arena_reuse_wait   [SDT event]
>>>   sdt_libc:memory_calloc_retry   [SDT event]
>>>   sdt_libc:memory_heap_free  [SDT event]
>>>   ...
>>>
>>> But none of them work:
>>>
>>>   Error:  No permissions to read 
>>> /sys/kernel/debug/tracing/events/sdt_libc/longjmp
>>>   Hint:   Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
>>>
>>>   ...
>>>
>>>   Error:  File /sys/kernel/debug/tracing/events/sdt_libc/longjmp not found.
>>>   Hint:   Perhaps this kernel misses some CONFIG_ setting to enable this 
>>> feature?.
>>>
>>> What kind of patches are required for SDT probes to work?
>> Hi Ingo,
>>
>> I suppose you are trying to record SDT events without probing it.
>> In that case, first put a probe on an event and then try to record
>> it. For example,
>
> Well, I was mainly complaining about the misleading messages and flow of the 
> tooling here. Could you please improve the messages so that if I use it like 
> the 
> way I reported it results in me trying the right approach?

Right, message is misleading. Will prepare a patch for this.

Also it's little odd flow for sdt markers, to put a probe first and then
record it while other events can be recorded directly. There was a
patch by Hemant about directly recording SDT marker events. I
don't see any updates on that:

https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1138183.html

-Ravi

> Thanks,
>
>   Ingo
>



Re: [PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

2017-01-24 Thread Ingo Molnar

* Ravi Bangoria  wrote:

> 
> 
> On Wednesday 14 December 2016 01:06 PM, Ingo Molnar wrote:
> > * Alexis Berlemont  wrote:
> >
> >> Hi Masami,
> >>
> >> Many thanks for your mail.
> >>
> >> Here is another patch set which tries to fix the points you mentioned:
> >>
> >> * Skip the arguments containing a constant ($123); 
> >> * Review the code in charge of the register renaming (search for '%'
> >>   and parse it);
> >> * Minor changes (print the argument in case of error, skipping, check
> >>   the sdt arg type index);
> >>
> >> Many thanks,
> >>
> >> Alexis.
> >>
> >> Alexis Berlemont (2):
> >>   perf sdt: add scanning of sdt probles arguments
> >>   perf probe: add sdt probes arguments into the uprobe cmd string
> > I'd like to hijack this thread to report an SDT oddity - one of my boxen 
> > reports 
> > lots of SDT tracepoints in 'perf list':
> >
> >   mem:[/len][:access]  [Hardware breakpoint]
> >
> >   sdt_libc:lll_lock_wait_private [SDT event]
> >   sdt_libc:longjmp   [SDT event]
> >   sdt_libc:longjmp_target[SDT event]
> >   sdt_libc:memory_arena_new  [SDT event]
> >   sdt_libc:memory_arena_retry[SDT event]
> >   sdt_libc:memory_arena_reuse[SDT event]
> >   sdt_libc:memory_arena_reuse_free_list  [SDT event]
> >   sdt_libc:memory_arena_reuse_wait   [SDT event]
> >   sdt_libc:memory_calloc_retry   [SDT event]
> >   sdt_libc:memory_heap_free  [SDT event]
> >   ...
> >
> > But none of them work:
> >
> >   Error:  No permissions to read 
> > /sys/kernel/debug/tracing/events/sdt_libc/longjmp
> >   Hint:   Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
> >
> >   ...
> >
> >   Error:  File /sys/kernel/debug/tracing/events/sdt_libc/longjmp not found.
> >   Hint:   Perhaps this kernel misses some CONFIG_ setting to enable this 
> > feature?.
> >
> > What kind of patches are required for SDT probes to work?
> 
> Hi Ingo,
> 
> I suppose you are trying to record SDT events without probing it.
> In that case, first put a probe on an event and then try to record
> it. For example,


Well, I was mainly complaining about the misleading messages and flow of the 
tooling here. Could you please improve the messages so that if I use it like 
the 
way I reported it results in me trying the right approach?

Thanks,

Ingo


Re: [PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

2017-01-23 Thread Ravi Bangoria


On Wednesday 14 December 2016 01:06 PM, Ingo Molnar wrote:
> * Alexis Berlemont  wrote:
>
>> Hi Masami,
>>
>> Many thanks for your mail.
>>
>> Here is another patch set which tries to fix the points you mentioned:
>>
>> * Skip the arguments containing a constant ($123); 
>> * Review the code in charge of the register renaming (search for '%'
>>   and parse it);
>> * Minor changes (print the argument in case of error, skipping, check
>>   the sdt arg type index);
>>
>> Many thanks,
>>
>> Alexis.
>>
>> Alexis Berlemont (2):
>>   perf sdt: add scanning of sdt probles arguments
>>   perf probe: add sdt probes arguments into the uprobe cmd string
> I'd like to hijack this thread to report an SDT oddity - one of my boxen 
> reports 
> lots of SDT tracepoints in 'perf list':
>
>   mem:[/len][:access]  [Hardware breakpoint]
>
>   sdt_libc:lll_lock_wait_private [SDT event]
>   sdt_libc:longjmp   [SDT event]
>   sdt_libc:longjmp_target[SDT event]
>   sdt_libc:memory_arena_new  [SDT event]
>   sdt_libc:memory_arena_retry[SDT event]
>   sdt_libc:memory_arena_reuse[SDT event]
>   sdt_libc:memory_arena_reuse_free_list  [SDT event]
>   sdt_libc:memory_arena_reuse_wait   [SDT event]
>   sdt_libc:memory_calloc_retry   [SDT event]
>   sdt_libc:memory_heap_free  [SDT event]
>   ...
>
> But none of them work:
>
>   Error:  No permissions to read 
> /sys/kernel/debug/tracing/events/sdt_libc/longjmp
>   Hint:   Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
>
>   ...
>
>   Error:  File /sys/kernel/debug/tracing/events/sdt_libc/longjmp not found.
>   Hint:   Perhaps this kernel misses some CONFIG_ setting to enable this 
> feature?.
>
> What kind of patches are required for SDT probes to work?

Hi Ingo,

I suppose you are trying to record SDT events without probing it.
In that case, first put a probe on an event and then try to record
it. For example,

$ ./perf list | grep sdt_
  sdt_glib:main__after_prepare   [SDT event]
  sdt_glib:main__before_dispatch [SDT event]
  ...

$ ./perf record -a -e sdt_glib:main__after_prepare
  event syntax error: 'sdt_glib:main__after_prepare'
   \___ unknown tracepoint

  Error:  File /sys/kernel/debug/tracing/events/sdt_glib/main__after_prepare 
not found.
  Hint: Perhaps this kernel misses some CONFIG_ setting to enable this feature?.
  ...

$ ./perf probe sdt_glib:main__after_prepare
  Added new events:
sdt_glib:main__after_prepare (on %main__after_prepare in 
/usr/lib64/libglib-2.0.so.0.5000.2)
sdt_glib:main__after_prepare_1 (on %main__after_prepare in 
/usr/lib64/libglib-2.0.so.0.5000.2)

  You can now use it in all perf tools, such as:

perf record -e sdt_glib:main__after_prepare_1 -aR sleep 1

$ ./perf record -a -e sdt_glib:main__after_prepare
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.191 MB perf.data ]

-Ravi



Re: [PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

2017-01-23 Thread Ravi Bangoria


On Wednesday 14 December 2016 01:06 PM, Ingo Molnar wrote:
> * Alexis Berlemont  wrote:
>
>> Hi Masami,
>>
>> Many thanks for your mail.
>>
>> Here is another patch set which tries to fix the points you mentioned:
>>
>> * Skip the arguments containing a constant ($123); 
>> * Review the code in charge of the register renaming (search for '%'
>>   and parse it);
>> * Minor changes (print the argument in case of error, skipping, check
>>   the sdt arg type index);
>>
>> Many thanks,
>>
>> Alexis.
>>
>> Alexis Berlemont (2):
>>   perf sdt: add scanning of sdt probles arguments
>>   perf probe: add sdt probes arguments into the uprobe cmd string
> I'd like to hijack this thread to report an SDT oddity - one of my boxen 
> reports 
> lots of SDT tracepoints in 'perf list':
>
>   mem:[/len][:access]  [Hardware breakpoint]
>
>   sdt_libc:lll_lock_wait_private [SDT event]
>   sdt_libc:longjmp   [SDT event]
>   sdt_libc:longjmp_target[SDT event]
>   sdt_libc:memory_arena_new  [SDT event]
>   sdt_libc:memory_arena_retry[SDT event]
>   sdt_libc:memory_arena_reuse[SDT event]
>   sdt_libc:memory_arena_reuse_free_list  [SDT event]
>   sdt_libc:memory_arena_reuse_wait   [SDT event]
>   sdt_libc:memory_calloc_retry   [SDT event]
>   sdt_libc:memory_heap_free  [SDT event]
>   ...
>
> But none of them work:
>
>   Error:  No permissions to read 
> /sys/kernel/debug/tracing/events/sdt_libc/longjmp
>   Hint:   Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
>
>   ...
>
>   Error:  File /sys/kernel/debug/tracing/events/sdt_libc/longjmp not found.
>   Hint:   Perhaps this kernel misses some CONFIG_ setting to enable this 
> feature?.
>
> What kind of patches are required for SDT probes to work?

Hi Ingo,

Works for me on my x86 Fedora 25 box. May be some permission issue?

@Alexis, Planning to progress on it :) ? I would like to prepare patch for
powerpc.

Thanks,
Ravi

> Thanks,
>
>   Ingo
>



Re: [PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

2016-12-13 Thread Ingo Molnar

* Alexis Berlemont  wrote:

> Hi Masami,
> 
> Many thanks for your mail.
> 
> Here is another patch set which tries to fix the points you mentioned:
> 
> * Skip the arguments containing a constant ($123); 
> * Review the code in charge of the register renaming (search for '%'
>   and parse it);
> * Minor changes (print the argument in case of error, skipping, check
>   the sdt arg type index);
> 
> Many thanks,
> 
> Alexis.
> 
> Alexis Berlemont (2):
>   perf sdt: add scanning of sdt probles arguments
>   perf probe: add sdt probes arguments into the uprobe cmd string

I'd like to hijack this thread to report an SDT oddity - one of my boxen 
reports 
lots of SDT tracepoints in 'perf list':

  mem:[/len][:access]  [Hardware breakpoint]

  sdt_libc:lll_lock_wait_private [SDT event]
  sdt_libc:longjmp   [SDT event]
  sdt_libc:longjmp_target[SDT event]
  sdt_libc:memory_arena_new  [SDT event]
  sdt_libc:memory_arena_retry[SDT event]
  sdt_libc:memory_arena_reuse[SDT event]
  sdt_libc:memory_arena_reuse_free_list  [SDT event]
  sdt_libc:memory_arena_reuse_wait   [SDT event]
  sdt_libc:memory_calloc_retry   [SDT event]
  sdt_libc:memory_heap_free  [SDT event]
  ...

But none of them work:

  Error:  No permissions to read 
/sys/kernel/debug/tracing/events/sdt_libc/longjmp
  Hint:   Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'

  ...

  Error:  File /sys/kernel/debug/tracing/events/sdt_libc/longjmp not found.
  Hint:   Perhaps this kernel misses some CONFIG_ setting to enable this 
feature?.

What kind of patches are required for SDT probes to work?

Thanks,

Ingo


[PATCH v5 0/2] perf probe: add sdt probes arguments into the uprobe cmd string

2016-12-13 Thread Alexis Berlemont
Hi Masami,

Many thanks for your mail.

Here is another patch set which tries to fix the points you mentioned:

* Skip the arguments containing a constant ($123); 
* Review the code in charge of the register renaming (search for '%'
  and parse it);
* Minor changes (print the argument in case of error, skipping, check
  the sdt arg type index);

Many thanks,

Alexis.

Alexis Berlemont (2):
  perf sdt: add scanning of sdt probles arguments
  perf probe: add sdt probes arguments into the uprobe cmd string

 tools/perf/arch/x86/util/perf_regs.c |  83 +
 tools/perf/util/perf_regs.c  |   6 ++
 tools/perf/util/perf_regs.h  |   6 ++
 tools/perf/util/probe-file.c | 170 ++-
 tools/perf/util/symbol-elf.c |  25 +-
 tools/perf/util/symbol.h |   1 +
 6 files changed, 285 insertions(+), 6 deletions(-)

-- 
2.10.2