Merge tag 'pm-4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
[linux/fpc-iii.git] / arch / x86 / include / asm / trace / mpx.h
blob0f492fc50bcec34368a1869995496b64a476cd39
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM mpx
4 #if !defined(_TRACE_MPX_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_MPX_H
7 #include <linux/tracepoint.h>
9 #ifdef CONFIG_X86_INTEL_MPX
11 TRACE_EVENT(mpx_bounds_register_exception,
13 TP_PROTO(void *addr_referenced,
14 const struct mpx_bndreg *bndreg),
15 TP_ARGS(addr_referenced, bndreg),
17 TP_STRUCT__entry(
18 __field(void *, addr_referenced)
19 __field(u64, lower_bound)
20 __field(u64, upper_bound)
23 TP_fast_assign(
24 __entry->addr_referenced = addr_referenced;
25 __entry->lower_bound = bndreg->lower_bound;
26 __entry->upper_bound = bndreg->upper_bound;
29 * Note that we are printing out the '~' of the upper
30 * bounds register here. It is actually stored in its
31 * one's complement form so that its 'init' state
32 * corresponds to all 0's. But, that looks like
33 * gibberish when printed out, so print out the 1's
34 * complement instead of the actual value here. Note
35 * though that you still need to specify filters for the
36 * actual value, not the displayed one.
38 TP_printk("address referenced: 0x%p bounds: lower: 0x%llx ~upper: 0x%llx",
39 __entry->addr_referenced,
40 __entry->lower_bound,
41 ~__entry->upper_bound
45 TRACE_EVENT(bounds_exception_mpx,
47 TP_PROTO(const struct mpx_bndcsr *bndcsr),
48 TP_ARGS(bndcsr),
50 TP_STRUCT__entry(
51 __field(u64, bndcfgu)
52 __field(u64, bndstatus)
55 TP_fast_assign(
56 /* need to get rid of the 'const' on bndcsr */
57 __entry->bndcfgu = (u64)bndcsr->bndcfgu;
58 __entry->bndstatus = (u64)bndcsr->bndstatus;
61 TP_printk("bndcfgu:0x%llx bndstatus:0x%llx",
62 __entry->bndcfgu,
63 __entry->bndstatus)
66 DECLARE_EVENT_CLASS(mpx_range_trace,
68 TP_PROTO(unsigned long start,
69 unsigned long end),
70 TP_ARGS(start, end),
72 TP_STRUCT__entry(
73 __field(unsigned long, start)
74 __field(unsigned long, end)
77 TP_fast_assign(
78 __entry->start = start;
79 __entry->end = end;
82 TP_printk("[0x%p:0x%p]",
83 (void *)__entry->start,
84 (void *)__entry->end
88 DEFINE_EVENT(mpx_range_trace, mpx_unmap_zap,
89 TP_PROTO(unsigned long start, unsigned long end),
90 TP_ARGS(start, end)
93 DEFINE_EVENT(mpx_range_trace, mpx_unmap_search,
94 TP_PROTO(unsigned long start, unsigned long end),
95 TP_ARGS(start, end)
98 TRACE_EVENT(mpx_new_bounds_table,
100 TP_PROTO(unsigned long table_vaddr),
101 TP_ARGS(table_vaddr),
103 TP_STRUCT__entry(
104 __field(unsigned long, table_vaddr)
107 TP_fast_assign(
108 __entry->table_vaddr = table_vaddr;
111 TP_printk("table vaddr:%p", (void *)__entry->table_vaddr)
114 #else
117 * This gets used outside of MPX-specific code, so we need a stub.
119 static inline
120 void trace_bounds_exception_mpx(const struct mpx_bndcsr *bndcsr)
124 #endif /* CONFIG_X86_INTEL_MPX */
126 #undef TRACE_INCLUDE_PATH
127 #define TRACE_INCLUDE_PATH asm/trace/
128 #undef TRACE_INCLUDE_FILE
129 #define TRACE_INCLUDE_FILE mpx
130 #endif /* _TRACE_MPX_H */
132 /* This part must be outside protection */
133 #include <trace/define_trace.h>