skb.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM skb
  4. #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_SKB_H
  6. #include <linux/skbuff.h>
  7. #include <linux/netdevice.h>
  8. #include <linux/tracepoint.h>
  9. /*
  10. * Tracepoint for free an sk_buff:
  11. */
  12. TRACE_EVENT(kfree_skb,
  13. TP_PROTO(struct sk_buff *skb, void *location),
  14. TP_ARGS(skb, location),
  15. TP_STRUCT__entry(
  16. __field( void *, skbaddr )
  17. __field( void *, location )
  18. __field( unsigned short, protocol )
  19. ),
  20. TP_fast_assign(
  21. __entry->skbaddr = skb;
  22. __entry->location = location;
  23. __entry->protocol = ntohs(skb->protocol);
  24. ),
  25. TP_printk("skbaddr=%p protocol=%u location=%p",
  26. __entry->skbaddr, __entry->protocol, __entry->location)
  27. );
  28. TRACE_EVENT(consume_skb,
  29. TP_PROTO(struct sk_buff *skb),
  30. TP_ARGS(skb),
  31. TP_STRUCT__entry(
  32. __field( void *, skbaddr )
  33. ),
  34. TP_fast_assign(
  35. __entry->skbaddr = skb;
  36. ),
  37. TP_printk("skbaddr=%p", __entry->skbaddr)
  38. );
  39. TRACE_EVENT(skb_copy_datagram_iovec,
  40. TP_PROTO(const struct sk_buff *skb, int len),
  41. TP_ARGS(skb, len),
  42. TP_STRUCT__entry(
  43. __field( const void *, skbaddr )
  44. __field( int, len )
  45. ),
  46. TP_fast_assign(
  47. __entry->skbaddr = skb;
  48. __entry->len = len;
  49. ),
  50. TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len)
  51. );
  52. #endif /* _TRACE_SKB_H */
  53. /* This part must be outside protection */
  54. #include <trace/define_trace.h>