bridge.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM bridge
  3. #if !defined(_TRACE_BRIDGE_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_BRIDGE_H
  5. #include <linux/netdevice.h>
  6. #include <linux/tracepoint.h>
  7. #include "../../../net/bridge/br_private.h"
  8. TRACE_EVENT(br_fdb_add,
  9. TP_PROTO(struct ndmsg *ndm, struct net_device *dev,
  10. const unsigned char *addr, u16 vid, u16 nlh_flags),
  11. TP_ARGS(ndm, dev, addr, vid, nlh_flags),
  12. TP_STRUCT__entry(
  13. __field(u8, ndm_flags)
  14. __string(dev, dev->name)
  15. __array(unsigned char, addr, ETH_ALEN)
  16. __field(u16, vid)
  17. __field(u16, nlh_flags)
  18. ),
  19. TP_fast_assign(
  20. __assign_str(dev, dev->name);
  21. memcpy(__entry->addr, addr, ETH_ALEN);
  22. __entry->vid = vid;
  23. __entry->nlh_flags = nlh_flags;
  24. __entry->ndm_flags = ndm->ndm_flags;
  25. ),
  26. TP_printk("dev %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u nlh_flags %04x ndm_flags %02x",
  27. __get_str(dev), __entry->addr[0], __entry->addr[1],
  28. __entry->addr[2], __entry->addr[3], __entry->addr[4],
  29. __entry->addr[5], __entry->vid,
  30. __entry->nlh_flags, __entry->ndm_flags)
  31. );
  32. TRACE_EVENT(br_fdb_external_learn_add,
  33. TP_PROTO(struct net_bridge *br, struct net_bridge_port *p,
  34. const unsigned char *addr, u16 vid),
  35. TP_ARGS(br, p, addr, vid),
  36. TP_STRUCT__entry(
  37. __string(br_dev, br->dev->name)
  38. __string(dev, p ? p->dev->name : "null")
  39. __array(unsigned char, addr, ETH_ALEN)
  40. __field(u16, vid)
  41. ),
  42. TP_fast_assign(
  43. __assign_str(br_dev, br->dev->name);
  44. __assign_str(dev, p ? p->dev->name : "null");
  45. memcpy(__entry->addr, addr, ETH_ALEN);
  46. __entry->vid = vid;
  47. ),
  48. TP_printk("br_dev %s port %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u",
  49. __get_str(br_dev), __get_str(dev), __entry->addr[0],
  50. __entry->addr[1], __entry->addr[2], __entry->addr[3],
  51. __entry->addr[4], __entry->addr[5], __entry->vid)
  52. );
  53. TRACE_EVENT(fdb_delete,
  54. TP_PROTO(struct net_bridge *br, struct net_bridge_fdb_entry *f),
  55. TP_ARGS(br, f),
  56. TP_STRUCT__entry(
  57. __string(br_dev, br->dev->name)
  58. __string(dev, f->dst ? f->dst->dev->name : "null")
  59. __array(unsigned char, addr, ETH_ALEN)
  60. __field(u16, vid)
  61. ),
  62. TP_fast_assign(
  63. __assign_str(br_dev, br->dev->name);
  64. __assign_str(dev, f->dst ? f->dst->dev->name : "null");
  65. memcpy(__entry->addr, f->key.addr.addr, ETH_ALEN);
  66. __entry->vid = f->key.vlan_id;
  67. ),
  68. TP_printk("br_dev %s dev %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u",
  69. __get_str(br_dev), __get_str(dev), __entry->addr[0],
  70. __entry->addr[1], __entry->addr[2], __entry->addr[3],
  71. __entry->addr[4], __entry->addr[5], __entry->vid)
  72. );
  73. TRACE_EVENT(br_fdb_update,
  74. TP_PROTO(struct net_bridge *br, struct net_bridge_port *source,
  75. const unsigned char *addr, u16 vid, bool added_by_user),
  76. TP_ARGS(br, source, addr, vid, added_by_user),
  77. TP_STRUCT__entry(
  78. __string(br_dev, br->dev->name)
  79. __string(dev, source->dev->name)
  80. __array(unsigned char, addr, ETH_ALEN)
  81. __field(u16, vid)
  82. __field(bool, added_by_user)
  83. ),
  84. TP_fast_assign(
  85. __assign_str(br_dev, br->dev->name);
  86. __assign_str(dev, source->dev->name);
  87. memcpy(__entry->addr, addr, ETH_ALEN);
  88. __entry->vid = vid;
  89. __entry->added_by_user = added_by_user;
  90. ),
  91. TP_printk("br_dev %s source %s addr %02x:%02x:%02x:%02x:%02x:%02x vid %u added_by_user %d",
  92. __get_str(br_dev), __get_str(dev), __entry->addr[0],
  93. __entry->addr[1], __entry->addr[2], __entry->addr[3],
  94. __entry->addr[4], __entry->addr[5], __entry->vid,
  95. __entry->added_by_user)
  96. );
  97. #endif /* _TRACE_BRIDGE_H */
  98. /* This part must be outside protection */
  99. #include <trace/define_trace.h>