Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1232724lqe; Mon, 8 Apr 2024 02:52:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsK2y0OiH5YzoIuAz0WNZ5sPphkyZDlOtRzijuyl8czKl2HrM75nwxSOD8j0C8RooaihWXm+Kp+8d/+hEmTWQrZr//Nkl9dMWQwma6hA== X-Google-Smtp-Source: AGHT+IFLGOKv9egx6pWmGpPU7kFGhCZ/lMyXc63hHt1W7Stjp6xDH6ir3VYNQmIvr9lfFfQhg+84 X-Received: by 2002:a17:906:c797:b0:a51:b62f:86dd with SMTP id cw23-20020a170906c79700b00a51b62f86ddmr3742163ejb.6.1712569940214; Mon, 08 Apr 2024 02:52:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712569940; cv=pass; d=google.com; s=arc-20160816; b=psWRTSyvvNVwXzXea3udm1QYVuum6F9DUb6fTt9nOeS/1YXVlDhH+MRhGrht67D3Yl I6GmH32+NfhN9Bsbwt0CDB1vGFz+ebjxQp5AEWxLCGxOmiNv3YA02HgKOqJHTu3kuY/b hjrwitkQpglZRTrCAbqEr8gFUqesOmkUzX4mOM1ab2KXxJ3Z1Tee3knJqUYlloOldFhG h4SHEHXW7wxi/U6dEJgf7BBSxGIsiZ8/p1S8YPWeZ5h6nw2rl5tuCqOgJVeRbiPWdgEK mpVcfvvLi3EXK1PoExZxGPvIk89mu9GZZNciTOf2jrAh202zs9mIgCqrsTzpZXc8TMA3 lrDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=/AB40R8a/9W5Iy9KzL7hxyYEm8jw/yB0gnz2a23jdno=; fh=xbabF+mn0TVz9Hozl9CxqYqc2nUtFPLUz4LTfMwHcT8=; b=e+YTg2/gEMyOrBn/xTEJsSl6d1FeeQHwKmi5LpSIN1FfHCFkXtpmSPHys6lUutGS7S D8I2LiJgTTiYRDL+Gdn1idVBLe44hxHmQGp2yPYV1R0RPo56wkBf8vyM/2sNeQfTivgg Gc8YKX2CgywkdwTHbGROCTNNLXPk+abew1JoYYlymDtnpws3esHCtT1NReqQcjGTHUvZ T8ynP3meghD3G2a4AmT1l3ol0oNpbHu+KMtCiArnTv/qO2PFjaUJdOYr4M93rdAcpVOg oMABcrMob8UaAu41yETitWwMB30oFXRvA0avXja/t3YiQWWqB3moUQs2zFxUnxzgcnSz M76g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@fujitsu.com header.s=fj2 header.b=Ms3bJDWg; arc=pass (i=1 spf=pass spfdomain=fujitsu.com dkim=pass dkdomain=fujitsu.com dmarc=pass fromdomain=fujitsu.com); spf=pass (google.com: domain of linux-nfs+bounces-2713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a9-20020a1709064a4900b00a4e679a883bsi3585671ejv.938.2024.04.08.02.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 02:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@fujitsu.com header.s=fj2 header.b=Ms3bJDWg; arc=pass (i=1 spf=pass spfdomain=fujitsu.com dkim=pass dkdomain=fujitsu.com dmarc=pass fromdomain=fujitsu.com); spf=pass (google.com: domain of linux-nfs+bounces-2713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=fujitsu.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D96741F2119C for ; Mon, 8 Apr 2024 09:52:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2AD4C4C600; Mon, 8 Apr 2024 09:52:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b="Ms3bJDWg" X-Original-To: linux-nfs@vger.kernel.org Received: from esa1.hc1455-7.c3s2.iphmx.com (esa1.hc1455-7.c3s2.iphmx.com [207.54.90.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E02C0481DF for ; Mon, 8 Apr 2024 09:52:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.54.90.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712569937; cv=none; b=Q0H+y3VDUPz5yEsP0R31rqrgNFtrVGw+wBkomVg/Vqfr9qm97ZUq1GCABwTT4Vcp0JacnDJ2xY7qcbwiIpMCQn98rcypWV4mIrpKeuFmEQqIpESbs2P+TSWJ+eMpUeRSjv0ncs71GMKdXEuMN+ZDck9OMnZ8jwzU8ZPgZQ0fhNA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712569937; c=relaxed/simple; bh=0K1sVZqkNG5KfeQKSfWlJkbz5GY99ktd/Y2YWdRL7qU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Ocl/rQnsF7jnQwhfC48aukeSVq+Fi4cvKTR7k0rxoBRpDtUCI6+1+UqDqudiF7F5dkk4glhyY6o665HgjWCCZV78ZoP594aNkXqmR/Mrq43sdqhaXduDPv5ZY/W3AC4PrJKj8j26LVBBujz87sRIOScLkJ55K1t/u1o6TxPlglg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fujitsu.com; spf=pass smtp.mailfrom=fujitsu.com; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b=Ms3bJDWg; arc=none smtp.client-ip=207.54.90.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fujitsu.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj2; t=1712569934; x=1744105934; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0K1sVZqkNG5KfeQKSfWlJkbz5GY99ktd/Y2YWdRL7qU=; b=Ms3bJDWgF7ikVZTfsdrWjIfmNy+/AiTufwoONsbHZtQk1zoa4sYprRUC Qi12N/pGRggZLRV/YMJCuZdU5rWWIMgmXBPLcNnCcUcJfNqiUKNmTy9rC xlYmX5s4LqcRq2EmKBrbVYTmNFccOgYlhP0SS/t6FnB7i0jkSdVwDN5eY U614DGgogGhIfwJbK/ojcwEXEaAYZ1G+rZpLKjAFJJF2MsvBEccKDGAbH S60ix3Us6zVlv8IsKcvKiYA+ScBgOUUG99RfdaXAxVsqosaiIGGYOKDbR RD7xWtjEWWFgvQ3Zf5CFZmf0Limn16acV+CZCaXZrc3LDgYx6QWL4rC3V g==; X-IronPort-AV: E=McAfee;i="6600,9927,11037"; a="154807439" X-IronPort-AV: E=Sophos;i="6.07,186,1708354800"; d="scan'208";a="154807439" Received: from unknown (HELO yto-r4.gw.nic.fujitsu.com) ([218.44.52.220]) by esa1.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2024 18:51:03 +0900 Received: from yto-m3.gw.nic.fujitsu.com (yto-nat-yto-m3.gw.nic.fujitsu.com [192.168.83.66]) by yto-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id 7C2F0D3EAC for ; Mon, 8 Apr 2024 18:51:00 +0900 (JST) Received: from kws-ab4.gw.nic.fujitsu.com (kws-ab4.gw.nic.fujitsu.com [192.51.206.22]) by yto-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id B6EF7E615E for ; Mon, 8 Apr 2024 18:50:59 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab4.gw.nic.fujitsu.com (Postfix) with ESMTP id 48A806BEFD for ; Mon, 8 Apr 2024 18:50:59 +0900 (JST) Received: from G08FNSTD200033.g08.fujitsu.local (unknown [10.167.225.189]) by edo.cn.fujitsu.com (Postfix) with ESMTP id AE2141A0002; Mon, 8 Apr 2024 17:50:58 +0800 (CST) From: Chen Hanxiao To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH] NFSv4: add tracepoint to referral events Date: Mon, 8 Apr 2024 17:50:52 +0800 Message-Id: <20240408095052.367-1-chenhx.fnst@fujitsu.com> X-Mailer: git-send-email 2.37.1.windows.1 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28304.006 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28304.006 X-TMASE-Result: 10-1.953800-10.000000 X-TMASE-MatchedRID: BrKfIHwbYjX/R1NSMc2qCR1kSRHxj+Z5CZa9cSpBObnAuQ0xDMaXkH4q tYI9sRE/DNbgKEt9XPNiGZRBxfTmk2XCD9DZzMgRngIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPIcSq bxBgG0w4pr5H/EtyHO9teO1ApRBQQR5rzQkkyuzxDQbS48nfx6oZUwBcOvlGVG6OqA9Pr9t2hx5 5pwnP3VY7MlCyFh+/O1/5CsusGKIFbjBuldNvkMkoq97WSHdFjfupJaud1uZCfRs6uIbkFVw== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 Trace new locations when hitting a referral. Signed-off-by: Chen Hanxiao --- fs/nfs/nfs4namespace.c | 3 +++ fs/nfs/nfs4trace.h | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 9a98595bb160..fca9fb801bc2 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -24,6 +24,7 @@ #include "nfs4_fs.h" #include "nfs.h" #include "dns_resolve.h" +#include "nfs4trace.h" #define NFSDBG_FACILITY NFSDBG_VFS @@ -351,6 +352,8 @@ static int try_location(struct fs_context *fc, p += ctx->nfs_server.export_path_len; *p = 0; + trace_nfs4_referral_location(ctx->nfs_server.hostname, + ctx->nfs_server.export_path); ret = nfs4_get_referral_tree(fc); if (ret == 0) return 0; diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 10985a4b8259..165c4dc7b5c7 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -2604,6 +2604,31 @@ DEFINE_NFS4_XATTR_EVENT(nfs4_setxattr); DEFINE_NFS4_XATTR_EVENT(nfs4_removexattr); DEFINE_NFS4_INODE_EVENT(nfs4_listxattr); + +TRACE_EVENT(nfs4_referral_location, + TP_PROTO( + const char *hostname, + const char *path + ), + + TP_ARGS(hostname, path), + + TP_STRUCT__entry( + __string(referral_hostname, hostname) + __string(referral_path, path) + ), + + TP_fast_assign( + __assign_str(referral_hostname, hostname)e + __assign_str(referral_path, path); + ), + + TP_printk( + "referral_host=%s referral_path=%s", + __get_str(referral_hostname), + __get_str(referral_path) + ) +); #endif /* CONFIG_NFS_V4_2 */ #endif /* CONFIG_NFS_V4_1 */ -- 2.39.1