xref: /openbmc/linux/drivers/soc/qcom/trace-rpmh.h (revision ded1ffea)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
4  */
5 
6 #if !defined(_TRACE_RPMH_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_RPMH_H
8 
9 #undef TRACE_SYSTEM
10 #define TRACE_SYSTEM rpmh
11 
12 #include <linux/tracepoint.h>
13 #include "rpmh-internal.h"
14 
15 TRACE_EVENT(rpmh_tx_done,
16 
17 	TP_PROTO(struct rsc_drv *d, int m, const struct tcs_request *r),
18 
19 	TP_ARGS(d, m, r),
20 
21 	TP_STRUCT__entry(
22 			 __string(name, d->name)
23 			 __field(int, m)
24 			 __field(u32, addr)
25 			 __field(u32, data)
26 	),
27 
28 	TP_fast_assign(
29 		       __assign_str(name, d->name);
30 		       __entry->m = m;
31 		       __entry->addr = r->cmds[0].addr;
32 		       __entry->data = r->cmds[0].data;
33 	),
34 
35 	TP_printk("%s: ack: tcs-m: %d addr: %#x data: %#x",
36 		  __get_str(name), __entry->m, __entry->addr, __entry->data)
37 );
38 
39 TRACE_EVENT(rpmh_send_msg,
40 
41 	TP_PROTO(struct rsc_drv *d, int m, enum rpmh_state state, int n, u32 h,
42 		 const struct tcs_cmd *c),
43 
44 	TP_ARGS(d, m, state, n, h, c),
45 
46 	TP_STRUCT__entry(
47 			 __string(name, d->name)
48 			 __field(int, m)
49 			 __field(u32, state)
50 			 __field(int, n)
51 			 __field(u32, hdr)
52 			 __field(u32, addr)
53 			 __field(u32, data)
54 			 __field(bool, wait)
55 	),
56 
57 	TP_fast_assign(
58 		       __assign_str(name, d->name);
59 		       __entry->m = m;
60 		       __entry->state = state;
61 		       __entry->n = n;
62 		       __entry->hdr = h;
63 		       __entry->addr = c->addr;
64 		       __entry->data = c->data;
65 		       __entry->wait = c->wait;
66 	),
67 
68 	TP_printk("%s: tcs(m): %d [%s] cmd(n): %d msgid: %#x addr: %#x data: %#x complete: %d",
69 		  __get_str(name), __entry->m,
70 		  __print_symbolic(__entry->state,
71 				   { RPMH_SLEEP_STATE, "sleep" },
72 				   { RPMH_WAKE_ONLY_STATE, "wake" },
73 				   { RPMH_ACTIVE_ONLY_STATE, "active" }),
74 		  __entry->n,
75 		  __entry->hdr,
76 		  __entry->addr, __entry->data, __entry->wait)
77 );
78 
79 #endif /* _TRACE_RPMH_H */
80 
81 #undef TRACE_INCLUDE_PATH
82 #define TRACE_INCLUDE_PATH .
83 
84 #undef TRACE_INCLUDE_FILE
85 #define TRACE_INCLUDE_FILE trace-rpmh
86 
87 #include <trace/define_trace.h>
88