[英]How does LIBC_PROBE macro actually work in Glibc?
我试图了解mallopt()
在 glibc 中的工作原理,但无法理解函数mallopt()
使用的LIBC_PROBE
宏的使用。 LIBC_PROBE
的定义是创建另一个宏LIBC_PROBE_1
并且它再次创建另一个STAP_PROBE##n
。 在mallopt()
情况下,它是STAP_PROBE3(a1, a2, a3)
。 在此之后,不知道STAP_PROBE3
将如何工作?
源文件: https : //github.com/lattera/glibc/blob/master/malloc/malloc.c (行:5141)。
来自include/stap-probe.h
:
Without USE_STAP_PROBE, that does nothing but evaluates all
its arguments (to prevent bit rot, unlike e.g. assert).
Systemtap's header defines the macros STAP_PROBE (provider, name) and
STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste
in MODULE_NAME (libc, libpthread, etc.) automagically.
The format of the arg parameters is discussed here:
https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
The precise details of how register names are specified is
architecture specific and can be found in the gdb and SystemTap
source code. */
所以:
malloopt()
工作原理并不重要。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.