Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1982716lqe; Tue, 9 Apr 2024 06:35:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcknWqs7SMyJrs8UfiYARYKYEUS1MDMO2cP4qBjbdfiQf6cUqDjRqeGuQtJWRS8Cto0QV3G0iiBwlaSABtcOlvL/86sULprFJlqMGAjA== X-Google-Smtp-Source: AGHT+IE7CuVzDOcyfhKHiYqY1oRTVwErwnB+DQUka0DAJD9D19xa52NunfkiAe0o7XovebIGPX40 X-Received: by 2002:a50:cc9c:0:b0:56e:2294:e2e6 with SMTP id q28-20020a50cc9c000000b0056e2294e2e6mr6928530edi.26.1712669709915; Tue, 09 Apr 2024 06:35:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712669709; cv=pass; d=google.com; s=arc-20160816; b=zRtxzDG0AcqY9wzEafV2RN0K9VrFL0zEDfgnslw/Z5REFxVOsWeC+gDPH99Tz+Iuf9 FddiuFNig7/e/Mu+COapDAYCpB7yCnnCc+8yfO6BNGpEigFLU0nAOQPseNmbT9KLTyDO 2Py5bJ6qI3zDpGxcT2DH/NRgZ1jdXOSJ90TfWUf3zrQ859cpfYxtRLDi0rPVE3PNAgm7 fMlj0l7nK6uN87aXNQ1sjzk9ZSD7ntu+19yjj4vUJSvOUtIkLxzxvKrly0yw9sVPIc6m RS4Z4fdXS7Eg1pRF1O1eIz80btmmyN1pbeaAIDlxohSr+hIaGTTd7lfqD5h5eZlrVqCM wdtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=PO8KdL+sL6s+El+KA/t++ByWDuQpm1XfRTuCeHHSz18=; fh=jCEJN5d6aOPlSjeAdq5b+j1jdv9lQNJtE8ZXzCrWNPo=; b=FPcancsW4F83S+O2SezW/UDYM8Lawo49tXxhQjZhz7nttim2N76dYH7rDqAWdXgMkU uTkvA02lfJfBdP5tb5k+peAu0L4F/8yEjOmezHDdgXKFXAN80tC8NNtjd1zjm70XzTwu Ir9R5akx32iQPR9mwZJoxOmd8uCaRbibAY7InOn7C0shVm8yG5voOGpN6fnDNS1w/eg+ OW5r/IpShBPR0keOrdSkfC2J0jireJ3HslHk7HeDC/GbTbJO9KnXfakdGQsN83kKcAA/ H7D0rAodAf3j1YVCRe5psAQjkXOD2pI4AdsurFKUpIZvzUXtvysKkkj8+chR5R5wVoFs X7ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oG6/Bz5B"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-2729-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2729-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w13-20020a056402268d00b0056e368cb371si4383002edd.618.2024.04.09.06.35.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 06:35:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2729-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oG6/Bz5B"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-2729-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2729-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 A46AB1F21F8E for ; Tue, 9 Apr 2024 13:35:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF2F31369AF; Tue, 9 Apr 2024 13:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oG6/Bz5B" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CAAB813541A for ; Tue, 9 Apr 2024 13:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712669200; cv=none; b=aEyoOUKldl/wHeeE5Bc7G1ptBHy0r7Y5gipI82OgGyX0fS3fcF7weDDkMCl0PwMpdUSfrjccWdLARNDpafinCPjTTkEtUEHLb1PPHRTGh/logfVho0YxOa/xG3QC5QirTRyal0M4GfqyvXFaJuWCdKcKmeu/Ws+vEaTx9fsOd0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712669200; c=relaxed/simple; bh=HkVY3LvtwEvEfcBeLdIHKnkk9yL5+a8OWtS1SHO24uk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Tg5/3JXJNM7tAsu0/cBTp7XdO0Vaj1o5IIU0cXICEdpygiZdHhHbkwNcrjdzPhgNkakH3zxfg05i1c8BchXL4NY+Anr2Uv339N0Btn3WXL5LjUNXWKxj57olwoAEe5S80cpx2LTU+iYODx2EQ8kL4bGqjco810UYhoYB2UyHOMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oG6/Bz5B; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53DC5C433C7 for ; Tue, 9 Apr 2024 13:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712669200; bh=HkVY3LvtwEvEfcBeLdIHKnkk9yL5+a8OWtS1SHO24uk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oG6/Bz5BTTlDExvSMJzDnIFwavmQEyGS01MBQchlZuxAvVJ+j4rON51ejo2PbMH/d BMPbQ8rCU/h9bgPBlFA8Ps2w8wbGCvq0AtLMpWeig/oyrbEU7XCFJQchArip8Jq1FF GSHk2mOB1A92sZU3vsyRElNNKRDqc6/+cfZj9G8U+hYfsvJ/37QXGBIrgSUSQ0tPMc CkHt5ZCDkfxPua9TKyhjZkikufkQE0VJ9Wn9DAWI3L+Jt7uLf3spDsF8YQqJVE/qoo jR55b5HqKS3Hh+Xvt5sD9DnOMrjZIs9M2fLyLAunvwY/USolKT9nKUP4YKX1LrKkDQ C2TMC715UVJKA== Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-434925427c6so9269961cf.1 for ; Tue, 09 Apr 2024 06:26:40 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWXEuKnRIHzjZqnP9Uz+nXyCDyErfgtxFLXrAyPyRyKq42GETkaRyo/f9LSwzhXF7IxH/twGNax+CMlniwQcYD9J8tK1bGqXwHc X-Gm-Message-State: AOJu0YyphNxa9dmCcvBLEvG32rLtMTegFgy0BpQ2nhTyaVAih4l9nEp3 ViTEN15fX8m/t/hGD9YEsB0lR81gb9BYTl4YkaIFkfhRJgkT05rZ0UtqCWGtEduQ7jDcnwaJepc ZJeFc0qRSN2O2nKq3asjgpCphc4I= X-Received: by 2002:a05:622a:19a1:b0:434:bb25:ed02 with SMTP id u33-20020a05622a19a100b00434bb25ed02mr3781914qtc.63.1712669199660; Tue, 09 Apr 2024 06:26:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240408095052.367-1-chenhx.fnst@fujitsu.com> In-Reply-To: <20240408095052.367-1-chenhx.fnst@fujitsu.com> From: Anna Schumaker Date: Tue, 9 Apr 2024 09:26:23 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] NFSv4: add tracepoint to referral events To: Chen Hanxiao Cc: Trond Myklebust , linux-nfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Chen, On Mon, Apr 8, 2024 at 5:52=E2=80=AFAM Chen Hanxiao wrote: > > 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 +=3D ctx->nfs_server.export_path_len; > *p =3D 0; > > + trace_nfs4_referral_location(ctx->nfs_server.hostname, > + ctx->nfs_server.export_path); > ret =3D nfs4_get_referral_tree(fc); > if (ret =3D=3D 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 ^^^^^^^ I wanted to double check if you've compiled and tested this? I ask because the 'e' at the end of the line here should be a semicolon, which my compiler complains about. Thanks, Anna > + __assign_str(referral_path, path); > + ), > + > + TP_printk( > + "referral_host=3D%s referral_path=3D%s", > + __get_str(referral_hostname), > + __get_str(referral_path) > + ) > +); > #endif /* CONFIG_NFS_V4_2 */ > > #endif /* CONFIG_NFS_V4_1 */ > -- > 2.39.1 >