Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cb3d1d9 authored by Zhaolei's avatar Zhaolei Committed by Ingo Molnar
Browse files

tracing, net, skb tracepoint: make skb tracepoint use the TRACE_EVENT() macro



TRACE_EVENT is a more generic way to define a tracepoint.
Doing so adds these new capabilities to this tracepoint:

  - zero-copy and per-cpu splice() tracing
  - binary tracing without printf overhead
  - structured logging records exposed under /debug/tracing/events
  - trace events embedded in function tracer output and other plugins
  - user-defined, per tracepoint filter expressions

Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: "Steven Rostedt ;" <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <49DD90D2.5020604@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e71e99c2
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@
#include <linux/skbuff.h>
#include <linux/tracepoint.h>

DECLARE_TRACE(kfree_skb,
	TP_PROTO(struct sk_buff *skb, void *location),
	TP_ARGS(skb, location));
#include <trace/skb_event_types.h>

#endif
+38 −0
Original line number Diff line number Diff line

/* use <trace/skb.h> instead */
#ifndef TRACE_EVENT
# error Do not include this file directly.
# error Unless you know what you are doing.
#endif

#undef TRACE_SYSTEM
#define TRACE_SYSTEM skb

/*
 * Tracepoint for free an sk_buff:
 */
TRACE_EVENT(kfree_skb,

	TP_PROTO(struct sk_buff *skb, void *location),

	TP_ARGS(skb, location),

	TP_STRUCT__entry(
		__field(	void *,		skbaddr		)
		__field(	unsigned short,	protocol	)
		__field(	void *,		location	)
	),

	TP_fast_assign(
		__entry->skbaddr = skb;
		if (skb) {
			__entry->protocol = ntohs(skb->protocol);
		}
		__entry->location = location;
	),

	TP_printk("skbaddr=%p protocol=%u location=%p",
		__entry->skbaddr, __entry->protocol, __entry->location)
);

#undef TRACE_SYSTEM
+1 −0
Original line number Diff line number Diff line
@@ -3,3 +3,4 @@
#include <trace/sched_event_types.h>
#include <trace/irq_event_types.h>
#include <trace/lockdep_event_types.h>
#include <trace/skb_event_types.h>
+1 −0
Original line number Diff line number Diff line
@@ -3,3 +3,4 @@
#include <trace/sched.h>
#include <trace/irq.h>
#include <trace/lockdep.h>
#include <trace/skb.h>