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: <20210610192926.6f7b606f1fefd285b3907cd5@kernel.org>
Date:   Thu, 10 Jun 2021 19:29:26 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
Cc:     <linux-kernel@...r.kernel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
Subject: Re: [PATCH] tools/perf probe: Print a hint if adding a probe fails

Hi Naveen,

On Thu, 10 Jun 2021 15:14:42 +0530
"Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com> wrote:

> Adding a probe can fail in a few scenarios. perf already checks for the
> address in the kprobe blacklist. However, the address could still be a
> jump label, or have a BUG_ON(). In such cases, it isn't always evident
> why adding the probe failed. Add a hint so that the user knows how to
> proceed.
> 

Thanks for the report.

Since now there is <tracefs>/error_log, if you see any errors in registering
probe-events, perf probe should dump the error_log for the hint message.
Also, kprobes should return the correct different error code for each
errors.

Thank you,

> Reported-by: Aneesh Kumar K.V <aneesh.kumar@...ux.ibm.com>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@...ux.vnet.ibm.com>
> ---
>  tools/perf/builtin-probe.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
> index 6b150756677014..ff9f3fdce600dd 100644
> --- a/tools/perf/builtin-probe.c
> +++ b/tools/perf/builtin-probe.c
> @@ -352,8 +352,11 @@ static int perf_add_probe_events(struct perf_probe_event *pevs, int npevs)
>  	}
>  
>  	ret = apply_perf_probe_events(pevs, npevs);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		pr_info("Hint: Check dmesg to understand reason for probe failure.\n"
> +			"      Consider probing at the next/previous instruction.\n");
>  		goto out_cleanup;
> +	}
>  
>  	for (i = k = 0; i < npevs; i++)
>  		k += pevs[i].ntevs;
> 
> base-commit: 0808b3d5b7514dc856178dbc509929329bbf301d
> -- 
> 2.31.1
> 


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ