• Steven Rostedt (Red Hat)'s avatar
    tracing: Fix traceon trigger condition to actually turn tracing on · 2c4a33ab
    Steven Rostedt (Red Hat) authored
    While working on my tutorial for 2014 Linux Collaboration Summit
    I found that the traceon trigger did not work when conditions were
    used. The other triggers worked fine though. Looking into it, it
    is because of the way the triggers use the ring buffer to store
    the fields it will use for the condition. But if tracing is off, nothing
    is stored in the buffer, and the tracepoint exits before calling the
    trigger to test the condition. This is fine for all the triggers that
    only work when tracing is on, but for traceon trigger that is to
    work when tracing is off, nothing happens.
    
    The fix is simple, just use a temp ring buffer to record the event
    if tracing is off and the event has a trace event conditional trigger
    enabled. The rest of the tracepoint code will work just fine, but
    the tracepoint wont be recorded in the other buffers.
    
    Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    2c4a33ab
trace.c 157 KB