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: PR10000: emit _stp_relocate* calculations correctly for kernel/module global $data (Was: [SCM] systemtap: system-wide probe/trace tool branch, master, updated. release-0.9-238-g432f054)


> So at runtime we have an address and we want to know which
> module/section it is part of so we can lookup the correct symbol or
> unwind table we need to use. We do that by looking through our
> module/section list and check that the address we have falls between the
> start of the module/section (at runtime) and the end (for which we need
> to know the size of the section).

You need to know the runtime set of addresses that fall within each module.
For that you don't need section sizes per se.  You need an address->module
mapping at runtime that works for what runtime modules really are.

For non-ET_REL, modules are contiguous.  (Even if we really supported
discontiguous modules, you just need to know the PT_LOAD set, which is easy
to find at runtime and was so found already in doing the loading.  i.e.,
it is the same as the file mapping tracking you used to decide this was the
module to probe, etc.)

For ET_REL, there isn't a universal meaningful kind of thing, so we are
just talking about the specifics of the runtime ET_REL loader you are
working with, i.e. Linux kernel modules.  Linux kernel modules are loaded
in two chunks, whose bounds are handy in the 'struct module': one at
module_core for core_size bytes; the other at module_init for init_size
bytes (which are cleared after the load-time initializer has run).


Thanks,
Roland


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