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:	Mon, 14 Dec 2009 12:21:34 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Cc:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Masami Hiramatsu <mhiramat@...hat.com>,
	Mike Galbraith <efault@....de>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH 1/1] perf symbols: Allow lookups by symbol name too

On Fri, Dec 11, 2009 at 06:50:22PM -0200, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@...hat.com>
> 
> Configurable via symbol_conf.sort_by_name, so that the cost of an extra
> rb_node on all 'struct symbol' instances is not paid by tools that only
> want to decode addresses.
> 
> How to use it:
> 
> 	symbol_conf.sort_by_name = true;
> 	symbol_init(&symbol_conf);
> 
> 	struct map *map = map_groups__find_by_name(kmaps, MAP__VARIABLE, "[kernel.kallsyms]");
> 
> 	if (map == NULL) {
> 		pr_err("couldn't find map!\n");
> 		kernel_maps__fprintf(stdout);
> 	} else {
> 		struct symbol *sym = map__find_symbol_by_name(map, sym_filter, NULL);
> 		if (sym == NULL)
> 			pr_err("couldn't find symbol %s!\n", sym_filter);
> 		else
> 			pr_info("symbol %s: %#Lx-%#Lx \n", sym_filter, sym->start, sym->end);
> 	}
> 
> Looking over the vmlinux/kallsyms is common enough that I'll add a
> variable to the upcoming struct perf_session to avoid the need to use
> map_groups__find_by_name to get the main vmlinux/kallsyms map.
> 
> The above example looks on the 'variable' symtab, but it is just like
> that for the functions one.
> 
> Also the sort operation is done when we first use
> map__find_symbol_by_name, in a lazy way.



Thanks a lot. I'll give it a try soon :)

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