This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: interesting option of stap


Hello,

Hopefully I already digged some time ago in linker cmd file syntax and initcall stuff so I am not 100% lost ;-). Here are my findings:

- kernels mentioned are for example at git.linaro.org (ubuntu based) or gitorious.org/pandroid... But android.git.kernel.org is a good source too. I was using objdump -h on vmlinux when I stated that .note.gnu.build-id is at location 0. Same results than readelf I guess.
I don't find any use of NOTES in vmlinux.lds.S although vmlinux.lds.h mentions that minimal linker cmd file shall contain it.

- /sys/kernel/notes does not exist on these kernels. I found in all my kernels in .zImage.cmd "arm-linux-gnueabi-objcopy ... -R .note -R .note.gnu.build-id ... arch/arm/boot/compressed/vmlinux arch/arm/boot/zImage", -R being "Remove section xxx from the output". That could be why I don't see "notes" in the kernel.


Well, digging further, I simply read again the code and I found:
  /* Don't save build-id if it is located before _stext.
   * This probably means that build-id will not be loaded at all and
   * happens for example with ARM kernel.
   *
   * See also:
   *    http://sources.redhat.com/ml/systemtap/2009-q4/msg00574.html
   */
  if (build_id_len > 0 && (build_id_vaddr > base + extra_offset)) {


-> html page is about the same problem on an ARM kernel. And the "build_id_vaddr >" test comes from commit 66f65c4fb0ddcdf8a85a29662a23a546cfd5dffe in 2009-12-15.

Test was removed in commit 155bb07a5bfdd16b112870f7064f012970b7fbd9 in 2010-11-06 related to user modules. That's why I see the problem in v1.4 and why I don't have build_id_offset in stap-symbols.h in v1.3. I guess test shall be reintroduced for kernel modules.


Although that fixes the issue, I will still ask Linaro guys about this build-id section that is removed in arch/arm/Makefile flags.


Thanks for the help

Regards
Fred


Frederic Turgis
OMAP Platform Business Unit - OMAP System Engineering - Platform Enablement



Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920

-----Original Message-----

From: Roland McGrath [mailto:roland@redhat.com]
Sent: Wednesday, February 23, 2011 3:45 AM
To: Turgis, Frederic
Cc: William Cohen; systemtap@sourceware.org
Subject: RE: interesting option of stap

> I provided you with our Android kernel (arm architecture of course). I checked some other Android kernel, 1 ubuntu kernel and 1 Linaro OMAP kernel, they all have .note.gnu.build-id section at 0 !!
>
> I will have a look at upstream vmlinux.lds.S (and NOTES macro) vs ours.

I looked at git://android.git.kernel.org/kernel/common.git on a guess that it might be an approximate basis for the code you're talking about.

arch/arm/kernel/vmlinux.lds.S there indeed lacks any use of the NOTES macro.  I think the place it probably belongs is before the use of the RO_DATA macro.  I suspect that would make the build ID note come out correctly.  You can look at the output of (eu-)readelf -S on the resultant vmlinux file and that will indicate sufficiently for us to tell how it went.  If you get such a kernel running, you can also look at 'hexdump -C /sys/kernel/notes' to see if the notes got into the kernel properly so they can be interrogated at runtime (this is used by some other tools to locate the debuginfo that goes with the running kernel, though systemtap does not rely on this).


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]