1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM x86_fpu
5 #if !defined(_TRACE_FPU_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/tracepoint.h>
10 DECLARE_EVENT_CLASS(x86_fpu
,
11 TP_PROTO(struct fpu
*fpu
),
15 __field(struct fpu
*, fpu
)
16 __field(bool, load_fpu
)
17 __field(u64
, xfeatures
)
18 __field(u64
, xcomp_bv
)
23 __entry
->load_fpu
= test_thread_flag(TIF_NEED_FPU_LOAD
);
24 if (boot_cpu_has(X86_FEATURE_OSXSAVE
)) {
25 __entry
->xfeatures
= fpu
->state
.xsave
.header
.xfeatures
;
26 __entry
->xcomp_bv
= fpu
->state
.xsave
.header
.xcomp_bv
;
29 TP_printk("x86/fpu: %p load: %d xfeatures: %llx xcomp_bv: %llx",
37 DEFINE_EVENT(x86_fpu
, x86_fpu_before_save
,
38 TP_PROTO(struct fpu
*fpu
),
42 DEFINE_EVENT(x86_fpu
, x86_fpu_after_save
,
43 TP_PROTO(struct fpu
*fpu
),
47 DEFINE_EVENT(x86_fpu
, x86_fpu_before_restore
,
48 TP_PROTO(struct fpu
*fpu
),
52 DEFINE_EVENT(x86_fpu
, x86_fpu_after_restore
,
53 TP_PROTO(struct fpu
*fpu
),
57 DEFINE_EVENT(x86_fpu
, x86_fpu_regs_activated
,
58 TP_PROTO(struct fpu
*fpu
),
62 DEFINE_EVENT(x86_fpu
, x86_fpu_regs_deactivated
,
63 TP_PROTO(struct fpu
*fpu
),
67 DEFINE_EVENT(x86_fpu
, x86_fpu_init_state
,
68 TP_PROTO(struct fpu
*fpu
),
72 DEFINE_EVENT(x86_fpu
, x86_fpu_dropped
,
73 TP_PROTO(struct fpu
*fpu
),
77 DEFINE_EVENT(x86_fpu
, x86_fpu_copy_src
,
78 TP_PROTO(struct fpu
*fpu
),
82 DEFINE_EVENT(x86_fpu
, x86_fpu_copy_dst
,
83 TP_PROTO(struct fpu
*fpu
),
87 DEFINE_EVENT(x86_fpu
, x86_fpu_xstate_check_failed
,
88 TP_PROTO(struct fpu
*fpu
),
92 #undef TRACE_INCLUDE_PATH
93 #define TRACE_INCLUDE_PATH asm/trace/
94 #undef TRACE_INCLUDE_FILE
95 #define TRACE_INCLUDE_FILE fpu
96 #endif /* _TRACE_FPU_H */
98 /* This part must be outside protection */
99 #include <trace/define_trace.h>