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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOJsxLEhZ-+e=H+9O_wn0F_jTp-BJKLURz7=q1HMb_Nhg0gaWw@mail.gmail.com>
Date:	Sun, 10 Jul 2011 19:26:07 +0300
From:	Pekka Enberg <penberg@...nel.org>
To:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc:	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	linux-kernel@...r.kernel.org, yrl.pp-manager.tt@...achi.com,
	Masami Hiramatsu <masami.hiramatsu@...il.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [PATCH -tip 4/5] [BUGFIX] perf probe: Fix the order of searching
 scopes for variables

On Sun, Jul 10, 2011 at 3:08 PM, Masami Hiramatsu
<masami.hiramatsu.pt@...achi.com> wrote:
> Hi Pekka,
>
> (2011/07/10 20:05), Pekka Enberg wrote:
>> On Sun, Jul 10, 2011 at 1:00 PM, Masami Hiramatsu
>> <masami.hiramatsu.pt@...achi.com> wrote:
>>> Fix variable searching routine to search from inner scope
>>> to outer scope.
>>
>> Admittedly, I don't really know this code at all. However, the
>> changelog is somewhat vague. Why do we need this change? What problem
>> does it fix? Why does the order in which we iterate 'scopes' matter?
>
> Hmm, I see.
>
> Debuginfo expresses functions and nested inlined functions as
> DIE(Dwarf Information Entry) tree, and "scope" means each
> level of the DIE.
>
> Outer
> ^
> |
>  CU DIE [A](compile unit: it's an object file)
>   +-global variable DIEs
>   +-inline function declaration DIEs
>   +-function [B] DIE
>      +-local variable DIEs
>      +-inline function instance [C] DIE
>         +-inline local variable DIEs
>         +-(nested)inline function instance [D] DIE
>            +...
> |
> v
> Inner
>
> Imagine that if we are at [C],
>
> nscopes = dwarf_getscopes_die([C], &scopes)
>
> this returns scopes[] DIEs containing [C] DIE, and nscopes = 3
> On that array, scopes[0] is [C], scopes[1] is [B], and scopes[2]
> is [A].
>
> And, the below loop
>
>  while (nscopes-- > 1)
>        die_find_variable_at(&scopes[nscopes], ...
>
> starts to find variables from the outermost scope [A] and
> find a global variable first. This changes searching order
> from inner scope ([B]) to outer ([A]) to search global vars
> last.

Thanks for the explanation! What kind of problems does this cause for
'perf probe' users?
--
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