From patchwork Mon Feb 22 07:30:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 1442954 X-Patchwork-Delegate: pabeni@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.01.org (client-ip=198.145.21.10; helo=ml01.01.org; envelope-from=mptcp-bounces@lists.01.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ni60n195; dkim-atps=neutral Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DkYkZ4232z9sCD for ; Mon, 22 Feb 2021 18:30:45 +1100 (AEDT) Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 96C87100EBB61; Sun, 21 Feb 2021 23:30:43 -0800 (PST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::434; helo=mail-pf1-x434.google.com; envelope-from=geliangtang@gmail.com; receiver= Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E599B100EBBDF for ; Sun, 21 Feb 2021 23:30:40 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id q20so6049158pfu.8 for ; Sun, 21 Feb 2021 23:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nhEJCC178u+jSiOx3ggpEO43ENA7s7Dr4IttEUp7AdE=; b=ni60n195wGejsgaBomKHw52RLijUBIcuoknU5udc0XKBcWTpeNFbpB5Ykoelfd6fOy EqSphcFzF9F+NzEgxNv69wRW2Pcow7Tg6b9AxueIXQ0qvqA3d3iSz2mS9/1gcGCF0NYK 4zy+kdqxhdwxvldbPJe/a/75lEVRJBmJeq3c5mKG/zagoVA7HHGcP5k+Gpk+gsFXZgee aL/tCi12N7hwFktnqbK1VuUPHyid7cmykx/gzggtDrnrHumHWbUeB8CtWQJxPcqornLC 1UthJInB0E105tRii1Llq1vzuwdhDt54wlsIZHUy3qfxvI6E2JRvK2Qp2gceiC3EvSaO +g/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nhEJCC178u+jSiOx3ggpEO43ENA7s7Dr4IttEUp7AdE=; b=JHDCiP5aSND0X+Gky75Kpri4gPFcP9/S2sFnqzwgyzEWQFi5iqrpjjuV+fHW1t7t+p RtzfZ4rCi8dHxfbouBuumw2e12z2oipd7MDM1sWpw3YvDBER/3226ZqAnk3s87tVzcaz IZ/C95HN/Yi8nN9DPEsjZ1CXAGgSqfzutBwSAwErJonDdJLk9zCWbhuc4Tv335JGHnUB GDDKL3G8qlvHY9ZktFKirvQhlCsxsT9EjKY/CMqDYAECswO5i3RFtQSRyb6bMwIxlppb adOXAI1E/DG/Ymp4BKA56GrSGzVnCAMiE4ztdSLSdNUB0Z/6WbupdVNMNwRW9Gm2/+nE VDaA== X-Gm-Message-State: AOAM530JjqfPjJ8K/uMujNh/ISThYtGzqEbgsybOd/zRTbAdJjKHKV5p kVsO687xikxbc3BPbRvvlANxJjJFbQOAxQ== X-Google-Smtp-Source: ABdhPJz2KioqyRzyh5rB11/bloA157sR6eJ1N7RMXDI67bZnXt+fdHKjw71Gow8CsJvS9mhunWag4A== X-Received: by 2002:a62:7555:0:b029:1ed:7b84:5e29 with SMTP id q82-20020a6275550000b02901ed7b845e29mr7431254pfc.61.1613979040176; Sun, 21 Feb 2021 23:30:40 -0800 (PST) Received: from localhost ([43.224.245.180]) by smtp.gmail.com with ESMTPSA id 7sm17699427pfh.142.2021.02.21.23.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 23:30:39 -0800 (PST) From: Geliang Tang To: mptcp@lists.01.org Date: Mon, 22 Feb 2021 15:30:31 +0800 Message-Id: <38cfc37b362365f951585f9fda3031896f734e01.1613978710.git.geliangtang@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: MHRYXBGSR3XV3WZMOT4OPHGNV3CJ6YLV X-Message-ID-Hash: MHRYXBGSR3XV3WZMOT4OPHGNV3CJ6YLV X-MailFrom: geliangtang@gmail.com X-Mailman-Rule-Hits: member-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address CC: Geliang Tang X-Mailman-Version: 3.1.1 Precedence: list Subject: [MPTCP] [MPTCP][PATCH mptcp-next 1/3] mptcp: add tracepoint for mptcp_subflow_get_send List-Id: Discussions regarding MPTCP upstreaming Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: This patch added the tracepoint for the packet scheduler function mptcp_subflow_get_send. Signed-off-by: Geliang Tang --- include/trace/events/mptcp.h | 45 ++++++++++++++++++++++++++++++++++++ net/mptcp/protocol.c | 9 +++++--- 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 include/trace/events/mptcp.h diff --git a/include/trace/events/mptcp.h b/include/trace/events/mptcp.h new file mode 100644 index 000000000000..b36b308f48e2 --- /dev/null +++ b/include/trace/events/mptcp.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM mptcp + +#if !defined(_TRACE_MPTCP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_MPTCP_H + +#include + +TRACE_EVENT(mptcp_subflow_get_send, + + TP_PROTO(struct mptcp_sock *msk, int nr_active, + struct sock *ssk_0, u64 ratio_0, + struct sock *ssk_1, u64 ratio_1), + + TP_ARGS(msk, nr_active, ssk_0, ratio_0, ssk_1, ratio_1), + + TP_STRUCT__entry( + __field(const void *, msk) + __field(__u32, nr_active) + __field(const void *, ssk_0) + __field(__u64, ratio_0) + __field(const void *, ssk_1) + __field(__u64, ratio_1) + ), + + TP_fast_assign( + __entry->msk = msk; + __entry->nr_active = nr_active; + __entry->ssk_0 = ssk_0; + __entry->ratio_0 = ratio_0; + __entry->ssk_1 = ssk_1; + __entry->ratio_1 = ratio_1; + ), + + TP_printk("msk=%p nr_active=%d ssk=%p:%lld backup=%p:%lld", + __entry->msk, __entry->nr_active, + __entry->ssk_0, __entry->ratio_0, + __entry->ssk_1, __entry->ratio_1) +); + +#endif /* _TRACE_MPTCP_H */ + +/* This part must be outside protection */ +#include diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index ec808187fa0e..dff3f8c96c5d 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -27,6 +27,9 @@ #include "protocol.h" #include "mib.h" +#define CREATE_TRACE_POINTS +#include + #if IS_ENABLED(CONFIG_MPTCP_IPV6) struct mptcp6_sock { struct mptcp_sock msk; @@ -1418,9 +1421,9 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk) } } - pr_debug("msk=%p nr_active=%d ssk=%p:%lld backup=%p:%lld", - msk, nr_active, send_info[0].ssk, send_info[0].ratio, - send_info[1].ssk, send_info[1].ratio); + trace_mptcp_subflow_get_send(msk, nr_active, + send_info[0].ssk, send_info[0].ratio, + send_info[1].ssk, send_info[1].ratio); /* pick the best backup if no other subflow is active */ if (!nr_active)