Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1077075lqt; Fri, 7 Jun 2024 07:27:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFXOWPhLXrqnDm7X49ZE9Fxe3uN3eDl9PzxssjrZAwmnU7Wt1TD7m0XVCIAswZ9dX6BGjlaZhmeKVpJrYBF0XW5STHY8KQGpJubOen8A== X-Google-Smtp-Source: AGHT+IEDsiwh6e3KGRdhkEumzUkPXBNL+aUm761tCZ6HBxNnG034oFsOtMvqnlsQNy5hOwkhsa8E X-Received: by 2002:a17:902:788e:b0:1f6:8ae4:510d with SMTP id d9443c01a7336-1f6d031372bmr22616675ad.39.1717770470528; Fri, 07 Jun 2024 07:27:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717770470; cv=pass; d=google.com; s=arc-20160816; b=uoeEcxsyXO3VAXllUDStNO5Cn4w9AEiyyDnUwO/gJp2rgzDnWp+Ya16AA5tErVkrcX MVVv59re+HNZAdAwoxSlmpWP5NSxTBJWaq3xq3AoOlbST95EmSkB4xRu+BOX+jinv5f8 hlP68mZqVhA6hgUo2BAI0E7Pi5+XETsg15xBi+hAQShiBDL97tzp8IKtG9ulAxfau0oJ s6bXjlcGmXf+M3mtsvJQ7uVroPg6ymC4Ze6EkdlMiI2HvoMdHSNwItW1yiFzlThK43LV Ej9mRBs6Y9wM9McefR+O+NTq4ZoCLGs3n4cg+HohJ+sEWbk0Cv9pWZYkNVI+LoaYJq5Y 83xw== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=hp1mOTFo7NjTD4NvtGmhOAOHOVqghMCE1ClzSjK2tAY=; fh=OUKZWod6C22emJS3X689dwhO5bDgGbDS06P/Z6+EGqk=; b=tWLsM7KMzccVE2nvdIcu6c23cuOJf1pAgKC3oVinFk82WUtNRAQUeuGz2roTx1GeIX fWeo2BuSm+0rBewdB1LnwMk0C/uiPa75SEcqVBWk2qVRZXqt2P2BKF8RCXO0BldMjEkG wImZ8nJHvnKsk3I2QYtgW9CgW5pN/wkGiGHbjBNnHcJ+WWm9mhL4IomMd/0idGb/UphH x1C7bW8tttCl1PmHiq6rJ7UY5RTsfoHCAM7qdFvAoCDT3dwYPPZ7Pu3WydDza2+zpujj rJOBuWIbMCaSBPnLcp3Z95Pkf1B4viHTs/I5hxkNPskvHOFURWYpajuD6o6734gvk3sE uibQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-3599-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7d2968si1513185ad.247.2024.06.07.07.27.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 07:27:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3599-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-3599-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3599-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2500D28890D for ; Fri, 7 Jun 2024 14:27:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 267581991D2; Fri, 7 Jun 2024 14:27:12 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE124196DA7 for ; Fri, 7 Jun 2024 14:27:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717770432; cv=none; b=FZk1kc3o5bRRgeAXRX0bZxNrs2stpi6Iw85TSCfI6TZPXsEbe/80uc0wjVOqnnPXygk6Hw5xk9dSpyjEfimbYpBCUKlroa82BfLDmtkIDEcjJ3YIyj9/MXQAyP+0p0eCR2zD36pM75jFHrQv6fw9YHIhlhf+jNZ952d0qY4BJIU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717770432; c=relaxed/simple; bh=4CmKlsX0grbPftATwEorynbm1ti+vOQnjoYOI8s3g2A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fJdkx902DjRKaEzXrDU02k0YOGxg7WM8HlgjDsX9qC+/Qy02UrltNYEtL4+0PAP6S4HdZEL0M1Vr822qNkzh2+T5b5hWKsZyqJSV6lUnbF0dPRSre0mieH/YWn+BkFH+hW+PGk9XdpVHon7QkICyWHt4Nl3BxqZB9SZCKm+arVw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=snitzer.net; arc=none smtp.client-ip=209.85.210.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=snitzer.net Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6f95be3d4c4so261846a34.3 for ; Fri, 07 Jun 2024 07:27:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717770429; x=1718375229; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hp1mOTFo7NjTD4NvtGmhOAOHOVqghMCE1ClzSjK2tAY=; b=gSZRlHId55E+TP4ZCKnmSNZLcIFhaWzULb/ykdow7J92YjzQannahUkqUEY7hj4B+h KR3BicKjTyUI03CK+YWRB3CZIGmGWLnPED1WCahueqPvklmGbbUCT9SoAOiNr/sRid3x X//ckiBJuhfVcx7ZCnEaRWlv4g2JVUgRhlFWiX4E1bmKXXsAyP4HsCBer+8nhnHtHjp7 9noKAGbMfB44Nlt0v7h2UU6T1uN8BB6npEFrxMpkJucdYojcYht6k/dwsIjfwDj2y3kP ggauF1Z8o2KbAwGaRNuy2ALmm85V4f0tXH+8XV9v5gbXcmtoxPbtb5g6IRVunl2+R/3E C5Eg== X-Gm-Message-State: AOJu0Yxs63g6z7GqosKiaLMVP5IxuTDlqp2wCyCGuMsaeKXRoPu0Haug 4dXfEDxC82nRYGQBo2C35Jd7JH2fzvyQykh3oY0sapFFQS7bLQN4UoQB8Ig7iFRKNbaSHfvA3F1 nRMarnA== X-Received: by 2002:a05:6830:14d4:b0:6f0:e7da:6637 with SMTP id 46e09a7af769-6f9572fbb04mr2655936a34.31.1717770429580; Fri, 07 Jun 2024 07:27:09 -0700 (PDT) Received: from localhost (pool-68-160-141-91.bstnma.fios.verizon.net. [68.160.141.91]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79532813a2dsm171665485a.20.2024.06.07.07.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 07:27:09 -0700 (PDT) From: Mike Snitzer To: linux-nfs@vger.kernel.org Cc: Jeff Layton , Chuck Lever , Trond Myklebust , snitzer@hammerspace.com Subject: [for-6.11 PATCH 14/29] NFS: Add tracepoints for nfs_local_enable and nfs_local_disable Date: Fri, 7 Jun 2024 10:26:31 -0400 Message-ID: <20240607142646.20924-15-snitzer@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240607142646.20924-1-snitzer@kernel.org> References: <20240607142646.20924-1-snitzer@kernel.org> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Trond Myklebust Allow tracing of when local I/O begins and ends. Signed-off-by: Trond Myklebust Signed-off-by: Mike Snitzer --- fs/nfs/localio.c | 5 ++--- fs/nfs/nfstrace.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c index 5c69eb0fe7b6..5939ca2216be 100644 --- a/fs/nfs/localio.c +++ b/fs/nfs/localio.c @@ -195,7 +195,6 @@ nfs_local_put_lookup_ctx(void) spin_unlock(&ctx->lock); if (fn) symbol_put(nfsd_open_local_fh); - dprintk("destroy lookup context\n"); } } @@ -206,8 +205,8 @@ void nfs_local_enable(struct nfs_client *clp) { if (nfs_local_get_lookup_ctx()) { - dprintk("enabled local i/o\n"); set_bit(NFS_CS_LOCAL_IO, &clp->cl_flags); + trace_nfs_local_enable(clp); } } EXPORT_SYMBOL_GPL(nfs_local_enable); @@ -219,7 +218,7 @@ void nfs_local_disable(struct nfs_client *clp) { if (test_and_clear_bit(NFS_CS_LOCAL_IO, &clp->cl_flags)) { - dprintk("disabled local i/o\n"); + trace_nfs_local_disable(clp); nfs_local_put_lookup_ctx(); } } diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h index 45d4086cdeb1..95a2c19a9172 100644 --- a/fs/nfs/nfstrace.h +++ b/fs/nfs/nfstrace.h @@ -1710,6 +1710,38 @@ TRACE_EVENT(nfs_local_open_fh, ) ); +DECLARE_EVENT_CLASS(nfs_local_client_event, + TP_PROTO( + const struct nfs_client *clp + ), + + TP_ARGS(clp), + + TP_STRUCT__entry( + __field(unsigned int, protocol) + __string(server, clp->cl_hostname) + ), + + TP_fast_assign( + __entry->protocol = clp->rpc_ops->version; + __assign_str(server); + ), + + TP_printk( + "server=%s NFSv%u", __get_str(server), __entry->protocol + ) +); + +#define DEFINE_NFS_LOCAL_CLIENT_EVENT(name) \ + DEFINE_EVENT(nfs_local_client_event, name, \ + TP_PROTO( \ + const struct nfs_client *clp \ + ), \ + TP_ARGS(clp)) + +DEFINE_NFS_LOCAL_CLIENT_EVENT(nfs_local_enable); +DEFINE_NFS_LOCAL_CLIENT_EVENT(nfs_local_disable); + DECLARE_EVENT_CLASS(nfs_xdr_event, TP_PROTO( const struct xdr_stream *xdr, -- 2.44.0