2 #define TRACE_SYSTEM vsock
4 #if !defined(_TRACE_VSOCK_VIRTIO_TRANSPORT_COMMON_H) || \
5 defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_VSOCK_VIRTIO_TRANSPORT_COMMON_H
8 #include <linux/tracepoint.h>
10 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_TYPE_STREAM);
12 #define show_type(val) \
13 __print_symbolic(val, { VIRTIO_VSOCK_TYPE_STREAM, "STREAM" })
15 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_INVALID);
16 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_REQUEST);
17 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_RESPONSE);
18 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_RST);
19 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_SHUTDOWN);
20 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_RW);
21 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_CREDIT_UPDATE);
22 TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_CREDIT_REQUEST);
24 #define show_op(val) \
25 __print_symbolic(val, \
26 { VIRTIO_VSOCK_OP_INVALID, "INVALID" }, \
27 { VIRTIO_VSOCK_OP_REQUEST, "REQUEST" }, \
28 { VIRTIO_VSOCK_OP_RESPONSE, "RESPONSE" }, \
29 { VIRTIO_VSOCK_OP_RST, "RST" }, \
30 { VIRTIO_VSOCK_OP_SHUTDOWN, "SHUTDOWN" }, \
31 { VIRTIO_VSOCK_OP_RW, "RW" }, \
32 { VIRTIO_VSOCK_OP_CREDIT_UPDATE, "CREDIT_UPDATE" }, \
33 { VIRTIO_VSOCK_OP_CREDIT_REQUEST, "CREDIT_REQUEST" })
35 TRACE_EVENT(virtio_transport_alloc_pkt,
37 __u32 src_cid, __u32 src_port,
38 __u32 dst_cid, __u32 dst_port,
53 __field(__u32, src_cid)
54 __field(__u32, src_port)
55 __field(__u32, dst_cid)
56 __field(__u32, dst_port)
63 __entry->src_cid = src_cid;
64 __entry->src_port = src_port;
65 __entry->dst_cid = dst_cid;
66 __entry->dst_port = dst_port;
70 __entry->flags = flags;
72 TP_printk("%u:%u -> %u:%u len=%u type=%s op=%s flags=%#x",
73 __entry->src_cid, __entry->src_port,
74 __entry->dst_cid, __entry->dst_port,
76 show_type(__entry->type),
81 TRACE_EVENT(virtio_transport_recv_pkt,
83 __u32 src_cid, __u32 src_port,
84 __u32 dst_cid, __u32 dst_port,
103 __field(__u32, src_cid)
104 __field(__u32, src_port)
105 __field(__u32, dst_cid)
106 __field(__u32, dst_port)
110 __field(__u32, flags)
111 __field(__u32, buf_alloc)
112 __field(__u32, fwd_cnt)
115 __entry->src_cid = src_cid;
116 __entry->src_port = src_port;
117 __entry->dst_cid = dst_cid;
118 __entry->dst_port = dst_port;
120 __entry->type = type;
122 __entry->flags = flags;
123 __entry->buf_alloc = buf_alloc;
124 __entry->fwd_cnt = fwd_cnt;
126 TP_printk("%u:%u -> %u:%u len=%u type=%s op=%s flags=%#x "
127 "buf_alloc=%u fwd_cnt=%u",
128 __entry->src_cid, __entry->src_port,
129 __entry->dst_cid, __entry->dst_port,
131 show_type(__entry->type),
132 show_op(__entry->op),
138 #endif /* _TRACE_VSOCK_VIRTIO_TRANSPORT_COMMON_H */
140 #undef TRACE_INCLUDE_FILE
141 #define TRACE_INCLUDE_FILE vsock_virtio_transport_common
143 /* This part must be outside protection */
144 #include <trace/define_trace.h>