summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/trace/mpx.h
blob: 5c03ec8a90d64f25a0b76b1361048e56329350c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#undef TRACE_SYSTEM
#define TRACE_SYSTEM mpx

#if !defined(_TRACE_MPX_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_MPX_H

#include <linux/tracepoint.h>

#ifdef CONFIG_X86_INTEL_MPX

TRACE_EVENT(bounds_exception_mpx,

	TP_PROTO(const struct bndcsr *bndcsr),
	TP_ARGS(bndcsr),

	TP_STRUCT__entry(
		__field(u64, bndcfgu)
		__field(u64, bndstatus)
	),

	TP_fast_assign(
		/* need to get rid of the 'const' on bndcsr */
		__entry->bndcfgu   = (u64)bndcsr->bndcfgu;
		__entry->bndstatus = (u64)bndcsr->bndstatus;
	),

	TP_printk("bndcfgu:0x%llx bndstatus:0x%llx",
		__entry->bndcfgu,
		__entry->bndstatus)
);

#else

/*
 * This gets used outside of MPX-specific code, so we need a stub.
 */
static inline void trace_bounds_exception_mpx(const struct bndcsr *bndcsr)
{
}

#endif /* CONFIG_X86_INTEL_MPX */

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH asm/trace/
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE mpx
#endif /* _TRACE_MPX_H */

/* This part must be outside protection */
#include <trace/define_trace.h>