2 #define TRACE_SYSTEM fib
4 #if !defined(_TRACE_FIB_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/skbuff.h>
8 #include <linux/netdevice.h>
9 #include <net/ip_fib.h>
10 #include <linux/tracepoint.h>
12 TRACE_EVENT(fib_table_lookup,
14 TP_PROTO(u32 tb_id, const struct flowi4 *flp),
23 __field( __u8, scope )
24 __field( __u8, flags )
25 __array( __u8, src, 4 )
26 __array( __u8, dst, 4 )
32 __entry->tb_id = tb_id;
33 __entry->oif = flp->flowi4_oif;
34 __entry->iif = flp->flowi4_iif;
35 __entry->tos = flp->flowi4_tos;
36 __entry->scope = flp->flowi4_scope;
37 __entry->flags = flp->flowi4_flags;
39 p32 = (__be32 *) __entry->src;
42 p32 = (__be32 *) __entry->dst;
46 TP_printk("table %u oif %d iif %d src %pI4 dst %pI4 tos %d scope %d flags %x",
47 __entry->tb_id, __entry->oif, __entry->iif,
48 __entry->src, __entry->dst, __entry->tos, __entry->scope,
52 TRACE_EVENT(fib_table_lookup_nh,
54 TP_PROTO(const struct fib_nh *nh),
59 __string( name, nh->nh_dev->name)
61 __array( __u8, src, 4 )
65 __be32 *p32 = (__be32 *) __entry->src;
67 __assign_str(name, nh->nh_dev ? nh->nh_dev->name : "not set");
68 __entry->oif = nh->nh_oif;
72 TP_printk("nexthop dev %s oif %d src %pI4",
73 __get_str(name), __entry->oif, __entry->src)
76 TRACE_EVENT(fib_validate_source,
78 TP_PROTO(const struct net_device *dev, const struct flowi4 *flp),
83 __string( name, dev->name )
87 __array( __u8, src, 4 )
88 __array( __u8, dst, 4 )
94 __assign_str(name, dev ? dev->name : "not set");
95 __entry->oif = flp->flowi4_oif;
96 __entry->iif = flp->flowi4_iif;
97 __entry->tos = flp->flowi4_tos;
99 p32 = (__be32 *) __entry->src;
102 p32 = (__be32 *) __entry->dst;
106 TP_printk("dev %s oif %d iif %d tos %d src %pI4 dst %pI4",
107 __get_str(name), __entry->oif, __entry->iif, __entry->tos,
108 __entry->src, __entry->dst)
110 #endif /* _TRACE_FIB_H */
112 /* This part must be outside protection */
113 #include <trace/define_trace.h>