summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/xray
Commit message (Collapse)AuthorAgeFilesLines
...
* [XRay][compiler-rt] XRay Flight Data Recorder ModeDean Michael Berris2017-01-252-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In this change we introduce the notion of a "flight data recorder" mode for XRay logging, where XRay logs in-memory first, and write out data on-demand as required (as opposed to the naive implementation that keeps logging while tracing is "on"). This depends on D26232 where we implement the core data structure for holding the buffers that threads will be using to write out records of operation. This implementation only currently works on x86_64 and depends heavily on the TSC math to write out smaller records to the inmemory buffers. Also, this implementation defines two different kinds of records with different sizes (compared to the current naive implementation): a MetadataRecord (16 bytes) and a FunctionRecord (8 bytes). MetadataRecord entries are meant to write out information like the thread ID for which the metadata record is defined for, whether the execution of a thread moved to a different CPU, etc. while a FunctionRecord represents the different kinds of function call entry/exit records we might encounter in the course of a thread's execution along with a delta from the last time the logging handler was called. While this implementation is not exactly what is described in the original XRay whitepaper, this one gives us an initial implementation that we can iterate and build upon. Reviewers: echristo, rSerge, majnemer Subscribers: mehdi_amini, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D27038 llvm-svn: 293015
* [XRay][Arm] Enable back XRay testing on Arm32 and fix the failing testsSerge Rogatch2017-01-191-1/+7
| | | | | | | | | | | | | | | | | Summary: Testing of XRay was occasionally disabled on 32-bit Arm targets (someone assumed that XRay was supported on 64-bit targets only). This patch should fix that problem. Also here the instruction&data cache incoherency problem is fixed, because it may be causing a test to fail. This patch is one of a series: see also - https://reviews.llvm.org/D28624 Reviewers: dberris, rengolin Reviewed By: rengolin Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown Differential Revision: https://reviews.llvm.org/D28623 llvm-svn: 292517
* Revert "[XRay][Arm] Enable back XRay testing on Arm32 and fix the failing tests"Renato Golin2017-01-181-3/+1
| | | | | | | | | This reverts commit r292211, as it broke the Thumb buldbot with: clang-5.0: error: the clang compiler does not support '-fxray-instrument on thumbv7-unknown-linux-gnueabihf' llvm-svn: 292356
* [XRay][Arm] Enable back XRay testing on Arm32 and fix the failing testsSerge Rogatch2017-01-171-1/+3
| | | | | | | | | | | | | | | | | Summary: Testing of XRay was occasionally disabled on 32-bit Arm targets (someone assumed that XRay was supported on 64-bit targets only). This patch should fix that problem. Also here the instruction&data cache incoherency problem is fixed, because it may be causing a test to fail. This patch is one of a series: see also - https://reviews.llvm.org/D28624 Reviewers: dberris, rengolin Reviewed By: rengolin Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown Differential Revision: https://reviews.llvm.org/D28623 llvm-svn: 292211
* [XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing ↵Serge Rogatch2017-01-101-1/+0
| | | | | | | | | | | | | | the instruction cache after code modification Summary: This patch attempts to fix test patching-unpatching.cc . The new code flushes the instruction cache after modifying the program at runtime. Reviewers: dberris, rengolin, pelikan, rovka Subscribers: rovka, llvm-commits, iid_iunknown, aemerson Differential Revision: https://reviews.llvm.org/D27996 llvm-svn: 291568
* [XRay] [compiler-rt] Include argv[0] in the log file name.Dean Michael Berris2017-01-031-0/+14
| | | | | | | | | | | | | | | | | Summary: If you decide to recompile parts of your Linux distro with XRay, it may be useful to know which trace belongs to which binary. While there, get rid of the incorrect strncat() usage; it always returns a pointer to the start which makes that if() always true. Replace with snprintf which is bounded so that enough from both strings fits nicely. Reviewers: dberris Subscribers: danalbert, srhines, kubabrecka, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D27912 llvm-svn: 290861
* Revert "[XRay][compiler-rt] XRay Flight Data Recorder Mode"Dean Michael Berris2017-01-032-4/+6
| | | | | | This reverts rL290852 as it breaks aarch64 and arm. llvm-svn: 290854
* [XRay][compiler-rt] XRay Flight Data Recorder ModeDean Michael Berris2017-01-032-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In this change we introduce the notion of a "flight data recorder" mode for XRay logging, where XRay logs in-memory first, and write out data on-demand as required (as opposed to the naive implementation that keeps logging while tracing is "on"). This depends on D26232 where we implement the core data structure for holding the buffers that threads will be using to write out records of operation. This implementation only currently works on x86_64 and depends heavily on the TSC math to write out smaller records to the inmemory buffers. Also, this implementation defines two different kinds of records with different sizes (compared to the current naive implementation): a MetadataRecord (16 bytes) and a FunctionRecord (8 bytes). MetadataRecord entries are meant to write out information like the thread ID for which the metadata record is defined for, whether the execution of a thread moved to a different CPU, etc. while a FunctionRecord represents the different kinds of function call entry/exit records we might encounter in the course of a thread's execution along with a delta from the last time the logging handler was called. While this implementation is not exactly what is described in the original XRay whitepaper, this one gives us an initial implementation that we can iterate and build upon. Reviewers: echristo, rSerge, majnemer Subscribers: mehdi_amini, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D27038 llvm-svn: 290852
* Revert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by ↵Renato Golin2016-12-231-0/+1
| | | | | | | | | flushing the instruction cache after code modification" This reverts commit r290452, not quite there yet. We need to test this offline. llvm-svn: 290453
* [XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing ↵Serge Rogatch2016-12-231-1/+0
| | | | | | | | | | | | | | the instruction cache after code modification Summary: This patch attempts to fix test patching-unpatching.cc . The new code flushes the instruction cache after modifying the program at runtime. Reviewers: dberris, rengolin Subscribers: llvm-commits, iid_iunknown, aemerson Differential Revision: https://reviews.llvm.org/D27996 llvm-svn: 290452
* Revert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by ↵Renato Golin2016-12-221-0/+1
| | | | | | | | | flushing the instruction cache after code modification" This reverts commit r290354, as it broke the build. We need to make sure this builds on AArch64 before committing again. llvm-svn: 290362
* [XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing ↵Serge Rogatch2016-12-221-1/+0
| | | | | | | | | | | | | | the instruction cache after code modification Summary: This patch attempts to fix test patching-unpatching.cc . The new code flushes the instruction cache after modifying the program at runtime. Reviewers: dberris, rengolin Subscribers: llvm-commits, iid_iunknown, aemerson Differential Revision: https://reviews.llvm.org/D27996 llvm-svn: 290354
* [XRay][CMake] Check target for XRay Flight Data RecorderPetr Hosek2016-12-121-0/+8
| | | | | | | | | This target doesn't currently do anything, but it is required by the runtimes build. Differential Revision: https://reviews.llvm.org/D27640 llvm-svn: 289420
* [XRay][AArch64] Disable the unstable test ↵Serge Rogatch2016-12-072-0/+6
| | | | | | | | | | | | | | | | XRay-aarch64-linux::patching-unpatching.cc Summary: The test `XRay-aarch64-linux::patching-unpatching.cc` sometimes passes, sometimes fails on buildbots. This patch disables test `patching-unpatching.cc` for AArch64 targets. Reviewers: rengolin, dberris Subscribers: llvm-commits, iid_iunknown, aemerson Differential Revision: https://reviews.llvm.org/D27528 llvm-svn: 288988
* [XRay][compiler-rt] Only add unit tests if we're building XRay.Dean Michael Berris2016-12-061-7/+5
| | | | | | | | | | As constructed before this patch, in case we run into case where we don't actually build the XRay library, we really ought to not be adding the unit test runs. This should fix the bootstrap build failures. This is a follow-up further to D26232. llvm-svn: 288788
* [XRay][compiler-rt] CMake fixes for XRay -- take 2.Dean Michael Berris2016-12-061-3/+5
| | | | | | | | | | The bootstrap buildbot complains about not being able to find the unittests for XRay, when the conditionals to include or not include tests and unit tests don't match. This is a follow-up to D26232. llvm-svn: 288786
* [XRay][compiler-rt] Fix unit test adding logic.Dean Michael Berris2016-12-061-1/+1
| | | | | | | | | Before this change we would add the unit tests potentially even if we don't actually include the unit tests. This is a follow-up on D26232. llvm-svn: 288785
* [XRay][compiler-rt] XRay Buffer QueueDean Michael Berris2016-12-062-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | This implements a simple buffer queue to manage a pre-allocated queue of fixed-sized buffers to hold XRay records. We need this to support Flight Data Recorder (FDR) mode. We also implement this as a sub-library first to allow for development before actually using it in an implementation. Some important properties of the buffer queue: - Thread-safe enqueueing/dequeueing of fixed-size buffers. - Pre-allocation of buffers at construction. This is a re-roll of the previous attempt to submit, because it caused failures in arm and aarch64. Reviewers: majnemer, echristo, rSerge Subscribers: tberghammer, danalbert, srhines, modocache, mehdi_amini, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D26232 llvm-svn: 288775
* [sanitizer] Add macOS minimum deployment target to all compiler invocations ↵Kuba Mracek2016-11-291-11/+1
| | | | | | | | | | in lit tests The Clang driver on macOS decides the deployment target based on various things, like your host OS version, the SDK version and some environment variables, which makes lit tests pass or fail based on your environment. Let's make sure we run all lit tests with `-mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}` (10.9 unless overriden). Differential Revision: https://reviews.llvm.org/D26929 llvm-svn: 288186
* Revert "[XRay][compiler-rt] XRay Buffer Queue"Dean Michael Berris2016-11-252-21/+0
| | | | | | Broke the build on arm7 and aarch64. llvm-svn: 287911
* [XRay][compiler-rt] XRay Buffer QueueDean Michael Berris2016-11-252-0/+21
| | | | | | | | | | | | | | | | | | | | | | Summary: This implements a simple buffer queue to manage a pre-allocated queue of fixed-sized buffers to hold XRay records. We need this to support Flight Data Recorder (FDR) mode. We also implement this as a sub-library first to allow for development before actually using it in an implementation. Some important properties of the buffer queue: - Thread-safe enqueueing/dequeueing of fixed-size buffers. - Pre-allocation of buffers at construction. Reviewers: majnemer, rSerge, echristo Subscribers: mehdi_amini, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D26232 llvm-svn: 287910
* [compiler-rt][XRay] Initial per-thread inmemory logging implementationDean Michael Berris2016-08-262-0/+41
| | | | | | | | | | | | | | | | | | | | | | Depends on D21612 which implements the building blocks for the compiler-rt implementation of the XRay runtime. We use a naive in-memory log of fixed-size entries that get written out to a log file when the buffers are full, and when the thread exits. This implementation lays some foundations on to allowing for more complex XRay records to be written to the log in subsequent changes. It also defines the format that the function call accounting tool in D21987 will start building upon. Once D21987 lands, we should be able to start defining more tests using that tool once the function call accounting tool becomes part of the llvm distribution. Reviewers: echristo, kcc, rnk, eugenis, majnemer, rSerge Subscribers: sdardis, rSerge, dberris, tberghammer, danalbert, srhines, majnemer, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D21982 llvm-svn: 279805
* Include tests only if COMPILER_RT_BUILD_XRAY is ON.Dean Michael Berris2016-08-261-23/+25
| | | | | | | | This should un-break users that have not re-generated their CMake configs when they ran it when this was defaulted to OFF. Related to r277975 post-commit review. llvm-svn: 279802
* [compiler-rt][XRay] Only add xray dependency if XRay is built and is ↵Dean Michael Berris2016-08-081-26/+26
| | | | | | available for the platform llvm-svn: 277983
* [compiler-rt][XRay] Fix XRay test build dependenciesDean Michael Berris2016-08-081-21/+23
| | | | llvm-svn: 277974
* [compiler-rt][XRay] Implement __xray_unpatch() and __xray_remove_handler()Dean Michael Berris2016-08-084-0/+131
Summary: We also add one test (and the XRay testing infrastructure) to exercise the patching and unpatching code. This uses the XRay API exported through the headers as well, installing a custom log handler. Depends on D23101 for the updated emitted code alignment for the return/entry sleds. Reviewers: rSerge, echristo, rnk Subscribers: tberghammer, danalbert, srhines, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23154 llvm-svn: 277971
OpenPOWER on IntegriCloud