/* SPDX-License-Identifier: GPL-2.0 */12/*3* If TRACE_SYSTEM is defined, that will be the directory created4* in the ftrace directory under /sys/kernel/tracing/events/<system>5*6* The define_trace.h below will also look for a file name of7* TRACE_SYSTEM.h where TRACE_SYSTEM is what is defined here.8* In this case, it would look for sample-trace.h9*10* If the header name will be different than the system name11* (as in this case), then you can override the header name that12* define_trace.h will look up by defining TRACE_INCLUDE_FILE13*14* This file is called sample-trace-array.h but we want the system15* to be called "sample-subsystem". Therefore we must define the name of this16* file:17*18* #define TRACE_INCLUDE_FILE sample-trace-array19*20* As we do in the bottom of this file.21*22* Notice that TRACE_SYSTEM should be defined outside of #if23* protection, just like TRACE_INCLUDE_FILE.24*/25#undef TRACE_SYSTEM26#define TRACE_SYSTEM sample-subsystem2728/*29* TRACE_SYSTEM is expected to be a C valid variable (alpha-numeric30* and underscore), although it may start with numbers. If for some31* reason it is not, you need to add the following lines:32*/33#undef TRACE_SYSTEM_VAR34#define TRACE_SYSTEM_VAR sample_subsystem3536/*37* But the above is only needed if TRACE_SYSTEM is not alpha-numeric38* and underscored. By default, TRACE_SYSTEM_VAR will be equal to39* TRACE_SYSTEM. As TRACE_SYSTEM_VAR must be alpha-numeric, if40* TRACE_SYSTEM is not, then TRACE_SYSTEM_VAR must be defined with41* only alpha-numeric and underscores.42*43* The TRACE_SYSTEM_VAR is only used internally and not visible to44* user space.45*/4647/*48* Notice that this file is not protected like a normal header.49* We also must allow for rereading of this file. The50*51* || defined(TRACE_HEADER_MULTI_READ)52*53* serves this purpose.54*/55#if !defined(_SAMPLE_TRACE_ARRAY_H) || defined(TRACE_HEADER_MULTI_READ)56#define _SAMPLE_TRACE_ARRAY_H5758#include <linux/tracepoint.h>59TRACE_EVENT(sample_event,6061TP_PROTO(int count, unsigned long time),6263TP_ARGS(count, time),6465TP_STRUCT__entry(66__field(int, count)67__field(unsigned long, time)68),6970TP_fast_assign(71__entry->count = count;72__entry->time = time;73),7475TP_printk("count value=%d at jiffies=%lu", __entry->count,76__entry->time)77);78#endif7980#undef TRACE_INCLUDE_PATH81#define TRACE_INCLUDE_PATH .82#define TRACE_INCLUDE_FILE sample-trace-array83#include <trace/define_trace.h>848586