Skip to contentSkip to conversation

fix kallsyms to allow discrimination of local symbols

RFC Frank Ch. Eigler 1 participant 1 message Jul 24, 2008

lore
Share & tools
lore
#0 lore raw

Hi -

Quoted 8 lines · Theodore Tso
Quoted 3 lines

I also proposed a compromise where systemtap would use the symbol+offset interface, but choose a single convenient symbol as base for all probes in a particular elf file (/section).

I guess I don't see the value of that over just using the address directly. James' point wasn't just to use the symbol+offset feature just for the sake of using it, but rather as a better way of specifying how to insert a probe into a kernel.

Right, I understand that this is the theory, but I believe the difference between symbol+offset vs. _stext+offset vs. absolute-address is almost entirely aesthetic rather than functional.

Quoted 4 lines

For example, it may be that by allowing the kernel to have a bit more semantic knowledge of where a probe is going, it could more easily do various safety-related checks that can't be done if all it is given is a raw address.

This is unlikely to be the case. The kernel can map from addresses to symbols internally on demand, should such extra safety checks come into existence. It can already check for __kprobes marked-ness, regardless of the API.

Quoted 10 lines
Quoted 6 lines

As a quality-of-implementation matter, systemtap checks at translation time that such probes make sense -- that "ext4_fill_super" even exists. (That is needed also to expand wildcards.) The only way it can do that is if it has dwarf or separate textual symbol table data (see above). Both of those carry addresses as well, so we might as well use them.

True, though I'll note for modern kernels, with /proc/kallsyms, we should hopefully be able to do this (offset=0 probes) without DWARF headers. [...]

Yes, that's what I was referring to ("... or separate textual symbol table"). Note that this table contains addresses too.

Quoted 3 lines

BTW, one of the things which I have wondered is whether DWARF was really the right approach after all, given how bloated and space-inefficient it seems to be. [...]

Yeah, it is probably the main source of pain in using systemtap at its fullest.

Quoted 4 lines

[...] So there is a big difference between "please do X, Y, and Z first and the patch would then be acceptable" versus "for reasons A, B and C this patch is totally unacceptable and in fact what you are trying to do is pointless".

I am sorry for my part in lowering the tone of the discussion. We will work out how to put James' patch in, with backward-compatiblity extensions.

- FChE