Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Trace files that want to automate creation of all tracepoints defined
0004  * in their file should include this file. The following are macros that the
0005  * trace file may define:
0006  *
0007  * TRACE_SYSTEM defines the system the tracepoint is for
0008  *
0009  * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
0010  *     This macro may be defined to tell define_trace.h what file to include.
0011  *     Note, leave off the ".h".
0012  *
0013  * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
0014  *     then this macro can define the path to use. Note, the path is relative to
0015  *     define_trace.h, not the file including it. Full path names for out of tree
0016  *     modules must be used.
0017  */
0018 
0019 #ifdef CREATE_CUSTOM_TRACE_EVENTS
0020 
0021 /* Prevent recursion */
0022 #undef CREATE_CUSTOM_TRACE_EVENTS
0023 
0024 #include <linux/stringify.h>
0025 
0026 #undef TRACE_CUSTOM_EVENT
0027 #define TRACE_CUSTOM_EVENT(name, proto, args, tstruct, assign, print)
0028 
0029 #undef DEFINE_CUSTOM_EVENT
0030 #define DEFINE_CUSTOM_EVENT(template, name, proto, args)
0031 
0032 #undef TRACE_INCLUDE
0033 #undef __TRACE_INCLUDE
0034 
0035 #ifndef TRACE_INCLUDE_FILE
0036 # define TRACE_INCLUDE_FILE TRACE_SYSTEM
0037 # define UNDEF_TRACE_INCLUDE_FILE
0038 #endif
0039 
0040 #ifndef TRACE_INCLUDE_PATH
0041 # define __TRACE_INCLUDE(system) <trace/events/system.h>
0042 # define UNDEF_TRACE_INCLUDE_PATH
0043 #else
0044 # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
0045 #endif
0046 
0047 # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
0048 
0049 /* Let the trace headers be reread */
0050 #define TRACE_CUSTOM_MULTI_READ
0051 
0052 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
0053 
0054 #ifdef TRACEPOINTS_ENABLED
0055 #include <trace/trace_custom_events.h>
0056 #endif
0057 
0058 #undef TRACE_CUSTOM_EVENT
0059 #undef DECLARE_CUSTOM_EVENT_CLASS
0060 #undef DEFINE_CUSTOM_EVENT
0061 #undef TRACE_CUSTOM_MULTI_READ
0062 
0063 /* Only undef what we defined in this file */
0064 #ifdef UNDEF_TRACE_INCLUDE_FILE
0065 # undef TRACE_INCLUDE_FILE
0066 # undef UNDEF_TRACE_INCLUDE_FILE
0067 #endif
0068 
0069 #ifdef UNDEF_TRACE_INCLUDE_PATH
0070 # undef TRACE_INCLUDE_PATH
0071 # undef UNDEF_TRACE_INCLUDE_PATH
0072 #endif
0073 
0074 /* We may be processing more files */
0075 #define CREATE_CUSTOM_TRACE_POINTS
0076 
0077 #endif /* CREATE_CUSTOM_TRACE_POINTS */