public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* where is the list of kernel tracepoint defined?
@ 2017-03-28  8:53 Shiyao Ma
  2017-03-28  9:13 ` Arkady
  0 siblings, 1 reply; 6+ messages in thread
From: Shiyao Ma @ 2017-03-28  8:53 UTC (permalink / raw)
  To: systemtap

Hi,


I'd like to see an index of all kernel trace points.


I am aware "stap -L" can do this.  but I am interested if there is
some file in the systemtap source code that lists such trace points?


Thanks.

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

* Re: where is the list of kernel tracepoint defined?
  2017-03-28  8:53 where is the list of kernel tracepoint defined? Shiyao Ma
@ 2017-03-28  9:13 ` Arkady
  2017-03-28 15:30   ` David Smith
  0 siblings, 1 reply; 6+ messages in thread
From: Arkady @ 2017-03-28  9:13 UTC (permalink / raw)
  To: Shiyao Ma; +Cc: systemtap

Hi Shiyao,

My understanding is that STAP loads the probe points from the Linux
kernel debug information. Probably you can parse the DWARF and find
the probe points.

Arkady

On Tue, Mar 28, 2017 at 11:53 AM, Shiyao Ma <i@introo.me> wrote:
> Hi,
>
>
> I'd like to see an index of all kernel trace points.
>
>
> I am aware "stap -L" can do this.  but I am interested if there is
> some file in the systemtap source code that lists such trace points?
>
>
> Thanks.

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

* Re: where is the list of kernel tracepoint defined?
  2017-03-28  9:13 ` Arkady
@ 2017-03-28 15:30   ` David Smith
  2017-03-28 17:19     ` Shiyao Ma
  0 siblings, 1 reply; 6+ messages in thread
From: David Smith @ 2017-03-28 15:30 UTC (permalink / raw)
  To: Arkady; +Cc: Shiyao Ma, systemtap

The answer is it depends on what you mean by "trace points".

If by "trace points" you mean "possible probe locations", then here's
your answer:

There is no single file in the systemtap source code that lists all
possible probe locations. You could look through all the tapset
(*.stp) files for the predefined probe points we provide (but there is
not guarantee that all those probe points exist in your particular
kernel). Arkady is correct, that systemtap parses the kernel debuginfo
to get the 'stap -L' output for kernel functions. The list of all
possible kernel functions is further constrained by systemtap's
blacklist.

If by "trace points" you mean "tracepoints" (i.e. predefined kernel
hooks were probes can be placed), then here's your answer:

There is no single file in the systemtap source code that lists all
possible kernel tracepoints. Instead, when you run "stap -l
'kernel.trace("*")'", systemtap goes and tries to compile the
tracepoint kernel header files and look for tracepoint definitions in
them.

Shiyao, perhaps you can clarify a bit what you are really asking.


On Tue, Mar 28, 2017 at 4:12 AM, Arkady <arkady.miasnikov@gmail.com> wrote:
> Hi Shiyao,
>
> My understanding is that STAP loads the probe points from the Linux
> kernel debug information. Probably you can parse the DWARF and find
> the probe points.
>
> Arkady
>
> On Tue, Mar 28, 2017 at 11:53 AM, Shiyao Ma <i@introo.me> wrote:
>> Hi,
>>
>>
>> I'd like to see an index of all kernel trace points.
>>
>>
>> I am aware "stap -L" can do this.  but I am interested if there is
>> some file in the systemtap source code that lists such trace points?
>>
>>
>> Thanks.



-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

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

* Re: where is the list of kernel tracepoint defined?
  2017-03-28 15:30   ` David Smith
@ 2017-03-28 17:19     ` Shiyao Ma
  2017-03-28 17:54       ` David Smith
  0 siblings, 1 reply; 6+ messages in thread
From: Shiyao Ma @ 2017-03-28 17:19 UTC (permalink / raw)
  To: David Smith; +Cc: Arkady, systemtap

My question is about kernel tracepoint.  The second part in your answer applies.


Thanks you guys.

On Tue, Mar 28, 2017 at 11:30 PM, David Smith <dsmith@redhat.com> wrote:
> The answer is it depends on what you mean by "trace points".
>
> If by "trace points" you mean "possible probe locations", then here's
> your answer:
>
> There is no single file in the systemtap source code that lists all
> possible probe locations. You could look through all the tapset
> (*.stp) files for the predefined probe points we provide (but there is
> not guarantee that all those probe points exist in your particular
> kernel). Arkady is correct, that systemtap parses the kernel debuginfo
> to get the 'stap -L' output for kernel functions. The list of all
> possible kernel functions is further constrained by systemtap's
> blacklist.
>
> If by "trace points" you mean "tracepoints" (i.e. predefined kernel
> hooks were probes can be placed), then here's your answer:
>
> There is no single file in the systemtap source code that lists all
> possible kernel tracepoints. Instead, when you run "stap -l
> 'kernel.trace("*")'", systemtap goes and tries to compile the
> tracepoint kernel header files and look for tracepoint definitions in
> them.
>
> Shiyao, perhaps you can clarify a bit what you are really asking.
>
>
> On Tue, Mar 28, 2017 at 4:12 AM, Arkady <arkady.miasnikov@gmail.com> wrote:
>> Hi Shiyao,
>>
>> My understanding is that STAP loads the probe points from the Linux
>> kernel debug information. Probably you can parse the DWARF and find
>> the probe points.
>>
>> Arkady
>>
>> On Tue, Mar 28, 2017 at 11:53 AM, Shiyao Ma <i@introo.me> wrote:
>>> Hi,
>>>
>>>
>>> I'd like to see an index of all kernel trace points.
>>>
>>>
>>> I am aware "stap -L" can do this.  but I am interested if there is
>>> some file in the systemtap source code that lists such trace points?
>>>
>>>
>>> Thanks.
>
>
>
> --
> David Smith
> dsmith@redhat.com
> Red Hat
> http://www.redhat.com
> 256.217.0141 (direct)
> 256.837.0057 (fax)

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

* Re: where is the list of kernel tracepoint defined?
  2017-03-28 17:19     ` Shiyao Ma
@ 2017-03-28 17:54       ` David Smith
  2017-03-28 19:02         ` Frank Ch. Eigler
  0 siblings, 1 reply; 6+ messages in thread
From: David Smith @ 2017-03-28 17:54 UTC (permalink / raw)
  To: Shiyao Ma; +Cc: Arkady, systemtap

On Tue, Mar 28, 2017 at 12:19 PM, Shiyao Ma <i@introo.me> wrote:
> My question is about kernel tracepoint.  The second part in your answer applies.

Great, I'm glad I was able to answer your question.

BTW, another way to list kernel tracepoints is by using 'perf'. "perf
list tracepoint" will list all the kernel tracepoints. Note that there
are some 'virtual' kernel tracepoints (like the syscall ones) that
systemtap doesn't list since we can't use them.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

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

* Re: where is the list of kernel tracepoint defined?
  2017-03-28 17:54       ` David Smith
@ 2017-03-28 19:02         ` Frank Ch. Eigler
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Ch. Eigler @ 2017-03-28 19:02 UTC (permalink / raw)
  To: David Smith; +Cc: Shiyao Ma, Arkady, systemtap


dsmith wrote:

> [...]  Note that there are some 'virtual' kernel tracepoints (like the
> syscall ones) that systemtap doesn't list since we can't use them.

Please excuse the pedantry: as you know, there are real kernel
tracepoint beneath those virtual ones.  stap can attach to them, and
open-code the same demultiplexing test that the kernel perf probes do
for the virtual tracepoints.

perf's   syscall:read
stap's   probe kernel.trace("sys_enter") {
            if (syscall_name($id) != "read")
                next; ....
         }

- FChE

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

end of thread, other threads:[~2017-03-28 19:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28  8:53 where is the list of kernel tracepoint defined? Shiyao Ma
2017-03-28  9:13 ` Arkady
2017-03-28 15:30   ` David Smith
2017-03-28 17:19     ` Shiyao Ma
2017-03-28 17:54       ` David Smith
2017-03-28 19:02         ` Frank Ch. Eigler

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 read-only IMAP folder(s) and NNTP newsgroup(s).