aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events/skb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/events/skb.h')
-rw-r--r--include/trace/events/skb.h32
1 files changed, 11 insertions, 21 deletions
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 3e042ca2cedb..50a974f7dfb4 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -9,27 +9,14 @@
#include <linux/netdevice.h>
#include <linux/tracepoint.h>
-#define TRACE_SKB_DROP_REASON \
- EM(SKB_DROP_REASON_NOT_SPECIFIED, NOT_SPECIFIED) \
- EM(SKB_DROP_REASON_NO_SOCKET, NO_SOCKET) \
- EM(SKB_DROP_REASON_PKT_TOO_SMALL, PKT_TOO_SMALL) \
- EM(SKB_DROP_REASON_TCP_CSUM, TCP_CSUM) \
- EM(SKB_DROP_REASON_TCP_FILTER, TCP_FILTER) \
- EM(SKB_DROP_REASON_UDP_CSUM, UDP_CSUM) \
- EMe(SKB_DROP_REASON_MAX, MAX)
+#undef FN
+#define FN(reason) TRACE_DEFINE_ENUM(SKB_DROP_REASON_##reason);
+DEFINE_DROP_REASON(FN, FN)
-#undef EM
-#undef EMe
-
-#define EM(a, b) TRACE_DEFINE_ENUM(a);
-#define EMe(a, b) TRACE_DEFINE_ENUM(a);
-
-TRACE_SKB_DROP_REASON
-
-#undef EM
-#undef EMe
-#define EM(a, b) { a, #b },
-#define EMe(a, b) { a, #b }
+#undef FN
+#undef FNe
+#define FN(reason) { SKB_DROP_REASON_##reason, #reason },
+#define FNe(reason) { SKB_DROP_REASON_##reason, #reason }
/*
* Tracepoint for free an sk_buff:
@@ -58,9 +45,12 @@ TRACE_EVENT(kfree_skb,
TP_printk("skbaddr=%p protocol=%u location=%p reason: %s",
__entry->skbaddr, __entry->protocol, __entry->location,
__print_symbolic(__entry->reason,
- TRACE_SKB_DROP_REASON))
+ DEFINE_DROP_REASON(FN, FNe)))
);
+#undef FN
+#undef FNe
+
TRACE_EVENT(consume_skb,
TP_PROTO(struct sk_buff *skb),