fib6.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM fib6
  3. #if !defined(_TRACE_FIB6_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_FIB6_H
  5. #include <linux/in6.h>
  6. #include <net/flow.h>
  7. #include <net/ip6_fib.h>
  8. #include <linux/tracepoint.h>
  9. TRACE_EVENT(fib6_table_lookup,
  10. TP_PROTO(const struct net *net, const struct rt6_info *rt,
  11. u32 tb_id, const struct flowi6 *flp),
  12. TP_ARGS(net, rt, tb_id, flp),
  13. TP_STRUCT__entry(
  14. __field( u32, tb_id )
  15. __field( int, oif )
  16. __field( int, iif )
  17. __field( __u8, tos )
  18. __field( __u8, scope )
  19. __field( __u8, flags )
  20. __array( __u8, src, 16 )
  21. __array( __u8, dst, 16 )
  22. __dynamic_array( char, name, IFNAMSIZ )
  23. __array( __u8, gw, 16 )
  24. ),
  25. TP_fast_assign(
  26. struct in6_addr *in6;
  27. __entry->tb_id = tb_id;
  28. __entry->oif = flp->flowi6_oif;
  29. __entry->iif = flp->flowi6_iif;
  30. __entry->tos = ip6_tclass(flp->flowlabel);
  31. __entry->scope = flp->flowi6_scope;
  32. __entry->flags = flp->flowi6_flags;
  33. in6 = (struct in6_addr *)__entry->src;
  34. *in6 = flp->saddr;
  35. in6 = (struct in6_addr *)__entry->dst;
  36. *in6 = flp->daddr;
  37. if (rt->rt6i_idev) {
  38. __assign_str(name, rt->rt6i_idev->dev->name);
  39. } else {
  40. __assign_str(name, "");
  41. }
  42. if (rt == net->ipv6.ip6_null_entry) {
  43. struct in6_addr in6_zero = {};
  44. in6 = (struct in6_addr *)__entry->gw;
  45. *in6 = in6_zero;
  46. } else if (rt) {
  47. in6 = (struct in6_addr *)__entry->gw;
  48. *in6 = rt->rt6i_gateway;
  49. }
  50. ),
  51. TP_printk("table %3u oif %d iif %d src %pI6c dst %pI6c tos %d scope %d flags %x ==> dev %s gw %pI6c",
  52. __entry->tb_id, __entry->oif, __entry->iif,
  53. __entry->src, __entry->dst, __entry->tos, __entry->scope,
  54. __entry->flags, __get_str(name), __entry->gw)
  55. );
  56. #endif /* _TRACE_FIB6_H */
  57. /* This part must be outside protection */
  58. #include <trace/define_trace.h>