1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM fib6
5 #if !defined(_TRACE_FIB6_H) || defined(TRACE_HEADER_MULTI_READ)
10 #include <net/ip6_fib.h>
11 #include <linux/tracepoint.h>
13 TRACE_EVENT(fib6_table_lookup
,
15 TP_PROTO(const struct net
*net
, const struct rt6_info
*rt
,
16 struct fib6_table
*table
, const struct flowi6
*flp
),
18 TP_ARGS(net
, rt
, table
, flp
),
26 __field( __u8
, scope
)
27 __field( __u8
, flags
)
28 __array( __u8
, src
, 16 )
29 __array( __u8
, dst
, 16 )
31 __dynamic_array( char, name
, IFNAMSIZ
)
32 __array( __u8
, gw
, 16 )
38 __entry
->tb_id
= table
->tb6_id
;
39 __entry
->oif
= flp
->flowi6_oif
;
40 __entry
->iif
= flp
->flowi6_iif
;
41 __entry
->tos
= ip6_tclass(flp
->flowlabel
);
42 __entry
->scope
= flp
->flowi6_scope
;
43 __entry
->flags
= flp
->flowi6_flags
;
45 in6
= (struct in6_addr
*)__entry
->src
;
48 in6
= (struct in6_addr
*)__entry
->dst
;
52 __assign_str(name
, rt
->rt6i_idev
->dev
->name
);
54 __assign_str(name
, "");
56 if (rt
== net
->ipv6
.ip6_null_entry
) {
57 struct in6_addr in6_zero
= {};
59 in6
= (struct in6_addr
*)__entry
->gw
;
63 in6
= (struct in6_addr
*)__entry
->gw
;
64 *in6
= rt
->rt6i_gateway
;
68 TP_printk("table %3u oif %d iif %d src %pI6c dst %pI6c tos %d scope %d flags %x ==> dev %s gw %pI6c",
69 __entry
->tb_id
, __entry
->oif
, __entry
->iif
,
70 __entry
->src
, __entry
->dst
, __entry
->tos
, __entry
->scope
,
71 __entry
->flags
, __get_str(name
), __entry
->gw
)
74 #endif /* _TRACE_FIB6_H */
76 /* This part must be outside protection */
77 #include <trace/define_trace.h>