Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM dccp
0004 
0005 #if !defined(_TRACE_DCCP_H) || defined(TRACE_HEADER_MULTI_READ)
0006 #define _TRACE_DCCP_H
0007 
0008 #include <net/sock.h>
0009 #include "dccp.h"
0010 #include "ccids/ccid3.h"
0011 #include <linux/tracepoint.h>
0012 #include <trace/events/net_probe_common.h>
0013 
0014 TRACE_EVENT(dccp_probe,
0015 
0016     TP_PROTO(struct sock *sk, size_t size),
0017 
0018     TP_ARGS(sk, size),
0019 
0020     TP_STRUCT__entry(
0021         /* sockaddr_in6 is always bigger than sockaddr_in */
0022         __array(__u8, saddr, sizeof(struct sockaddr_in6))
0023         __array(__u8, daddr, sizeof(struct sockaddr_in6))
0024         __field(__u16, sport)
0025         __field(__u16, dport)
0026         __field(__u16, size)
0027         __field(__u16, tx_s)
0028         __field(__u32, tx_rtt)
0029         __field(__u32, tx_p)
0030         __field(__u32, tx_x_calc)
0031         __field(__u64, tx_x_recv)
0032         __field(__u64, tx_x)
0033         __field(__u32, tx_t_ipi)
0034     ),
0035 
0036     TP_fast_assign(
0037         const struct inet_sock *inet = inet_sk(sk);
0038         struct ccid3_hc_tx_sock *hc = NULL;
0039 
0040         if (ccid_get_current_tx_ccid(dccp_sk(sk)) == DCCPC_CCID3)
0041             hc = ccid3_hc_tx_sk(sk);
0042 
0043         memset(__entry->saddr, 0, sizeof(struct sockaddr_in6));
0044         memset(__entry->daddr, 0, sizeof(struct sockaddr_in6));
0045 
0046         TP_STORE_ADDR_PORTS(__entry, inet, sk);
0047 
0048         /* For filtering use */
0049         __entry->sport = ntohs(inet->inet_sport);
0050         __entry->dport = ntohs(inet->inet_dport);
0051 
0052         __entry->size = size;
0053         if (hc) {
0054             __entry->tx_s = hc->tx_s;
0055             __entry->tx_rtt = hc->tx_rtt;
0056             __entry->tx_p = hc->tx_p;
0057             __entry->tx_x_calc = hc->tx_x_calc;
0058             __entry->tx_x_recv = hc->tx_x_recv >> 6;
0059             __entry->tx_x = hc->tx_x >> 6;
0060             __entry->tx_t_ipi = hc->tx_t_ipi;
0061         } else {
0062             __entry->tx_s = 0;
0063             memset_startat(__entry, 0, tx_rtt);
0064         }
0065     ),
0066 
0067     TP_printk("src=%pISpc dest=%pISpc size=%d tx_s=%d tx_rtt=%d "
0068           "tx_p=%d tx_x_calc=%u tx_x_recv=%llu tx_x=%llu tx_t_ipi=%d",
0069           __entry->saddr, __entry->daddr, __entry->size,
0070           __entry->tx_s, __entry->tx_rtt, __entry->tx_p,
0071           __entry->tx_x_calc, __entry->tx_x_recv, __entry->tx_x,
0072           __entry->tx_t_ipi)
0073 );
0074 
0075 #endif /* _TRACE_TCP_H */
0076 
0077 /* This part must be outside protection */
0078 #undef TRACE_INCLUDE_PATH
0079 #define TRACE_INCLUDE_PATH .
0080 #undef TRACE_INCLUDE_FILE
0081 #define TRACE_INCLUDE_FILE trace
0082 #include <trace/define_trace.h>