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 52C2DCCFA06 for ; Wed, 25 Sep 2024 23:06:35 +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=1zvPXKZXRxsEnxZTiVmQhZCTMXS6MIUDDZCOG0DEebs=; b=LDg6LYhIAF3r0+LL11GP+j/EgC Pv+Ar8S+t7Vl1BHRUflVBNJ7KPv5g8KXPS7g5xV50FD79JLWxiZ1ZfZUPnOksjlns+iYwuI7Ai7Ya dz+bZ87fNC5zL9lxfSoeNKTJoFqJPOt5AkefNwfKsZ1J+6x/e6TVPIH73ynH1CMv3zmoDCXMP4QzU VHyi1MjX9kOnRzGH6Xaxrcx3fAysreM9Yp+MyuFWyAtUfqP1sSVS8qTmEu0ozoegFCaALw92S3qbo HJ/LWoR89tbBknadNwN0cWguikor677+UtFKrj8TUwgt93dEAcNTC9rZwpn+f701QCyaZjGApoOBI dW507j1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stb5W-00000006iu2-2mJa; Wed, 25 Sep 2024 23:06:26 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stb47-00000006iiD-18DY for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2024 23:05:00 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 73C415C5E93; Wed, 25 Sep 2024 23:04:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CD7FC4CEC3; Wed, 25 Sep 2024 23:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727305498; bh=SF1z1QG7yhYVWGAKH47605vTjCu1mCPy5sgus+qM8u4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CW7s/e9nOckWBsyaGj64St2rDz1kGsbMf8PevyvOypasSNFg7o8Ht0C/pj/iyAO3N jCuZoE4Jnafg1yt406w6mkdojnbqjPYhN9003zCzWPYspUPSY+9YLYugb4OqYu8tr7 +EvObU14sfqLrZLSAozedq3YiCS6Aekx4t5EzXvv67pjRFZJji8ZiBQolvgxOpzIbV rXPXzypznDavrNJ5vFRe9hBN3db8ZB6BaKDlZgLz/9fqnGeKRfrRHQXTWKRgs99RmQ ifS5OFqI7/EwxMk7h4Ezj4HiBbx7IN1Eevt2It11zP+aRFcDariEVQqiZFXMQ8wqe9 YBfufRTEZPBLw== Date: Wed, 25 Sep 2024 16:04:55 -0700 From: Namhyung Kim To: James Clark , Arnaldo Carvalho de Melo Cc: 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=utf-8 Content-Disposition: inline In-Reply-To: <5160d57a-3520-4d99-ae10-5cc539fba813@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_160459_385155_4A21CD18 X-CRM114-Status: GOOD ( 23.65 ) 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 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. Namhyung