diff options
author | Derek Bruening <bruening@google.com> | 2016-06-03 16:27:50 +0000 |
---|---|---|
committer | Derek Bruening <bruening@google.com> | 2016-06-03 16:27:50 +0000 |
commit | b05f4c85dea351be7a3d529e6f98e22b6bb163d7 (patch) | |
tree | 4772602a60f8fbf0fc3f33dbed3b4a8c5389a0ab /test/esan | |
parent | d5bcae95c1d1b013893bd3ca6cc04e7f7f5d5736 (diff) |
[esan|wset] Add 8-level working set snapshot accumulation
Summary:
Adds a new option -snapshot_step controlling the frequency distribution for
an 8-level series of samples using each bit of each shadow byte.
Implements accumulation from each level to the next higher level at the
specified frequency.
Adds storage of the 8 series of samples using CircularBuffer instances.
Fixes an error in the circular buffer data structure where a static
object's destructor will be called too early.
Prints the results out at the end in a simple manner to give us something
to start with.
Updates the workingset-samples test to test the new feature.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka
Differential Revision: http://reviews.llvm.org/D20833
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/esan')
-rw-r--r-- | test/esan/TestCases/workingset-samples.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/esan/TestCases/workingset-samples.cpp b/test/esan/TestCases/workingset-samples.cpp index cb0ce01e8..6ca1a2ccc 100644 --- a/test/esan/TestCases/workingset-samples.cpp +++ b/test/esan/TestCases/workingset-samples.cpp @@ -1,5 +1,5 @@ // RUN: %clang_esan_wset -O0 %s -o %t 2>&1 -// RUN: %env_esan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s +// RUN: %run %t 2>&1 | FileCheck %s #include <sched.h> #include <stdlib.h> @@ -19,8 +19,21 @@ int main(int argc, char **argv) { for (int i = 0; i < size; ++i) buf[i] = i; munmap(buf, size); - // CHECK: {{.*}}EfficiencySanitizer: snapshot {{.*}} - // CHECK-NEXT: {{.*}}EfficiencySanitizer: snapshot {{.*}} + // We only check for a few samples here to reduce the chance of flakiness. + // CHECK: =={{[0-9]+}}== Total number of samples: {{[0-9]+}} + // CHECK-NEXT: =={{[0-9]+}}== Samples array #0 at period 20 ms + // CHECK-NEXT: =={{[0-9]+}}==# 0: {{[ 0-9]+}} KB ({{[ 0-9]+}} cache lines) + // CHECK-NEXT: =={{[0-9]+}}==# 1: {{[ 0-9]+}} KB ({{[ 0-9]+}} cache lines) + // CHECK-NEXT: =={{[0-9]+}}==# 2: {{[ 0-9]+}} KB ({{[ 0-9]+}} cache lines) + // CHECK-NEXT: =={{[0-9]+}}==# 3: {{[ 0-9]+}} KB ({{[ 0-9]+}} cache lines) + // CHECK: =={{[0-9]+}}== Samples array #1 at period 80 ms + // CHECK-NEXT: =={{[0-9]+}}==# 0: {{[ 0-9]+}} KB ({{[ 0-9]+}} cache lines) + // CHECK: =={{[0-9]+}}== Samples array #2 at period 320 ms + // CHECK: =={{[0-9]+}}== Samples array #3 at period 1280 ms + // CHECK: =={{[0-9]+}}== Samples array #4 at period 5120 ms + // CHECK: =={{[0-9]+}}== Samples array #5 at period 20 sec + // CHECK: =={{[0-9]+}}== Samples array #6 at period 81 sec + // CHECK: =={{[0-9]+}}== Samples array #7 at period 327 sec // CHECK: {{.*}} EfficiencySanitizer: the total working set size: 32 MB (5242{{[0-9][0-9]}} cache lines) return 0; } |