Internal probes
***************

In order to aid in debugging and monitoring internal behavior, theglibc exposes nearly-zero-overhead SystemTap probes marked with the libc provider.

These probes are not part of the glibcadj 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.

Memory Allocation Probes
========================

These probes are designed to signal relatively unusual situations within the virtual memory subsystem of theglibc.

 -- Probe: memory_sbrk_more (void *$ARG1, size_t $ARG2)
     This probe is triggered after the main arena is extended by calling sbrk.  Argument $ARG1 is the additional size requested to sbrk, and $ARG2 is the pointer that marks the end of the sbrk area, returned in response to the request.

 -- Probe: memory_sbrk_less (void *$ARG1, size_t $ARG2)
     This probe is triggered after the size of the main arena is decreased by calling sbrk.  Argument $ARG1 is the size released by sbrk (the positive value, rather than the negative value passed to sbrk), and $ARG2 is the pointer that marks the end of the sbrk area, returned in response to the request.

 -- Probe: memory_heap_new (void *$ARG1, size_t $ARG2)
     This probe is triggered after a new heap is mmaped.  Argument $ARG1 is a pointer to the base of the memory area, where the heap_info data structure is held, and $ARG2 is the size of the heap.

 -- Probe: memory_heap_free (void *$ARG1, size_t $ARG2)
     This probe is triggered before (unlike the other sbrk and heap probes) a heap is completely removed via munmap.  Argument $ARG1 is a pointer to the heap, and $ARG2 is the size of the heap.

 -- Probe: memory_heap_more (void *$ARG1, size_t $ARG2)
     This probe is triggered after a trailing portion of an mmaped heap is extended.  Argument $ARG1 is a pointer to the heap, and $ARG2 is the new size of the heap.

 -- Probe: memory_heap_less (void *$ARG1, size_t $ARG2)
     This probe is triggered after a trailing portion of an mmaped heap is released.  Argument $ARG1 is a pointer to the heap, and $ARG2 is the new size of the heap.

 -- Probe: memory_malloc_retry (size_t $ARG1)
 -- Probe: memory_realloc_retry (size_t $ARG1, void *$ARG2)
 -- Probe: memory_memalign_retry (size_t $ARG1, size_t $ARG2)
 -- Probe: memory_calloc_retry (size_t $ARG1)
     These probes are triggered when the corresponding functions fail to obtain the requested amount of memory from the arena in use, before they call arena_get_retry to select an alternate arena in which to retry the allocation.  Argument $ARG1 is the amount of memory requested by the user; in the calloc case, that is the total size computed from both function arguments.  In the realloc case, $ARG2 is the pointer to the memory area being resized.  In the memalign case, $ARG2 is the alignment to be used for the request, which may be stricter than the value passed to the memalign function.  A memalign probe is also used by functions posix_memalign, valloc and pvalloc.

     Note that the argument order does not match that of the corresponding two-argument functions, so that in all of these probes the user-requested allocation size is in $ARG1.

 -- Probe: memory_arena_retry (size_t $ARG1, void *$ARG2)
     This probe is triggered within arena_get_retry (the function called to select the alternate arena in which to retry an allocation that failed on the first attempt), before the selection of an alternate arena.  This probe is redundant, but much easier to use when it's not important to determine which of the various memory allocation functions is failing to allocate on the first try.  Argument $ARG1 is the same as in the function-specific probes, except for extra room for padding introduced by functions that have to ensure stricter alignment. Argument $ARG2 is the arena in which allocation failed.

 -- Probe: memory_arena_new (void *$ARG1, size_t $ARG2)
     This probe is triggered when malloc allocates and initializes an additional arena (not the main arena), but before the arena is assigned to the running thread or inserted into the internal linked list of arenas.  The arena's malloc_state internal data structure is located at $ARG1, within a newly-allocated heap big enough to hold at least $ARG2 bytes.

 -- Probe: memory_arena_reuse (void *$ARG1, void *$ARG2)
     This probe is triggered when malloc has just selected an existing arena to reuse, and (temporarily) reserved it for exclusive use. Argument $ARG1 is a pointer to the newly-selected arena, and $ARG2 is a pointer to the arena previously used by that thread.

     This occurs within reused_arena, right after the mutex mentioned in probe memory_arena_reuse_wait is acquired; argument $ARG1 will point to the same arena.  In this configuration, this will usually only occur once per thread.  The exception is when a thread first selected the main arena, but a subsequent allocation from it fails: then, and only then, may we switch to another arena to retry that allocation, and for further allocations within that thread.

 -- Probe: memory_arena_reuse_wait (void *$ARG1, void *$ARG2, void *$ARG3)
     This probe is triggered when malloc is about to wait for an arena to become available for reuse.  Argument $ARG1 holds a pointer to the mutex the thread is going to wait on, $ARG2 is a pointer to a newly-chosen arena to be reused, and $ARG3 is a pointer to the arena previously used by that thread.

     This occurs within reused_arena, when a thread first tries to allocate memory or needs a retry after a failure to allocate from the main arena, there isn't any free arena, the maximum number of arenas has been reached, and an existing arena was chosen for reuse, but its mutex could not be immediately acquired.  The mutex in $ARG1 is the mutex of the selected arena.

 -- Probe: memory_arena_reuse_free_list (void *$ARG1)
     This probe is triggered when malloc has chosen an arena that is in the free list for use by a thread, within the get_free_list function.  The argument $ARG1 holds a pointer to the selected arena.

 -- Probe: memory_mallopt (int $ARG1, int $ARG2)
     This probe is triggered when function mallopt is called to change malloc internal configuration parameters, before any change to the parameters is made.  The arguments $ARG1 and $ARG2 are the ones passed to the mallopt function.

 -- Probe: memory_mallopt_mxfast (int $ARG1, int $ARG2)
     This probe is triggered shortly after the memory_mallopt probe, when the parameter to be changed is M_MXFAST, and the requested value is in an acceptable range.  Argument $ARG1 is the requested value, and $ARG2 is the previous value of this malloc parameter.

 -- Probe: memory_mallopt_trim_threshold (int $ARG1, int $ARG2, int $ARG3)
     This probe is triggered shortly after the memory_mallopt probe, when the parameter to be changed is M_TRIM_THRESHOLD.  Argument $ARG1 is the requested value, $ARG2 is the previous value of this malloc parameter, and $ARG3 is nonzero if dynamic threshold adjustment was already disabled.

 -- Probe: memory_mallopt_top_pad (int $ARG1, int $ARG2, int $ARG3)
     This probe is triggered shortly after the memory_mallopt probe, when the parameter to be changed is M_TOP_PAD.  Argument $ARG1 is the requested value, $ARG2 is the previous value of this malloc parameter, and $ARG3 is nonzero if dynamic threshold adjustment was already disabled.

 -- Probe: memory_mallopt_mmap_threshold (int $ARG1, int $ARG2, int $ARG3)
     This probe is triggered shortly after the memory_mallopt probe, when the parameter to be changed is M_MMAP_THRESHOLD, and the requested value is in an acceptable range.  Argument $ARG1 is the requested value, $ARG2 is the previous value of this malloc parameter, and $ARG3 is nonzero if dynamic threshold adjustment was already disabled.

 -- Probe: memory_mallopt_mmap_max (int $ARG1, int $ARG2, int $ARG3)
     This probe is triggered shortly after the memory_mallopt probe, when the parameter to be changed is M_MMAP_MAX.  Argument $ARG1 is the requested value, $ARG2 is the previous value of this malloc parameter, and $ARG3 is nonzero if dynamic threshold adjustment was already disabled.

 -- Probe: memory_mallopt_perturb (int $ARG1, int $ARG2)
     This probe is triggered shortly after the memory_mallopt probe, when the parameter to be changed is M_PERTURB.  Argument $ARG1 is the requested value, and $ARG2 is the previous value of this malloc parameter.

 -- Probe: memory_mallopt_arena_test (int $ARG1, int $ARG2)
     This probe is triggered shortly after the memory_mallopt probe, when the parameter to be changed is M_ARENA_TEST, and the requested value is in an acceptable range.  Argument $ARG1 is the requested value, and $ARG2 is the previous value of this malloc parameter.

 -- Probe: memory_mallopt_arena_max (int $ARG1, int $ARG2)
     This probe is triggered shortly after the memory_mallopt probe, when the parameter to be changed is M_ARENA_MAX, and the requested value is in an acceptable range.  Argument $ARG1 is the requested value, and $ARG2 is the previous value of this malloc parameter.

 -- Probe: memory_mallopt_free_dyn_thresholds (int $ARG1, int $ARG2)
     This probe is triggered when function free decides to adjust the dynamic brk/mmap thresholds.  Argument $ARG1 and $ARG2 are the adjusted mmap and trim thresholds, respectively.

 -- Probe: memory_tunable_tcache_max_bytes (int $ARG1, int $ARG2)
     This probe is triggered when the glibc.malloc.tcache_max tunable is set.  Argument $ARG1 is the requested value, and $ARG2 is the previous value of this tunable.

 -- Probe: memory_tunable_tcache_count (int $ARG1, int $ARG2)
     This probe is triggered when the glibc.malloc.tcache_count tunable is set.  Argument $ARG1 is the requested value, and $ARG2 is the previous value of this tunable.

 -- Probe: memory_tunable_tcache_unsorted_limit (int $ARG1, int $ARG2)
     This probe is triggered when the glibc.malloc.tcache_unsorted_limit tunable is set.  Argument $ARG1 is the requested value, and $ARG2 is the previous value of this tunable.

 -- Probe: memory_tcache_double_free (void *$ARG1, int $ARG2)
     This probe is triggered when free determines that the memory being freed has probably already been freed, and resides in the per-thread cache.  Note that there is an extremely unlikely chance that this probe will trigger due to random payload data remaining in the allocated memory matching the key used to detect double frees. This probe actually indicates that an expensive linear search of the tcache, looking for a double free, has happened.  Argument $ARG1 is the memory location as passed to free, Argument $ARG2 is the tcache bin it resides in.

Mathematical Function Probes
============================

Some mathematical functions fall back to multiple precision arithmetic for some inputs to get last bit precision for their return values.  This multiple precision fallback is much slower than the default algorithms and may have a significant impact on application performance.  The systemtap probe markers described in this section may help you determine if your application calls mathematical functions with inputs that may result in multiple-precision arithmetic.

Unless explicitly mentioned otherwise, a precision of 1 implies 24 bits of precision in the mantissa of the multiple precision number.  Hence, a precision level of 32 implies 768 bits of precision in the mantissa.

 -- Probe: slowatan2 (int $ARG1, double $ARG2, double $ARG3, double $ARG4)
     This probe is triggered when the atan2 function is called with an input that results in multiple precision computation.  Argument $ARG1 is the precision with which computation succeeded. Arguments $ARG2 and $ARG3 are inputs to the atan2 function and $ARG4 is the computed result.

 -- Probe: slowatan2_inexact (int $ARG1, double $ARG2, double $ARG3, double $ARG4)
     This probe is triggered when the atan function is called with an input that results in multiple precision computation and none of the multiple precision computations result in an accurate result. Argument $ARG1 is the maximum precision with which computations were performed.  Arguments $ARG2 and $ARG3 are inputs to the atan2 function and $ARG4 is the computed result.

 -- Probe: slowatan (int $ARG1, double $ARG2, double $ARG3)
     This probe is triggered when the atan function is called with an input that results in multiple precision computation.  Argument $ARG1 is the precision with which computation succeeded. Argument $ARG2 is the input to the atan function and $ARG3 is the computed result.

 -- Probe: slowatan_inexact (int $ARG1, double $ARG2, double $ARG3)
     This probe is triggered when the atan function is called with an input that results in multiple precision computation and none of the multiple precision computations result in an accurate result. Argument $ARG1 is the maximum precision with which computations were performed.  Argument $ARG2 is the input to the atan function and $ARG3 is the computed result.

 -- Probe: slowtan (double $ARG1, double $ARG2)
     This probe is triggered when the tan function is called with an input that results in multiple precision computation with precision 32.  Argument $ARG1 is the input to the function and $ARG2 is the computed result.

 -- Probe: slowasin (double $ARG1, double $ARG2)
     This probe is triggered when the asin function is called with an input that results in multiple precision computation with precision 32.  Argument $ARG1 is the input to the function and $ARG2 is the computed result.

 -- Probe: slowacos (double $ARG1, double $ARG2)
     This probe is triggered when the acos function is called with an input that results in multiple precision computation with precision 32.  Argument $ARG1 is the input to the function and $ARG2 is the computed result.

 -- Probe: slowsin (double $ARG1, double $ARG2)
     This probe is triggered when the sin function is called with an input that results in multiple precision computation with precision 32.  Argument $ARG1 is the input to the function and $ARG2 is the computed result.

 -- Probe: slowcos (double $ARG1, double $ARG2)
     This probe is triggered when the cos function is called with an input that results in multiple precision computation with precision 32.  Argument $ARG1 is the input to the function and $ARG2 is the computed result.

 -- Probe: slowsin_dx (double $ARG1, double $ARG2, double $ARG3)
     This probe is triggered when the sin function is called with an input that results in multiple precision computation with precision 32.  Argument $ARG1 is the input to the function, $ARG2 is the error bound of $ARG1 and $ARG3 is the computed result.

 -- Probe: slowcos_dx (double $ARG1, double $ARG2, double $ARG3)
     This probe is triggered when the cos function is called with an input that results in multiple precision computation with precision 32.  Argument $ARG1 is the input to the function, $ARG2 is the error bound of $ARG1 and $ARG3 is the computed result.

Non-local Goto Probes
=====================

These probes are used to signal calls to setjmp, sigsetjmp, longjmp or siglongjmp.

 -- Probe: setjmp (void *$ARG1, int $ARG2, void *$ARG3)
     This probe is triggered whenever setjmp or sigsetjmp is called.  Argument $ARG1 is a pointer to the jmp_buf passed as the first argument of setjmp or sigsetjmp, $ARG2 is the second argument of sigsetjmp or zero if this is a call to setjmp and $ARG3 is a pointer to the return address that will be stored in the jmp_buf.

 -- Probe: longjmp (void *$ARG1, int $ARG2, void *$ARG3)
     This probe is triggered whenever longjmp or siglongjmp is called.  Argument $ARG1 is a pointer to the jmp_buf passed as the first argument of longjmp or siglongjmp, $ARG2 is the return value passed as the second argument of longjmp or siglongjmp and $ARG3 is a pointer to the return address longjmp or siglongjmp will return to.

     The longjmp probe is triggered at a point where the registers have not yet been restored to the values in the jmp_buf and unwinding will show a call stack including the caller of longjmp or siglongjmp.

 -- Probe: longjmp_target (void *$ARG1, int $ARG2, void *$ARG3)
     This probe is triggered under the same conditions and with the same arguments as the longjmp probe.

     The longjmp_target probe is triggered at a point where the registers have been restored to the values in the jmp_buf and unwinding will show a call stack including the caller of setjmp or sigsetjmp.