Sources Bugzilla – Bug 10139
.probes section disappears into debuginfo
Last modified: 2009-05-14 17:19:51 UTC
When building packages with separate .debuginfo dwarf files the .probes section goes into the .debug file. Systemtap wasn't searching there for .probes. This wasn't immediately apparent since if no .probes section is found the fallback to use labels is used but is a lot slower (and does sometimes not work because the label disappeared in an optimization). I fixed the searching for the .probes section with: commit 5896cd059949413cf56678d7a7fa6c0788f576b5 Author: Mark Wielaard <mjw@redhat.com> Date: Sun May 10 20:24:40 2009 +0200 Get .probes section through dwarf debuginfo file if necessary. * tapsets.cxx (dwarf_builder::build): Add some comments, verbose log messages and get Elf through dwarf_getelf if it exists before searching for .probes section. This makes current packages build with systemtap sdt.h probes work even if they end up with the .probes section in the .debug file. But it would be better if the .probes section stayed in the main elf file. The debuginfo is still needed for probes that need arguments of course, but simple probes based on markers would work otherwise if they don't need arguments.
We now mark the .probes section as SHF_ALLOC and we search in both dwarf and main elf files for a .probes section in case we hit on a binary build against an older sdt.h commit 01a419e428f33d115a72fa8eac1d808825d2cae5 Author: Mark Wielaard <mjw@redhat.com> Date: Thu May 14 19:07:10 2009 +0200 PR10139 Mark .probes section SHF_ALLOC. * includes/sys/sdt.h (STAP_PROBE_DATA_): Mark .probes section SHF_ALLOC. * tapsets.cxx (dwarf_builder::build): Search in either dwarf or main elf file for .probes section. Side note. We cannot easily make this a non-allocated SHT_NOTE. Those are kept by stripping, but possibly not in all old tools (binutils strip from some years ago). And SHT_NOTE means it's an ELF note, which has a standard header layout if you don't use that format, all the normal ELF tools will tell you that there is a corrupt section. So we would have to change the format of the section in that case.