This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
query: how does systemtap finds out the correct offsets of SDT markers
- From: Hemant <hkshaw at linux dot vnet dot ibm dot com>
- To: systemtap at sourceware dot org
- Date: Thu, 26 Sep 2013 14:25:28 +0530
- Subject: query: how does systemtap finds out the correct offsets of SDT markers
- Authentication-results: sourceware.org; auth=none
Hi
I have been trying to understand how systemtap probes on the SDT markers
and trying to implement this functionality in perf. But I am having
trouble to understand that how systemtap handles prelinking issue for
shared libraries. From what I got till now is :
base = address of .stapsdt.base section.
Then, address of the base section is retrieved from the sdt notes'
description in .note.stapsdt section stored in say, base_ref. Prelinking
might change the base address.
Then, base_ref is subtracted from base and added to pc (pc contains the
location of the sdt note).
pc += base - base_ref
My point in the .note.stapsdt section, the markers' location is stored
as an "offset". And since, we need to specify only the offset inside the
uprobe_events file in the tracing directory, why do we need to handle/do
all the calculations regarding these base addresses. Can the offset
change after prelinking? Or am I wrong and some other things are
happening here which I am unaware of? Can anybody just throw some pointers?
--
Thanks
Hemant