From patchwork Mon Sep 23 15:07:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13809707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84062CF9C6F for ; Mon, 23 Sep 2024 15:09:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 173306B009D; Mon, 23 Sep 2024 11:09:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 123186B009E; Mon, 23 Sep 2024 11:09:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F07FD6B009F; Mon, 23 Sep 2024 11:09:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CF68B6B009D for ; Mon, 23 Sep 2024 11:09:08 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 561261613CD for ; Mon, 23 Sep 2024 15:09:08 +0000 (UTC) X-FDA: 82596335976.17.F232CC8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 9522D4001C for ; Mon, 23 Sep 2024 15:09:06 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e3HqVdBO; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727104059; a=rsa-sha256; cv=none; b=hD1Dk7eKGDD2OmESzZcDEeSYpJvncKSEF6ZYAKrUWT8P+Bjo6KZ4RZvWQRLTM2hAxuXJci ndEHqlWy5paziQ5pzW2mqD9AfNvbrxs97Axtfds/ZjYdEtwdDUqsEYWbmHvWD3J5zZvOVK mqG0Zxk8mRKGIVsJyMjazN+THBhiYQQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e3HqVdBO; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727104059; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=h43zAABX1+Y84szWbuf6Y3zUUIJDGkYGOYZIeY5MUOA=; b=vSpil9QNVQqemBaA+7aj4MQ8LvP9FSdWdFmdVpI72HMz3OvCPjjgJ06wSB2nM4iKmSjU7K Zh2GWHyY29NE4L3pqYkVaxZt0K+7UTiyR+O9XpCvRGUcvy3kkqn1ZykvG9VfhVCn6Hb/zM WXzAdNzBtTx9ozZk2JqPhxFoflc418U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727104145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h43zAABX1+Y84szWbuf6Y3zUUIJDGkYGOYZIeY5MUOA=; b=e3HqVdBOeUT2XysHFnpi3ubvIzrWLdUsOWNwB/sPxfqfJVb6dxOZlNDcDHq5+DScL/Hynd 8B+F67q7uabSYxiT8HmyHcsD63+/WdMRyWAXkyKbxy+epyRhT/ArFel8kGqJ2jcDVXYi49 KJpww5qq1u1VaJuX+aCCg00WhmoBYcM= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-464-iresh_brOiyWhufnlrfLWA-1; Mon, 23 Sep 2024 11:09:02 -0400 X-MC-Unique: iresh_brOiyWhufnlrfLWA-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E0E2718BC2C9; Mon, 23 Sep 2024 15:08:52 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.145]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8B0E21955D87; Mon, 23 Sep 2024 15:08:48 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Marc Dionne Cc: David Howells , Paulo Alcantara , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Steve French Subject: [PATCH 8/8] cifs: Make the write_{enter,done,err} tracepoints display netfs info Date: Mon, 23 Sep 2024 16:07:52 +0100 Message-ID: <20240923150756.902363-9-dhowells@redhat.com> In-Reply-To: <20240923150756.902363-1-dhowells@redhat.com> References: <20240923150756.902363-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Queue-Id: 9522D4001C X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: sn6o5ixwpmmspibkexzw1i44b1i9gsao X-HE-Tag: 1727104146-143804 X-HE-Meta: U2FsdGVkX1+cgk4YmE544APkVZ0sUINEDG3/7byWZF7X+vXLC1lCM7qw/bXk/bvHOTKS1Kv1mfg0dEligfFRwfnE4dzc34jEMydWL8lps30i9OLJunN5sCt6tgz8psVfZlvlP8ldqH48gJ+kkWvI93M7b+do7LifYkYnkAdQs8sku7gTWV3h1pM6lw72INBrKdfzJnRbyyEJxifZnFR/XjoUmwqO+iK4GGomAcDaMe6RD3tyJS5A7PE67id4ml3zzBBFvV7V5aHyO/E9VpnldVo4gFm+GEtOeDCkBfWNs09XOkeRWzuVSB8q1kWzzQJTlBpSTvP/62x4ZSsDNgqQURqM1uD6TGUxWEqY3Gwuxw/4UWl0iMYwLhFuyzRiLrX2kD3E5XgnEvn3yN2PWNhLxcVF4osYeeXfE+xU5djNFSA46CuDSBPOlIvF/bhnQyNURQtFsfc+2a+lSzw39wheRMiTagTBSI0LnU+4k/o8ePziWwexkEowNuQZjIHQ9SJ7DZo5gxvlJhtFvhVYZtH1npOHFNN9dYAVs/6jS3OvlkfKrQdx9yckBoa7e2vr2J8gdLR4VrI5rgaRLzZZGEywRV/tBo9PtG/gxZDUAKPqz6cdwAggRNEglNKn6eXIHUgvpRuiCUftHKUUQ9GHbb8u0gSsSUqgNoG7p3twy7mVNJsZAAXl9euJkWFOVWbvaNw+8c3cJJfnKWUtV6FOIO+5mvnlk2HNDeMe7Cx7hEBWFH/xIeVFEvMn/3TdYWqwLt9vTs4IJiAGNJ8PE+4P/aAoviZZikSgT8GxxEt7PKlVgBuhkiyUabD+jpbRT8LQ37jMoQlXjsazFpndtfidejgU3Jm4J9UHlSB+MyPZwyMyISp5stXbsp19NxobBb+oF08iDUYlDQJhW9eSSTwF0oR4She01tu1bGeB395bBatiffOs6IevRn8uUol/Uf+e7gNm94X7uWkh/ank8jT2mGo u/7+nsk/ WYNpXluZMXWoP2JeRfNyOEcQ3CdFJJytyUMzLrrQbnHG/aC20E/BS9wTQpN5BTnZAVw2aogCB2YA2rnBRzbsSHIpFxgn2pZQYQDQwuk/ik6mDPgBypaLUXgOpqfwbzvZS+QownEaSXnf577pDsPR6AjzAAwPP515quep14kHcmtSmLrSd0h6GktyCoGCzBOgofmbY/ytx4gyExO9rSeL/+S0PiwF1GXM1rMx8EOKiLgTMsgvERo/a+CUDj2H19Mq0dUYOgD5kDZrPLCKnOqFttUtE5tlgfwqP2BYVntg3gDHX6VpbclBzkkhKtawvXx0J6DylPjIQ2u80S6ZvmVEp5uOun3dcrd2oFbUJYw1jOoF6dehtpJ7/dv92etMDPgKRjTzXM9jy1Pt0lhrRIDfLr2d5z2cqgqwZJ/PnQi6dUIgqMzoTHewRHTilGB1JeVgmHa6wTv3IkSpY1QbrvHKpbutUNDTc9qYnJrO+ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Make the write RPC tracepoints use the same trace macro complexes as the read tracepoints and display the netfs request and subrequest IDs where available (see commit 519be989717c ("cifs: Add a tracepoint to track credits involved in R/W requests")). Signed-off-by: David Howells cc: Steve French cc: Paulo Alcantara (Red Hat) cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/smb/client/smb2pdu.c | 22 +++++++++++++++------- fs/smb/client/trace.h | 6 +++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index 0b63608aeecb..9afc3baba27b 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -4858,7 +4858,9 @@ smb2_writev_callback(struct mid_q_entry *mid) #endif if (result) { cifs_stats_fail_inc(tcon, SMB2_WRITE_HE); - trace_smb3_write_err(wdata->xid, + trace_smb3_write_err(wdata->rreq->debug_id, + wdata->subreq.debug_index, + wdata->xid, wdata->req->cfile->fid.persistent_fid, tcon->tid, tcon->ses->Suid, wdata->subreq.start, wdata->subreq.len, wdata->result); @@ -4866,7 +4868,9 @@ smb2_writev_callback(struct mid_q_entry *mid) pr_warn_once("Out of space writing to %s\n", tcon->tree_name); } else - trace_smb3_write_done(0 /* no xid */, + trace_smb3_write_done(wdata->rreq->debug_id, + wdata->subreq.debug_index, + wdata->xid, wdata->req->cfile->fid.persistent_fid, tcon->tid, tcon->ses->Suid, wdata->subreq.start, wdata->subreq.len); @@ -4944,7 +4948,9 @@ smb2_async_writev(struct cifs_io_subrequest *wdata) offsetof(struct smb2_write_req, Buffer)); req->RemainingBytes = 0; - trace_smb3_write_enter(wdata->xid, + trace_smb3_write_enter(wdata->rreq->debug_id, + wdata->subreq.debug_index, + wdata->xid, io_parms->persistent_fid, io_parms->tcon->tid, io_parms->tcon->ses->Suid, @@ -5024,7 +5030,9 @@ smb2_async_writev(struct cifs_io_subrequest *wdata) wdata, flags, &wdata->credits); /* Can't touch wdata if rc == 0 */ if (rc) { - trace_smb3_write_err(xid, + trace_smb3_write_err(wdata->rreq->debug_id, + wdata->subreq.debug_index, + xid, io_parms->persistent_fid, io_parms->tcon->tid, io_parms->tcon->ses->Suid, @@ -5104,7 +5112,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, offsetof(struct smb2_write_req, Buffer)); req->RemainingBytes = 0; - trace_smb3_write_enter(xid, io_parms->persistent_fid, + trace_smb3_write_enter(0, 0, xid, io_parms->persistent_fid, io_parms->tcon->tid, io_parms->tcon->ses->Suid, io_parms->offset, io_parms->length); @@ -5125,7 +5133,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, rsp = (struct smb2_write_rsp *)rsp_iov.iov_base; if (rc) { - trace_smb3_write_err(xid, + trace_smb3_write_err(0, 0, xid, req->PersistentFileId, io_parms->tcon->tid, io_parms->tcon->ses->Suid, @@ -5134,7 +5142,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, cifs_dbg(VFS, "Send error in write = %d\n", rc); } else { *nbytes = le32_to_cpu(rsp->DataLength); - trace_smb3_write_done(xid, + trace_smb3_write_done(0, 0, xid, req->PersistentFileId, io_parms->tcon->tid, io_parms->tcon->ses->Suid, diff --git a/fs/smb/client/trace.h b/fs/smb/client/trace.h index 8e9964001e2a..0b52d22a91a0 100644 --- a/fs/smb/client/trace.h +++ b/fs/smb/client/trace.h @@ -157,6 +157,7 @@ DEFINE_EVENT(smb3_rw_err_class, smb3_##name, \ TP_ARGS(rreq_debug_id, rreq_debug_index, xid, fid, tid, sesid, offset, len, rc)) DEFINE_SMB3_RW_ERR_EVENT(read_err); +DEFINE_SMB3_RW_ERR_EVENT(write_err); /* For logging errors in other file I/O ops */ DECLARE_EVENT_CLASS(smb3_other_err_class, @@ -202,7 +203,6 @@ DEFINE_EVENT(smb3_other_err_class, smb3_##name, \ int rc), \ TP_ARGS(xid, fid, tid, sesid, offset, len, rc)) -DEFINE_SMB3_OTHER_ERR_EVENT(write_err); DEFINE_SMB3_OTHER_ERR_EVENT(query_dir_err); DEFINE_SMB3_OTHER_ERR_EVENT(zero_err); DEFINE_SMB3_OTHER_ERR_EVENT(falloc_err); @@ -370,6 +370,8 @@ DEFINE_EVENT(smb3_rw_done_class, smb3_##name, \ DEFINE_SMB3_RW_DONE_EVENT(read_enter); DEFINE_SMB3_RW_DONE_EVENT(read_done); +DEFINE_SMB3_RW_DONE_EVENT(write_enter); +DEFINE_SMB3_RW_DONE_EVENT(write_done); /* For logging successful other op */ DECLARE_EVENT_CLASS(smb3_other_done_class, @@ -411,11 +413,9 @@ DEFINE_EVENT(smb3_other_done_class, smb3_##name, \ __u32 len), \ TP_ARGS(xid, fid, tid, sesid, offset, len)) -DEFINE_SMB3_OTHER_DONE_EVENT(write_enter); DEFINE_SMB3_OTHER_DONE_EVENT(query_dir_enter); DEFINE_SMB3_OTHER_DONE_EVENT(zero_enter); DEFINE_SMB3_OTHER_DONE_EVENT(falloc_enter); -DEFINE_SMB3_OTHER_DONE_EVENT(write_done); DEFINE_SMB3_OTHER_DONE_EVENT(query_dir_done); DEFINE_SMB3_OTHER_DONE_EVENT(zero_done); DEFINE_SMB3_OTHER_DONE_EVENT(falloc_done);