fib.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM fib
  3. #if !defined(_TRACE_FIB_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_FIB_H
  5. #include <linux/skbuff.h>
  6. #include <linux/netdevice.h>
  7. #include <net/ip_fib.h>
  8. #include <linux/tracepoint.h>
  9. TRACE_EVENT(fib_table_lookup,
  10. TP_PROTO(u32 tb_id, const struct flowi4 *flp),
  11. TP_ARGS(tb_id, flp),
  12. TP_STRUCT__entry(
  13. __field( u32, tb_id )
  14. __field( int, oif )
  15. __field( int, iif )
  16. __field( __u8, tos )
  17. __field( __u8, scope )
  18. __field( __u8, flags )
  19. __array( __u8, src, 4 )
  20. __array( __u8, dst, 4 )
  21. ),
  22. TP_fast_assign(
  23. __be32 *p32;
  24. __entry->tb_id = tb_id;
  25. __entry->oif = flp->flowi4_oif;
  26. __entry->iif = flp->flowi4_iif;
  27. __entry->tos = flp->flowi4_tos;
  28. __entry->scope = flp->flowi4_scope;
  29. __entry->flags = flp->flowi4_flags;
  30. p32 = (__be32 *) __entry->src;
  31. *p32 = flp->saddr;
  32. p32 = (__be32 *) __entry->dst;
  33. *p32 = flp->daddr;
  34. ),
  35. TP_printk("table %u oif %d iif %d src %pI4 dst %pI4 tos %d scope %d flags %x",
  36. __entry->tb_id, __entry->oif, __entry->iif,
  37. __entry->src, __entry->dst, __entry->tos, __entry->scope,
  38. __entry->flags)
  39. );
  40. TRACE_EVENT(fib_table_lookup_nh,
  41. TP_PROTO(const struct fib_nh *nh),
  42. TP_ARGS(nh),
  43. TP_STRUCT__entry(
  44. __string( name, nh->nh_dev->name)
  45. __field( int, oif )
  46. __array( __u8, src, 4 )
  47. ),
  48. TP_fast_assign(
  49. __be32 *p32 = (__be32 *) __entry->src;
  50. __assign_str(name, nh->nh_dev ? nh->nh_dev->name : "not set");
  51. __entry->oif = nh->nh_oif;
  52. *p32 = nh->nh_saddr;
  53. ),
  54. TP_printk("nexthop dev %s oif %d src %pI4",
  55. __get_str(name), __entry->oif, __entry->src)
  56. );
  57. TRACE_EVENT(fib_validate_source,
  58. TP_PROTO(const struct net_device *dev, const struct flowi4 *flp),
  59. TP_ARGS(dev, flp),
  60. TP_STRUCT__entry(
  61. __string( name, dev->name )
  62. __field( int, oif )
  63. __field( int, iif )
  64. __field( __u8, tos )
  65. __array( __u8, src, 4 )
  66. __array( __u8, dst, 4 )
  67. ),
  68. TP_fast_assign(
  69. __be32 *p32;
  70. __assign_str(name, dev ? dev->name : "not set");
  71. __entry->oif = flp->flowi4_oif;
  72. __entry->iif = flp->flowi4_iif;
  73. __entry->tos = flp->flowi4_tos;
  74. p32 = (__be32 *) __entry->src;
  75. *p32 = flp->saddr;
  76. p32 = (__be32 *) __entry->dst;
  77. *p32 = flp->daddr;
  78. ),
  79. TP_printk("dev %s oif %d iif %d tos %d src %pI4 dst %pI4",
  80. __get_str(name), __entry->oif, __entry->iif, __entry->tos,
  81. __entry->src, __entry->dst)
  82. );
  83. #endif /* _TRACE_FIB_H */
  84. /* This part must be outside protection */
  85. #include <trace/define_trace.h>