xref: /openbmc/linux/include/trace/events/rwmmio.h (revision 96d3e6f0)
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, u64 val, u8 width, volatile void __iomem *addr),
16 
17 	TP_ARGS(caller, val, width, addr),
18 
19 	TP_STRUCT__entry(
20 		__field(unsigned long, caller)
21 		__field(unsigned long, addr)
22 		__field(u64, val)
23 		__field(u8, width)
24 	),
25 
26 	TP_fast_assign(
27 		__entry->caller = caller;
28 		__entry->val = val;
29 		__entry->addr = (unsigned long)addr;
30 		__entry->width = width;
31 	),
32 
33 	TP_printk("%pS width=%d val=%#llx addr=%#lx",
34 		(void *)__entry->caller, __entry->width,
35 		__entry->val, __entry->addr)
36 );
37 
38 DEFINE_EVENT(rwmmio_rw_template, rwmmio_write,
39 	TP_PROTO(unsigned long caller, u64 val, u8 width, volatile void __iomem *addr),
40 	TP_ARGS(caller, val, width, addr)
41 );
42 
43 DEFINE_EVENT(rwmmio_rw_template, rwmmio_post_write,
44 	TP_PROTO(unsigned long caller, u64 val, u8 width, volatile void __iomem *addr),
45 	TP_ARGS(caller, val, width, addr)
46 );
47 
48 TRACE_EVENT(rwmmio_read,
49 
50 	TP_PROTO(unsigned long caller, u8 width, const volatile void __iomem *addr),
51 
52 	TP_ARGS(caller, width, addr),
53 
54 	TP_STRUCT__entry(
55 		__field(unsigned long, caller)
56 		__field(unsigned long, addr)
57 		__field(u8, width)
58 	),
59 
60 	TP_fast_assign(
61 		__entry->caller = caller;
62 		__entry->addr = (unsigned long)addr;
63 		__entry->width = width;
64 	),
65 
66 	TP_printk("%pS width=%d addr=%#lx",
67 		 (void *)__entry->caller, __entry->width, __entry->addr)
68 );
69 
70 TRACE_EVENT(rwmmio_post_read,
71 
72 	TP_PROTO(unsigned long caller, u64 val, u8 width, const volatile void __iomem *addr),
73 
74 	TP_ARGS(caller, val, width, addr),
75 
76 	TP_STRUCT__entry(
77 		__field(unsigned long, caller)
78 		__field(unsigned long, addr)
79 		__field(u64, val)
80 		__field(u8, width)
81 	),
82 
83 	TP_fast_assign(
84 		__entry->caller = caller;
85 		__entry->val = val;
86 		__entry->addr = (unsigned long)addr;
87 		__entry->width = width;
88 	),
89 
90 	TP_printk("%pS width=%d val=%#llx addr=%#lx",
91 		 (void *)__entry->caller, __entry->width,
92 		 __entry->val, __entry->addr)
93 );
94 
95 #endif /* _TRACE_RWMMIO_H */
96 
97 #include <trace/define_trace.h>
98