Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Kostya Kortchinsky
committed
Apr 25, 2018
1 parent
a48924c
commit d8803d3
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// RUN: %clang_scudo %s -o %t | ||
// RUN: %run %t 2>&1 | FileCheck %s | ||
|
||
// Tests that the allocator stats printing function exists and outputs | ||
// "something". Currently that "something" is fairly nebulous, as the 32-bit | ||
// primary doesn't output anything, and for the 64-bit one it's highly dependent | ||
// on the size class map and potential library allocations. So keep it very | ||
// generic for now. | ||
|
||
#include <stdlib.h> | ||
|
||
#include <sanitizer/scudo_interface.h> | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
free(malloc(1U)); | ||
__scudo_print_stats(); | ||
return 0; | ||
} | ||
|
||
// CHECK: Stats: |