xref: /openbmc/linux/drivers/interconnect/trace.h (revision 8dd06ef34b6e2f41b29fbf5fc1663780f2524285)
1*c46ab9dbSGeorgi Djakov /* SPDX-License-Identifier: GPL-2.0 */
2*c46ab9dbSGeorgi Djakov /*
3*c46ab9dbSGeorgi Djakov  * Interconnect framework tracepoints
4*c46ab9dbSGeorgi Djakov  * Copyright (c) 2019, Linaro Ltd.
5*c46ab9dbSGeorgi Djakov  * Author: Georgi Djakov <georgi.djakov@linaro.org>
6*c46ab9dbSGeorgi Djakov  */
7*c46ab9dbSGeorgi Djakov 
8*c46ab9dbSGeorgi Djakov #undef TRACE_SYSTEM
9*c46ab9dbSGeorgi Djakov #define TRACE_SYSTEM interconnect
10*c46ab9dbSGeorgi Djakov 
11*c46ab9dbSGeorgi Djakov #if !defined(_TRACE_INTERCONNECT_H) || defined(TRACE_HEADER_MULTI_READ)
12*c46ab9dbSGeorgi Djakov #define _TRACE_INTERCONNECT_H
13*c46ab9dbSGeorgi Djakov 
14*c46ab9dbSGeorgi Djakov #include <linux/interconnect.h>
15*c46ab9dbSGeorgi Djakov #include <linux/tracepoint.h>
16*c46ab9dbSGeorgi Djakov 
17*c46ab9dbSGeorgi Djakov TRACE_EVENT(icc_set_bw,
18*c46ab9dbSGeorgi Djakov 
19*c46ab9dbSGeorgi Djakov 	TP_PROTO(struct icc_path *p, struct icc_node *n, int i,
20*c46ab9dbSGeorgi Djakov 		 u32 avg_bw, u32 peak_bw),
21*c46ab9dbSGeorgi Djakov 
22*c46ab9dbSGeorgi Djakov 	TP_ARGS(p, n, i, avg_bw, peak_bw),
23*c46ab9dbSGeorgi Djakov 
24*c46ab9dbSGeorgi Djakov 	TP_STRUCT__entry(
25*c46ab9dbSGeorgi Djakov 		__string(path_name, p->name)
26*c46ab9dbSGeorgi Djakov 		__string(dev, dev_name(p->reqs[i].dev))
27*c46ab9dbSGeorgi Djakov 		__string(node_name, n->name)
28*c46ab9dbSGeorgi Djakov 		__field(u32, avg_bw)
29*c46ab9dbSGeorgi Djakov 		__field(u32, peak_bw)
30*c46ab9dbSGeorgi Djakov 		__field(u32, node_avg_bw)
31*c46ab9dbSGeorgi Djakov 		__field(u32, node_peak_bw)
32*c46ab9dbSGeorgi Djakov 	),
33*c46ab9dbSGeorgi Djakov 
34*c46ab9dbSGeorgi Djakov 	TP_fast_assign(
35*c46ab9dbSGeorgi Djakov 		__assign_str(path_name, p->name);
36*c46ab9dbSGeorgi Djakov 		__assign_str(dev, dev_name(p->reqs[i].dev));
37*c46ab9dbSGeorgi Djakov 		__assign_str(node_name, n->name);
38*c46ab9dbSGeorgi Djakov 		__entry->avg_bw = avg_bw;
39*c46ab9dbSGeorgi Djakov 		__entry->peak_bw = peak_bw;
40*c46ab9dbSGeorgi Djakov 		__entry->node_avg_bw = n->avg_bw;
41*c46ab9dbSGeorgi Djakov 		__entry->node_peak_bw = n->peak_bw;
42*c46ab9dbSGeorgi Djakov 	),
43*c46ab9dbSGeorgi Djakov 
44*c46ab9dbSGeorgi Djakov 	TP_printk("path=%s dev=%s node=%s avg_bw=%u peak_bw=%u agg_avg=%u agg_peak=%u",
45*c46ab9dbSGeorgi Djakov 		  __get_str(path_name),
46*c46ab9dbSGeorgi Djakov 		  __get_str(dev),
47*c46ab9dbSGeorgi Djakov 		  __get_str(node_name),
48*c46ab9dbSGeorgi Djakov 		  __entry->avg_bw,
49*c46ab9dbSGeorgi Djakov 		  __entry->peak_bw,
50*c46ab9dbSGeorgi Djakov 		  __entry->node_avg_bw,
51*c46ab9dbSGeorgi Djakov 		  __entry->node_peak_bw)
52*c46ab9dbSGeorgi Djakov );
53*c46ab9dbSGeorgi Djakov 
54*c46ab9dbSGeorgi Djakov TRACE_EVENT(icc_set_bw_end,
55*c46ab9dbSGeorgi Djakov 
56*c46ab9dbSGeorgi Djakov 	TP_PROTO(struct icc_path *p, int ret),
57*c46ab9dbSGeorgi Djakov 
58*c46ab9dbSGeorgi Djakov 	TP_ARGS(p, ret),
59*c46ab9dbSGeorgi Djakov 
60*c46ab9dbSGeorgi Djakov 	TP_STRUCT__entry(
61*c46ab9dbSGeorgi Djakov 		__string(path_name, p->name)
62*c46ab9dbSGeorgi Djakov 		__string(dev, dev_name(p->reqs[0].dev))
63*c46ab9dbSGeorgi Djakov 		__field(int, ret)
64*c46ab9dbSGeorgi Djakov 	),
65*c46ab9dbSGeorgi Djakov 
66*c46ab9dbSGeorgi Djakov 	TP_fast_assign(
67*c46ab9dbSGeorgi Djakov 		__assign_str(path_name, p->name);
68*c46ab9dbSGeorgi Djakov 		__assign_str(dev, dev_name(p->reqs[0].dev));
69*c46ab9dbSGeorgi Djakov 		__entry->ret = ret;
70*c46ab9dbSGeorgi Djakov 	),
71*c46ab9dbSGeorgi Djakov 
72*c46ab9dbSGeorgi Djakov 	TP_printk("path=%s dev=%s ret=%d",
73*c46ab9dbSGeorgi Djakov 		  __get_str(path_name),
74*c46ab9dbSGeorgi Djakov 		  __get_str(dev),
75*c46ab9dbSGeorgi Djakov 		  __entry->ret)
76*c46ab9dbSGeorgi Djakov );
77*c46ab9dbSGeorgi Djakov 
78*c46ab9dbSGeorgi Djakov #endif /* _TRACE_INTERCONNECT_H */
79*c46ab9dbSGeorgi Djakov 
80*c46ab9dbSGeorgi Djakov /* This part must be outside protection */
81*c46ab9dbSGeorgi Djakov 
82*c46ab9dbSGeorgi Djakov #undef TRACE_INCLUDE_PATH
83*c46ab9dbSGeorgi Djakov #define TRACE_INCLUDE_PATH .
84*c46ab9dbSGeorgi Djakov 
85*c46ab9dbSGeorgi Djakov #undef TRACE_INCLUDE_FILE
86*c46ab9dbSGeorgi Djakov #define TRACE_INCLUDE_FILE trace
87*c46ab9dbSGeorgi Djakov 
88*c46ab9dbSGeorgi Djakov #include <trace/define_trace.h>
89