skb.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM skb
  3. #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_SKB_H
  5. #include <linux/skbuff.h>
  6. #include <linux/netdevice.h>
  7. #include <linux/tracepoint.h>
  8. /*
  9. * Tracepoint for free an sk_buff:
  10. */
  11. TRACE_EVENT(kfree_skb,
  12. TP_PROTO(struct sk_buff *skb, void *location),
  13. TP_ARGS(skb, location),
  14. TP_STRUCT__entry(
  15. __field( void *, skbaddr )
  16. __field( void *, location )
  17. __field( unsigned short, protocol )
  18. ),
  19. TP_fast_assign(
  20. __entry->skbaddr = skb;
  21. __entry->location = location;
  22. __entry->protocol = ntohs(skb->protocol);
  23. ),
  24. TP_printk("skbaddr=%p protocol=%u location=%p",
  25. __entry->skbaddr, __entry->protocol, __entry->location)
  26. );
  27. TRACE_EVENT(consume_skb,
  28. TP_PROTO(struct sk_buff *skb),
  29. TP_ARGS(skb),
  30. TP_STRUCT__entry(
  31. __field( void *, skbaddr )
  32. ),
  33. TP_fast_assign(
  34. __entry->skbaddr = skb;
  35. ),
  36. TP_printk("skbaddr=%p", __entry->skbaddr)
  37. );
  38. TRACE_EVENT(print_skb_gso,
  39. TP_PROTO(struct sk_buff *skb, __be16 src, __be16 dest),
  40. TP_ARGS(skb, src, dest),
  41. TP_STRUCT__entry(
  42. __field(void *, skbaddr)
  43. __field(int, len)
  44. __field(int, data_len)
  45. __field(__be16, src)
  46. __field(__be16, dest)
  47. ),
  48. TP_fast_assign(
  49. __entry->skbaddr = skb;
  50. __entry->len = skb->len;
  51. __entry->data_len = skb->data_len;
  52. __entry->src = src;
  53. __entry->dest = dest;
  54. ),
  55. TP_printk("GSO: skbaddr=%pK, len=%d, data_len=%d, src=%u, dest=%u",
  56. __entry->skbaddr, __entry->len, __entry->data_len,
  57. be16_to_cpu(__entry->src), be16_to_cpu(__entry->dest))
  58. );
  59. TRACE_EVENT(skb_copy_datagram_iovec,
  60. TP_PROTO(const struct sk_buff *skb, int len),
  61. TP_ARGS(skb, len),
  62. TP_STRUCT__entry(
  63. __field( const void *, skbaddr )
  64. __field( int, len )
  65. ),
  66. TP_fast_assign(
  67. __entry->skbaddr = skb;
  68. __entry->len = len;
  69. ),
  70. TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len)
  71. );
  72. #endif /* _TRACE_SKB_H */
  73. /* This part must be outside protection */
  74. #include <trace/define_trace.h>