blob: 6f8962428158540848d199c6b800654944c92946 [file] [log] [blame]
/* SPDX-License-Identifier: GPL-2.0 */
* If TRACE_SYSTEM is defined, that will be the directory created
* in the ftrace directory under /sys/kernel/tracing/events/<system>
* The define_trace.h below will also look for a file name of
* TRACE_SYSTEM.h where TRACE_SYSTEM is what is defined here.
* In this case, it would look for sample-trace.h
* If the header name will be different than the system name
* (as in this case), then you can override the header name that
* define_trace.h will look up by defining TRACE_INCLUDE_FILE
* This file is called sample-trace-array.h but we want the system
* to be called "sample-subsystem". Therefore we must define the name of this
* file:
* #define TRACE_INCLUDE_FILE sample-trace-array
* As we do in the bottom of this file.
* Notice that TRACE_SYSTEM should be defined outside of #if
* protection, just like TRACE_INCLUDE_FILE.
#define TRACE_SYSTEM sample-subsystem
* TRACE_SYSTEM is expected to be a C valid variable (alpha-numeric
* and underscore), although it may start with numbers. If for some
* reason it is not, you need to add the following lines:
#define TRACE_SYSTEM_VAR sample_subsystem
* But the above is only needed if TRACE_SYSTEM is not alpha-numeric
* and underscored. By default, TRACE_SYSTEM_VAR will be equal to
* TRACE_SYSTEM. As TRACE_SYSTEM_VAR must be alpha-numeric, if
* TRACE_SYSTEM is not, then TRACE_SYSTEM_VAR must be defined with
* only alpha-numeric and underscores.
* The TRACE_SYSTEM_VAR is only used internally and not visible to
* user space.
* Notice that this file is not protected like a normal header.
* We also must allow for rereading of this file. The
* serves this purpose.
#include <linux/tracepoint.h>
TP_PROTO(int count, unsigned long time),
TP_ARGS(count, time),
__field(int, count)
__field(unsigned long, time)
__entry->count = count;
__entry->time = time;
TP_printk("count value=%d at jiffies=%lu", __entry->count,
#define TRACE_INCLUDE_FILE sample-trace-array
#include <trace/define_trace.h>