Re: [PATCH v2 2/2] perf uprobe: Skip prologue if program compiled without optimization

From: Masami Hiramatsu
Date: Fri Aug 26 2016 - 20:35:54 EST


On Fri, 26 Aug 2016 16:54:52 -0300
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:

> Em Fri, Aug 26, 2016 at 04:30:27PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Wed, Aug 03, 2016 at 02:28:45PM +0530, Ravi Bangoria escreveu:
> > > +++ b/tools/perf/util/probe-finder.c
> > > @@ -892,6 +892,169 @@ static int find_probe_point_lazy(Dwarf_Die *sp_die, struct probe_finder *pf)
> > > return die_walk_lines(sp_die, probe_point_lazy_walker, pf);
> > > }
> >
> > > +static bool var_has_loclist(Dwarf_Die *die)
> >
> > So, the variable 'die' cause the build to fail in multiple systems, I'm
> > renaming it to 'cu_die', there are some more problems when cross compiling it
> > to some arches, I'm trying to fix them all now:
>
> Fixed, please check:
>
> http://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/urgent&id=3866e3762da3291613dfb8b193885a8ed3836669

Hmm I think var_has_loclist(cu_die) should be vr_die(means Variable DIE) not
cu_die (Compile Unit DIE == object file itself) since user must pass the
DIE for local variable. And revisiting on the code, it seems this has several
generic dwarf related functions, which can be put into dwarf-aux.c/.h as
other APIs.
But anyway it is a trivial & cleanup thing.

At first we should fix this bug for helping users ASAP. So I'm OK.

Thank you!

--
Masami Hiramatsu <mhiramat@xxxxxxxxxx>