Skip to content

Commit

Permalink
tcp: add trace event class tcp_event_sk_skb
Browse files Browse the repository at this point in the history
Introduce event class tcp_event_sk_skb for tcp tracepoints that
have arguments sk and skb.

Existing tracepoint trace_tcp_retransmit_skb() falls into this class.
This patch rewrites the definition of trace_tcp_retransmit_skb() with
tcp_event_sk_skb.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Song Liu authored and David S. Miller committed Oct 24, 2017
1 parent bded442 commit f6e37b2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion include/trace/events/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
#include <linux/tracepoint.h>
#include <net/ipv6.h>

TRACE_EVENT(tcp_retransmit_skb,
/*
* tcp event with arguments sk and skb
*
* Note: this class requires a valid sk pointer; while skb pointer could
* be NULL.
*/
DECLARE_EVENT_CLASS(tcp_event_sk_skb,

TP_PROTO(struct sock *sk, struct sk_buff *skb),

Expand Down Expand Up @@ -64,6 +70,13 @@ TRACE_EVENT(tcp_retransmit_skb,
__entry->saddr_v6, __entry->daddr_v6)
);

DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb,

TP_PROTO(struct sock *sk, struct sk_buff *skb),

TP_ARGS(sk, skb)
);

#endif /* _TRACE_TCP_H */

/* This part must be outside protection */
Expand Down

0 comments on commit f6e37b2

Please sign in to comment.