query: how does systemtap finds out the correct offsets of SDT markers

Hemant hkshaw@linux.vnet.ibm.com
Thu Sep 26 08:55:00 GMT 2013


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



More information about the Systemtap mailing list