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