[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100113133952.GD2934@ghostprotocols.net>
Date: Wed, 13 Jan 2010 11:39:52 -0200
From: Arnaldo Carvalho de Melo <acme@...radead.org>
To: Kirill Smelkov <kirr@...dau.phys.spbu.ru>
Cc: Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
Mike Galbraith <efault@....de>,
Masami Hiramatsu <mhiramat@...hat.com>
Subject: Re: [PATCH 1/6] perf top: teach it to autolocate vmlinux
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@...dau.phys.spbu.ru>
> Cc: Mike Galbraith <efault@....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
--
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