Are LIBC probes part of the ABI?
Carlos O'Donell
carlos@redhat.com
Fri Mar 23 19:01:00 GMT 2018
On 03/19/2018 10:40 AM, Wilco Dijkstra wrote:
> Hi,
>
> Various patches have recently removed LIBC probes. I couldn't find a script
> or similar that lists these in the binary. Are probes created dynamically and
> therefore removing a probe is no different from not executing one?
>
> Some malloc improvements were backported in November. This included
> removal of a few probes, so I think the answer is yes, but I'd like to be sure.
(1) How do you list probes?
You can use systemtap to list the "mark" (probe) points.
https://sourceware.org/systemtap/langref/Probe_points.html#SECTION00055800000000000000
stap -L 'process("/lib64/libc.so.6").mark("*")'
stap -L 'process("/lib64/ld-linux-x86-64.so.2").mark("*")'
(2) Are probes created dynamically?
The instrumentation is indeed dynamic, it uses the kernel kprobes/uprobes infrastructure.
The probe is nop space in the binary with additional markup in .note.stapsdt section, but
it also impacts how the compiler is allowed to manipulate arguments passed to the probe
since they have to be available for the probe to access them.
(3) Is removing a probe no different from executing it?
Yes and no. Removing the probe means it is no longer in the list of known probes, and
therefore slightly different from the probe not executing. Semantically though from the
perspective of a running trace script it will appear as if the probe is never triggered
because it doesn't exist.
(4) Is a probe part of the ABI?
stap probes are *not* part of the ABI.
Please see:
https://www.gnu.org/software/libc/manual/html_node/Internal-Probes.html#Internal-Probes
~~~
These probes are not part of the GNU C Library stable ABI, and they are subject to change or removal across releases. Our only promise with regard to them is that, if we find a need to remove or modify the arguments of a probe, the modified probe will have a different name, so that program monitors relying on the old probe will not get unexpected arguments.
~~~
In practice the loader probes are very important to gdb's scalable DSO scanning.
(5) New and removed probes should be documented!
See the manual/probes.texi. We should maintain an accurate list of probes.
Does that answer your question?
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list