Skip to content

Commit

Permalink
perf record, x86: Print more intelligent error message when sampling …
Browse files Browse the repository at this point in the history
…fails

Print more accurate error message when "perf record" fails because
there is no APIC support, on x86.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Simon Kaempflein authored and Ingo Molnar committed Nov 23, 2009
1 parent 81516c5 commit bfd4511
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ static void create_counter(int counter, int cpu, pid_t pid)
printf("\n");
error("perfcounter syscall returned with %d (%s)\n",
fd[nr_cpu][counter], strerror(err));

#if defined(__i386__) || defined(__x86_64__)
if (attr->type == PERF_TYPE_HARDWARE && err == EOPNOTSUPP)
die("No hardware sampling interrupt available. No APIC? If so then you can boot the kernel with the \"lapic\" boot parameter to force-enable it.\n");
#endif

die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
exit(-1);
}
Expand Down

0 comments on commit bfd4511

Please sign in to comment.