Li Zefan | d0b6e04 | 2009-07-13 10:33:21 +0800 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM skb |
| 3 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 4 | #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_SKB_H |
Neil Horman | 4893d39 | 2009-03-11 09:48:26 +0000 | [diff] [blame] | 6 | |
Josh Stone | 5393f31 | 2009-03-24 09:44:28 +0000 | [diff] [blame] | 7 | #include <linux/skbuff.h> |
Neil Horman | e9b3cc1 | 2009-08-13 05:19:44 +0000 | [diff] [blame] | 8 | #include <linux/netdevice.h> |
Josh Stone | 5393f31 | 2009-03-24 09:44:28 +0000 | [diff] [blame] | 9 | #include <linux/tracepoint.h> |
| 10 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 11 | /* |
| 12 | * Tracepoint for free an sk_buff: |
| 13 | */ |
| 14 | TRACE_EVENT(kfree_skb, |
| 15 | |
| 16 | TP_PROTO(struct sk_buff *skb, void *location), |
| 17 | |
| 18 | TP_ARGS(skb, location), |
| 19 | |
| 20 | TP_STRUCT__entry( |
| 21 | __field( void *, skbaddr ) |
| 22 | __field( unsigned short, protocol ) |
| 23 | __field( void *, location ) |
| 24 | ), |
| 25 | |
| 26 | TP_fast_assign( |
| 27 | __entry->skbaddr = skb; |
Mathieu Desnoyers | 881fe4b | 2011-01-06 12:53:19 -0500 | [diff] [blame] | 28 | __entry->protocol = ntohs(skb->protocol); |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 29 | __entry->location = location; |
| 30 | ), |
| 31 | |
| 32 | TP_printk("skbaddr=%p protocol=%u location=%p", |
| 33 | __entry->skbaddr, __entry->protocol, __entry->location) |
| 34 | ); |
| 35 | |
Koki Sanagi | 07dc22e | 2010-08-23 18:46:12 +0900 | [diff] [blame] | 36 | TRACE_EVENT(consume_skb, |
| 37 | |
| 38 | TP_PROTO(struct sk_buff *skb), |
| 39 | |
| 40 | TP_ARGS(skb), |
| 41 | |
| 42 | TP_STRUCT__entry( |
| 43 | __field( void *, skbaddr ) |
| 44 | ), |
| 45 | |
| 46 | TP_fast_assign( |
| 47 | __entry->skbaddr = skb; |
| 48 | ), |
| 49 | |
| 50 | TP_printk("skbaddr=%p", __entry->skbaddr) |
| 51 | ); |
| 52 | |
Neil Horman | e9b3cc1 | 2009-08-13 05:19:44 +0000 | [diff] [blame] | 53 | TRACE_EVENT(skb_copy_datagram_iovec, |
| 54 | |
| 55 | TP_PROTO(const struct sk_buff *skb, int len), |
| 56 | |
| 57 | TP_ARGS(skb, len), |
| 58 | |
| 59 | TP_STRUCT__entry( |
| 60 | __field( const void *, skbaddr ) |
| 61 | __field( int, len ) |
| 62 | ), |
| 63 | |
| 64 | TP_fast_assign( |
| 65 | __entry->skbaddr = skb; |
| 66 | __entry->len = len; |
| 67 | ), |
| 68 | |
| 69 | TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len) |
| 70 | ); |
| 71 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 72 | #endif /* _TRACE_SKB_H */ |
Steven Rostedt | a8d154b | 2009-04-10 09:36:00 -0400 | [diff] [blame] | 73 | |
| 74 | /* This part must be outside protection */ |
| 75 | #include <trace/define_trace.h> |