On Mon, 2021-02-22 at 15:30 +0800, Geliang Tang wrote:
This patch added the tracepoint for subflow_check_data_avail to show
the
mapping status.
Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
---
include/trace/events/mptcp.h | 26 ++++++++++++++++++++++++++
net/mptcp/subflow.c | 2 +-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/include/trace/events/mptcp.h b/include/trace/events/mptcp.h
index f06a7d33b237..29570009a7e4 100644
--- a/include/trace/events/mptcp.h
+++ b/include/trace/events/mptcp.h
@@ -7,6 +7,14 @@
#include <linux/tracepoint.h>
+#define show_mapping_status(status) \
+ __print_symbolic(status, \
+ { 0, "MAPPING_OK" }, \
+ { 1, "MAPPING_INVALID" }, \
+ { 2, "MAPPING_EMPTY" }, \
+ { 3, "MAPPING_DATA_FIN" }, \
+ { 4, "MAPPING_DUMMY" })
+
TRACE_EVENT(mptcp_subflow_get_send,
TP_PROTO(struct mptcp_sock *msk, int nr_active,
@@ -90,6 +98,24 @@ TRACE_EVENT(get_mapping_status,
TP_printk("%s", __entry->str)
);
+TRACE_EVENT(subflow_check_data_avail,
+
+ TP_PROTO(__u8 status),
+
+ TP_ARGS(status),
+
+ TP_STRUCT__entry(
+ __field(__u8, status)
+ ),
+
+ TP_fast_assign(
+ __entry->status = status;
+ ),
+
+ TP_printk("mapping_status = %s",
+ show_mapping_status(__entry->status))
Here I think it would be nice additionally including
'skb_peek(&ssk->sk_receive_queue)'
With that, I think we can remove the initial pr_debug()
in subflow_check_data_avail(), as the trace event plus a perf return
probe (always available) should be enough to track all the subflow
status.
Thanks!
Paolo