From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91594606A326 for ; Wed, 4 Nov 2026 17:16:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=m+uDY/47; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=miPBP8n3 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=G6piw17zsMhVcLRQ/Dg2jf3W7PAeTRazgMleX2m6GP0=; b=m+uDY/47oDHtboogA1JNRMveCH XBj4Ad8e62M1AxPWDodXaULCyg94yhhgBF4+aqQH0eNYMLg4LxL/pne2bB0xWi838BsOFdV/oV17f ZEAvVj+jF1JBbTdKnzKXOd9pGXKwlkmbSRXvPcIr8YmffBmrCd6ct6asQ2TyG0g3FGR6+CcTJV7zT KE64haZzKP7we91v1XkatI4vWivQCO/3yFeU2KWxMx3JrM6WIbl5ATlg8NrLLW+dAC4nt2D0jFaV9 UYtrv9t/MfuDOSulNl2+ruGe9SXvWE3RBPbpRsGTMxewB5FN/WtVFmU/YeOUBTaMSHHNi9kurCFZS +Hpz/xuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xOeav-00000006AOo-3nz3; Wed, 04 Nov 2026 17:16:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xOeat-00000006AOG-3qpC for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2026 17:16:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 43DC71BB0; Wed, 4 Nov 2026 09:16:11 -0800 (PST) Received: from localhost (unknown [10.2.196.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E47373F673; Wed, 4 Nov 2026 09:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1793812574; bh=rjFG8+pH2b8+JHyFE8+L/4q0xjEFb4uHAwVsDh7Gt3U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=miPBP8n3+SPHqDpdlN2QuS0mCHcF9FE1RQJKlaMe6Fdiuo0cmRfBncPjj2sgPisKT B56FKi//xbM6bXATp4Per1c7DVpZgzKM9btoYd+4CJYD+dPVPdjWH+MwWwUXKshkhO O/s/O2cJH2hWl3h7fj4ARASEO2wsUP/HXaLsZqxc= Date: Wed, 4 Nov 2026 17:16:11 +0000 From: Leo Yan To: James Clark Cc: Leo Yan , Adrian Hunter , Suzuki K Poulose , Mike Leach , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Mathieu Poirier , Jonathan Corbet , Shuah Khan , Suyash Mahar , Amir Ayupov , linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , linux-doc@vger.kernel.org, John Garry Subject: Re: [PATCH v3 10/18] perf auxtrace: Turn Intel BTS snapshot search into a generic one Message-ID: <20261104171611.GN9176@e132581.arm.com> References: <20261102-james-cs-unformatted-per-thread-fix-v3-0-dbcb0c281b9b@linaro.org> <20261102-james-cs-unformatted-per-thread-fix-v3-10-dbcb0c281b9b@linaro.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261102-james-cs-unformatted-per-thread-fix-v3-10-dbcb0c281b9b@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261104_091616_003335_EC1A6E18 X-CRM114-Status: GOOD ( 14.49 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Mon, Nov 02, 2026 at 12:15:24PM +0000, James Clark wrote: > Currently each auxtrace user has to implement both the snapshot search > and the logic to fixup the 'head' and 'old' values after finding a wrap. > IntelPT and BTS have the same fixup logic but different wrap searches. > BTS and Arm SPE have the same search but SPE modifies head differently > (although it probably shouldn’t), and Arm Coresight doesn't have a > search at all, but later it will want the same search and fixup logic. > > Add auxtrace_record__default_find_snapshot() as a generic > find_snapshot() implementation that tracers can use without > reimplementing it. It's based on intel_bts_find_snapshot() and the > search includes the caching from it. Split the pointer fixup into > auxtrace_record__snapshot_fixup() so that tracers with their own search, > like Intel PT, can still share it. > > No functional changes intended apart from changing the pr_debug3()s > to print hex to match __auxtrace_mmap__read() and no longer leaking > snapshot_refs when expanding the array length. > > Signed-off-by: James Clark Reviewed-by: Leo Yan