lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y5mdqtwe.fsf@kernel.org>
Date:	Sat, 21 Jul 2012 19:40:33 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	David Ahern <dsahern@...il.com>
Cc:	acme@...stprotocols.net, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 10/11] perf tool: give user better message if precise is not supported

Hi, David

On Fri, 20 Jul 2012 17:25:55 -0600, David Ahern wrote:
> If the PEBS is not supported (e.g., a VM) and the precise modifier is
> set the user is given a confusing error message:
>
>   $ perf top -e cycles:p
>
>   The sys_perf_event_open() syscall returned with 95 (Operation not supported).
> /bin/dmesg may provide additional information.
>   No CONFIG_PERF_EVENTS=y kernel support configured?
>
>   $ perf record -e cycles:p -a -- sleep 1
>
>   Error: sys_perf_event_open() syscall returned with 95 (Operation not
> supported).  /bin/dmesg may provide additional information.
>
>   Fatal: No hardware sampling interrupt available. No APIC? If so then you can
> boot the kernel with the "lapic" boot parameter to force-enable it.
>
> Which in no way conveys the real error. With this patch:
>   $ perf top -e cycles:p
>   PEBS request not supported. Try removing 'p' modifier
>
>   $ perf record -e cycles:p -a -- sleep 1
>   PEBS request not supported. Try removing 'p' modifier
>

The name 'PEBS' is intel-specific, so shouldn't we try to avoid using it
directly? How about this:

    Precise event sampling is not supported. Try removing 'p' modifier

Thanks,
Namhyung


> Signed-off-by: David Ahern <dsahern@...il.com>
> Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> ---
>  tools/perf/builtin-record.c |    4 ++++
>  tools/perf/builtin-top.c    |    4 ++++
>  2 files changed, 8 insertions(+)
>
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index f5a6452..911e300 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -267,6 +267,10 @@ try_again:
>  				ui__error("The %s event is not supported.\n",
>  					  perf_evsel__name(pos));
>  				exit(EXIT_FAILURE);
> +			} else if ((err == ENOTSUP) && (attr->precise_ip)) {
> +				ui__error("PEBS request not supported. "
> +					  "Try removing 'p' modifier\n");
> +				exit(EXIT_FAILURE);
>  			}
>  
>  			printf("\n");
> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> index 0ce665c..1706dc9 100644
> --- a/tools/perf/builtin-top.c
> +++ b/tools/perf/builtin-top.c
> @@ -968,6 +968,10 @@ try_again:
>  				ui__error("Too many events are opened.\n"
>  					    "Try again after reducing the number of events\n");
>  				goto out_err;
> +			} else if ((err == ENOTSUP) && (attr->precise_ip)) {
> +				ui__error("PEBS request not supported. "
> +					    "Try removing 'p' modifier\n");
> +				goto out_err;
>  			}
>  
>  			ui__error("The sys_perf_event_open() syscall "
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ