diff options
author | Xinliang David Li <davidxl@google.com> | 2016-08-09 04:21:14 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-08-09 04:21:14 +0000 |
commit | 662d5497c3a4fbcdbf125d109f4abe5a9385cc20 (patch) | |
tree | 75caffb22007df93d6a22f8424a6ee34ffe3e2d0 /lib/profile/InstrProfiling.c | |
parent | 97809160002d2a275a04e62313e55f1607fde234 (diff) |
[Profile] Implement new API __llvm_profile_dump
The API is intended to be used by user to do fine
grained (per-region) control of profile dumping.
Differential Revision: http://reviews.llvm.org/D23106
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfiling.c')
-rw-r--r-- | lib/profile/InstrProfiling.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/profile/InstrProfiling.c b/lib/profile/InstrProfiling.c index b7ba25f30..1dcd05b64 100644 --- a/lib/profile/InstrProfiling.c +++ b/lib/profile/InstrProfiling.c @@ -27,6 +27,16 @@ COMPILER_RT_VISIBILITY uint64_t __llvm_profile_get_magic(void) { : (INSTR_PROF_RAW_MAGIC_32); } +static unsigned ProfileDumped = 0; + +COMPILER_RT_VISIBILITY unsigned lprofProfileDumped() { + return ProfileDumped; +} + +COMPILER_RT_VISIBILITY void lprofSetProfileDumped() { + ProfileDumped = 1; +} + /* Return the number of bytes needed to add to SizeInBytes to make it * the result a multiple of 8. */ @@ -68,4 +78,5 @@ COMPILER_RT_VISIBILITY void __llvm_profile_reset_counters(void) { } } } + ProfileDumped = 0; } |