From patchwork Wed Nov 6 12:35:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13864800 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 0BE41D44D58 for ; Wed, 6 Nov 2024 12:40:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 955228D000E; Wed, 6 Nov 2024 07:40:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B6898D0001; Wed, 6 Nov 2024 07:40:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E3D78D000E; Wed, 6 Nov 2024 07:40:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 478208D0001 for ; Wed, 6 Nov 2024 07:40:16 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 02C0FC018A for ; Wed, 6 Nov 2024 12:40:15 +0000 (UTC) X-FDA: 82755626940.10.A51AE7E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 301FC180022 for ; Wed, 6 Nov 2024 12:39:40 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="V/RhVXaW"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.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=1730896755; a=rsa-sha256; cv=none; b=afVhzOnqDJ4FiNplDK3cToGUBHyV17C6lgTgbqSzbaD1v1/lmpcZ/V/fTTEg1IRIGBkxEm 0ex0XyFefgGh2iN2vpNJb3ZIGCk+TuXv2PowzvZb1d+bKnF2395mp7YSup8J6gv9T972lX xIxF6oL/TQoJ0Gp7IoT9cqnhcJ1zwOE= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="V/RhVXaW"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.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=1730896755; 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=QCDL9BqA4pDDX31tPDuoaoWVDY2hJyHDwXlxpfOucp0=; b=QBPClhMkKkC1ldeTX8NP1Qeo1p2uoHGEzgNn6+KBHKfV7fMZUekeJYnAkYP1w2zKSKKlPT aUDvtoJg0qfwhz5GtXGhaw/O8eLA++IKHqCUSytLuaO324vWgkaP7zVBhVAq4xHT4rcwvw jF70Z9o0oan8kaOKmlFM2jSS1xUgSy0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730896813; 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=QCDL9BqA4pDDX31tPDuoaoWVDY2hJyHDwXlxpfOucp0=; b=V/RhVXaWQR4a4+soXBVmqbZpGlQwI2uVJaD8VhXP75BE1iraBKJZcyZ6tvOPVDQTfgIfAI x+1qVHcMz2pSXOJZ7EGEJAp3CoKVfBXu3d7rO+CeuygJ+GC9tFByN10FaA62GUWRTr1uqv piPBb3gKM9Y/enMOm6iamceOgPMEEJM= Received: from mx-prod-mc-04.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-618-nG6qfYvSMVqIxFIznRIAhg-1; Wed, 06 Nov 2024 07:40:10 -0500 X-MC-Unique: nG6qfYvSMVqIxFIznRIAhg-1 X-Mimecast-MFC-AGG-ID: nG6qfYvSMVqIxFIznRIAhg Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B55BE19560BD; Wed, 6 Nov 2024 12:40:07 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.231]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 38EA41955F40; Wed, 6 Nov 2024 12:40:02 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , 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, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 32/33] afs: Add a tracepoint for afs_read_receive() Date: Wed, 6 Nov 2024 12:35:56 +0000 Message-ID: <20241106123559.724888-33-dhowells@redhat.com> In-Reply-To: <20241106123559.724888-1-dhowells@redhat.com> References: <20241106123559.724888-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Rspam-User: X-Rspamd-Queue-Id: 301FC180022 X-Rspamd-Server: rspam01 X-Stat-Signature: obcszdjppk3je4ke8krw9gbyk58f5opm X-HE-Tag: 1730896780-434812 X-HE-Meta: U2FsdGVkX1+Rzf074cPcvFEOGatg+Jy8iUsqEGKphJ8iiQ0EeTRSSBGsnAMMzgYvJzkRW9blcFcF/HMzki/TQUb0VzmrRqsQuw9sN1VJpQdv3tBls/dNfA99hZeKiSUVEPTzAGr9aNVT9laWjwOg3OyylDItr/kLr/HU80+CiJBzRR+600xzUcbKmYhgQwR+S2xY/Ofjt/IW/bC3NtLs6uiNmaEnv4lUR7FAvTa1gipcHGrnDpzHWgrDr5RMsxzbIaMOC3kqATBOfilD6rdIII6fg9G37S/pU51eRNN3JlHhIvFpaZB+fUFaC1vS+MknjXO0AmdXMMq9Pn1yP5aV1liqccoKqac8Ff1IrfyuPFgdO275bDnDrTpWBx65ZsKj0Ht9yFnjFFPPyqPlNrEbKoZ0E7V6HzqPXVGOuCIuqCthBFr60uzBSdiwYIyDILhzr9dAl6Xen45Cjt88SJytDtRZlTpE4I3hvZnyC8SzAwn/Wqd5TCnnJZ/ZY9CsUTi022rOYHCY6nRhxfcQMBwo/pCAeapKl6S3LFtZZ1ZbDZkTIq1zuA6eWflBx07xvoWy16sIgtRndssNwFH2cF2+qVykU2QnFBbqJG4fjr4dxJ/v6lXOqRS3B03pDNKK2ONDGzXBQ8kgwiGX+hDkO1GECnAykRSAoaCmd8LlIaG0Fw1l80DK9WwB9UxR8fWBAyvxZVso6U8WMM1ZUCZyQMcdoglYeVPn69P1RBnkTUIQQDQ3FheQstY6h0vwc5T6JpJencV6xPYUB8+kFGZvvxlzDZVyCHpltU3zTw2bSYtYSBSJOe6GW/xSqSIrX4bGXj2IxWxx7ntWX849mkb1nNUfUeXURE2tVL09qCr65y+Qs+cpsqcuf8LMu1cbOmRQY1HalLip3HdeAMc1CgSy5m2Oi4LrZS4wjhp1ygRBEeYzSqAXJZkyaB3a+XStWF7WlBdLEkvJOFPIyygAoz3hqCF nBUkjjhy soiXDja+tAKcujGuFT/AAH1zyqPPxzfVdjG04iQTBw7ZjX24qOsgr/7zJEJmPgkaVqn+vROJ4ARsVc5DE3IwJ5ap1ebFP9FYcXag377m9aNJoX+HWPs4TC2vjTEcRfU2DUByQPs/WG0dpk1sA8NQMwJkJtOiQ2XLNs00gvIKJIMBmzn2hhLjd9Y//FqT4GAwpYpALaMQLw0S2aLvvQeomCj4fZTdgHZQRL7t2OdzSHzKhBu0N8cO3UBHewBkn0S0IRWiqxJ9nP6BPXrQG9jjH+d8shyluLXrIcVYhoJmIv9NcMPe4Mn/InvQtzdB91NBq5MnchqFYW9w/zr2EI58TvuH8c3kNbI3Abahbsp9038Kyhz9rSxgp1MvZ4qX39SDn2HWEmh1YzRHnYJK+18DE5WY0yTV6bi1aae5lztg/F9biCokequfpd7KbYsIalq35Np9cr0NhWFMcOWiRBfTWVtvtIrkAV7RWawdSUraXhykt29Q= 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: Add a tracepoint for afs_read_receive() to allow potential missed wakeups to be debugged. Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/file.c | 1 + include/trace/events/afs.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/fs/afs/file.c b/fs/afs/file.c index c296efebb491..fc15497608c6 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -274,6 +274,7 @@ static void afs_read_receive(struct afs_call *call) state = READ_ONCE(call->state); if (state == AFS_CALL_COMPLETE) return; + trace_afs_read_recv(op, call); while (state < AFS_CALL_COMPLETE && READ_ONCE(call->need_attention)) { WRITE_ONCE(call->need_attention, false); diff --git a/include/trace/events/afs.h b/include/trace/events/afs.h index c52fd83ca9b7..2e92487f3f34 100644 --- a/include/trace/events/afs.h +++ b/include/trace/events/afs.h @@ -1775,6 +1775,36 @@ TRACE_EVENT(afs_make_call, __entry->fid.unique) ); +TRACE_EVENT(afs_read_recv, + TP_PROTO(const struct afs_operation *op, const struct afs_call *call), + + TP_ARGS(op, call), + + TP_STRUCT__entry( + __field(unsigned int, rreq) + __field(unsigned int, sreq) + __field(unsigned int, op) + __field(unsigned int, op_flags) + __field(unsigned int, call) + __field(enum afs_call_state, call_state) + ), + + TP_fast_assign( + __entry->op = op->debug_id; + __entry->sreq = op->fetch.subreq->debug_index; + __entry->rreq = op->fetch.subreq->rreq->debug_id; + __entry->op_flags = op->flags; + __entry->call = call->debug_id; + __entry->call_state = call->state; + ), + + TP_printk("R=%08x[%x] OP=%08x c=%08x cs=%x of=%x", + __entry->rreq, __entry->sreq, + __entry->op, + __entry->call, __entry->call_state, + __entry->op_flags) + ); + #endif /* _TRACE_AFS_H */ /* This part must be outside protection */