summaryrefslogtreecommitdiff
path: root/lib/asan/asan_stats.cc
AgeCommit message (Collapse)Author
2015-06-26[ASan] Clean up obsolete stats.Alexey Samsonov
Remove stats that we no longer collect after the allocator change. Use proper constant SizeClassMap::kNumClasses to fix potential buffer overflow (https://code.google.com/p/address-sanitizer/issues/detail?id=397). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240816 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12[Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in ↵Alexey Samsonov
favor of a unified interface in <sanitizer/allocator_interface.h>. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-07Generalize sanitizer allocator public interface.Alexey Samsonov
Introduce new public header <sanitizer/allocator_interface.h> and a set of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc. that will eventually replace their tool-specific equivalents (__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific functions are now deprecated and implemented as stubs redirecting to __sanitizer_ versions (which are implemented differently in each tool). Replace all uses of __xsan_ versions with __sanitizer_ versions in unit and lit tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21[msan] Chained origins re-design.Evgeniy Stepanov
Generalize StackDepot and create a new specialized instance of it to efficiently (i.e. without duplicating stack trace data) store the origin history tree. This reduces memory usage for chained origins roughly by an order of magnitude. Most importantly, this new design allows us to put two limits on stored history data (exposed in MSAN_OPTIONS) that help avoid exponential growth in used memory on certain workloads. See comments in lib/msan/msan_origin.h for more details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209284 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02Improve collecting malloc stats in ASanAlexey Samsonov
Summary: This change makes races between updates of thread-local stats and merging all the thread-local stats together less harmful. Reviewers: kcc Reviewed By: kcc CC: dvyukov, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1572 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189744 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05[sanitizer] found a bug by code inspection: CHECK(a=b) instead of ↵Kostya Serebryany
CHECK(a==b). Was puzzled why lint did not catch it. Turns out this check was disabled for asan source. fix all cases and enable the check git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178872 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-21[ASan] Switch ASan to generic ThreadRegistry from sanitizer_common. Delete ↵Alexey Samsonov
ASan-specific AsanThreadRegistry. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177634 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20[ASan] Move malloc stats collection away from AsanThreadRegistry class.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177508 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31[ASan] Split ASan interface header into private and public parts. Add a test ↵Alexey Samsonov
that makes sure users can include interface header git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174058 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14asan/tsan: move blocking mutex from asan to sanitizer_commonDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172380 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27[sanitizer] add statistics to the allocator; fix lintKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-26[asan] asan_allocator2: by default use the StackDepot to store the stack ↵Kostya Serebryany
traces instead of storing them in the redzones git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-21[asan] asan_allocator2: better memory statsKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170888 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-23[asan] get rid of some of the uses of kPageSize. The intent is to get rid of ↵Kostya Serebryany
it completely to support platforms with multiple possible page sizes. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@168517 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-19[ASan] change interface of GetAccumulatedStats() function to prevent Clang ↵Alexey Samsonov
from inserting memcpy() call into runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@168305 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29Relocate the external headers provided by ASan and the common sanitizerChandler Carruth
library. These headers are intended to be available to user code when built with AddressSanitizer (or one of the other sanitizer's in the future) to interface with the runtime library. As such, they form stable external C interfaces, and the headers shouldn't be located within the implementation. I've pulled them out into what seem like fairly obvious locations and names, but I'm wide open to further bikeshedding of these names and locations. I've updated the code and the build system to cope with the new locations, both CMake and Makefile. Please let me know if this breaks anyone's build. The eventual goal is to install these headers along side the Clang builtin headers when we build the ASan runtime and install it. My current thinking is to locate them at: <prefix>/lib/clang/X.Y/include/sanitizer/common_interface_defs.h <prefix>/lib/clang/X.Y/include/sanitizer/asan_interface.h <prefix>/lib/clang/X.Y/include/sanitizer/... But maybe others have different suggestions? Fixing the style of the #include between these headers at least unblocks experimentation with installing them as they now should work when installed in these locations. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162822 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] get rid of AsanPrintf in favor of Printf from sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06[Sanitizer]: Introduce a common internal printf function. For now, also use ↵Alexey Samsonov
tool-specific wrappers TsanPrintf (its output is controlled by TSan flags) and AsanPrintf (which copies its results to the ASan-private buffer). Supported formats: %[z]{d,u,x}, %s, %p. Re-write all format strings in TSan according to this format (this should have no effect on 64-bit platforms). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04Remove file-type tags for .cc files in ASan run-time libraryAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157927 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31[asan] more renamingKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31[asan,tsan] introduce sanitizer_common/sanitizer_defs.h and perform some ↵Kostya Serebryany
renaming in asan rt. More to come. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157743 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-21[asan] Support for %z to Printf()Evgeniy Stepanov
At the moment, asan internal Printf() uses %l modifier for printing values of size_t and related types. This works, because we control both the implementation of Printf and all its uses, but can be a little misleading. This change adds support for %z to Printf(). All callers that print sizes and pointers as integers are switched to %zu / %zx. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@153177 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08AddressSanitizer: replace all "real_X" calls with "REAL(X)"Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@150073 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05[asan] always collect malloc statstics (removed FLAG_stats)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@145838 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-03[asan] get rid of some more dependency on libstdc++Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@145743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-30AddressSanitizer run-time library. Not yet integrated with the compiler-rt ↵Kostya Serebryany
build system, but can be built using the old makefile. See details in README.txt git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@145463 91177308-0d34-0410-b5e6-96231b3b80d8