diff options
author | csilvers <csilvers@6b5cf1ce-ec42-a296-1ba9-69fdba395a50> | 2011-10-18 20:57:45 +0000 |
---|---|---|
committer | csilvers <csilvers@6b5cf1ce-ec42-a296-1ba9-69fdba395a50> | 2011-10-18 20:57:45 +0000 |
commit | a6076edd177d59e67207753b799ce047a3663cb0 (patch) | |
tree | 5b3bce7c1fbc9277d82d62379000acbf32374a73 /src/heap-profile-table.h | |
parent | c2eedce2a718913ed6264ac8e96571c233761e3b (diff) | |
download | gperftools-a6076edd177d59e67207753b799ce047a3663cb0.tar.gz |
* Get the deallocation stack trace outside the lock (sean)
* Make PageHeap dynamically allocated for leak checks (maxim)
* BUGFIX: Fix probing of nm -f behavior in pprof (dpeng)
* PORTING: Add "support" for MIPS cycletimer
* BUGFIX: Fix a race with the CentralFreeList lock (sanjay)
* Allow us to compile on OS X 10.6 and run on 10.5 (raltherr)
* Support /pprof/censusprofile url arguments (rajatjain)
* Die in configure when g++ is't installed (csilvers)
* Change IgnoreObject to return its argument (nlewycky)
* Update malloc-hook files to support more CPUs
* Move stack trace collecting out of the mutex (taylorc)
* BUGFIX: write our own strstr to avoid libc problems (csilvers)
* use simple callgrind compression facility in pprof
* print an error message when we can't run pprof to symbolize (csilvers)
git-svn-id: http://gperftools.googlecode.com/svn/trunk@120 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
Diffstat (limited to 'src/heap-profile-table.h')
-rw-r--r-- | src/heap-profile-table.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/heap-profile-table.h b/src/heap-profile-table.h index c9bee15..8ab1164 100644 --- a/src/heap-profile-table.h +++ b/src/heap-profile-table.h @@ -97,15 +97,20 @@ class HeapProfileTable { HeapProfileTable(Allocator alloc, DeAllocator dealloc); ~HeapProfileTable(); - // Record an allocation at 'ptr' of 'bytes' bytes. - // skip_count gives the number of stack frames between this call - // and the memory allocation function that was asked to do the allocation. - void RecordAlloc(const void* ptr, size_t bytes, int skip_count); - - // Direct version of RecordAlloc when the caller stack to use - // is already known: call_stack of depth stack_depth. - void RecordAllocWithStack(const void* ptr, size_t bytes, - int stack_depth, const void* const call_stack[]); + // Collect the stack trace for the function that asked to do the + // allocation for passing to RecordAlloc() below. + // + // The stack trace is stored in 'stack'. The stack depth is returned. + // + // 'skip_count' gives the number of stack frames between this call + // and the memory allocation function. + static int GetCallerStackTrace(int skip_count, void* stack[kMaxStackDepth]); + + // Record an allocation at 'ptr' of 'bytes' bytes. 'stack_depth' + // and 'call_stack' identifying the function that requested the + // allocation. They can be generated using GetCallerStackTrace() above. + void RecordAlloc(const void* ptr, size_t bytes, + int stack_depth, const void* const call_stack[]); // Record the deallocation of memory at 'ptr'. void RecordFree(const void* ptr); |