From cb9881b4dd932b0d8e838f6e902ad6585ef57026 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Thu, 2 Jun 2016 01:21:52 +0000 Subject: [asan] add an interface function __sanitizer_print_memory_profile (a basic memory profiler; asan/Linux-only for now) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271463 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/sanitizer/common_interface_defs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/sanitizer') diff --git a/include/sanitizer/common_interface_defs.h b/include/sanitizer/common_interface_defs.h index 0cd6e9791..1bf3c1c96 100644 --- a/include/sanitizer/common_interface_defs.h +++ b/include/sanitizer/common_interface_defs.h @@ -133,6 +133,12 @@ extern "C" { const char *s2, size_t n, int result); void __sanitizer_weak_hook_strcmp(void *called_pc, const char *s1, const char *s2, int result); + + // Prints stack traces for all live heap allocations ordered by total + // allocation size until `top_percent` of total live heap is shown. + // `top_percent` should be between 1 and 100. + // Experimental feature currently available only with asan on Linux. + void __sanitizer_print_memory_profile(size_t top_percent); #ifdef __cplusplus } // extern "C" #endif -- cgit v1.2.3