• Steven Rostedt's avatar
    tracing: update sample with TRACE_INCLUDE_FILE · 71e1c8ac
    Steven Rostedt authored
    When creating trace events for ftrace, the header file with the TRACE_EVENT
    macros must also have a macro called TRACE_SYSTEM. This macro describes
    the name of the system the TRACE_EVENTS are defined for. It also doubles
    as a way for the define_trace.h file to include the file that included
    it.
    
    For example:
    
    in irq.h
    
     #define TRACE_SYSTEM irq
    
    [...]
    
     #include <trace/define_trace.h>
    
    The define_trace will use TRACE_SYSTEM to include irq.h. But if the name
    of the trace system does not match the name of the trace header file,
    one can override it with:
    
    Which will change define_trace.h to inclued foo_trace.h instead of foo.h
    
    The sample comments this, but people that use the sample code will more
    likely use the code and not read the comments. This patch changes the
    sample code to use the TRACE_INCLUDE_FILE to better show developers how to
    use it.
    
    [ Impact: make sample less confusing to developers ]
    Reported-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    71e1c8ac
trace-events-sample.h 3.83 KB