summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/xray/TestCases
Commit message (Collapse)AuthorAgeFilesLines
...
* [XRay][compiler-rt][NFC] Expand the PIC test case for XRayDean Michael Berris2017-08-181-1/+2
| | | | | | | | | | | | | Summary: Here we add a build with -ffunction-sections -fdata-sections and -Wl,--gc-sections to ensure that we're still able to generate XRay traces. This is just adding a test, no functional changes. Differential Revision: https://reviews.llvm.org/D36863 llvm-svn: 311145
* [XRay][compiler-rt] Fix test to not be too strict with output order.Dean Michael Berris2017-07-311-1/+1
| | | | | | Follow-up to D35789. llvm-svn: 309543
* [XRay][compiler-rt] Fix typo for REQUIRES.Dean Michael Berris2017-07-311-1/+1
| | | | | | Follow-up on D35789. llvm-svn: 309540
* [XRay][compiler-rt] Require build-in-tree and x86_64-linux.Dean Michael Berris2017-07-311-0/+4
| | | | | | | | | The quiet-start.cc test currently fails for arm (and potentially other platforms). This change limits it to x86_64-linux. Follow-up to D35789. llvm-svn: 309538
* [XRay][compiler-rt] Do not print the warning when the binary is not XRay ↵Dean Michael Berris2017-07-311-0/+22
| | | | | | | | | | | | | | | | | instrumented. Summary: Currently when the XRay runtime is linked into a binary that doesn't have the instrumentation map, we print a warning unconditionally. This change attempts to make this behaviour more quiet. Reviewers: kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35789 llvm-svn: 309534
* [XRay][compiler-rt] Update test to account for change in logging format.Dean Michael Berris2017-07-211-1/+1
| | | | | | | Fixes build breakage for some bots after we've started logging both the process id and the thread id. llvm-svn: 308701
* [XRay][compiler-rt][NFC] Move test case into correct directory.Dean Michael Berris2017-06-281-0/+0
| | | | | | Followup to D34669. llvm-svn: 306506
* [XRay][compiler-rt] Only run test in x86_64 linux.Dean Michael Berris2017-06-281-0/+2
| | | | | | Followup to D34669. llvm-svn: 306505
* [XRay][compiler-rt][NFC] Add example always/never instrument files.Dean Michael Berris2017-06-281-0/+21
| | | | | | | | | | | | | | | | | | | | Summary: This change introduces two files that show exaples of the always/never instrument files that can be provided to clang. We don't add these as defaults yet in clang, which we can do later on (in a separate change). We also add a test that makes sure that these apply in the compiler-rt project tests, and that changes in clang don't break the expectations in compiler-rt. Reviewers: pelikan, kpw Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34669 llvm-svn: 306502
* [XRay][compiler-rt][NFC] Add a test for both arg1 and arg0 handling in the ↵Dean Michael Berris2017-06-191-0/+39
| | | | | | | | | | same binary This test makes sure we can handle both arg0 and arg1 handling in the same binary, and making sure that the XRay runtime calls the correct trampoline when handlers for both of these cases are installed. llvm-svn: 305660
* Add test for logging the implicit "this" argument for C++ member functions.Dean Michael Berris2017-06-161-0/+31
| | | | | | | | | | | | | | | | Summary: This allows us to do more interesting things with the data available to C++ methods, to log the `this` pointer. Depends on D34050. Reviewers: pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34051 llvm-svn: 305545
* [XRay][compiler-rt] Add __xray_remove_customevent_handler(...)Dean Michael Berris2017-05-221-1/+1
| | | | | | | This change adds __xray_remove_customevent_handler(...) to be consistent with other APIs that add/remove handlers. llvm-svn: 303526
* [XRay] Fix __xray_function_address on PPC reguarding local entry points.Tim Shen2017-05-171-12/+4
| | | | | | | | | | Reviewers: echristo, dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33266 llvm-svn: 303302
* [XRay][compiler-rt] Only run custom event logging in x86_64-linuxDean Michael Berris2017-05-121-1/+3
| | | | | | | | | We only have an implementation in x86_64 that works for the patching/unpatching and runtime support (trampolines). Follow-up to D30630. llvm-svn: 302873
* [XRay][compiler-rt] Runtime changes to support custom event loggingDean Michael Berris2017-05-121-0/+38
| | | | | | | | | | | | | | | | | | | | Summary: This change implements support for the custom event logging sleds and intrinsics at runtime. For now it only supports handling the sleds in x86_64, with the implementations for other architectures stubbed out to do nothing. NOTE: Work in progress, uploaded for exposition/exploration purposes. Depends on D27503, D30018, and D33032. Reviewers: echristo, javed.absar, timshen Subscribers: mehdi_amini, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D30630 llvm-svn: 302857
* [XRay] Fix XRay PPC return value bug.Tim Shen2017-05-101-3/+0
| | | | | | | | | | | | | | | | | | Summary: This bug is caused by the incorrect handling of return-value registers. According to OpenPOWER 64-Bit ELF V2 ABI 2.2.5, up to 2 general-purpose registers are going to be used for return values, and up to 8 floating point registers or vector registers are going to be used for return values. Reviewers: dberris, echristo Subscribers: nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D33027 llvm-svn: 302691
* [XRay] Fix the test func-id-utils.cc on PPC.Tim Shen2017-05-101-9/+15
| | | | | | | | | | | | | | | | | | | | Summary: The test fails on PPC, because the address of a function may vary depending on whether the "taker" shares the same ToC (roughly, in the same "module") as the function. Therefore the addresses of the functions taken in func-id-utils.cc may be different from the addresses taken in xray runtime. Change the test to be permissive on address comparison. Reviewers: dberris, echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33026 llvm-svn: 302686
* [XRay][compiler-rt] XFAIL on ppcDean Michael Berris2017-05-081-0/+2
| | | | | | Follow-up on D32846. llvm-svn: 302392
* [powerpc] Mark coverage-sample.cc as XFAIL on powerpc64leBill Seurer2017-05-051-0/+3
| | | | | | | When run this test case causes a segementation fault on powerpc64le. The xfail should be removed when the problem is fixed. llvm-svn: 302237
* [XRay][compiler-rt] Remove dependency on FileCheck from function id ↵Dean Michael Berris2017-05-051-18/+14
| | | | | | | | | | utilities tests Follow-up on D32846 to simplify testing and not rely on FileCheck to test boundary conditions, and instead do all the testing in code instead. llvm-svn: 302212
* [XRay][compiler-rt] Add function id utilities for XRayDean Michael Berris2017-05-051-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows us to provide users and implementers of XRay handlers a means of converting XRay function id's to addresses. This, in combination with the facilities provided in D32695, allows users to find out: - How many function id's there are defined in the current binary. - Get the address of the function associated with this function id. - Patch only specific functions according to their requirements. While we don't directly provide symbolization support in XRay, having the function's address lets users determine this information easily either during runtime, or offline with tools like 'addr2line'. Reviewers: dblaikie, echristo, pelikan Subscribers: kpw, llvm-commits Differential Revision: https://reviews.llvm.org/D32846 llvm-svn: 302210
* [XRay][compiler-rt] Support patching/unpatching specific functionsDean Michael Berris2017-05-041-0/+88
| | | | | | | | | | | | | | | | | | Summary: This change allows us to patch/unpatch specific functions using the function ID. This is useful in cases where implementations might want to do coverage-style, or more fine-grained control of which functions to patch or un-patch at runtime. Depends on D32693. Reviewers: dblaikie, echristo, kpw Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32695 llvm-svn: 302112
* [XRay] [compiler-rt] - Fix standalone and non-deterministic test issueKeith Wyss2017-04-202-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The thread order test fails sometimes my machine independently of standalone build. From testing both standalone and in-tree build, I see I configured it wrong. The other hypothesis for an issue is that cold starts can interfere with whether record unwriting happens. Once this happens more than once, we can naively FileCheck on the wrong test output, which compounds the issue. While "rm blah.* || true" will print to stderr if the glob can't expand, this is mostly harmless and makes sure earlier failing tests don't sabotage us. Example failure: --- header: version: 1 type: 1 constant-tsc: true nonstop-tsc: true cycle-frequency: 3800000000 records: - { type: 0, func-id: 1, function: 'f1()', cpu: 9, thread: 21377, kind: function-enter, tsc: 2413745203147228 } - { type: 0, func-id: 1, function: 'f1()', cpu: 9, thread: 21377, kind: function-exit, tsc: 2413745203304238 } ... The CMAKE related change fixes the expectation that COMPILER_RT_STANDALONE_BUILD will be explicitly FALSE instead of empty string when it is not "TRUE". Reviewers: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32259 llvm-svn: 300822
* Skip tests that use 'llvm_xray' for standalone builds.Keith Wyss2017-04-192-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: Tests that generate output with compiler-rt and verify it with the llvm_xray command (built from the llvm tree) are extremely convenient, but compiler-rt can be built out of tree and llvm_xray is not built for every target. This change intends to disable tests for out of tree builds, but does nothing to detect whether llvm_xray can be found elsewhere on the path, is fresh enough, or is part of a build target for the in tree build. Tested: Tested that this didn't break check-xray. Haven't reproduced bots or standalone builds. Reviewers: dberris, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32150 llvm-svn: 300716
* [XRay] [compiler-rt] Unwriting FDR mode buffers when functions are short.Dean Michael Berris2017-04-061-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: "short" is defined as an xray flag, and buffer rewinding happens for both exits and tail exits. I've made the choice to seek backwards finding pairs of FunctionEntry, TailExit record pairs and erasing them if the FunctionEntry occurred before exit from the currently exiting function. This is a compromise so that we don't skip logging tail calls if the function that they call into takes longer our duration. This works by counting the consecutive function and function entry, tail exit pairs that proceed the current point in the buffer. The buffer is rewound to check whether these entry points happened recently enough to be erased. It is still possible we will omit them if they call into a child function that is not instrumented which calls a fast grandchild that is instrumented before doing other processing. Reviewers: pelikan, dberris Reviewed By: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31345 llvm-svn: 299629
* [XRay][compiler-rt] Spell REQUIRES properly for x86_64-linuxDean Michael Berris2017-03-302-2/+2
| | | | | | | | | | Until llvm-xray starts running/supporting binaries that are not ELF64 we only run the FDR tests on x86_64-linux. Previous changes caused the tests to not actually run on x86_64. Follow-up on D31454. llvm-svn: 299050
* [XRay][compiler-rt] Only run tests using llvm-xray in x86_64 for nowDean Michael Berris2017-03-302-3/+4
| | | | | | Followup on D31454. llvm-svn: 299049
* [XRay][compiler-rt] XFAIL the FDR mode tests on aarch64-42vmaDean Michael Berris2017-03-302-0/+3
| | | | | | Followup on D31454. llvm-svn: 299048
* [XRay][compiler-rt] Use llvm-xray in FDR mode testsDean Michael Berris2017-03-302-3/+57
| | | | | | | | | | | | | | | Summary: This change allows us to do an end-to-end test of the FDR mode implementation that uses the llvm-xray tooling to verify that what we are both writing and reading the data in a consistent manner. Reviewers: kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31454 llvm-svn: 299042
* [XRay][compiler-rt] Add an end-to-end test for FDR LoggingDean Michael Berris2017-03-291-0/+62
| | | | | | | | | | | | | | | | | | Summary: This change exercises the end-to-end functionality defined in the FDR logging implementation. We also prepare for being able to run traces generated by the FDR logging implementation from being analysed with the llvm-xray command that comes with the LLVM distribution. This also unblocks D31385, D31384, and D31345. Reviewers: kpw, pelikan Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D31452 llvm-svn: 298977
* [XRay] [compiler-rt] Mark arg1 logging test as failing on !x86_64.Dean Michael Berris2017-03-071-1/+1
| | | | | | | | | | | | | | | | Summary: rL297000 and rL297003 implemented arg1 logging on amd64 and made other architectures build. We need to blacklist the new test as well. Reviewers: dberris, timshen Reviewed By: dberris Subscribers: sdardis, llvm-commits Differential Revision: https://reviews.llvm.org/D30635 llvm-svn: 297238
* [PowerPC] mark xray test as unsupported on powerpcle in testsuiteBill Seurer2017-03-071-0/+2
| | | | | | | | | Temporarily mark the test as unsupported so the powerpc le buildbot testers can get back to work. There was a brief discussion of this on the mailing list for r296998. llvm-svn: 297184
* [XRay] [compiler-rt] Allow logging the first argument of a function call.Dean Michael Berris2017-03-061-0/+41
| | | | | | | | | | | | | | | | | | | Summary: Functions with the LOG_ARGS_ENTRY sled kind at their beginning will be handled in a way to (optionally) pass their first call argument to your logging handler. For practical and performance reasons, only the first argument is supported, and only up to 64 bits. Reviewers: javed.absar, dberris Reviewed By: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29703 llvm-svn: 297000
* [XRay][compiler-rt] Switch default XRay 'patch_premain' to falseDean Michael Berris2017-02-284-4/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: Currently, we assume that applications built with XRay would like to have the instrumentation sleds patched before main starts. This patch changes the default so that we do not patch the instrumentation sleds before main. This default is more helpful for deploying applications in environments where changing the current default is harder (i.e. on remote machines, or work-pool-like systems). This default (not to patch pre-main) makes it easier to selectively run applications with XRay instrumentation enabled, than with the current state. Reviewers: echristo, timshen Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D30396 llvm-svn: 296445
* [Compiler-rt][XRAY][MIPS] Support xray on mips/mipsel/mips64/mips64elSagar Thakur2017-02-151-0/+33
| | | | | | | | | Summary: Adds support for xray on mips/mipsel/mips64/mips64el. Reviewed by sdardis, dberris Differential: D27699 llvm-svn: 295166
* [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][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][AArch64] Disable the unstable test ↵Serge Rogatch2016-12-071-0/+1
| | | | | | | | | | | | | | | | 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
* [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
* [compiler-rt][XRay] Implement __xray_unpatch() and __xray_remove_handler()Dean Michael Berris2016-08-081-0/+47
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