xref: /linux/drivers/net/dsa/mv88e6xxx/trace.h (revision a06c3fad49a50d5d5eb078f93e70f4d3eca5d5a5)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* Copyright 2022 NXP
3  */
4 
5 #undef TRACE_SYSTEM
6 #define TRACE_SYSTEM	mv88e6xxx
7 
8 #if !defined(_MV88E6XXX_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
9 #define _MV88E6XXX_TRACE_H
10 
11 #include <linux/device.h>
12 #include <linux/if_ether.h>
13 #include <linux/tracepoint.h>
14 
15 DECLARE_EVENT_CLASS(mv88e6xxx_atu_violation,
16 
17 	TP_PROTO(const struct device *dev, int spid, u16 portvec,
18 		 const unsigned char *addr, u16 fid),
19 
20 	TP_ARGS(dev, spid, portvec, addr, fid),
21 
22 	TP_STRUCT__entry(
23 		__string(name, dev_name(dev))
24 		__field(int, spid)
25 		__field(u16, portvec)
26 		__array(unsigned char, addr, ETH_ALEN)
27 		__field(u16, fid)
28 	),
29 
30 	TP_fast_assign(
31 		__assign_str(name);
32 		__entry->spid = spid;
33 		__entry->portvec = portvec;
34 		memcpy(__entry->addr, addr, ETH_ALEN);
35 		__entry->fid = fid;
36 	),
37 
38 	TP_printk("dev %s spid %d portvec 0x%x addr %pM fid %u",
39 		  __get_str(name), __entry->spid, __entry->portvec,
40 		  __entry->addr, __entry->fid)
41 );
42 
43 DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_member_violation,
44 	     TP_PROTO(const struct device *dev, int spid, u16 portvec,
45 		      const unsigned char *addr, u16 fid),
46 	     TP_ARGS(dev, spid, portvec, addr, fid));
47 
48 DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_miss_violation,
49 	     TP_PROTO(const struct device *dev, int spid, u16 portvec,
50 		      const unsigned char *addr, u16 fid),
51 	     TP_ARGS(dev, spid, portvec, addr, fid));
52 
53 DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_full_violation,
54 	     TP_PROTO(const struct device *dev, int spid, u16 portvec,
55 		      const unsigned char *addr, u16 fid),
56 	     TP_ARGS(dev, spid, portvec, addr, fid));
57 
58 DECLARE_EVENT_CLASS(mv88e6xxx_vtu_violation,
59 
60 	TP_PROTO(const struct device *dev, int spid, u16 vid),
61 
62 	TP_ARGS(dev, spid, vid),
63 
64 	TP_STRUCT__entry(
65 		__string(name, dev_name(dev))
66 		__field(int, spid)
67 		__field(u16, vid)
68 	),
69 
70 	TP_fast_assign(
71 		__assign_str(name);
72 		__entry->spid = spid;
73 		__entry->vid = vid;
74 	),
75 
76 	TP_printk("dev %s spid %d vid %u",
77 		  __get_str(name), __entry->spid, __entry->vid)
78 );
79 
80 DEFINE_EVENT(mv88e6xxx_vtu_violation, mv88e6xxx_vtu_member_violation,
81 	     TP_PROTO(const struct device *dev, int spid, u16 vid),
82 	     TP_ARGS(dev, spid, vid));
83 
84 DEFINE_EVENT(mv88e6xxx_vtu_violation, mv88e6xxx_vtu_miss_violation,
85 	     TP_PROTO(const struct device *dev, int spid, u16 vid),
86 	     TP_ARGS(dev, spid, vid));
87 
88 #endif /* _MV88E6XXX_TRACE_H */
89 
90 /* We don't want to use include/trace/events */
91 #undef TRACE_INCLUDE_PATH
92 #define TRACE_INCLUDE_PATH .
93 #undef TRACE_INCLUDE_FILE
94 #define TRACE_INCLUDE_FILE	trace
95 /* This part must be outside protection */
96 #include <trace/define_trace.h>
97