1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright © 2024 Intel Corporation */
3 
4 #undef TRACE_SYSTEM
5 #define TRACE_SYSTEM i915
6 
7 #if !defined(__INTEL_UNCORE_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
8 #define __INTEL_UNCORE_TRACE_H__
9 
10 #include "i915_reg_defs.h"
11 
12 #include <linux/types.h>
13 #include <linux/tracepoint.h>
14 
15 TRACE_EVENT_CONDITION(i915_reg_rw,
16 	TP_PROTO(bool write, i915_reg_t reg, u64 val, int len, bool trace),
17 
18 	TP_ARGS(write, reg, val, len, trace),
19 
20 	TP_CONDITION(trace),
21 
22 	TP_STRUCT__entry(
23 		__field(u64, val)
24 		__field(u32, reg)
25 		__field(u16, write)
26 		__field(u16, len)
27 		),
28 
29 	TP_fast_assign(
30 		__entry->val = (u64)val;
31 		__entry->reg = i915_mmio_reg_offset(reg);
32 		__entry->write = write;
33 		__entry->len = len;
34 		),
35 
36 	TP_printk("%s reg=0x%x, len=%d, val=(0x%x, 0x%x)",
37 		__entry->write ? "write" : "read",
38 		__entry->reg, __entry->len,
39 		(u32)(__entry->val & 0xffffffff),
40 		(u32)(__entry->val >> 32))
41 );
42 #endif /* __INTEL_UNCORE_TRACE_H__ */
43 
44 /* This part must be outside protection */
45 #undef TRACE_INCLUDE_PATH
46 #undef TRACE_INCLUDE_FILE
47 #define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
48 #define TRACE_INCLUDE_FILE intel_uncore_trace
49 #include <trace/define_trace.h>
50