Messages in this thread | | | Date | Fri, 14 May 2010 00:10:10 +0200 | Subject | Re: perf: relative path to source for perf probe? | From | Chase Douglas <> |
| |
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/
| |