From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0762DCEACCE for ; Tue, 1 Oct 2024 19:09:05 +0000 (UTC) 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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2rWbLuR/c7dpQKCZZZW1HDJAGUOREzZiBSleatuSxxw=; b=pcA12NOrW2bvVe8luWqoRnJp9K 6cFpNC2GPaMTMdhUPFpLhz2ftH4q0UKgUsyUnefSX2eAAXDBMsm59HHyjF0WCKRI4j9ulHUmPT9Rg mZfqt0m87syl/n9RHLdbguQOFIIn6whxuxbFrpOp68e0VMEpGJtVUO4SUgGJN0dHavEjqwRpE+i0H SBr/NsLJXa1LNMvKW+HVaYOK9Xfvl/H4daGIcAFdkv1oC3trILI5FQgSOn6CsiHaAdir2KOLngs3D /CUJb9Vepjhm+9nUnKcuQXvJFReSIsVBu1vuONdnF0BaN/226d4enbRr++9YSvxT99PJEfiPhe4gp 9ztS5a9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sviEx-00000003r3B-35aM; Tue, 01 Oct 2024 19:08:55 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sviD9-00000003qrS-0HGm for linux-arm-kernel@lists.infradead.org; Tue, 01 Oct 2024 19:07:04 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E60585C2783; Tue, 1 Oct 2024 19:06:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1095C4CEC6; Tue, 1 Oct 2024 19:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727809621; bh=yjNLzGHwXYeXGDZK7SOq5iph3nIKqLB/EJ0tT3+l+Io=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qlvgwP2l+hgxora6zSRHNT5G47RptA5HB8MiRHakprax4pIu4aKHJAV/Kp78bwtAV 1XE77L+hQcQwG0BNr1xWg4DqMfW7nvibDKCtswedjOWVPsIQTp8arEcYifAlkhtchU v19SoAii0Ktd2eosPbhfFM04YFG2+rSzBsaoGX/Sp8m3AhC9ixBDhH8w3DX7qTqx12 V/ptYvVEy/woTZmz838CED8l6uCpCWCX+QmM2HPTfQlwqStf0isY4TqcJK9YVUORxv H4FI0hY0yTnQhnbfSBAJpTxwihmztoZm4UVHUhCjlbHhkrPhEhuJe0drFKg0yYj2ML xRvboiq+PLrgw== Date: Tue, 1 Oct 2024 16:06:57 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: James Clark , Ilkka Koskinen , linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, John Garry , Will Deacon , Mike Leach , Leo Yan , Suzuki K Poulose , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" Subject: Re: [PATCH] perf: cs-etm: Fix the assert() to handle captured and unprocessed cpu trace Message-ID: References: <20240924233930.5193-1-ilkka@os.amperecomputing.com> <5160d57a-3520-4d99-ae10-5cc539fba813@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241001_120703_213948_ABB2F866 X-CRM114-Status: GOOD ( 26.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 25, 2024 at 04:04:55PM -0700, Namhyung Kim wrote: > On Wed, Sep 25, 2024 at 10:54:31AM +0100, James Clark wrote: > > > > > > On 25/09/2024 12:39 am, Ilkka Koskinen wrote: > > > If one builds perf with DEBUG=1, captures data on multiple CPUs and > > > finally runs 'perf report -C ' for only one of the cpus, assert() > > > aborts the program. This happens because there are empty queues with > > > format set. This patch changes the condition to abort only if a queue > > > is not empty and if the format is unset. > > > > > > $ make -C tools/perf DEBUG=1 CORESIGHT=1 CSLIBS=/usr/lib CSINCLUDES=/usr/include install > > > $ perf record -o kcore --kcore -e cs_etm/timestamp/k -s -C 0-1 dd if=/dev/zero of=/dev/null bs=1M count=1 > > > $ perf report --input kcore/data --vmlinux=/home/ikoskine/projects/linux/vmlinux -C 1 > > > Aborted (core dumped) > > > > > > Fixes: 57880a7966be ("perf: cs-etm: Allocate queues for all CPUs") > > > Signed-off-by: Ilkka Koskinen > > > --- > > > tools/perf/util/cs-etm.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > > > index 90f32f327b9b..40f047baef81 100644 > > > --- a/tools/perf/util/cs-etm.c > > > +++ b/tools/perf/util/cs-etm.c > > > @@ -3323,7 +3323,7 @@ static int cs_etm__create_decoders(struct cs_etm_auxtrace *etm) > > > * Don't create decoders for empty queues, mainly because > > > * etmq->format is unknown for empty queues. > > > */ > > > - assert(empty == (etmq->format == UNSET)); > > > + assert(empty || etmq->format != UNSET); > > > if (empty) > > > continue; > > > > Oops I didn't realize you could filter on CPU in report mode. Thanks for the > > fix. Adding a test to the end of test_arm_coresight.sh might be quite > > useful. Either way: > > > > Reviewed-by: James Clark > > Thanks, it should go to the perf-tool. Arnaldo, please pick up. Right, picking it now. Thanks, - Arnaldo