On Fri, 2010-12-03 at 18:33 -0800, David Sharp wrote:
I would not touch the TRACE_EVENT() structures. They are there as is and
I would not think about changing them. Something like that would never
make it into mainline.
Now what you can do, is to make your own events based off of the same
tracepoints. For example, the TRACE_EVENT(sched_switch...) has in
You could even write a module that does something like this:
void probe_sched_switch(void *mydata,
struct task_struct *prev,
struct task_struct *next)
struct ring_buffer *buffer;
struct ring_buffer_event *event;
struct myentry *entry;
event = trace_current_buffer_lock_reserve(buffer,
entry = ring_buffer_event_data(event);
entry->myfield = prev->x;
You will need to do a register_ftrace_event() to register that 'mytype'
and how to output it. Otherwise it would just be ignored in the "trace"
All of the above would work fine as a loadable module that you could
easily maintain out of tree, and still uses the internals of the system.