Add first set of memory probes.
[platform/upstream/glibc.git] / manual / probes.texi
1 @node Internal Probes
2 @c @node Internal Probes, , POSIX Threads, Top
3 @c %MENU% Probes to monitor libc internal behavior
4 @chapter Internal probes
5
6 In order to aid in debugging and monitoring internal behavior,
7 @theglibc{} exposes nearly-zero-overhead SystemTap probes marked with
8 the @code{libc} provider.
9
10 These probes are not part of the @glibcadj{} stable ABI, and they are
11 subject to change or removal across releases.  Our only promise with
12 regard to them is that, if we find a need to remove or modify the
13 arguments of a probe, the modified probe will have a different name, so
14 that program monitors relying on the old probe will not get unexpected
15 arguments.
16
17 @menu
18 * Memory Allocation Probes::  Probes in the memory allocation subsystem
19 @end menu
20
21 @node Memory Allocation Probes
22 @section Memory Allocation Probes
23
24 These probes are designed to signal relatively unusual situations within
25 the virtual memory subsystem of @theglibc{}.
26
27 @deftp Probe memory_arena_new (void *@var{$arg1}, size_t @var{$arg2})
28 This probe is triggered when @code{malloc} allocates and initializes an
29 additional arena (not the main arena), but before the arena is assigned
30 to the running thread or inserted into the internal linked list of
31 arenas.  The arena's @code{malloc_state} internal data structure is
32 located at @var{$arg1}, within a newly-allocated heap big enough to hold
33 at least @var{$arg2} bytes.
34 @end deftp
35
36 @deftp Probe memory_mallopt (int @var{$arg1}, int @var{$arg2})
37 This probe is triggered when function @code{mallopt} is called to change
38 @code{malloc} internal configuration parameters, before any change to
39 the parameters is made.  The arguments @var{$arg1} and @var{$arg2} are
40 the ones passed to the @code{mallopt} function.
41 @end deftp