skb.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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(skb_copy_datagram_iovec,
  39. TP_PROTO(const struct sk_buff *skb, int len),
  40. TP_ARGS(skb, len),
  41. TP_STRUCT__entry(
  42. __field( const void *, skbaddr )
  43. __field( int, len )
  44. ),
  45. TP_fast_assign(
  46. __entry->skbaddr = skb;
  47. __entry->len = len;
  48. ),
  49. TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len)
  50. );
  51. #endif /* _TRACE_SKB_H */
  52. /* This part must be outside protection */
  53. #include <trace/define_trace.h>