xref: /openbmc/linux/include/trace/events/mdio.h (revision 2a598d0b)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM mdio
4 
5 #if !defined(_TRACE_MDIO_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_MDIO_H
7 
8 #include <linux/tracepoint.h>
9 
10 TRACE_EVENT_CONDITION(mdio_access,
11 
12 	TP_PROTO(struct mii_bus *bus, char read,
13 		 u8 addr, unsigned regnum, u16 val, int err),
14 
15 	TP_ARGS(bus, read, addr, regnum, val, err),
16 
17 	TP_CONDITION(err >= 0),
18 
19 	TP_STRUCT__entry(
20 		__array(char, busid, MII_BUS_ID_SIZE)
21 		__field(char, read)
22 		__field(u8, addr)
23 		__field(u16, val)
24 		__field(unsigned, regnum)
25 	),
26 
27 	TP_fast_assign(
28 		strncpy(__entry->busid, bus->id, MII_BUS_ID_SIZE);
29 		__entry->read = read;
30 		__entry->addr = addr;
31 		__entry->regnum = regnum;
32 		__entry->val = val;
33 	),
34 
35 	TP_printk("%s %-5s phy:0x%02hhx reg:0x%02x val:0x%04hx",
36 		  __entry->busid, __entry->read ? "read" : "write",
37 		  __entry->addr, __entry->regnum, __entry->val)
38 );
39 
40 #endif /* if !defined(_TRACE_MDIO_H) || defined(TRACE_HEADER_MULTI_READ) */
41 
42 /* This part must be outside protection */
43 #include <trace/define_trace.h>
44