All of lore.kernel.org
 help / color / mirror / Atom feed
* sdt provider and access to the trace_event_raw_* struct
@ 2024-10-04 11:29 Alan Maguire
  2024-10-04 14:29 ` Kris Van Hees
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Maguire @ 2024-10-04 11:29 UTC (permalink / raw)
  To: dtrace; +Cc: DTrace development list

hi folks

I've come across a case where I need to trace a kernel tracepoint with a
lot of associated trace info.  It seems that the current approach for
sdt probes looks at the "struct trace_event_raw_<tracepoint_name>"
structure and maps its fields into args[] values, translating each
member into a separate argument.  That works great for tracepoints with
a limited number of fields. However in the case of a tracepoint with a
lot of such fields (i.e. more than the number of args[] supported), it
would be useful to also have a convenient way to access the raw "struct
trace_event_raw_*" data, especially since we have access to it directly
via CTF. It's possible to do this via a hack, e.g. the following works:

#!/usr/sbin/dtrace -s

sdt:sched::sched_switch
{
        s = (struct trace_event_raw_sched_switch *)(arg0-8);
        print(s);
}


...but presumably that only works because the first arg value isn't
scalar. It would be good to have a helper or builtin variable to access
this pointer directly. Maybe there's a better way to do this, or maybe
we could add a helper/builtin to make this pointer accessible? What do
folks think?

Thanks!

Alan

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

end of thread, other threads:[~2024-10-07 13:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 11:29 sdt provider and access to the trace_event_raw_* struct Alan Maguire
2024-10-04 14:29 ` Kris Van Hees
2024-10-04 15:46   ` Alan Maguire
2024-10-04 19:22     ` Kris Van Hees
2024-10-07 13:17       ` Alan Maguire

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.