public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Are LIBC probes part of the ABI?
@ 2018-03-19 15:40 Wilco Dijkstra
  2018-03-23 19:01 ` Carlos O'Donell
  0 siblings, 1 reply; 2+ messages in thread
From: Wilco Dijkstra @ 2018-03-19 15:40 UTC (permalink / raw)
  To: libc-alpha; +Cc: nd

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.

Wilco 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Are LIBC probes part of the ABI?
  2018-03-19 15:40 Are LIBC probes part of the ABI? Wilco Dijkstra
@ 2018-03-23 19:01 ` Carlos O'Donell
  0 siblings, 0 replies; 2+ messages in thread
From: Carlos O'Donell @ 2018-03-23 19:01 UTC (permalink / raw)
  To: Wilco Dijkstra, libc-alpha; +Cc: nd

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-23 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 15:40 Are LIBC probes part of the ABI? Wilco Dijkstra
2018-03-23 19:01 ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).