lkml.org 
[lkml]   [2010]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: perf: relative path to source for perf probe?
From
On Thu, May 13, 2010 at 11:46 PM, Arnaldo Carvalho de Melo
<acme@ghostprotocols.net> wrote:
> IOW:
>
> real_path = user_provided_path + (DW_AT_name - DW_AT_comp_dir)
>
> + == concat
>
> - remove initial string
>
> if the project is build in place, i.e. in the kernel case, when one
> doesn't use 'make O='
>
> But then, given user_provided_path what we can do is to find a match
> from the end of DW_AT_name, thus infering the missing (non-existent in
> DWARF) DW_AT_source_dir tag :-)
>
>> In this case (after compiling kernel, user moved its source into another
>> directory), we have to find the top directory of this source code.
>>
>> Imagine that, if user compiled code under /home/user/git-ksrc/, and
>> it was moved under  /usr/src/2.6.x/, perf probe will be given an option
>> '-s /usr/src/2.6.x/'.
>
> So, for the DW_AT_name example above, we would have these files:
>
> At build time (DW_AT_name):
>
> /home/acme_unencrypted/git/linux-2.6-tip/arch/x86/kernel/head_64.S
>
> And at analysis time (using the path where the user moved all the source
> tree):
>
> /usr/src/2.6.x/arch/x86/kernel/head_64.S
>
> Putting then side by side:
>
> /home/acme_unencrypted/git/linux-2.6-tip/arch/x86/kernel/head_64.S
>                          /usr/src/2.6.x/arch/x86/kernel/head_64.S
>
> So know we know what DW_AT_source_dir is.
>
> Implementation is left to the reader 8-)

Thank you both for this discussion! I think I have enough information
to try to create an implementation. Now I just need to find the time
to do it :).

-- Chase
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-05-14 00:13    [W:0.857 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site