xref: /linux/drivers/net/dsa/mv88e6xxx/trace.h (revision 36ec807b627b4c0a0a382f0ae48eac7187d14b2b)
18646384dSVladimir Oltean /* SPDX-License-Identifier: GPL-2.0-or-later */
28646384dSVladimir Oltean /* Copyright 2022 NXP
38646384dSVladimir Oltean  */
48646384dSVladimir Oltean 
58646384dSVladimir Oltean #undef TRACE_SYSTEM
68646384dSVladimir Oltean #define TRACE_SYSTEM	mv88e6xxx
78646384dSVladimir Oltean 
88646384dSVladimir Oltean #if !defined(_MV88E6XXX_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
98646384dSVladimir Oltean #define _MV88E6XXX_TRACE_H
108646384dSVladimir Oltean 
118646384dSVladimir Oltean #include <linux/device.h>
128646384dSVladimir Oltean #include <linux/if_ether.h>
138646384dSVladimir Oltean #include <linux/tracepoint.h>
148646384dSVladimir Oltean 
158646384dSVladimir Oltean DECLARE_EVENT_CLASS(mv88e6xxx_atu_violation,
168646384dSVladimir Oltean 
178646384dSVladimir Oltean 	TP_PROTO(const struct device *dev, int spid, u16 portvec,
188646384dSVladimir Oltean 		 const unsigned char *addr, u16 fid),
198646384dSVladimir Oltean 
208646384dSVladimir Oltean 	TP_ARGS(dev, spid, portvec, addr, fid),
218646384dSVladimir Oltean 
228646384dSVladimir Oltean 	TP_STRUCT__entry(
238646384dSVladimir Oltean 		__string(name, dev_name(dev))
248646384dSVladimir Oltean 		__field(int, spid)
258646384dSVladimir Oltean 		__field(u16, portvec)
268646384dSVladimir Oltean 		__array(unsigned char, addr, ETH_ALEN)
278646384dSVladimir Oltean 		__field(u16, fid)
288646384dSVladimir Oltean 	),
298646384dSVladimir Oltean 
308646384dSVladimir Oltean 	TP_fast_assign(
31*2c92ca84SSteven Rostedt (Google) 		__assign_str(name);
328646384dSVladimir Oltean 		__entry->spid = spid;
338646384dSVladimir Oltean 		__entry->portvec = portvec;
348646384dSVladimir Oltean 		memcpy(__entry->addr, addr, ETH_ALEN);
358646384dSVladimir Oltean 		__entry->fid = fid;
368646384dSVladimir Oltean 	),
378646384dSVladimir Oltean 
388646384dSVladimir Oltean 	TP_printk("dev %s spid %d portvec 0x%x addr %pM fid %u",
398646384dSVladimir Oltean 		  __get_str(name), __entry->spid, __entry->portvec,
408646384dSVladimir Oltean 		  __entry->addr, __entry->fid)
418646384dSVladimir Oltean );
428646384dSVladimir Oltean 
438646384dSVladimir Oltean DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_member_violation,
448646384dSVladimir Oltean 	     TP_PROTO(const struct device *dev, int spid, u16 portvec,
458646384dSVladimir Oltean 		      const unsigned char *addr, u16 fid),
468646384dSVladimir Oltean 	     TP_ARGS(dev, spid, portvec, addr, fid));
478646384dSVladimir Oltean 
488646384dSVladimir Oltean DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_miss_violation,
498646384dSVladimir Oltean 	     TP_PROTO(const struct device *dev, int spid, u16 portvec,
508646384dSVladimir Oltean 		      const unsigned char *addr, u16 fid),
518646384dSVladimir Oltean 	     TP_ARGS(dev, spid, portvec, addr, fid));
528646384dSVladimir Oltean 
538646384dSVladimir Oltean DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_full_violation,
548646384dSVladimir Oltean 	     TP_PROTO(const struct device *dev, int spid, u16 portvec,
558646384dSVladimir Oltean 		      const unsigned char *addr, u16 fid),
568646384dSVladimir Oltean 	     TP_ARGS(dev, spid, portvec, addr, fid));
578646384dSVladimir Oltean 
589e3d9ae5SVladimir Oltean DECLARE_EVENT_CLASS(mv88e6xxx_vtu_violation,
599e3d9ae5SVladimir Oltean 
609e3d9ae5SVladimir Oltean 	TP_PROTO(const struct device *dev, int spid, u16 vid),
619e3d9ae5SVladimir Oltean 
629e3d9ae5SVladimir Oltean 	TP_ARGS(dev, spid, vid),
639e3d9ae5SVladimir Oltean 
649e3d9ae5SVladimir Oltean 	TP_STRUCT__entry(
659e3d9ae5SVladimir Oltean 		__string(name, dev_name(dev))
669e3d9ae5SVladimir Oltean 		__field(int, spid)
679e3d9ae5SVladimir Oltean 		__field(u16, vid)
689e3d9ae5SVladimir Oltean 	),
699e3d9ae5SVladimir Oltean 
709e3d9ae5SVladimir Oltean 	TP_fast_assign(
71*2c92ca84SSteven Rostedt (Google) 		__assign_str(name);
729e3d9ae5SVladimir Oltean 		__entry->spid = spid;
739e3d9ae5SVladimir Oltean 		__entry->vid = vid;
749e3d9ae5SVladimir Oltean 	),
759e3d9ae5SVladimir Oltean 
769e3d9ae5SVladimir Oltean 	TP_printk("dev %s spid %d vid %u",
779e3d9ae5SVladimir Oltean 		  __get_str(name), __entry->spid, __entry->vid)
789e3d9ae5SVladimir Oltean );
799e3d9ae5SVladimir Oltean 
809e3d9ae5SVladimir Oltean DEFINE_EVENT(mv88e6xxx_vtu_violation, mv88e6xxx_vtu_member_violation,
819e3d9ae5SVladimir Oltean 	     TP_PROTO(const struct device *dev, int spid, u16 vid),
829e3d9ae5SVladimir Oltean 	     TP_ARGS(dev, spid, vid));
839e3d9ae5SVladimir Oltean 
849e3d9ae5SVladimir Oltean DEFINE_EVENT(mv88e6xxx_vtu_violation, mv88e6xxx_vtu_miss_violation,
859e3d9ae5SVladimir Oltean 	     TP_PROTO(const struct device *dev, int spid, u16 vid),
869e3d9ae5SVladimir Oltean 	     TP_ARGS(dev, spid, vid));
879e3d9ae5SVladimir Oltean 
888646384dSVladimir Oltean #endif /* _MV88E6XXX_TRACE_H */
898646384dSVladimir Oltean 
908646384dSVladimir Oltean /* We don't want to use include/trace/events */
918646384dSVladimir Oltean #undef TRACE_INCLUDE_PATH
928646384dSVladimir Oltean #define TRACE_INCLUDE_PATH .
938646384dSVladimir Oltean #undef TRACE_INCLUDE_FILE
948646384dSVladimir Oltean #define TRACE_INCLUDE_FILE	trace
958646384dSVladimir Oltean /* This part must be outside protection */
968646384dSVladimir Oltean #include <trace/define_trace.h>
97