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