lkml.org 
[lkml]   [2009]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: perf counters: problem with perf record
Ingo Molnar wrote
>> Maybe it's a good idea to add another comment making it clear that the
>> performance counters are not fully working in this case. Or detect this
>> case in "perf-record" and output a message relating to that.
>
> Ok. Mind sending a patch that changes the message so that it explains it
> all to you more clearly?

Here's a patch for this:

More accurate error message when "perf record" fails because there is no
APIC support:
---
tools/perf/builtin-record.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 04f335e..77b21f1 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -303,6 +303,10 @@ try_again:
printf("\n");
error("perfcounter syscall returned with %d (%s)\n",
fd[nr_cpu][counter], strerror(err));
+
+ if (attr->type == PERF_TYPE_HARDWARE && err == EOPNOTSUPP)
+ die("No hardware sampling interrupt available.
No APIC? Boot the kernel with the \"lapic\" boot parameter to
force-enable it.\n");
+
die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
exit(-1);
}
--
1.5.4.3

>
>>> And does booting with the suggested lapic parameter cure your problems?
>>>
>> Yes, thank you!
>
> Great.
>
> You might want to send another patch that allows the .config enabling of
> that lapic boot parameter. It sucks to carry around boot parameters.
>

I'm not sure if this is a good idea. Some systems may crash if you
force-enable it:
http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/1635.html

And I'm also not familiar with the kernel internals on that topic ;)

Simon



\
 
 \ /
  Last update: 2009-11-16 06:31    [W:0.057 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site