xref: /openbmc/linux/include/trace/events/rwmmio.h (revision c699ce1a)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  */
5 #undef TRACE_SYSTEM
6 #define TRACE_SYSTEM rwmmio
7 
8 #if !defined(_TRACE_RWMMIO_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define _TRACE_RWMMIO_H
10 
11 #include <linux/tracepoint.h>
12 
13 DECLARE_EVENT_CLASS(rwmmio_rw_template,
14 
15 	TP_PROTO(unsigned long caller, unsigned long caller0, u64 val, u8 width,
16 		 volatile void __iomem *addr),
17 
18 	TP_ARGS(caller, caller0, val, width, addr),
19 
20 	TP_STRUCT__entry(
21 		__field(unsigned long, caller)
22 		__field(unsigned long, caller0)
23 		__field(unsigned long, addr)
24 		__field(u64, val)
25 		__field(u8, width)
26 	),
27 
28 	TP_fast_assign(
29 		__entry->caller = caller;
30 		__entry->caller0 = caller0;
31 		__entry->val = val;
32 		__entry->addr = (unsigned long)addr;
33 		__entry->width = width;
34 	),
35 
36 	TP_printk("%pS -> %pS width=%d val=%#llx addr=%#lx",
37 		(void *)__entry->caller0, (void *)__entry->caller, __entry->width,
38 		__entry->val, __entry->addr)
39 );
40 
41 DEFINE_EVENT(rwmmio_rw_template, rwmmio_write,
42 	TP_PROTO(unsigned long caller, unsigned long caller0, u64 val, u8 width,
43 		 volatile void __iomem *addr),
44 	TP_ARGS(caller, caller0, val, width, addr)
45 );
46 
47 DEFINE_EVENT(rwmmio_rw_template, rwmmio_post_write,
48 	TP_PROTO(unsigned long caller, unsigned long caller0, u64 val, u8 width,
49 		 volatile void __iomem *addr),
50 	TP_ARGS(caller, caller0, val, width, addr)
51 );
52 
53 TRACE_EVENT(rwmmio_read,
54 
55 	TP_PROTO(unsigned long caller, unsigned long caller0, u8 width,
56 		 const volatile void __iomem *addr),
57 
58 	TP_ARGS(caller, caller0, width, addr),
59 
60 	TP_STRUCT__entry(
61 		__field(unsigned long, caller)
62 		__field(unsigned long, caller0)
63 		__field(unsigned long, addr)
64 		__field(u8, width)
65 	),
66 
67 	TP_fast_assign(
68 		__entry->caller = caller;
69 		__entry->caller0 = caller0;
70 		__entry->addr = (unsigned long)addr;
71 		__entry->width = width;
72 	),
73 
74 	TP_printk("%pS -> %pS width=%d addr=%#lx",
75 		 (void *)__entry->caller0, (void *)__entry->caller, __entry->width, __entry->addr)
76 );
77 
78 TRACE_EVENT(rwmmio_post_read,
79 
80 	TP_PROTO(unsigned long caller, unsigned long caller0, u64 val, u8 width,
81 		 const volatile void __iomem *addr),
82 
83 	TP_ARGS(caller, caller0, val, width, addr),
84 
85 	TP_STRUCT__entry(
86 		__field(unsigned long, caller)
87 		__field(unsigned long, caller0)
88 		__field(unsigned long, addr)
89 		__field(u64, val)
90 		__field(u8, width)
91 	),
92 
93 	TP_fast_assign(
94 		__entry->caller = caller;
95 		__entry->caller0 = caller0;
96 		__entry->val = val;
97 		__entry->addr = (unsigned long)addr;
98 		__entry->width = width;
99 	),
100 
101 	TP_printk("%pS -> %pS width=%d val=%#llx addr=%#lx",
102 		 (void *)__entry->caller0, (void *)__entry->caller, __entry->width,
103 		 __entry->val, __entry->addr)
104 );
105 
106 #endif /* _TRACE_RWMMIO_H */
107 
108 #include <trace/define_trace.h>
109