net.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM net
  3. #if !defined(_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_NET_H
  5. #include <linux/skbuff.h>
  6. #include <linux/netdevice.h>
  7. #include <linux/ip.h>
  8. #include <linux/tracepoint.h>
  9. TRACE_EVENT(net_dev_xmit,
  10. TP_PROTO(struct sk_buff *skb,
  11. int rc,
  12. struct net_device *dev,
  13. unsigned int skb_len),
  14. TP_ARGS(skb, rc, dev, skb_len),
  15. TP_STRUCT__entry(
  16. __field( void *, skbaddr )
  17. __field( unsigned int, len )
  18. __field( int, rc )
  19. __string( name, dev->name )
  20. ),
  21. TP_fast_assign(
  22. __entry->skbaddr = skb;
  23. __entry->len = skb_len;
  24. __entry->rc = rc;
  25. __assign_str(name, dev->name);
  26. ),
  27. TP_printk("dev=%s skbaddr=%p len=%u rc=%d",
  28. __get_str(name), __entry->skbaddr, __entry->len, __entry->rc)
  29. );
  30. DECLARE_EVENT_CLASS(net_dev_template,
  31. TP_PROTO(struct sk_buff *skb),
  32. TP_ARGS(skb),
  33. TP_STRUCT__entry(
  34. __field( void *, skbaddr )
  35. __field( unsigned int, len )
  36. __string( name, skb->dev->name )
  37. ),
  38. TP_fast_assign(
  39. __entry->skbaddr = skb;
  40. __entry->len = skb->len;
  41. __assign_str(name, skb->dev->name);
  42. ),
  43. TP_printk("dev=%s skbaddr=%p len=%u",
  44. __get_str(name), __entry->skbaddr, __entry->len)
  45. )
  46. DEFINE_EVENT(net_dev_template, net_dev_queue,
  47. TP_PROTO(struct sk_buff *skb),
  48. TP_ARGS(skb)
  49. );
  50. DEFINE_EVENT(net_dev_template, netif_receive_skb,
  51. TP_PROTO(struct sk_buff *skb),
  52. TP_ARGS(skb)
  53. );
  54. DEFINE_EVENT(net_dev_template, netif_rx,
  55. TP_PROTO(struct sk_buff *skb),
  56. TP_ARGS(skb)
  57. );
  58. #endif /* _TRACE_NET_H */
  59. /* This part must be outside protection */
  60. #include <trace/define_trace.h>