From 322dea08387167e3c3a9c9b60325ebafa264bd77 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Fri, 20 Sep 2013 11:10:56 -0300 Subject: Add malloc probes for sbrk and heap resizing. for ChangeLog * malloc/arena.c (new_heap): New memory_heap_new probe. (grow_heap): New memory_heap_more probe. (shrink_heap): New memory_heap_less probe. (heap_trim): New memory_heap_free probe. * malloc/malloc.c (sysmalloc): New memory_sbrk_more probe. (systrim): New memory_sbrk_less probe. * manual/probes.texi: Document them. --- manual/probes.texi | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'manual') diff --git a/manual/probes.texi b/manual/probes.texi index 696525da48..1a45c69b91 100644 --- a/manual/probes.texi +++ b/manual/probes.texi @@ -26,6 +26,47 @@ the virtual memory subsystem of @theglibc{}. The location and the availability of some probes depend on whether per-thread arenas are enabled (the default) or disabled at the time @theglibc{} is compiled. +@deftp Probe memory_sbrk_more (void *@var{$arg1}, size_t @var{$arg2}) +This probe is triggered after the main arena is extended by calling +@code{sbrk}. Argument @var{$arg1} is the additional size requested to +@code{sbrk}, and @var{$arg2} is the pointer that marks the end of the +@code{sbrk} area, returned in response to the request. +@end deftp + +@deftp Probe memory_sbrk_less (void *@var{$arg1}, size_t @var{$arg2}) +This probe is triggered after the size of the main arena is decreased by +calling @code{sbrk}. Argument @var{$arg1} is the size released by +@code{sbrk} (the positive value, rather than the negative value passed +to @code{sbrk}), and @var{$arg2} is the pointer that marks the end of +the @code{sbrk} area, returned in response to the request. +@end deftp + +@deftp Probe memory_heap_new (void *@var{$arg1}, size_t @var{$arg2}) +This probe is triggered after a new heap is @code{mmap}ed. Argument +@var{$arg1} is a pointer to the base of the memory area, where the +@code{heap_info} data structure is held, and @var{$arg2} is the size of +the heap. +@end deftp + +@deftp Probe memory_heap_free (void *@var{$arg1}, size_t @var{$arg2}) +This probe is triggered @emph{before} (unlike the other sbrk and heap +probes) a heap is completely removed via @code{munmap}. Argument +@var{$arg1} is a pointer to the heap, and @var{$arg2} is the size of the +heap. +@end deftp + +@deftp Probe memory_heap_more (void *@var{$arg1}, size_t @var{$arg2}) +This probe is triggered after a trailing portion of an @code{mmap}ed +heap is extended. Argument @var{$arg1} is a pointer to the heap, and +@var{$arg2} is the new size of the heap. +@end deftp + +@deftp Probe memory_heap_less (void *@var{$arg1}, size_t @var{$arg2}) +This probe is triggered after a trailing portion of an @code{mmap}ed +heap is released. Argument @var{$arg1} is a pointer to the heap, and +@var{$arg2} is the new size of the heap. +@end deftp + @deftp Probe memory_malloc_retry (size_t @var{$arg1}) @deftpx Probe memory_realloc_retry (size_t @var{$arg1}, void *@var{$arg2}) @deftpx Probe memory_memalign_retry (size_t @var{$arg1}, size_t @var{$arg2}) -- cgit 1.4.1