summaryrefslogtreecommitdiff
path: root/lib/esan/esan.cpp
diff options
context:
space:
mode:
authorDerek Bruening <bruening@google.com>2016-07-09 04:13:25 +0000
committerDerek Bruening <bruening@google.com>2016-07-09 04:13:25 +0000
commitbcdfb408444c657422499a2274eb377879588e89 (patch)
treeaedcaccf6e02afc9348c1680cddf2df18aecc29e /lib/esan/esan.cpp
parent87110b4eb106dc2ccaaa74647293fe6e05cabb96 (diff)
[esan] Add __esan_report for mid-run data
Summary: Adds a new public interface routine __esan_report() which can be used to request profiling results prior to abnormal termination (e.g., for a server process killed by its parent where the normal exit does not allow for normal result reporting). Implements this for the working-set tool. The cache frag tool is left unimplemented as it requires missing iteration capabilities. Adds a new test. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D22098 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274964 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/esan/esan.cpp')
-rw-r--r--lib/esan/esan.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/esan/esan.cpp b/lib/esan/esan.cpp
index 970f91a83..3c69b4e91 100644
--- a/lib/esan/esan.cpp
+++ b/lib/esan/esan.cpp
@@ -228,6 +228,15 @@ int finalizeLibrary() {
return 0;
}
+void reportResults() {
+ VPrintf(1, "in esan::%s\n", __FUNCTION__);
+ if (__esan_which_tool == ESAN_CacheFrag) {
+ return reportCacheFrag();
+ } else if (__esan_which_tool == ESAN_WorkingSet) {
+ return reportWorkingSet();
+ }
+}
+
void processCompilationUnitInit(void *Ptr) {
VPrintf(2, "in esan::%s\n", __FUNCTION__);
if (__esan_which_tool == ESAN_CacheFrag) {