On Wed, 21 Jul 2021 23:39:13 -0400 Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> > > Add an interface to libtracefs that makes it easy to create synthetic > events. For example: > I forgot to add (although it's in the man page) #define start_event "sched_waking" #define start_field "pid" #define end_event "sched_switch" #define end_field "next_pid" #define match_name "pid" -- Steve > struct tracefs_synth *synth; > struct tep_handle *tep; > struct trace_seq seq; > > /* Load all events from the system */ > tep = tracefs_local_events(NULL); > > /* Initialize the synthetic event */ > synth = tracefs_synth_init(tep, "wakeup_lat", > NULL, start_event, > NULL, end_event, > match_name, > start_field, end_field); > > /* The tep is no longer needed */ > tep_free(tep); > >