From: Leo Yan <leo.yan@linaro.org> To: Wei Li <liwei391@huawei.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, Kim Phillips <kim.phillips@arm.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, guohanjun@huawei.com Subject: Re: [PATCH v2 1/2] perf tools: Fix record failure when mixed with ARM SPE event Date: Fri, 24 Jul 2020 16:59:11 +0800 [thread overview] Message-ID: <20200724085911.GA8487@leoy-ThinkPad-X240s> (raw) In-Reply-To: <20200724071111.35593-2-liwei391@huawei.com> On Fri, Jul 24, 2020 at 03:11:10PM +0800, Wei Li wrote: > When recording with cache-misses and arm_spe_x event, i found that > it will just fail without showing any error info if i put cache-misses > after 'arm_spe_x' event. > > [root@localhost 0620]# perf record -e cache-misses -e \ > arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,\ > jitter=1,store_filter=1,min_latency=0/ sleep 1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.067 MB perf.data ] > [root@localhost 0620]# perf record -e \ > arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,\ > store_filter=1,min_latency=0/ -e cache-misses sleep 1 > [root@localhost 0620]# > > The current code can only work if the only event to be traced is an > 'arm_spe_x', or if it is the last event to be specified. Otherwise the > last event type will be checked against all the arm_spe_pmus[i]->types, > none will match and an out of bound 'i' index will be used in > arm_spe_recording_init(). > > We don't support concurrent multiple arm_spe_x events currently, that > is checked in arm_spe_recording_options(), and it will show the relevant > info. So add the check and record of the first found 'arm_spe_pmu' to > fix this issue here. > > Fixes: ffd3d18c20b8d ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support") > Signed-off-by: Wei Li <liwei391@huawei.com> Thanks for the patch, Wei. I have tested this series on Arm64 D06 platform: Tested-by: Leo Yan <leo.yan@linaro.org> I'd like to wait for Mathieu's ACK. Thanks, Leo > --- > tools/perf/arch/arm/util/auxtrace.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c > index 0a6e75b8777a..28a5d0c18b1d 100644 > --- a/tools/perf/arch/arm/util/auxtrace.c > +++ b/tools/perf/arch/arm/util/auxtrace.c > @@ -56,7 +56,7 @@ struct auxtrace_record > struct perf_pmu *cs_etm_pmu; > struct evsel *evsel; > bool found_etm = false; > - bool found_spe = false; > + struct perf_pmu *found_spe = NULL; > static struct perf_pmu **arm_spe_pmus = NULL; > static int nr_spes = 0; > int i = 0; > @@ -74,12 +74,12 @@ struct auxtrace_record > evsel->core.attr.type == cs_etm_pmu->type) > found_etm = true; > > - if (!nr_spes) > + if (!nr_spes || found_spe) > continue; > > for (i = 0; i < nr_spes; i++) { > if (evsel->core.attr.type == arm_spe_pmus[i]->type) { > - found_spe = true; > + found_spe = arm_spe_pmus[i]; > break; > } > } > @@ -96,7 +96,7 @@ struct auxtrace_record > > #if defined(__aarch64__) > if (found_spe) > - return arm_spe_recording_init(err, arm_spe_pmus[i]); > + return arm_spe_recording_init(err, found_spe); > #endif > > /* > -- > 2.17.1 >
WARNING: multiple messages have this Message-ID (diff)
From: Leo Yan <leo.yan@linaro.org> To: Wei Li <liwei391@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com>, Kim Phillips <kim.phillips@arm.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo <acme@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, guohanjun@huawei.com, Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@redhat.com>, linux-arm-kernel@lists.infradead.org, Mike Leach <mike.leach@linaro.org> Subject: Re: [PATCH v2 1/2] perf tools: Fix record failure when mixed with ARM SPE event Date: Fri, 24 Jul 2020 16:59:11 +0800 [thread overview] Message-ID: <20200724085911.GA8487@leoy-ThinkPad-X240s> (raw) In-Reply-To: <20200724071111.35593-2-liwei391@huawei.com> On Fri, Jul 24, 2020 at 03:11:10PM +0800, Wei Li wrote: > When recording with cache-misses and arm_spe_x event, i found that > it will just fail without showing any error info if i put cache-misses > after 'arm_spe_x' event. > > [root@localhost 0620]# perf record -e cache-misses -e \ > arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,\ > jitter=1,store_filter=1,min_latency=0/ sleep 1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.067 MB perf.data ] > [root@localhost 0620]# perf record -e \ > arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,\ > store_filter=1,min_latency=0/ -e cache-misses sleep 1 > [root@localhost 0620]# > > The current code can only work if the only event to be traced is an > 'arm_spe_x', or if it is the last event to be specified. Otherwise the > last event type will be checked against all the arm_spe_pmus[i]->types, > none will match and an out of bound 'i' index will be used in > arm_spe_recording_init(). > > We don't support concurrent multiple arm_spe_x events currently, that > is checked in arm_spe_recording_options(), and it will show the relevant > info. So add the check and record of the first found 'arm_spe_pmu' to > fix this issue here. > > Fixes: ffd3d18c20b8d ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support") > Signed-off-by: Wei Li <liwei391@huawei.com> Thanks for the patch, Wei. I have tested this series on Arm64 D06 platform: Tested-by: Leo Yan <leo.yan@linaro.org> I'd like to wait for Mathieu's ACK. Thanks, Leo > --- > tools/perf/arch/arm/util/auxtrace.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c > index 0a6e75b8777a..28a5d0c18b1d 100644 > --- a/tools/perf/arch/arm/util/auxtrace.c > +++ b/tools/perf/arch/arm/util/auxtrace.c > @@ -56,7 +56,7 @@ struct auxtrace_record > struct perf_pmu *cs_etm_pmu; > struct evsel *evsel; > bool found_etm = false; > - bool found_spe = false; > + struct perf_pmu *found_spe = NULL; > static struct perf_pmu **arm_spe_pmus = NULL; > static int nr_spes = 0; > int i = 0; > @@ -74,12 +74,12 @@ struct auxtrace_record > evsel->core.attr.type == cs_etm_pmu->type) > found_etm = true; > > - if (!nr_spes) > + if (!nr_spes || found_spe) > continue; > > for (i = 0; i < nr_spes; i++) { > if (evsel->core.attr.type == arm_spe_pmus[i]->type) { > - found_spe = true; > + found_spe = arm_spe_pmus[i]; > break; > } > } > @@ -96,7 +96,7 @@ struct auxtrace_record > > #if defined(__aarch64__) > if (found_spe) > - return arm_spe_recording_init(err, arm_spe_pmus[i]); > + return arm_spe_recording_init(err, found_spe); > #endif > > /* > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-07-24 8:59 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-24 7:11 [PATCH v2 0/2] perf tools: Fix record failure when mixed with ARM SPE event Wei Li 2020-07-24 7:11 ` Wei Li 2020-07-24 7:11 ` [PATCH v2 1/2] " Wei Li 2020-07-24 7:11 ` Wei Li 2020-07-24 8:59 ` Leo Yan [this message] 2020-07-24 8:59 ` Leo Yan 2020-07-27 20:29 ` Mathieu Poirier 2020-07-27 20:29 ` Mathieu Poirier 2020-07-24 7:11 ` [PATCH v2 2/2] perf tools: ARM SPE code cleanup Wei Li 2020-07-24 7:11 ` Wei Li 2020-07-27 20:34 ` Mathieu Poirier 2020-07-27 20:34 ` Mathieu Poirier 2020-07-28 11:42 ` Arnaldo Carvalho de Melo 2020-07-28 11:42 ` Arnaldo Carvalho de Melo 2020-07-28 12:02 ` Arnaldo Carvalho de Melo 2020-07-28 12:02 ` Arnaldo Carvalho de Melo 2020-07-28 12:38 ` Leo Yan 2020-07-28 12:38 ` Leo Yan 2020-07-28 15:46 ` Mathieu Poirier 2020-07-28 15:46 ` Mathieu Poirier
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=20200724085911.GA8487@leoy-ThinkPad-X240s \ --to=leo.yan@linaro.org \ --cc=acme@kernel.org \ --cc=alexander.shishkin@linux.intel.com \ --cc=guohanjun@huawei.com \ --cc=jolsa@redhat.com \ --cc=kim.phillips@arm.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=liwei391@huawei.com \ --cc=mark.rutland@arm.com \ --cc=mathieu.poirier@linaro.org \ --cc=mike.leach@linaro.org \ --cc=mingo@redhat.com \ --cc=namhyung@kernel.org \ --cc=peterz@infradead.org \ --cc=suzuki.poulose@arm.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.