From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: James Clark <james.clark@linaro.org>,
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: Tue, 1 Oct 2024 16:06:57 -0300 [thread overview]
Message-ID: <ZvxIUSz1O92BGOiP@x1> (raw)
In-Reply-To: <ZvSXFx4N2vXReqZs@google.com>
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 <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.
Right, picking it now.
Thanks,
- Arnaldo
prev parent reply other threads:[~2024-10-01 19:07 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
2024-10-01 19:06 ` Arnaldo Carvalho de Melo [this message]
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=ZvxIUSz1O92BGOiP@x1 \
--to=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=namhyung@kernel.org \
--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).