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]
Date:	Sun, 26 Dec 2010 23:30:23 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Franck Bui-Huu <vagabon.xyz@...il.com>
Cc:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	linux-kernel@...r.kernel.org, 2nddept-manager@....hitachi.co.jp
Subject: Re: [PATCH] perf-probe: fix perf-probe(1)'s report

(2010/12/24 0:04), Franck Bui-Huu wrote:
> From: Franck Bui-Huu <fbuihuu@...il.com>
> 
> After adding probes, perf-probe(1) reports the probes locations which
> include filenames for certain cases.
> 
> But for short file names (whose length < 32), perf-probe didn't display
> the name correctly. It actually skipped the first character.
> 
> Here's an example where 'icmp.c' was screwed:
> 
>    $ perf probe -n -a "icmp.c;sk=*"
>    Add new events:
>      probe:icmp_push_reply (on @cmp.c)
>      probe:icmp_reply     (on @cmp.c)
>      probe:icmp_reply_1   (on @cmp.c)
>      probe:icmp_send      (on @cmp.c)
>      probe:icmp_send_1    (on @cmp.c)
>      probe:icmp_error     (on @cmp.c)
>      probe:icmp_error_1   (on @cmp.c)
>      probe:icmp_error_2   (on @cmp.c)
>      probe:icmp_error_3   (on @cmp.c)
> 
> This patch fixes this bug in synthesize_perf_probe_point().

Oops, I've missed that.
Thanks! that's really good catch!

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>

> 
> Signed-off-by: Franck Bui-Huu <fbuihuu@...il.com>
> ---
>  tools/perf/util/probe-event.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 10ad1ad..adc2620 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -1077,13 +1077,13 @@ static char *synthesize_perf_probe_point(struct perf_probe_point *pp)
>  			goto error;
>  	}
>  	if (pp->file) {
> -		len = strlen(pp->file) - 31;
> -		if (len < 0)
> -			len = 0;
> -		tmp = strchr(pp->file + len, '/');
> -		if (!tmp)
> -			tmp = pp->file + len;
> -		ret = e_snprintf(file, 32, "@%s", tmp + 1);
> +		tmp = pp->file;
> +		len = strlen(tmp);
> +		if (len > 30) {
> +			tmp = strchr(pp->file + len - 30, '/');
> +			tmp = tmp ? tmp + 1 : pp->file + len - 30;
> +		}
> +		ret = e_snprintf(file, 32, "@%s", tmp);
>  		if (ret <= 0)
>  			goto error;
>  	}
> @@ -1099,7 +1099,7 @@ static char *synthesize_perf_probe_point(struct perf_probe_point *pp)
>  
>  	return buf;
>  error:
> -	pr_debug("Failed to synthesize perf probe point: %s",
> +	pr_debug("Failed to synthesize perf probe point: %s\n",
>  		 strerror(-ret));
>  	if (buf)
>  		free(buf);


-- 
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@...achi.com
--
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