xref: /linux/arch/x86/include/asm/msr-trace.h (revision e5c86679d5e864947a52fb31e45a425dea3e7fa9)
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM msr
3 
4 #undef TRACE_INCLUDE_FILE
5 #define TRACE_INCLUDE_FILE msr-trace
6 
7 #undef TRACE_INCLUDE_PATH
8 #define TRACE_INCLUDE_PATH asm/
9 
10 #if !defined(_TRACE_MSR_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _TRACE_MSR_H
12 
13 #include <linux/tracepoint.h>
14 
15 /*
16  * Tracing for x86 model specific registers. Directly maps to the
17  * RDMSR/WRMSR instructions.
18  */
19 
20 DECLARE_EVENT_CLASS(msr_trace_class,
21 	    TP_PROTO(unsigned msr, u64 val, int failed),
22 	    TP_ARGS(msr, val, failed),
23 	    TP_STRUCT__entry(
24 		    __field(	unsigned,	msr )
25 		    __field(    u64,		val )
26 		    __field(    int,		failed )
27 	    ),
28 	    TP_fast_assign(
29 		    __entry->msr = msr;
30 		    __entry->val = val;
31 		    __entry->failed = failed;
32 	    ),
33 	    TP_printk("%x, value %llx%s",
34 		      __entry->msr,
35 		      __entry->val,
36 		      __entry->failed ? " #GP" : "")
37 );
38 
39 DEFINE_EVENT(msr_trace_class, read_msr,
40 	     TP_PROTO(unsigned msr, u64 val, int failed),
41 	     TP_ARGS(msr, val, failed)
42 );
43 
44 DEFINE_EVENT(msr_trace_class, write_msr,
45 	     TP_PROTO(unsigned msr, u64 val, int failed),
46 	     TP_ARGS(msr, val, failed)
47 );
48 
49 DEFINE_EVENT(msr_trace_class, rdpmc,
50 	     TP_PROTO(unsigned msr, u64 val, int failed),
51 	     TP_ARGS(msr, val, failed)
52 );
53 
54 #endif /* _TRACE_MSR_H */
55 
56 /* This part must be outside protection */
57 #include <trace/define_trace.h>
58