linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* user-defined static trace points
@ 2016-03-01 15:53 Milian Wolff
  2016-03-01 19:18 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Milian Wolff @ 2016-03-01 15:53 UTC (permalink / raw)
  To: perf group

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

Hey all,

I'm aware that we can add custum user-defined dynamic trace points using `perf 
probe`. But this is unwieldy for some larger applications, esp. if we 
recompile them often. Is there a public API (that I could not find so far), to 
define static trace points in userspace code?

I found http://www.brendangregg.com/blog/2015-07-03/hacking-linux-usdt-ftrace.html which references https://www.sourceware.org/systemtap/wiki/
AddingUserSpaceProbingToApps for systemtap, but on my machine I don't have a 
<sys/sdt.h> header. Would such trace points be useable by perf? https://
lwn.net/Articles/570818/ doesn't seem to be included, i.e. I don't have `perf 
probe --markers` with a recent build of perf...

If someone could point me into the right direction, that would be highly 
appreciated. I would also like to know about the performance impact of adding 
static trace points to code. If it is low, I'd then try to add such trace 
points to Qt upstream in some GUI related areas, e.g. to investigate FPS or 
similar.

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] 3+ messages in thread

* Re: user-defined static trace points
  2016-03-01 15:53 user-defined static trace points Milian Wolff
@ 2016-03-01 19:18 ` Andi Kleen
  2016-03-02  6:51   ` Hemant Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2016-03-01 19:18 UTC (permalink / raw)
  To: Milian Wolff; +Cc: perf group, Hemant Kumar

Milian Wolff <milian.wolff@kdab.com> writes:

> Hey all,
>
> I'm aware that we can add custum user-defined dynamic trace points using `perf 
> probe`. But this is unwieldy for some larger applications, esp. if we 
> recompile them often. Is there a public API (that I could not find so far), to 
> define static trace points in userspace code?
>
> I found
> http://www.brendangregg.com/blog/2015-07-03/hacking-linux-usdt-ftrace.html
> which references https://www.sourceware.org/systemtap/wiki/
> AddingUserSpaceProbingToApps for systemtap, but on my machine I don't have a 
> <sys/sdt.h> header.

You need to install systemtap-devel or similar.

> Would such trace points be useable by perf? https://
> lwn.net/Articles/570818/ doesn't seem to be included, i.e. I don't have `perf 
> probe --markers` with a recent build of perf.

There is a patch to teach perf about SDT probes, but so far it has not
been integrated. You can use them from systemtap or gdb though.

https://lwn.net/Articles/569622/

Perhaps Hemant needs to resubmit?


>
> If someone could point me into the right direction, that would be highly 
> appreciated. I would also like to know about the performance impact of adding 
> static trace points to code. If it is low, I'd then try to add such trace 
> points to Qt upstream in some GUI related areas, e.g. to investigate FPS or 
> similar.

When they are disabled they are just nops (so basically free)
When enabled it is an exception so not super cheap.

-Andi


-- 
ak@linux.intel.com -- Speaking for myself only

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

* Re: user-defined static trace points
  2016-03-01 19:18 ` Andi Kleen
@ 2016-03-02  6:51   ` Hemant Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Hemant Kumar @ 2016-03-02  6:51 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Andi Kleen, Milian Wolff, perf group



On 03/02/2016 12:48 AM, Andi Kleen wrote:
> Milian Wolff <milian.wolff@kdab.com> writes:
>
>> Hey all,
>>
>> I'm aware that we can add custum user-defined dynamic trace points using `perf
>> probe`. But this is unwieldy for some larger applications, esp. if we
>> recompile them often. Is there a public API (that I could not find so far), to
>> define static trace points in userspace code?
>>
>> I found
>> http://www.brendangregg.com/blog/2015-07-03/hacking-linux-usdt-ftrace.html
>> which references https://www.sourceware.org/systemtap/wiki/
>> AddingUserSpaceProbingToApps for systemtap, but on my machine I don't have a
>> <sys/sdt.h> header.
> You need to install systemtap-devel or similar.
>
>> Would such trace points be useable by perf? https://
>> lwn.net/Articles/570818/ doesn't seem to be included, i.e. I don't have `perf
>> probe --markers` with a recent build of perf.
> There is a patch to teach perf about SDT probes, but so far it has not
> been integrated. You can use them from systemtap or gdb though.
>
> https://lwn.net/Articles/569622/
>
> Perhaps Hemant needs to resubmit?
>

So far, the patches for SDT support for perf have undergone several changes
and ultimately got picked up by Masami. Masami was working on the probe 
cache
feature along with the SDT support and sent a v3 :
https://lkml.org/lkml/2015/8/15/52
(" [RFC PATCH perf/core v3 00/17] perf-probe --cache and SDT support")

Although, I don't think the SDT related patches got picked up.

Masami, are you working on a v4 patchset?

-- 
Thanks,
Hemant Kumar

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

end of thread, other threads:[~2016-03-02  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 15:53 user-defined static trace points Milian Wolff
2016-03-01 19:18 ` Andi Kleen
2016-03-02  6:51   ` Hemant Kumar

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