~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/samples/ftrace/sample-trace-array.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 
  3 /*
  4  * If TRACE_SYSTEM is defined, that will be the directory created
  5  * in the ftrace directory under /sys/kernel/tracing/events/<system>
  6  *
  7  * The define_trace.h below will also look for a file name of
  8  * TRACE_SYSTEM.h where TRACE_SYSTEM is what is defined here.
  9  * In this case, it would look for sample-trace.h
 10  *
 11  * If the header name will be different than the system name
 12  * (as in this case), then you can override the header name that
 13  * define_trace.h will look up by defining TRACE_INCLUDE_FILE
 14  *
 15  * This file is called sample-trace-array.h but we want the system
 16  * to be called "sample-subsystem". Therefore we must define the name of this
 17  * file:
 18  *
 19  * #define TRACE_INCLUDE_FILE sample-trace-array
 20  *
 21  * As we do in the bottom of this file.
 22  *
 23  * Notice that TRACE_SYSTEM should be defined outside of #if
 24  * protection, just like TRACE_INCLUDE_FILE.
 25  */
 26 #undef TRACE_SYSTEM
 27 #define TRACE_SYSTEM sample-subsystem
 28 
 29 /*
 30  * TRACE_SYSTEM is expected to be a C valid variable (alpha-numeric
 31  * and underscore), although it may start with numbers. If for some
 32  * reason it is not, you need to add the following lines:
 33  */
 34 #undef TRACE_SYSTEM_VAR
 35 #define TRACE_SYSTEM_VAR sample_subsystem
 36 
 37 /*
 38  * But the above is only needed if TRACE_SYSTEM is not alpha-numeric
 39  * and underscored. By default, TRACE_SYSTEM_VAR will be equal to
 40  * TRACE_SYSTEM. As TRACE_SYSTEM_VAR must be alpha-numeric, if
 41  * TRACE_SYSTEM is not, then TRACE_SYSTEM_VAR must be defined with
 42  * only alpha-numeric and underscores.
 43  *
 44  * The TRACE_SYSTEM_VAR is only used internally and not visible to
 45  * user space.
 46  */
 47 
 48 /*
 49  * Notice that this file is not protected like a normal header.
 50  * We also must allow for rereading of this file. The
 51  *
 52  *  || defined(TRACE_HEADER_MULTI_READ)
 53  *
 54  * serves this purpose.
 55  */
 56 #if !defined(_SAMPLE_TRACE_ARRAY_H) || defined(TRACE_HEADER_MULTI_READ)
 57 #define _SAMPLE_TRACE_ARRAY_H
 58 
 59 #include <linux/tracepoint.h>
 60 TRACE_EVENT(sample_event,
 61 
 62         TP_PROTO(int count, unsigned long time),
 63 
 64         TP_ARGS(count, time),
 65 
 66         TP_STRUCT__entry(
 67                 __field(int, count)
 68                 __field(unsigned long, time)
 69         ),
 70 
 71         TP_fast_assign(
 72                 __entry->count = count;
 73                 __entry->time = time;
 74         ),
 75 
 76         TP_printk("count value=%d at jiffies=%lu", __entry->count,
 77                 __entry->time)
 78         );
 79 #endif
 80 
 81 #undef TRACE_INCLUDE_PATH
 82 #define TRACE_INCLUDE_PATH .
 83 #define TRACE_INCLUDE_FILE sample-trace-array
 84 #include <trace/define_trace.h>
 85 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php