* [patch] perf tools: perf list broken on ARM
@ 2013-12-09 21:58 Vince Weaver
2013-12-10 2:11 ` Namhyung Kim
0 siblings, 1 reply; 14+ messages in thread
From: Vince Weaver @ 2013-12-09 21:58 UTC (permalink / raw)
To: Namhyung Kim
Cc: linux-kernel, Chad Paradis, David Ahern, Ingo Molnar, Jiri Olsa,
Paul Mackerras, Peter Zijlstra, Stephane Eranian
Hello,
"perf list" listing of hardware events doesn't work on older ARM devices.
The change enabling event detection:
commit b41f1cec91c37eeea6fdb15effbfa24ea0a5536b
Author: Namhyung Kim <namhyung.kim@lge.com>
Date: Tue Aug 27 11:41:53 2013 +0900
perf list: Skip unsupported events
uses the following code in tools/perf/util/parse-events.c:
struct perf_event_attr attr = {
.type = type,
.config = config,
.disabled = 1,
.exclude_kernel = 1,
};
On ARM machines pre-dating the Cortex-A15 this doesn't work, as
these machines don't support .exclude_kernel. So starting with 3.12
"perf list" does not report any hardware events at all on older
machines (seen on Rasp-Pi, Pandaboard, Beagleboard, etc).
If we drop the "exclude_kernel" attribute events are properly reported.
Reported-by: Chad Paradis <chad.paradis@umit.maine.edu>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 6de6f89..360ecab 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1087,7 +1087,6 @@ static bool is_event_supported(u8 type, unsigned config)
.type = type,
.config = config,
.disabled = 1,
- .exclude_kernel = 1,
};
struct {
struct thread_map map;
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2013-12-09 21:58 [patch] perf tools: perf list broken on ARM Vince Weaver
@ 2013-12-10 2:11 ` Namhyung Kim
2013-12-10 3:58 ` Vince Weaver
0 siblings, 1 reply; 14+ messages in thread
From: Namhyung Kim @ 2013-12-10 2:11 UTC (permalink / raw)
To: Vince Weaver
Cc: linux-kernel, Chad Paradis, David Ahern, Ingo Molnar, Jiri Olsa,
Paul Mackerras, Peter Zijlstra, Stephane Eranian
Hi Vince,
On Mon, 9 Dec 2013 16:58:35 -0500 (EST), Vince Weaver wrote:
> Hello,
>
> "perf list" listing of hardware events doesn't work on older ARM devices.
> The change enabling event detection:
>
> commit b41f1cec91c37eeea6fdb15effbfa24ea0a5536b
> Author: Namhyung Kim <namhyung.kim@lge.com>
> Date: Tue Aug 27 11:41:53 2013 +0900
>
> perf list: Skip unsupported events
>
>
> uses the following code in tools/perf/util/parse-events.c:
>
> struct perf_event_attr attr = {
> .type = type,
> .config = config,
> .disabled = 1,
> .exclude_kernel = 1,
> };
>
> On ARM machines pre-dating the Cortex-A15 this doesn't work, as
> these machines don't support .exclude_kernel. So starting with 3.12
> "perf list" does not report any hardware events at all on older
> machines (seen on Rasp-Pi, Pandaboard, Beagleboard, etc).
>
> If we drop the "exclude_kernel" attribute events are properly reported.
Okay, the reason I set the bit was consideration of a very strict
perf_event_paranoid setting (-2).
So maybe we can try it again with the bit cleared after a failure, or
checking the paranoid setting first.
Thanks,
Namhyung
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2013-12-10 2:11 ` Namhyung Kim
@ 2013-12-10 3:58 ` Vince Weaver
2013-12-10 5:08 ` Namhyung Kim
0 siblings, 1 reply; 14+ messages in thread
From: Vince Weaver @ 2013-12-10 3:58 UTC (permalink / raw)
To: Namhyung Kim
Cc: Vince Weaver, linux-kernel, Chad Paradis, David Ahern,
Ingo Molnar, Jiri Olsa, Paul Mackerras, Peter Zijlstra,
Stephane Eranian
On Tue, 10 Dec 2013, Namhyung Kim wrote:
> Hi Vince,
> Okay, the reason I set the bit was consideration of a very strict
> perf_event_paranoid setting (-2).
>
> So maybe we can try it again with the bit cleared after a failure, or
> checking the paranoid setting first.
If perf_event_paranoid is set to 2 then you should get EPERM rather than
ENOENT or EINVAL, right? Maybe that could be used too.
As a side note, why doesn't paranoid 2 block events that don't have
exclude_hv set?
Vince
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2013-12-10 3:58 ` Vince Weaver
@ 2013-12-10 5:08 ` Namhyung Kim
0 siblings, 0 replies; 14+ messages in thread
From: Namhyung Kim @ 2013-12-10 5:08 UTC (permalink / raw)
To: Vince Weaver
Cc: linux-kernel, Chad Paradis, David Ahern, Ingo Molnar, Jiri Olsa,
Paul Mackerras, Peter Zijlstra, Stephane Eranian
On Mon, 9 Dec 2013 22:58:46 -0500 (EST), Vince Weaver wrote:
> On Tue, 10 Dec 2013, Namhyung Kim wrote:
>
>> Hi Vince,
>> Okay, the reason I set the bit was consideration of a very strict
>> perf_event_paranoid setting (-2).
>>
>> So maybe we can try it again with the bit cleared after a failure, or
>> checking the paranoid setting first.
>
> If perf_event_paranoid is set to 2 then you should get EPERM rather than
> ENOENT or EINVAL, right? Maybe that could be used too.
Ah, yes, it's 2. :) And it also can use the return value then.
>
> As a side note, why doesn't paranoid 2 block events that don't have
> exclude_hv set?
Hmm.. maybe because it predated the bit?
Thanks,
Namhyung
^ permalink raw reply [flat|nested] 14+ messages in thread
* [patch] perf tools: perf list broken on ARM
@ 2013-12-30 20:39 Vince Weaver
2014-01-08 21:30 ` Vince Weaver
2014-02-22 17:55 ` [tip:perf/core] perf list: Fix checking for supported events on older kernels tip-bot for Vince Weaver
0 siblings, 2 replies; 14+ messages in thread
From: Vince Weaver @ 2013-12-30 20:39 UTC (permalink / raw)
To: linux-kernel
Cc: Namhyung Kim, Chad Paradis, Peter Zijlstra, Paul Mackerras,
Ingo Molnar, Arnaldo Carvalho de Melo
"perf list" listing of hardware events doesn't work on older ARM devices.
The change enabling event detection:
commit b41f1cec91c37eeea6fdb15effbfa24ea0a5536b
Author: Namhyung Kim <namhyung.kim@lge.com>
Date: Tue Aug 27 11:41:53 2013 +0900
perf list: Skip unsupported events
uses the following code in tools/perf/util/parse-events.c:
struct perf_event_attr attr = {
.type = type,
.config = config,
.disabled = 1,
.exclude_kernel = 1,
};
On ARM machines pre-dating the Cortex-A15 this doesn't work, as
these machines don't support .exclude_kernel. So starting with 3.12
"perf list" does not report any hardware events at all on older
machines (seen on Rasp-Pi, Pandaboard, Beagleboard, etc).
This version of the patch makes changes suggested by Namhyung Kim
to check for EACCESS and retry (instead of just dropping
the exclude_kernel) so we can properly handle machines where
/proc/sys/kernel/perf_event_paranoid is set to 2.
Reported-by: Chad Paradis <chad.paradis@umit.maine.edu>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Acked-by: Namhyung Kim <namhyung@kernel.org>
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 6de6f89..1fa98b9 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1082,12 +1082,12 @@ int is_valid_tracepoint(const char *event_string)
static bool is_event_supported(u8 type, unsigned config)
{
bool ret = true;
+ int open_return;
struct perf_evsel *evsel;
struct perf_event_attr attr = {
.type = type,
.config = config,
.disabled = 1,
- .exclude_kernel = 1,
};
struct {
struct thread_map map;
@@ -1099,7 +1099,20 @@ static bool is_event_supported(u8 type, unsigned config)
evsel = perf_evsel__new(&attr);
if (evsel) {
- ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
+ open_return = perf_evsel__open(evsel, NULL, &tmap.map);
+ ret = open_return >= 0;
+
+ if (open_return == -EACCES) {
+ /*
+ * This happens if the paranoid value
+ * /proc/sys/kernel/perf_event_paranoid is set to 2
+ * Re-run with exclude_kernel set; we don't do that
+ * by default as some ARM machines do not support it.
+ *
+ */
+ evsel->attr.exclude_kernel = 1;
+ ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
+ }
perf_evsel__delete(evsel);
}
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2013-12-30 20:39 [patch] perf tools: perf list broken on ARM Vince Weaver
@ 2014-01-08 21:30 ` Vince Weaver
2014-01-09 8:17 ` Namhyung Kim
2014-01-09 9:02 ` Peter Zijlstra
2014-02-22 17:55 ` [tip:perf/core] perf list: Fix checking for supported events on older kernels tip-bot for Vince Weaver
1 sibling, 2 replies; 14+ messages in thread
From: Vince Weaver @ 2014-01-08 21:30 UTC (permalink / raw)
To: Vince Weaver
Cc: linux-kernel, Namhyung Kim, Chad Paradis, Peter Zijlstra,
Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo
just checking on the status of this patch. Am I sending it to the wrong
place? Did it get lost in the post-holiday e-mail purges?
The bug is annoying if you're trying to use perf on ARM systems.
Vince
On Mon, 30 Dec 2013, Vince Weaver wrote:
>
> "perf list" listing of hardware events doesn't work on older ARM devices.
> The change enabling event detection:
>
> commit b41f1cec91c37eeea6fdb15effbfa24ea0a5536b
> Author: Namhyung Kim <namhyung.kim@lge.com>
> Date: Tue Aug 27 11:41:53 2013 +0900
>
> perf list: Skip unsupported events
>
>
> uses the following code in tools/perf/util/parse-events.c:
>
> struct perf_event_attr attr = {
> .type = type,
> .config = config,
> .disabled = 1,
> .exclude_kernel = 1,
> };
>
> On ARM machines pre-dating the Cortex-A15 this doesn't work, as
> these machines don't support .exclude_kernel. So starting with 3.12
> "perf list" does not report any hardware events at all on older
> machines (seen on Rasp-Pi, Pandaboard, Beagleboard, etc).
>
> This version of the patch makes changes suggested by Namhyung Kim
> to check for EACCESS and retry (instead of just dropping
> the exclude_kernel) so we can properly handle machines where
> /proc/sys/kernel/perf_event_paranoid is set to 2.
>
> Reported-by: Chad Paradis <chad.paradis@umit.maine.edu>
> Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
> Acked-by: Namhyung Kim <namhyung@kernel.org>
>
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index 6de6f89..1fa98b9 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -1082,12 +1082,12 @@ int is_valid_tracepoint(const char *event_string)
> static bool is_event_supported(u8 type, unsigned config)
> {
> bool ret = true;
> + int open_return;
> struct perf_evsel *evsel;
> struct perf_event_attr attr = {
> .type = type,
> .config = config,
> .disabled = 1,
> - .exclude_kernel = 1,
> };
> struct {
> struct thread_map map;
> @@ -1099,7 +1099,20 @@ static bool is_event_supported(u8 type, unsigned config)
>
> evsel = perf_evsel__new(&attr);
> if (evsel) {
> - ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
> + open_return = perf_evsel__open(evsel, NULL, &tmap.map);
> + ret = open_return >= 0;
> +
> + if (open_return == -EACCES) {
> + /*
> + * This happens if the paranoid value
> + * /proc/sys/kernel/perf_event_paranoid is set to 2
> + * Re-run with exclude_kernel set; we don't do that
> + * by default as some ARM machines do not support it.
> + *
> + */
> + evsel->attr.exclude_kernel = 1;
> + ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
> + }
> perf_evsel__delete(evsel);
> }
>
>
Vince Weaver
vincent.weaver@maine.edu
http://www.eece.maine.edu/~vweaver/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2014-01-08 21:30 ` Vince Weaver
@ 2014-01-09 8:17 ` Namhyung Kim
2014-01-09 12:12 ` Arnaldo Carvalho de Melo
2014-01-09 9:02 ` Peter Zijlstra
1 sibling, 1 reply; 14+ messages in thread
From: Namhyung Kim @ 2014-01-09 8:17 UTC (permalink / raw)
To: Vince Weaver, Arnaldo Carvalho de Melo
Cc: linux-kernel, Chad Paradis, Peter Zijlstra, Paul Mackerras,
Ingo Molnar
Hi Vince,
On Wed, 8 Jan 2014 16:30:17 -0500 (EST), Vince Weaver wrote:
> just checking on the status of this patch. Am I sending it to the wrong
> place? Did it get lost in the post-holiday e-mail purges?
>
> The bug is annoying if you're trying to use perf on ARM systems.
Right, acme, would you please merge this?
Thanks,
Namhyung
>
> On Mon, 30 Dec 2013, Vince Weaver wrote:
>
>>
>> "perf list" listing of hardware events doesn't work on older ARM devices.
>> The change enabling event detection:
>>
>> commit b41f1cec91c37eeea6fdb15effbfa24ea0a5536b
>> Author: Namhyung Kim <namhyung.kim@lge.com>
>> Date: Tue Aug 27 11:41:53 2013 +0900
>>
>> perf list: Skip unsupported events
>>
>>
>> uses the following code in tools/perf/util/parse-events.c:
>>
>> struct perf_event_attr attr = {
>> .type = type,
>> .config = config,
>> .disabled = 1,
>> .exclude_kernel = 1,
>> };
>>
>> On ARM machines pre-dating the Cortex-A15 this doesn't work, as
>> these machines don't support .exclude_kernel. So starting with 3.12
>> "perf list" does not report any hardware events at all on older
>> machines (seen on Rasp-Pi, Pandaboard, Beagleboard, etc).
>>
>> This version of the patch makes changes suggested by Namhyung Kim
>> to check for EACCESS and retry (instead of just dropping
>> the exclude_kernel) so we can properly handle machines where
>> /proc/sys/kernel/perf_event_paranoid is set to 2.
>>
>> Reported-by: Chad Paradis <chad.paradis@umit.maine.edu>
>> Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
>> Acked-by: Namhyung Kim <namhyung@kernel.org>
>>
>> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
>> index 6de6f89..1fa98b9 100644
>> --- a/tools/perf/util/parse-events.c
>> +++ b/tools/perf/util/parse-events.c
>> @@ -1082,12 +1082,12 @@ int is_valid_tracepoint(const char *event_string)
>> static bool is_event_supported(u8 type, unsigned config)
>> {
>> bool ret = true;
>> + int open_return;
>> struct perf_evsel *evsel;
>> struct perf_event_attr attr = {
>> .type = type,
>> .config = config,
>> .disabled = 1,
>> - .exclude_kernel = 1,
>> };
>> struct {
>> struct thread_map map;
>> @@ -1099,7 +1099,20 @@ static bool is_event_supported(u8 type, unsigned config)
>>
>> evsel = perf_evsel__new(&attr);
>> if (evsel) {
>> - ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
>> + open_return = perf_evsel__open(evsel, NULL, &tmap.map);
>> + ret = open_return >= 0;
>> +
>> + if (open_return == -EACCES) {
>> + /*
>> + * This happens if the paranoid value
>> + * /proc/sys/kernel/perf_event_paranoid is set to 2
>> + * Re-run with exclude_kernel set; we don't do that
>> + * by default as some ARM machines do not support it.
>> + *
>> + */
>> + evsel->attr.exclude_kernel = 1;
>> + ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
>> + }
>> perf_evsel__delete(evsel);
>> }
>>
>>
>
> Vince Weaver
> vincent.weaver@maine.edu
> http://www.eece.maine.edu/~vweaver/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2014-01-08 21:30 ` Vince Weaver
2014-01-09 8:17 ` Namhyung Kim
@ 2014-01-09 9:02 ` Peter Zijlstra
1 sibling, 0 replies; 14+ messages in thread
From: Peter Zijlstra @ 2014-01-09 9:02 UTC (permalink / raw)
To: Vince Weaver
Cc: linux-kernel, Namhyung Kim, Chad Paradis, Paul Mackerras,
Ingo Molnar, Arnaldo Carvalho de Melo
On Wed, Jan 08, 2014 at 04:30:17PM -0500, Vince Weaver wrote:
>
> just checking on the status of this patch. Am I sending it to the wrong
> place? Did it get lost in the post-holiday e-mail purges?
>
> The bug is annoying if you're trying to use perf on ARM systems.
Its for acme and he seems on the Cc, I suppose you got stuck in the
holiday backlog.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2014-01-09 8:17 ` Namhyung Kim
@ 2014-01-09 12:12 ` Arnaldo Carvalho de Melo
2014-01-09 12:37 ` Namhyung Kim
0 siblings, 1 reply; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-01-09 12:12 UTC (permalink / raw)
To: Namhyung Kim
Cc: Vince Weaver, linux-kernel, Chad Paradis, Peter Zijlstra,
Paul Mackerras, Ingo Molnar
Em Thu, Jan 09, 2014 at 05:17:27PM +0900, Namhyung Kim escreveu:
> Hi Vince,
>
> On Wed, 8 Jan 2014 16:30:17 -0500 (EST), Vince Weaver wrote:
> > just checking on the status of this patch. Am I sending it to the wrong
> > place? Did it get lost in the post-holiday e-mail purges?
> >
> > The bug is annoying if you're trying to use perf on ARM systems.
>
> Right, acme, would you please merge this?
I will, but having a patch authored by someone and Acked-by that same
person looks weird, so, to clarify, this was written by Vince, acked by
you, right?
- Arnaldo
> Thanks,
> Namhyung
>
> >
> > On Mon, 30 Dec 2013, Vince Weaver wrote:
> >
> >>
> >> "perf list" listing of hardware events doesn't work on older ARM devices.
> >> The change enabling event detection:
> >>
> >> commit b41f1cec91c37eeea6fdb15effbfa24ea0a5536b
> >> Author: Namhyung Kim <namhyung.kim@lge.com>
> >> Date: Tue Aug 27 11:41:53 2013 +0900
> >>
> >> perf list: Skip unsupported events
> >>
> >>
> >> uses the following code in tools/perf/util/parse-events.c:
> >>
> >> struct perf_event_attr attr = {
> >> .type = type,
> >> .config = config,
> >> .disabled = 1,
> >> .exclude_kernel = 1,
> >> };
> >>
> >> On ARM machines pre-dating the Cortex-A15 this doesn't work, as
> >> these machines don't support .exclude_kernel. So starting with 3.12
> >> "perf list" does not report any hardware events at all on older
> >> machines (seen on Rasp-Pi, Pandaboard, Beagleboard, etc).
> >>
> >> This version of the patch makes changes suggested by Namhyung Kim
> >> to check for EACCESS and retry (instead of just dropping
> >> the exclude_kernel) so we can properly handle machines where
> >> /proc/sys/kernel/perf_event_paranoid is set to 2.
> >>
> >> Reported-by: Chad Paradis <chad.paradis@umit.maine.edu>
> >> Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
> >> Acked-by: Namhyung Kim <namhyung@kernel.org>
> >>
> >> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> >> index 6de6f89..1fa98b9 100644
> >> --- a/tools/perf/util/parse-events.c
> >> +++ b/tools/perf/util/parse-events.c
> >> @@ -1082,12 +1082,12 @@ int is_valid_tracepoint(const char *event_string)
> >> static bool is_event_supported(u8 type, unsigned config)
> >> {
> >> bool ret = true;
> >> + int open_return;
> >> struct perf_evsel *evsel;
> >> struct perf_event_attr attr = {
> >> .type = type,
> >> .config = config,
> >> .disabled = 1,
> >> - .exclude_kernel = 1,
> >> };
> >> struct {
> >> struct thread_map map;
> >> @@ -1099,7 +1099,20 @@ static bool is_event_supported(u8 type, unsigned config)
> >>
> >> evsel = perf_evsel__new(&attr);
> >> if (evsel) {
> >> - ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
> >> + open_return = perf_evsel__open(evsel, NULL, &tmap.map);
> >> + ret = open_return >= 0;
> >> +
> >> + if (open_return == -EACCES) {
> >> + /*
> >> + * This happens if the paranoid value
> >> + * /proc/sys/kernel/perf_event_paranoid is set to 2
> >> + * Re-run with exclude_kernel set; we don't do that
> >> + * by default as some ARM machines do not support it.
> >> + *
> >> + */
> >> + evsel->attr.exclude_kernel = 1;
> >> + ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
> >> + }
> >> perf_evsel__delete(evsel);
> >> }
> >>
> >>
> >
> > Vince Weaver
> > vincent.weaver@maine.edu
> > http://www.eece.maine.edu/~vweaver/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2014-01-09 12:12 ` Arnaldo Carvalho de Melo
@ 2014-01-09 12:37 ` Namhyung Kim
2014-01-09 12:48 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 14+ messages in thread
From: Namhyung Kim @ 2014-01-09 12:37 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Vince Weaver, linux-kernel, Chad Paradis, Peter Zijlstra,
Paul Mackerras, Ingo Molnar
2014-01-09 (목), 09:12 -0300, Arnaldo Carvalho de Melo:
> Em Thu, Jan 09, 2014 at 05:17:27PM +0900, Namhyung Kim escreveu:
> > Hi Vince,
> >
> > On Wed, 8 Jan 2014 16:30:17 -0500 (EST), Vince Weaver wrote:
> > > just checking on the status of this patch. Am I sending it to the wrong
> > > place? Did it get lost in the post-holiday e-mail purges?
> > >
> > > The bug is annoying if you're trying to use perf on ARM systems.
> >
> > Right, acme, would you please merge this?
>
> I will, but having a patch authored by someone and Acked-by that same
> person looks weird, so, to clarify, this was written by Vince, acked by
> you, right?
You seemed to be confused - it's not authored by me. He was just
referring a problematic commit b41f1cec91c3 which was written by me. So
yeah, this commit was written by Vince.
Thanks,
Namhyung
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2014-01-09 12:37 ` Namhyung Kim
@ 2014-01-09 12:48 ` Arnaldo Carvalho de Melo
2014-02-05 20:34 ` Vince Weaver
0 siblings, 1 reply; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-01-09 12:48 UTC (permalink / raw)
To: Namhyung Kim
Cc: Vince Weaver, linux-kernel, Chad Paradis, Peter Zijlstra,
Paul Mackerras, Ingo Molnar
Em Thu, Jan 09, 2014 at 09:37:03PM +0900, Namhyung Kim escreveu:
> 2014-01-09 (목), 09:12 -0300, Arnaldo Carvalho de Melo:
> > Em Thu, Jan 09, 2014 at 05:17:27PM +0900, Namhyung Kim escreveu:
> > > Hi Vince,
> > >
> > > On Wed, 8 Jan 2014 16:30:17 -0500 (EST), Vince Weaver wrote:
> > > > just checking on the status of this patch. Am I sending it to the wrong
> > > > place? Did it get lost in the post-holiday e-mail purges?
> > > >
> > > > The bug is annoying if you're trying to use perf on ARM systems.
> > >
> > > Right, acme, would you please merge this?
> >
> > I will, but having a patch authored by someone and Acked-by that same
> > person looks weird, so, to clarify, this was written by Vince, acked by
> > you, right?
>
> You seemed to be confused - it's not authored by me. He was just
> referring a problematic commit b41f1cec91c3 which was written by me. So
> yeah, this commit was written by Vince.
You are right, I saw that Author: line in the changeset comment, close
to the start of the message and got confused, thanks for clarifying.
- Arnaldo
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2014-01-09 12:48 ` Arnaldo Carvalho de Melo
@ 2014-02-05 20:34 ` Vince Weaver
2014-02-06 13:38 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 14+ messages in thread
From: Vince Weaver @ 2014-02-05 20:34 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Namhyung Kim, linux-kernel, Chad Paradis, Peter Zijlstra,
Paul Mackerras, Ingo Molnar
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1248 bytes --]
On Thu, 9 Jan 2014, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jan 09, 2014 at 09:37:03PM +0900, Namhyung Kim escreveu:
> > 2014-01-09 (목), 09:12 -0300, Arnaldo Carvalho de Melo:
> > > Em Thu, Jan 09, 2014 at 05:17:27PM +0900, Namhyung Kim escreveu:
> > > > Hi Vince,
> > > >
> > > > On Wed, 8 Jan 2014 16:30:17 -0500 (EST), Vince Weaver wrote:
> > > > > just checking on the status of this patch. Am I sending it to the wrong
> > > > > place? Did it get lost in the post-holiday e-mail purges?
> > > > >
> > > > > The bug is annoying if you're trying to use perf on ARM systems.
> > > >
> > > > Right, acme, would you please merge this?
> > >
> > > I will, but having a patch authored by someone and Acked-by that same
> > > person looks weird, so, to clarify, this was written by Vince, acked by
> > > you, right?
> >
> > You seemed to be confused - it's not authored by me. He was just
> > referring a problematic commit b41f1cec91c3 which was written by me. So
> > yeah, this commit was written by Vince.
>
> You are right, I saw that Author: line in the changeset comment, close
> to the start of the message and got confused, thanks for clarifying.
Do I need to re-send this patch? It still applies cleanly to 3.14-rc1.
Vince
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch] perf tools: perf list broken on ARM
2014-02-05 20:34 ` Vince Weaver
@ 2014-02-06 13:38 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-02-06 13:38 UTC (permalink / raw)
To: Vince Weaver
Cc: Namhyung Kim, linux-kernel, Chad Paradis, Peter Zijlstra,
Paul Mackerras, Ingo Molnar
Em Wed, Feb 05, 2014 at 03:34:42PM -0500, Vince Weaver escreveu:
> > You are right, I saw that Author: line in the changeset comment, close
> > to the start of the message and got confused, thanks for clarifying.
>
> Do I need to re-send this patch? It still applies cleanly to 3.14-rc1.
Sorry, picked it up now, will send it to Ingo today.
- Arnaldo
^ permalink raw reply [flat|nested] 14+ messages in thread
* [tip:perf/core] perf list: Fix checking for supported events on older kernels
2013-12-30 20:39 [patch] perf tools: perf list broken on ARM Vince Weaver
2014-01-08 21:30 ` Vince Weaver
@ 2014-02-22 17:55 ` tip-bot for Vince Weaver
1 sibling, 0 replies; 14+ messages in thread
From: tip-bot for Vince Weaver @ 2014-02-22 17:55 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, paulus, mingo, hpa, mingo, a.p.zijlstra,
chad.paradis, namhyung, vincent.weaver, tglx
Commit-ID: 88fee52e58ca14d8465b614774ed0bf08e1a7790
Gitweb: http://git.kernel.org/tip/88fee52e58ca14d8465b614774ed0bf08e1a7790
Author: Vince Weaver <vincent.weaver@maine.edu>
AuthorDate: Mon, 30 Dec 2013 15:39:45 -0500
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 10 Feb 2014 11:34:31 -0300
perf list: Fix checking for supported events on older kernels
"perf list" listing of hardware events doesn't work on older ARM devices.
The change enabling event detection:
commit b41f1cec91c37eeea6fdb15effbfa24ea0a5536b
Author: Namhyung Kim <namhyung.kim@lge.com>
Date: Tue Aug 27 11:41:53 2013 +0900
perf list: Skip unsupported events
uses the following code in tools/perf/util/parse-events.c:
struct perf_event_attr attr = {
.type = type,
.config = config,
.disabled = 1,
.exclude_kernel = 1,
};
On ARM machines pre-dating the Cortex-A15 this doesn't work, as these
machines don't support .exclude_kernel. So starting with 3.12 "perf
list" does not report any hardware events at all on older machines (seen
on Rasp-Pi, Pandaboard, Beagleboard, etc).
This version of the patch makes changes suggested by Namhyung Kim to
check for EACCESS and retry (instead of just dropping the
exclude_kernel) so we can properly handle machines where
/proc/sys/kernel/perf_event_paranoid is set to 2.
Reported-by: Chad Paradis <chad.paradis@umit.maine.edu>
Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Chad Paradis <chad.paradis@umit.maine.edu>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1312301536150.28814@vincent-weaver-1.um.maine.edu
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/parse-events.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index d248fca..1e15df1 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1091,12 +1091,12 @@ int is_valid_tracepoint(const char *event_string)
static bool is_event_supported(u8 type, unsigned config)
{
bool ret = true;
+ int open_return;
struct perf_evsel *evsel;
struct perf_event_attr attr = {
.type = type,
.config = config,
.disabled = 1,
- .exclude_kernel = 1,
};
struct {
struct thread_map map;
@@ -1108,7 +1108,20 @@ static bool is_event_supported(u8 type, unsigned config)
evsel = perf_evsel__new(&attr);
if (evsel) {
- ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
+ open_return = perf_evsel__open(evsel, NULL, &tmap.map);
+ ret = open_return >= 0;
+
+ if (open_return == -EACCES) {
+ /*
+ * This happens if the paranoid value
+ * /proc/sys/kernel/perf_event_paranoid is set to 2
+ * Re-run with exclude_kernel set; we don't do that
+ * by default as some ARM machines do not support it.
+ *
+ */
+ evsel->attr.exclude_kernel = 1;
+ ret = perf_evsel__open(evsel, NULL, &tmap.map) >= 0;
+ }
perf_evsel__delete(evsel);
}
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-02-22 17:55 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-30 20:39 [patch] perf tools: perf list broken on ARM Vince Weaver
2014-01-08 21:30 ` Vince Weaver
2014-01-09 8:17 ` Namhyung Kim
2014-01-09 12:12 ` Arnaldo Carvalho de Melo
2014-01-09 12:37 ` Namhyung Kim
2014-01-09 12:48 ` Arnaldo Carvalho de Melo
2014-02-05 20:34 ` Vince Weaver
2014-02-06 13:38 ` Arnaldo Carvalho de Melo
2014-01-09 9:02 ` Peter Zijlstra
2014-02-22 17:55 ` [tip:perf/core] perf list: Fix checking for supported events on older kernels tip-bot for Vince Weaver
-- strict thread matches above, loose matches on Subject: below --
2013-12-09 21:58 [patch] perf tools: perf list broken on ARM Vince Weaver
2013-12-10 2:11 ` Namhyung Kim
2013-12-10 3:58 ` Vince Weaver
2013-12-10 5:08 ` Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox