lkml.org 
[lkml]   [2022]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] tracing: Add sample code for custom trace events
On Thu, 3 Mar 2022 10:40:06 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> > +static struct trace_event_call sched_switch_call = {
> > + .class = &sched_switch_class,
> > + .event = {
> > + .funcs = &sched_switch_funcs,
> > + },
> > + .print_fmt = SCHED_PRINT_FMT,
> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
> > + .module = THIS_MODULE,
> > +#else
> > + .mod = THIS_MODULE,
> > +#endif
>
> I think this example code doesn't need to care about older kernels.

Oops, I thought I got rid of all the mod versions :-p I had this
working on a 5.4 kernel that we were going use, and there was a bunch
more of these in my original code. I'll nuke this on v2.

>
> Others looks good to me.
>
> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
>
> Hopefully, it is more helpful if there are more comments for other developers. :-)
> (and usage comments too)

Actually, I was thinking of coming up with a bunch of helper
functions/macros to make this less complex. But yeah, it needs a bunch
of comments before it can be accepted.

Thanks a lot for the review!

-- Steve

\
 
 \ /
  Last update: 2022-03-03 04:27    [W:0.042 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site