xref: /linux/drivers/soc/qcom/trace-smp2p.h (revision 55d0969c451159cff86949b38c39171cab962069)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  */
5 
6 #undef TRACE_SYSTEM
7 #define TRACE_SYSTEM qcom_smp2p
8 
9 #if !defined(__QCOM_SMP2P_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
10 #define __QCOM_SMP2P_TRACE_H__
11 
12 #include <linux/device.h>
13 #include <linux/tracepoint.h>
14 
15 TRACE_EVENT(smp2p_ssr_ack,
16 	TP_PROTO(const struct device *dev),
17 	TP_ARGS(dev),
18 	TP_STRUCT__entry(
19 		__string(dev_name, dev_name(dev))
20 	),
21 	TP_fast_assign(
22 		__assign_str(dev_name);
23 	),
24 	TP_printk("%s: SSR detected", __get_str(dev_name))
25 );
26 
27 TRACE_EVENT(smp2p_negotiate,
28 	TP_PROTO(const struct device *dev, unsigned int features),
29 	TP_ARGS(dev, features),
30 	TP_STRUCT__entry(
31 		__string(dev_name, dev_name(dev))
32 		__field(u32, out_features)
33 	),
34 	TP_fast_assign(
35 		__assign_str(dev_name);
36 		__entry->out_features = features;
37 	),
38 	TP_printk("%s: state=open out_features=%s", __get_str(dev_name),
39 		__print_flags(__entry->out_features, "|",
40 			{SMP2P_FEATURE_SSR_ACK, "SMP2P_FEATURE_SSR_ACK"})
41 	)
42 );
43 
44 TRACE_EVENT(smp2p_notify_in,
45 	TP_PROTO(struct smp2p_entry *smp2p_entry, unsigned long status, u32 val),
46 	TP_ARGS(smp2p_entry, status, val),
47 	TP_STRUCT__entry(
48 		__string(dev_name, dev_name(smp2p_entry->smp2p->dev))
49 		__string(client_name, smp2p_entry->name)
50 		__field(unsigned long, status)
51 		__field(u32, val)
52 	),
53 	TP_fast_assign(
54 		__assign_str(dev_name);
55 		__assign_str(client_name);
56 		__entry->status = status;
57 		__entry->val = val;
58 	),
59 	TP_printk("%s: %s: status:0x%0lx val:0x%0x",
60 		__get_str(dev_name),
61 		__get_str(client_name),
62 		__entry->status,
63 		__entry->val
64 	)
65 );
66 
67 TRACE_EVENT(smp2p_update_bits,
68 	TP_PROTO(struct smp2p_entry *smp2p_entry, u32 orig, u32 val),
69 	TP_ARGS(smp2p_entry, orig, val),
70 	TP_STRUCT__entry(
71 		__string(dev_name, dev_name(smp2p_entry->smp2p->dev))
72 		__string(client_name, smp2p_entry->name)
73 		__field(u32, orig)
74 		__field(u32, val)
75 	),
76 	TP_fast_assign(
77 		__assign_str(dev_name);
78 		__assign_str(client_name);
79 		__entry->orig = orig;
80 		__entry->val = val;
81 	),
82 	TP_printk("%s: %s: orig:0x%0x new:0x%0x",
83 		__get_str(dev_name),
84 		__get_str(client_name),
85 		__entry->orig,
86 		__entry->val
87 	)
88 );
89 
90 #endif /* __QCOM_SMP2P_TRACE_H__ */
91 
92 #undef TRACE_INCLUDE_PATH
93 #define TRACE_INCLUDE_PATH .
94 
95 #undef TRACE_INCLUDE_FILE
96 #define TRACE_INCLUDE_FILE trace-smp2p
97 
98 #include <trace/define_trace.h>
99