Skip to contentSkip to conversation

perf user tool precise attribute broken in 3.5rc1+

DISCUSSION Andi Kleen 5 participants 16 messages Jun 7, 2012 – Dec 4, 2012

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

With a perf user tool compiled from a 3.5rc1+ kernel I cannot use the 'p' attribute anymore. Always get

ak@petrock:~> ./perf record -e cycles:p ./t

Error: sys_perf_event_open() syscall returned with 22 (Invalid argument). /bin/dmesg may provide additional information.

Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

./t: Terminated

With an older perf it works, so the kernel is ok.

ak@petrock:~> ./perf record -e cycles:p ./t
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.005 MB perf.data (~217 samples) ] ak@petrock:~>

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.
#1 lore raw

What CPU model?

Quoted 23 lines · Andi Kleen

With a perf user tool compiled from a 3.5rc1+ kernel I cannot use the 'p' attribute anymore. Always get

ak@petrock:~> ./perf record -e cycles:p ./t

 Error: sys_perf_event_open() syscall returned with 22 (Invalid argument).  /bin/dmesg may provide additional information.

 Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

./t: Terminated

With an older perf it works, so the kernel is ok.

ak@petrock:~> ./perf record -e cycles:p ./t
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.005 MB perf.data (~217 samples) ] ak@petrock:~>

-Andi
--
[email protected] -- Speaking for myself only.

author
#2 lore raw
Quoted 1 line · Stephane Eranian

What CPU model?

I see it on Sandy Bridge and others. But the perf tool shouldn't know anything about that anyways? The kernel driver is ok

-Andi

#3 lore raw
In reply to Stephane Eranian
Quoted 1 line · Stephane Eranian

What CPU model?

+1, latest tip works for me ;)

jirka

Quoted 25 lines · Andi Kleen
Quoted 23 lines

With a perf user tool compiled from a 3.5rc1+ kernel I cannot use the 'p' attribute anymore. Always get

ak@petrock:~> ./perf record -e cycles:p ./t

 Error: sys_perf_event_open() syscall returned with 22 (Invalid argument).  /bin/dmesg may provide additional information.

 Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

./t: Terminated

With an older perf it works, so the kernel is ok.

ak@petrock:~> ./perf record -e cycles:p ./t
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.005 MB perf.data (~217 samples) ] ak@petrock:~>

-Andi
--
[email protected] -- Speaking for myself only.

author
#4 lore raw
Quoted 3 lines · Jiri Olsa
Quoted 1 line · Stephane Eranian

What CPU model?

+1, latest tip works for me ;)

how about mainline?

-Andi

#5 lore raw
Quoted 8 lines · Andi Kleen
Quoted 3 lines · Jiri Olsa
Quoted 1 line · Stephane Eranian

What CPU model?

+1, latest tip works for me ;)

how about mainline?

-Andi

yes..

jirka

---
[jolsa@dhcp-26-214 perf]$ ./perf record -e cycles:p date Thu Jun 7 23:33:02 CEST 2012
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.006 MB perf.data (~260 samples) ] [jolsa@dhcp-26-214 perf]$ git show
commit 513335f964a17bd99a699b939391eb111aa5f65b
Merge: 0c30989 4c01acc
Author: Linus Torvalds <[email protected]>
Date: Thu Jun 7 09:06:54 2012 -0700

#6 lore raw
In reply to Andi Kleen
Quoted 10 lines · Andi Kleen

With a perf user tool compiled from a 3.5rc1+ kernel I cannot use the 'p' attribute anymore. Always get

ak@petrock:~> ./perf record -e cycles:p ./t

 Error: sys_perf_event_open() syscall returned with 22 (Invalid argument).  /bin/dmesg may provide additional information.

 Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

Remember that PEBS is disabled on SNB unless you have the new ucode + my patch.

Quoted 13 lines

./t: Terminated

With an older perf it works, so the kernel is ok.

ak@petrock:~> ./perf record -e cycles:p ./t
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.005 MB perf.data (~217 samples) ] ak@petrock:~>

-Andi
--
[email protected] -- Speaking for myself only.

author
#7 lore raw
Quoted 5 lines · Stephane Eranian
Quoted 4 lines · Andi Kleen

With a perf user tool compiled from a 3.5rc1+ kernel I cannot use the 'p' attribute anymore. Always get

Quoted 7 lines
Quoted 6 lines

ak@petrock:~> ./perf record -e cycles:p ./t

 Error: sys_perf_event_open() syscall returned with 22 (Invalid argument).  /bin/dmesg may provide additional information.

 Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

Remember that PEBS is disabled on SNB unless you have the new ucode + my patch.

This is not the problem. This was actually a -E where it was not disabled in my tree. And the older perf binary works, so it's clearly not a kernel problem.

-Andi

#8 lore raw

Em Thu, Jun 07, 2012 at 10:58:36PM +0200, Andi Kleen escreveu:

Quoted 10 lines · Stephane Eranian
Quoted 9 lines · Andi Kleen
Quoted 8 lines

With a perf user tool compiled from a 3.5rc1+ kernel I cannot use the 'p' attribute anymore. Always get

ak@petrock:~> ./perf record -e cycles:p ./t

 Error: sys_perf_event_open() syscall returned with 22 (Invalid argument).  /bin/dmesg may provide additional information.

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

 Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

Remember that PEBS is disabled on SNB unless you have the new ucode + my patch.

This is not the problem. This was actually a -E where it was not disabled in my tree. And the older perf binary works, so it's clearly not a kernel problem.

Are you sure the old one works? Perhaps it silently falls back to cpu-clock?

What 'perf evlist -v' says?

- Arnaldo

author
#9 lore raw
Quoted 2 lines

Are you sure the old one works? Perhaps it silently falls back to cpu-clock?

Yes i'm sure. I was actually debugging some kernel pebs code, and had a heavily instrumented pebs code path and was first trying to figure out what went wrong in the kernel, until I realized that the userland was broken.

Does :p work for anyone else?

BTW I hope the perf userland becomes more stable again. Recently I've had far more trouble with the user binary than the kernel driver, which is unusal.

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.
#10 lore raw

Em Fri, Jun 08, 2012 at 05:10:09AM +0200, Andi Kleen escreveu:

Quoted 9 lines
Quoted 2 lines

Are you sure the old one works? Perhaps it silently falls back to cpu-clock?

Yes i'm sure. I was actually debugging some kernel pebs code, and had a heavily instrumented pebs code path and was first trying to figure out what went wrong in the kernel, until I realized that the userland was broken.

Does :p work for anyone else?

It seems to work for Linus on Ivy Bridge with what is on tip/perf/urgent

Quoted 3 lines

BTW I hope the perf userland becomes more stable again. Recently I've had far more trouble with the user binary than the kernel driver, which is unusal.

Well, as a feedback your post is very much appreciated, we'll try to do better.

What areas do you feel are more troubling? Anything you reported that still hasn't been fixed?

Probably we should stop working on features and just process patches and work on a suite of autotest scripts, something we've been discussing but not working that much at.

- Arnaldo

author
#11 lore raw
Quoted 4 lines · Arnaldo Carvalho de Melo

Em Fri, Jun 08, 2012 at 05:10:09AM +0200, Andi Kleen escreveu:

Quoted 2 lines
Quoted 2 lines

Are you sure the old one works? Perhaps it silently falls back to cpu-clock?

Quoted 8 lines
Quoted 6 lines

Yes i'm sure. I was actually debugging some kernel pebs code, and had a heavily instrumented pebs code path and was first trying to figure out what went wrong in the kernel, until I realized that the userland was broken.

Does :p work for anyone else?

It seems to work for Linus on Ivy Bridge with what is on tip/perf/urgent

Hmm, maybe some local problem. I'll do some debugging and a bisect.

-Andi

author
#12 lore raw

Hmm, the problem disappeared after a make clean.
Sorry for the noise.

-Andi

#13 lore raw

Em Fri, Jun 08, 2012 at 11:55:49PM +0200, Andi Kleen escreveu:

Quoted 2 lines

Hmm, the problem disappeared after a make clean.
Sorry for the noise.

Thanks for the feedback!

- Arnaldo

#14 lore raw
In reply to Andi Kleen
Quoted 7 lines · Andi Kleen <andi <at> firstfloor.org> writes:

Hmm, the problem disappeared after a make clean.
Sorry for the noise.

-Andi

Andi, I am using your hsw_pmu 3.6 kernel and the perf it comes with. However, I experience the same problem you addressed here. Could you elaborate how you solved the problem by "make clean"?

-Hassan

#15 lore raw
In reply to Andi Kleen
Quoted 10 lines · Andi Kleen
Quoted 9 lines · Stephane Eranian
Quoted 8 lines · Andi Kleen

With a perf user tool compiled from a 3.5rc1+ kernel I cannot use the 'p' attribute anymore. Always get

ak@petrock:~> ./perf record -e cycles:p ./t

 Error: sys_perf_event_open() syscall returned with 22 (Invalid argument).  /bin/dmesg may provide additional information.

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

 Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

Remember that PEBS is disabled on SNB unless you have the new ucode + my patch.

This is not the problem. This was actually a -E where it was not disabled in my tree.  And the older perf binary works, so it's clearly not a kernel problem.

What's -E?

Quoted 2 lines

-Andi