linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: James Clark <james.clark@linaro.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ilkka Koskinen <ilkka@os.amperecomputing.com>,
	linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	John Garry <john.g.garry@oracle.com>,
	Will Deacon <will@kernel.org>, Mike Leach <mike.leach@linaro.org>,
	Leo Yan <leo.yan@linux.dev>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Liang, Kan" <kan.liang@linux.intel.com>
Subject: Re: [PATCH] perf: cs-etm: Fix the assert() to handle captured and unprocessed cpu trace
Date: Wed, 25 Sep 2024 16:04:55 -0700	[thread overview]
Message-ID: <ZvSXFx4N2vXReqZs@google.com> (raw)
In-Reply-To: <5160d57a-3520-4d99-ae10-5cc539fba813@linaro.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 <cpu>' 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 <ilkka@os.amperecomputing.com>
> > ---
> >   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 <james.clark@linaro.org>
 
Thanks, it should go to the perf-tool.  Arnaldo, please pick up.
Namhyung


  reply	other threads:[~2024-09-25 23:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-24 23:39 [PATCH] perf: cs-etm: Fix the assert() to handle captured and unprocessed cpu trace Ilkka Koskinen
2024-09-25  9:54 ` James Clark
2024-09-25 23:04   ` Namhyung Kim [this message]
2024-10-01 19:06     ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZvSXFx4N2vXReqZs@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=ilkka@os.amperecomputing.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).