diff options
| author | Kostya Kortchinsky <kostyak@google.com> | 2018-04-25 18:52:29 +0000 |
|---|---|---|
| committer | Kostya Kortchinsky <kostyak@google.com> | 2018-04-25 18:52:29 +0000 |
| commit | d8803d3d9251d35499659538244e5dd4550f5aaf (patch) | |
| tree | 4fd33eeba6733047142582f1725132fc16dc9049 /compiler-rt/lib/scudo/scudo_allocator.cpp | |
| parent | a48924c706dc2e0d0adc56aefb058d3696f85946 (diff) | |
| download | bcm5719-llvm-d8803d3d9251d35499659538244e5dd4550f5aaf.tar.gz bcm5719-llvm-d8803d3d9251d35499659538244e5dd4550f5aaf.zip | |
[scudo] Adding an interface function to print allocator stats
Summary:
This adds `__scudo_print_stats` as an interface function to display the Primary
and Secondary allocator statistics for Scudo.
Reviewers: alekseyshl, flowerhack
Reviewed By: alekseyshl
Subscribers: delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D46016
llvm-svn: 330857
Diffstat (limited to 'compiler-rt/lib/scudo/scudo_allocator.cpp')
| -rw-r--r-- | compiler-rt/lib/scudo/scudo_allocator.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/lib/scudo/scudo_allocator.cpp b/compiler-rt/lib/scudo/scudo_allocator.cpp index e0f78a01542..c72ac8601ba 100644 --- a/compiler-rt/lib/scudo/scudo_allocator.cpp +++ b/compiler-rt/lib/scudo/scudo_allocator.cpp @@ -594,6 +594,11 @@ struct ScudoAllocator { SoftRssLimitMb = LimitMb; CheckRssLimit = HardRssLimitMb || SoftRssLimitMb; } + + void printStats() { + initThreadMaybe(); + BackendAllocator.printStats(); + } }; static ScudoAllocator Instance(LINKER_INITIALIZED); @@ -743,3 +748,7 @@ void __scudo_set_rss_limit(uptr LimitMb, s32 HardLimit) { return; Instance.setRssLimit(LimitMb, !!HardLimit); } + +void __scudo_print_stats() { + Instance.printStats(); +} |

