summaryrefslogtreecommitdiff
path: root/test/xray/TestCases/Linux/basic-filtering.cc
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2018-02-22 06:08:26 +0000
committerKamil Rytarowski <n54@gmx.com>2018-02-22 06:08:26 +0000
commit9665582c0a1e0e2528e3eeb0fa1cfdfd4be26e63 (patch)
tree0dbef83d069c28d1dd420bc1e829c3cd718b8640 /test/xray/TestCases/Linux/basic-filtering.cc
parentdeef7d3300634a52fcd6aadb3b2fd88491ea959e (diff)
Xray instrumentation / enabling more tests
Summary: The Unix subdirectory mostly allows only on Linux x86_64 but now we can target x86_64 arch in general. Patch by David CARLIER Reviewers: krytarowski, dberris, emaste Reviewed By: krytarowski, dberris, emaste Subscribers: emaste, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43382 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/xray/TestCases/Linux/basic-filtering.cc')
-rw-r--r--test/xray/TestCases/Linux/basic-filtering.cc51
1 files changed, 0 insertions, 51 deletions
diff --git a/test/xray/TestCases/Linux/basic-filtering.cc b/test/xray/TestCases/Linux/basic-filtering.cc
index b758859cf..e69de29bb 100644
--- a/test/xray/TestCases/Linux/basic-filtering.cc
+++ b/test/xray/TestCases/Linux/basic-filtering.cc
@@ -1,51 +0,0 @@
-// Check to make sure that we are actually filtering records from the basic mode
-// logging implementation.
-
-// RUN: %clangxx_xray -std=c++11 %s -o %t -g
-// RUN: rm basic-filtering-* || true
-// RUN: XRAY_OPTIONS="patch_premain=true xray_naive_log=true verbosity=1 \
-// RUN: xray_logfile_base=basic-filtering- \
-// RUN: xray_naive_log_func_duration_threshold_us=1000 \
-// RUN: xray_naive_log_max_stack_depth=2" %run %t 2>&1 | \
-// RUN: FileCheck %s
-// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t \
-// RUN: "`ls basic-filtering-* | head -1`" | \
-// RUN: FileCheck %s --check-prefix TRACE
-// RUN: rm basic-filtering-* || true
-//
-// REQUIRES: x86_64-linux
-// REQUIRES: built-in-llvm-tree
-
-#include <cstdio>
-#include <time.h>
-
-[[clang::xray_always_instrument]] void __attribute__((noinline)) filtered() {
- printf("filtered was called.\n");
-}
-
-[[clang::xray_always_instrument]] void __attribute__((noinline)) beyond_stack() {
- printf("beyond stack was called.\n");
-}
-
-[[clang::xray_always_instrument]] void __attribute__((noinline))
-always_shows() {
- struct timespec sleep;
- sleep.tv_nsec = 2000000;
- sleep.tv_sec = 0;
- struct timespec rem;
- while (nanosleep(&sleep, &rem) == -1)
- sleep = rem;
- printf("always_shows was called.\n");
- beyond_stack();
-}
-
-[[clang::xray_always_instrument]] int main(int argc, char *argv[]) {
- filtered(); // CHECK: filtered was called.
- always_shows(); // CHECK: always_shows was called.
- // CHECK: beyond stack was called.
-}
-
-// TRACE-NOT: - { type: 0, func-id: {{.*}}, function: {{.*filtered.*}}, {{.*}} }
-// TRACE-NOT: - { type: 0, func-id: {{.*}}, function: {{.*beyond_stack.*}}, {{.*}} }
-// TRACE-DAG: - { type: 0, func-id: [[FID:[0-9]+]], function: {{.*always_shows.*}}, cpu: {{.*}}, thread: {{.*}}, kind: function-enter, tsc: {{[0-9]+}} }
-// TRACE-DAG: - { type: 0, func-id: [[FID]], function: {{.*always_shows.*}}, cpu: {{.*}}, thread: {{.*}}, kind: function-{{exit|tail-exit}}, tsc: {{[0-9]+}} }