2018-08-16 15:26:55 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-05-30 02:49:07 +00:00
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM benchmark
|
|
|
|
|
|
|
|
#if !defined(_TRACE_BENCHMARK_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _TRACE_BENCHMARK_H
|
|
|
|
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
|
2016-11-28 18:03:21 +00:00
|
|
|
extern int trace_benchmark_reg(void);
|
2014-05-30 02:49:07 +00:00
|
|
|
extern void trace_benchmark_unreg(void);
|
|
|
|
|
|
|
|
#define BENCHMARK_EVENT_STRLEN 128
|
|
|
|
|
|
|
|
TRACE_EVENT_FN(benchmark_event,
|
|
|
|
|
2022-09-06 22:53:14 +00:00
|
|
|
TP_PROTO(const char *str, u64 delta),
|
2014-05-30 02:49:07 +00:00
|
|
|
|
2022-09-06 22:53:14 +00:00
|
|
|
TP_ARGS(str, delta),
|
2014-05-30 02:49:07 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__array( char, str, BENCHMARK_EVENT_STRLEN )
|
2022-09-06 22:53:14 +00:00
|
|
|
__field( u64, delta)
|
2014-05-30 02:49:07 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
memcpy(__entry->str, str, BENCHMARK_EVENT_STRLEN);
|
2022-09-06 22:53:14 +00:00
|
|
|
__entry->delta = delta;
|
2014-05-30 02:49:07 +00:00
|
|
|
),
|
|
|
|
|
2022-09-06 22:53:14 +00:00
|
|
|
TP_printk("%s delta=%llu", __entry->str, __entry->delta),
|
2014-05-30 02:49:07 +00:00
|
|
|
|
|
|
|
trace_benchmark_reg, trace_benchmark_unreg
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif /* _TRACE_BENCHMARK_H */
|
|
|
|
|
|
|
|
#undef TRACE_INCLUDE_FILE
|
|
|
|
#undef TRACE_INCLUDE_PATH
|
|
|
|
#define TRACE_INCLUDE_PATH .
|
|
|
|
#define TRACE_INCLUDE_FILE trace_benchmark
|
|
|
|
|
|
|
|
/* This part must be outside protection */
|
|
|
|
#include <trace/define_trace.h>
|