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]

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


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


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