2 #define TRACE_SYSTEM bridge
4 #if !defined(_TRACE_BRIDGE_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_BRIDGE_H
7 #include <linux/netdevice.h>
8 #include <linux/tracepoint.h>
10 #include "../../../net/bridge/br_private.h"
12 TRACE_EVENT(br_fdb_add
,
14 TP_PROTO(struct ndmsg
*ndm
, struct net_device
*dev
,
15 const unsigned char *addr
, u16 vid
, u16 nlh_flags
),
17 TP_ARGS(ndm
, dev
, addr
, vid
, nlh_flags
),
20 __field(u8
, ndm_flags
)
21 __string(dev
, dev
->name
)
22 __array(unsigned char, addr
, ETH_ALEN
)
24 __field(u16
, nlh_flags
)
28 __assign_str(dev
, dev
->name
);
29 memcpy(__entry
->addr
, addr
, ETH_ALEN
);
31 __entry
->nlh_flags
= nlh_flags
;
32 __entry
->ndm_flags
= ndm
->ndm_flags
;
35 TP_printk("dev %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u nlh_flags %04x ndm_flags %02x",
36 __get_str(dev
), __entry
->addr
[0], __entry
->addr
[1],
37 __entry
->addr
[2], __entry
->addr
[3], __entry
->addr
[4],
38 __entry
->addr
[5], __entry
->vid
,
39 __entry
->nlh_flags
, __entry
->ndm_flags
)
42 TRACE_EVENT(br_fdb_external_learn_add
,
44 TP_PROTO(struct net_bridge
*br
, struct net_bridge_port
*p
,
45 const unsigned char *addr
, u16 vid
),
47 TP_ARGS(br
, p
, addr
, vid
),
50 __string(br_dev
, br
->dev
->name
)
51 __string(dev
, p
? p
->dev
->name
: "null")
52 __array(unsigned char, addr
, ETH_ALEN
)
57 __assign_str(br_dev
, br
->dev
->name
);
58 __assign_str(dev
, p
? p
->dev
->name
: "null");
59 memcpy(__entry
->addr
, addr
, ETH_ALEN
);
63 TP_printk("br_dev %s port %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u",
64 __get_str(br_dev
), __get_str(dev
), __entry
->addr
[0],
65 __entry
->addr
[1], __entry
->addr
[2], __entry
->addr
[3],
66 __entry
->addr
[4], __entry
->addr
[5], __entry
->vid
)
69 TRACE_EVENT(fdb_delete
,
71 TP_PROTO(struct net_bridge
*br
, struct net_bridge_fdb_entry
*f
),
76 __string(br_dev
, br
->dev
->name
)
77 __string(dev
, f
->dst
? f
->dst
->dev
->name
: "null")
78 __array(unsigned char, addr
, ETH_ALEN
)
83 __assign_str(br_dev
, br
->dev
->name
);
84 __assign_str(dev
, f
->dst
? f
->dst
->dev
->name
: "null");
85 memcpy(__entry
->addr
, f
->key
.addr
.addr
, ETH_ALEN
);
86 __entry
->vid
= f
->key
.vlan_id
;
89 TP_printk("br_dev %s dev %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u",
90 __get_str(br_dev
), __get_str(dev
), __entry
->addr
[0],
91 __entry
->addr
[1], __entry
->addr
[2], __entry
->addr
[3],
92 __entry
->addr
[4], __entry
->addr
[5], __entry
->vid
)
95 TRACE_EVENT(br_fdb_update
,
97 TP_PROTO(struct net_bridge
*br
, struct net_bridge_port
*source
,
98 const unsigned char *addr
, u16 vid
, bool added_by_user
),
100 TP_ARGS(br
, source
, addr
, vid
, added_by_user
),
103 __string(br_dev
, br
->dev
->name
)
104 __string(dev
, source
->dev
->name
)
105 __array(unsigned char, addr
, ETH_ALEN
)
107 __field(bool, added_by_user
)
111 __assign_str(br_dev
, br
->dev
->name
);
112 __assign_str(dev
, source
->dev
->name
);
113 memcpy(__entry
->addr
, addr
, ETH_ALEN
);
115 __entry
->added_by_user
= added_by_user
;
118 TP_printk("br_dev %s source %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u added_by_user %d",
119 __get_str(br_dev
), __get_str(dev
), __entry
->addr
[0],
120 __entry
->addr
[1], __entry
->addr
[2], __entry
->addr
[3],
121 __entry
->addr
[4], __entry
->addr
[5], __entry
->vid
,
122 __entry
->added_by_user
)
126 #endif /* _TRACE_BRIDGE_H */
128 /* This part must be outside protection */
129 #include <trace/define_trace.h>