Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfd45118 authored by Simon Kaempflein's avatar Simon Kaempflein Committed by Ingo Molnar
Browse files

perf record, x86: Print more intelligent error message when sampling fails



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

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 81516c5f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);
	}