tcp: mark trace event arguments sk and skb as const
authorSong Liu <songliubraving@fb.com>
Mon, 23 Oct 2017 16:20:23 +0000 (09:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Oct 2017 00:21:25 +0000 (01:21 +0100)
Some functions that we plan to add trace points require const sk
and/or skb. So we mark these fields as const in the tracepoint.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/trace/events/tcp.h

index 14b0a7083f1daf589ea3a3c9554d035bf4d921c0..2b6fe72c67814e580021a4c266409de4a7e52e5b 100644 (file)
  */
 DECLARE_EVENT_CLASS(tcp_event_sk_skb,
 
-       TP_PROTO(struct sock *sk, struct sk_buff *skb),
+       TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
 
        TP_ARGS(sk, skb),
 
        TP_STRUCT__entry(
-               __field(void *, skbaddr)
-               __field(void *, skaddr)
+               __field(const void *, skbaddr)
+               __field(const void *, skaddr)
                __field(__u16, sport)
                __field(__u16, dport)
                __array(__u8, saddr, 4)
@@ -72,7 +72,7 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb,
 
 DEFINE_EVENT(tcp_event_sk_skb, tcp_retransmit_skb,
 
-       TP_PROTO(struct sock *sk, struct sk_buff *skb),
+       TP_PROTO(const struct sock *sk, const struct sk_buff *skb),
 
        TP_ARGS(sk, skb)
 );