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] [day] [month] [year] [list]
Date:	Wed, 18 Sep 2013 15:34:00 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Namhyung Kim <namhyung@...nel.org>,
	Waiman Long <Waiman.Long@...com>,
	Stephane Eranian <eranian@...gle.com>,
	Jiri Olsa <jolsa@...hat.com>, David Ahern <dsahern@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] perf: Support for Openembedded/Yocto -dbg packages


* Ricardo Ribalda Delgado <ricardo.ribalda@...il.com> wrote:

> On OpenEmbedded the symbol files are located under a .debug folder on
> the same folder as the binary file.
> 
> This patch adds support for such files.
> 
> Without this patch on perf top you can see:
> 
> no symbols found in /usr/lib/gstreamer-1.0/libtheoraenc.so.1.1.2, maybe install
> a debug package?
> 
> 84.56%  libtheoraenc.so.1.1.2       [.] 0x000000000000b346
> 
> With this patch symbols are shown:
> 
> 19.06%  libtheoraenc.so.1.1.2       [.] oc_int_frag_satd_thresh_mmxext
> 9.76%   libtheoraenc.so.1.1.2       [.] oc_analyze_mb_mode_luma
> 5.58%   libtheoraenc.so.1.1.2       [.] oc_qii_state_advance
> 4.84%   libtheoraenc.so.1.1.2       [.] oc_enc_tokenize_ac
> ...

Nice! Two nits are remaining:

> @@ -64,6 +65,21 @@ int dso__binary_type_file(struct dso *dso, enum dso_binary_type type,
>  			 symbol_conf.symfs, dso->long_name);
>  		break;
>  
> +	case DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO:{

I think you missed the review feedback I gave for this line in the 
previous mail.

> +		char *last_slash;
> +
> +		last_slash = dso->long_name + dso->long_name_len;
> +		while (last_slash != dso->long_name && *last_slash != '/')
> +			last_slash--;
> +
> +		size -= snprintf(file, MIN(size, strlen(symbol_conf.symfs) +
> +				(last_slash - dso->long_name) + 2), "%s%s",
> +				symbol_conf.symfs, dso->long_name);
> +		snprintf(file + strlen(file), size, ".debug%s",
> +				last_slash);
> +		break;
> +	}

The 'MIN' still looks superfluous (btw., we use min()) - why not simply 
set 'size' to the correct value when you set and iterate last_slash?

(and scnprintf() should be used, as Arnaldo suggested.)

Thanks,

	Ingo
--
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