public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Masami Hiramatsu <mhiramat@redhat.com>,
	Mike Galbraith <efault@gmx.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 1/1] perf symbols: Allow lookups by symbol name too
Date: Mon, 14 Dec 2009 12:21:34 +0100	[thread overview]
Message-ID: <20091214112132.GD5168@nowhere> (raw)
In-Reply-To: <1260564622-12392-1-git-send-email-acme@infradead.org>

On Fri, Dec 11, 2009 at 06:50:22PM -0200, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.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 :)


  reply	other threads:[~2009-12-14 11:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-11 20:50 [PATCH 1/1] perf symbols: Allow lookups by symbol name too Arnaldo Carvalho de Melo
2009-12-14 11:21 ` Frederic Weisbecker [this message]
     [not found] ` <tip-79406cd789f745ac6aa9d597895f904a98a14007@git.kernel.org>
2009-12-15  2:12   ` [tip:perf/urgent] " Frederic Weisbecker
2009-12-15  2:20     ` Arnaldo Carvalho de Melo
2009-12-15  2:32       ` Frederic Weisbecker
2009-12-15  2:44         ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091214112132.GD5168@nowhere \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox