blob: 9e92f22eb086c2b89b58d2fd9a37fe9ffc09edd2 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Li Zefand0b6e042009-07-13 10:33:21 +08002#undef TRACE_SYSTEM
3#define TRACE_SYSTEM skb
4
Steven Rostedtea20d922009-04-10 08:54:16 -04005#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_SKB_H
Neil Horman4893d392009-03-11 09:48:26 +00007
Josh Stone5393f312009-03-24 09:44:28 +00008#include <linux/skbuff.h>
Neil Hormane9b3cc12009-08-13 05:19:44 +00009#include <linux/netdevice.h>
Josh Stone5393f312009-03-24 09:44:28 +000010#include <linux/tracepoint.h>
11
Steven Rostedtea20d922009-04-10 08:54:16 -040012/*
13 * Tracepoint for free an sk_buff:
14 */
15TRACE_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 )
Steven Rostedtea20d922009-04-10 08:54:16 -040023 __field( void *, location )
David Sharpca9da2d2010-12-03 16:13:23 -080024 __field( unsigned short, protocol )
Steven Rostedtea20d922009-04-10 08:54:16 -040025 ),
26
27 TP_fast_assign(
28 __entry->skbaddr = skb;
Steven Rostedtea20d922009-04-10 08:54:16 -040029 __entry->location = location;
David Sharpca9da2d2010-12-03 16:13:23 -080030 __entry->protocol = ntohs(skb->protocol);
Steven Rostedtea20d922009-04-10 08:54:16 -040031 ),
32
33 TP_printk("skbaddr=%p protocol=%u location=%p",
34 __entry->skbaddr, __entry->protocol, __entry->location)
35);
36
Koki Sanagi07dc22e2010-08-23 18:46:12 +090037TRACE_EVENT(consume_skb,
38
39 TP_PROTO(struct sk_buff *skb),
40
41 TP_ARGS(skb),
42
43 TP_STRUCT__entry(
44 __field( void *, skbaddr )
45 ),
46
47 TP_fast_assign(
48 __entry->skbaddr = skb;
49 ),
50
51 TP_printk("skbaddr=%p", __entry->skbaddr)
52);
53
Neil Hormane9b3cc12009-08-13 05:19:44 +000054TRACE_EVENT(skb_copy_datagram_iovec,
55
56 TP_PROTO(const struct sk_buff *skb, int len),
57
58 TP_ARGS(skb, len),
59
60 TP_STRUCT__entry(
61 __field( const void *, skbaddr )
62 __field( int, len )
63 ),
64
65 TP_fast_assign(
66 __entry->skbaddr = skb;
67 __entry->len = len;
68 ),
69
70 TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len)
71);
72
Steven Rostedtea20d922009-04-10 08:54:16 -040073#endif /* _TRACE_SKB_H */
Steven Rostedta8d154b2009-04-10 09:36:00 -040074
75/* This part must be outside protection */
76#include <trace/define_trace.h>