All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Mike Galbraith <efault@gmx.de>,
	Masami Hiramatsu <mhiramat@redhat.com>
Subject: Re: [PATCH 1/6] perf top: teach it to autolocate vmlinux
Date: Wed, 13 Jan 2010 11:39:52 -0200	[thread overview]
Message-ID: <20100113133952.GD2934@ghostprotocols.net> (raw)
In-Reply-To: <de6bae3b8d61ea3db1a797f31ebea6e3ed8c00a8.1262952612.git.kirr@landau.phys.spbu.ru>

Em Fri, Jan 08, 2010 at 03:23:04PM +0300, Kirill Smelkov escreveu:
> By relying on logic in dso__load_kernel_sym(), we can automatically load
> vmlinux.
> 
> The only thing which needs to be adjusted, is how --sym-annotate option
> is handled - now we can't rely on vmlinux been loaded until full
> successful pass of dso__load_vmlinux(), but that's not the case if we'll
> do sym_filter_entry setup in symbol_filter().
> 
> So move this step right after event__process_sample() where we know the
> whole dso__load_kernel_sym() pass is done.
> 
> By the way, though conceptually similar `perf top` still can't annotate
> userspace - see next patches with fixes.
> 
> Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> Cc: Mike Galbraith <efault@gmx.de>
> ---

<SNIP>

> @@ -951,6 +953,13 @@ static void event__process_sample(const event_t *self,
>  	    al.sym == NULL || al.filtered)
>  		return;
>  
> +	/* let's see, whether we need to install initial sym_filter_entry */
> +	if (sym_filter_entry_sched) {
> +		sym_filter_entry = sym_filter_entry_sched;
> +		sym_filter_entry_sched = NULL;
> +		parse_source(sym_filter_entry);
> +	}
> +

You're assuming that the first sample is for the kernel, right? It may
be not and then the vmlinux won't be loaded at this point.

I think that the right way is to force it to be loaded by calling:

	map__load(session->vmlinux_maps[MAP__FUNCTION], session, filter);

after perf_session__create_kernel_maps and before parse_source(), ok?

	You can even create a helper:

int perf_session__load_vmlinux(struct perf_session *self,
                               symbol_filter_t filter)
{
	return map__load(session->vmlinux_maps[MAP__FUNCTION],
			 session, filter);
}

	As this probably will be of interest for tools such as 'perf
probe', etc.

- Arnaldo

  reply	other threads:[~2010-01-13 13:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 12:23 [PATCH 0/6] perf tools: fix annotate and top->annotate + more Kirill Smelkov
2010-01-08 12:23 ` [PATCH 1/6] perf top: teach it to autolocate vmlinux Kirill Smelkov
2010-01-13 13:39   ` Arnaldo Carvalho de Melo [this message]
2010-01-17 16:59     ` Kirill Smelkov
2010-01-17 17:53       ` Arnaldo Carvalho de Melo
2010-01-08 12:23 ` [PATCH 2/6] perf top: align help text on keys Kirill Smelkov
2010-01-08 12:23 ` [PATCH 3/6] perf top: fix code typo in prompt_symbol() Kirill Smelkov
2010-01-13 13:47   ` Arnaldo Carvalho de Melo
2010-01-08 12:23 ` [PATCH 4/6] perf annotate: fix it for non-prelinked *.so Kirill Smelkov
2010-01-08 12:23 ` [PATCH 5/6] perf top: fix annotate for userspace Kirill Smelkov
2010-01-08 12:23 ` [PATCH 6/6] perf: fix few typos + cosmetics Kirill Smelkov
2010-01-13 13:41   ` 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=20100113133952.GD2934@ghostprotocols.net \
    --to=acme@infradead.org \
    --cc=efault@gmx.de \
    --cc=kirr@landau.phys.spbu.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.