1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM msr
5 #undef TRACE_INCLUDE_FILE
6 #define TRACE_INCLUDE_FILE msr-trace
8 #undef TRACE_INCLUDE_PATH
9 #define TRACE_INCLUDE_PATH asm/
11 #if !defined(_TRACE_MSR_H) || defined(TRACE_HEADER_MULTI_READ)
14 #include <linux/tracepoint.h>
17 * Tracing for x86 model specific registers. Directly maps to the
18 * RDMSR/WRMSR instructions.
21 DECLARE_EVENT_CLASS(msr_trace_class
,
22 TP_PROTO(unsigned msr
, u64 val
, int failed
),
23 TP_ARGS(msr
, val
, failed
),
25 __field( unsigned, msr
)
27 __field( int, failed
)
32 __entry
->failed
= failed
;
34 TP_printk("%x, value %llx%s",
37 __entry
->failed
? " #GP" : "")
40 DEFINE_EVENT(msr_trace_class
, read_msr
,
41 TP_PROTO(unsigned msr
, u64 val
, int failed
),
42 TP_ARGS(msr
, val
, failed
)
45 DEFINE_EVENT(msr_trace_class
, write_msr
,
46 TP_PROTO(unsigned msr
, u64 val
, int failed
),
47 TP_ARGS(msr
, val
, failed
)
50 DEFINE_EVENT(msr_trace_class
, rdpmc
,
51 TP_PROTO(unsigned msr
, u64 val
, int failed
),
52 TP_ARGS(msr
, val
, failed
)
55 #endif /* _TRACE_MSR_H */
57 /* This part must be outside protection */
58 #include <trace/define_trace.h>