summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/xray/TestCases/Posix
Commit message (Collapse)AuthorAgeFilesLines
* [XRay] Fixing one test case for FreeBSDDavid Carlier2019-08-281-0/+10
| | | | | | | | | | Reviewers: dberris Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D66867 llvm-svn: 370209
* compiler-rt: Rename .cc file in test/xray to .cppFangrui Song2019-08-0228-0/+0
| | | | | | | | | Like r367463, but for test/xray. Update test/xray/lit.cfg.py config.suffixes to remove .cc (we actually don't have .c tests now) llvm-svn: 367652
* Add header <atomic> which is needed to compile with some older library versions.Douglas Yung2018-11-211-0/+1
| | | | llvm-svn: 347382
* [XRay] Add a test for re-initialising FDR mode (NFC)Dean Michael Berris2018-11-211-0/+72
| | | | | | | This change adds an end-to-end test that ensures FDR mode can be re-initialised safely in the face of multiple threads being traced. llvm-svn: 347368
* [XRay] Update XRayRecord to support Custom/Typed EventsDean Michael Berris2018-11-065-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change cuts across LLVM and compiler-rt to add support for rendering custom events in the XRayRecord type, to allow for including user-provided annotations in the output YAML (as raw bytes). This work enables us to add custom event and typed event records into the `llvm::xray::Trace` type for user-provided events. This can then be programmatically handled through the C++ API and can be included in some of the tooling as well. For now we support printing the raw data we encounter in the custom events in the converted output. Future work will allow us to start interpreting these custom and typed events through a yet-to-be-defined API for extending the trace analysis library. Reviewers: mboerger Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D54139 llvm-svn: 346214
* Disable XRay test fork_basic_logging for NetBSDKamil Rytarowski2018-11-061-0/+3
| | | | | | This code has not been ported so far. llvm-svn: 346196
* [XRay] Fix fdr-thread-order.cc when current directory contains ↵Fangrui Song2018-09-281-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fdr-thread-order.cc Summary: Currently, cd test/xray/TestCases/Posix $build/bin/llvm-lit fdr-thread-order.cc fails because `rm fdr-thread-order.*` deletes the .cc file. This patch uses: * %t as temporary directory name containing log files * %t.exe as executable name It does not delete %t after the test finishes for debugging convenience. This matches the behavior of tests of various other LLVM components. Log files will not clog up because the temporary directory (unique among test files but the same among multiple invocations of a test) is cleaned at the beginning of the test. Reviewers: dberris, mboerger, eizan Reviewed By: dberris Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D52638 llvm-svn: 343295
* [XRay] Fix argv0-log-file-name.cc race when tests are executed parallellyFangrui Song2018-09-271-1/+1
| | | | | | | `rm xray-log.*` may delete log files of other tests and cause them to fail, when tests are executed parallelly. llvm-svn: 343282
* [XRay] Remove the unused variablePetr Hosek2018-09-151-2/+0
| | | | | | | This broke the fdr-single-thread test after FDRLoggingOptions struct has been removed in r342318. llvm-svn: 342320
* [XRay] Remove the deprecated __xray_log_init APIPetr Hosek2018-09-154-14/+3
| | | | | | | | | This API has been deprecated three months ago and shouldn't be used anymore, all clients should migrate to the new string based API. Differential Revision: https://reviews.llvm.org/D51606 llvm-svn: 342318
* [XRay][clang] Emit "never-instrument" attributeDean Michael Berris2018-09-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, we only emit the XRay attributes in LLVM IR when the -fxray-instrument flag is provided. This may cause issues with thinlto when the final binary is being built/linked with -fxray-instrument, and the constitutent LLVM IR gets re-lowered with xray instrumentation. With this change, we can honour the "never-instrument "attributes provided in the source code and preserve those in the IR. This way, even in thinlto builds, we retain the attributes which say whether functions should never be XRay instrumented. This change addresses llvm.org/PR38922. Reviewers: mboerger, eizan Subscribers: mehdi_amini, dexonsmith, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D52015 llvm-svn: 342200
* [XRay][compiler-rt] Profiling Mode: Include file header in buffersDean Michael Berris2018-07-312-4/+8
| | | | | | | | | | | | | | | | | Summary: This change provides access to the file header even in the in-memory buffer processing. This allows in-memory processing of the buffers to also check the version, and the format, of the profile data. Reviewers: eizan, kpw Reviewed By: eizan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D50037 llvm-svn: 338347
* [XRay tests] Don't filter test-critical callsJeremy Morse2018-07-251-1/+1
| | | | | | | | | | By default, xray filters events that takes less than 5uS from its log. In this existing test, should printf complete very quickly this will lead to test-critical function calls being filtered (i.e. print_parent_tid). Given that we're not testing the filtering feature, disable it for this test. llvm-svn: 337929
* Reapply "[XRay] Remove scheduling dependency in fork_basic_logging.cc"Matthew Voss2018-07-231-4/+4
| | | | | | | | | | | | | | | | | | | Summary: Continuation of https://reviews.llvm.org/D49501 Second part of the test has an scheduling order when there shouldn't be. Reviewers: dberris, ormris Reviewed By: dberris, ormris Subscribers: TWeaver Differential Revision: https://reviews.llvm.org/D49559 llvm-svn: 337745
* [XRay][compiler-rt] Profiling: No files when emptyDean Michael Berris2018-07-192-2/+2
| | | | | | | | | This change makes it so that the profiling mode implementation will only write files when there are buffers to write. Before this change, we'd always open a file even if there were no profiles collected when flushing. llvm-svn: 337443
* Remove scheduling dependency from XRay :: Posix/fork_basic_logging.ccMatthew Voss2018-07-191-2/+2
| | | | | | | | | | | | | | | | | | | Summary: We've been seeing intermittent failures on our internal bots and we suspect this may be due to the OS scheduling the child process to run before the parent process. This version ensures that the parent and child can be run in either order. Reviewers: Maknee, dberris Reviewed By: dberris Subscribers: delcypher, #sanitizers, Maknee, llvm-commits Differential Revision: https://reviews.llvm.org/D49501 llvm-svn: 337432
* [XRay][compiler-rt] FDR Mode: Allow multiple runsDean Michael Berris2018-07-181-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fix a bug in FDR mode which didn't allow for re-initialising the logging in the same process. This change ensures that: - When we flush the FDR mode logging, that the state of the logging implementation is `XRAY_LOG_UNINITIALIZED`. - Fix up the thread-local initialisation to use aligned storage and `pthread_getspecific` as well as `pthread_setspecific` for the thread-specific data. - Actually use the pointer provided to the thread-exit cleanup handling, instead of assuming that the thread has thread-local data associated with it, and reaching at thread-exit time. In this change we also have an explicit test for two consecutive sessions for FDR mode tracing, and ensuring both sessions succeed. Reviewers: kpw, eizan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49359 llvm-svn: 337341
* [XRay][compiler-rt] Add PID field to llvm-xray tool and add PID metadata ↵Dean Michael Berris2018-07-134-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | record entry in FDR mode Summary: llvm-xray changes: - account-mode - process-id {...} shows after thread-id - convert-mode - process {...} shows after thread - parses FDR and basic mode pid entries - Checks version number for FDR log parsing. Basic logging changes: - Update header version from 2 -> 3 FDR logging changes: - Update header version from 2 -> 3 - in writeBufferPreamble, there is an additional PID Metadata record (after thread id record and tsc record) Test cases changes: - fdr-mode.cc, fdr-single-thread.cc, fdr-thread-order.cc modified to catch process id output in the log. Reviewers: dberris Reviewed By: dberris Subscribers: hiraditya, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49153 llvm-svn: 336974
* [XRay][compiler-rt] Profiling Mode: Flush logs on exitDean Michael Berris2018-07-132-2/+2
| | | | | | | | | | | | | | | | | Summary: This change adds support for writing out profiles at program exit. Depends on D48653. Reviewers: kpw, eizan Reviewed By: kpw Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48956 llvm-svn: 336969
* [XRay][compiler-rt] Fixup: require x86_64 for profiling mode testsDean Michael Berris2018-07-122-2/+4
| | | | | | | This constrains the build environments we are testing/supporting for the runtime tests until we can be sure xray works in more platforms. llvm-svn: 336878
* [XRay] basic mode PID and TID always fetchDean Michael Berris2018-07-111-0/+100
| | | | | | | | | | | | | | Summary: XRayRecords now includes a PID field. Basic handlers fetch pid and tid each time they are called instead of caching the value. Added a testcase that calls fork and checks if the child TID is different from the parent TID to verify that the processes' TID are different in the trace. Reviewers: dberris, Maknee Reviewed By: dberris, Maknee Subscribers: kpw, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49025 llvm-svn: 336769
* [XRay] rm GLOB || true -> rm -fFangrui Song2018-06-1912-21/+21
| | | | | | | | | | | | Summary: `rm -f` does not write diagnostic message when there is no file argument. Reviewers: dberris Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48311 llvm-svn: 335025
* [XRay][profiler] Part 5: Profiler File WritingDean Michael Berris2018-06-122-10/+19
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is part of the larger XRay Profiling Mode effort. This patch implements the profile writing mechanism, to allow profiles collected through the profiler mode to be persisted to files. Follow-on patches would allow us to load these profiles and start converting/analysing them through the `llvm-xray` tool. Depends on D44620. Reviewers: echristo, kpw, pelikan Reviewed By: kpw Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45998 llvm-svn: 334472
* [XRay][profiler] Part 4: Profiler Mode WiringDean Michael Berris2018-06-123-1/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is part of the larger XRay Profiling Mode effort. This patch implements the wiring required to enable us to actually select the `xray-profiling` mode, and install the handlers to start measuring the time and frequency of the function calls in call stacks. The current way to get the profile information is by working with the XRay API to `__xray_process_buffers(...)`. In subsequent changes we'll implement profile saving to files, similar to how the FDR and basic modes operate, as well as means for converting this format into those that can be loaded/visualised as flame graphs. We will also be extending the accounting tool in LLVM to support stack-based function call accounting. We also continue with the implementation to support building small histograms of latencies for the `FunctionCallTrie::Node` type, to allow us to actually approximate the distribution of latencies per function. Depends on D45758 and D46998. Reviewers: eizan, kpw, pelikan Reviewed By: kpw Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D44620 llvm-svn: 334469
* [XRay][compiler-rt] Remove reliance on C++ ABI featuresDean Michael Berris2018-06-081-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes http://llvm.org/PR32274. This change adds a test to ensure that we're able to link XRay modes and the runtime to binaries that don't need to depend on the C++ standard library or a C++ ABI library. In particular, we ensure that this will work with C programs compiled+linked with XRay. To make the test pass, we need to change a few things in the XRay runtime implementations to remove the reliance on C++ ABI features. In particular, we change the thread-safe function-local-static initialisation to use pthread_* instead of the C++ features that ensure non-trivial thread-local/function-local-static initialisation. Depends on D47696. Reviewers: dblaikie, jfb, kpw, eizan Reviewed By: kpw Subscribers: echristo, eizan, kpw, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D46998 llvm-svn: 334262
* [XRay] Fix supposely failing test for FreeBSDDavid Carlier2018-06-011-1/+1
| | | | | | | | | | | | One test was marked as XFAIL for FreeBSD however still running when launching make check-xray Reviewers: krytarowski, vitalybuka Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D47622 llvm-svn: 333733
* [XRay][compiler-rt] Support in-memory processing of FDR mode logsDean Michael Berris2018-05-141-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows for handling the in-memory data associated with the FDR mode implementation through the new `__xray_log_process_buffers` API. With this change, we can now allow users to process the data in-memory of the process instead of through writing files. This for example allows users to stream the data of the FDR logging implementation through network sockets, or through other mechanisms instead of saving them to local files. We introduce an FDR-specific flag, for "no_file_flush" which lets the flushing logic skip opening/writing to files. This option can be defaulted to `true` when building the compiler-rt XRay runtime through the `XRAY_FDR_OPTIONS` preprocessor macro. Reviewers: kpw, echristo, pelikan, eizan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46574 llvm-svn: 332208
* [XRay][compiler-rt] Support string-based config for Basic mode.Dean Michael Berris2018-05-041-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This addresses http://llvm.org/PR36790. This change allows the XRay Basic Mode implementation to use the string-based initialization routine provided through `__xray_log_init_mode(...)`. In the process, we've also deprecated some flags defined for the `XRAY_OPTIONS` environment variable. We then introduce another environment variable that can control the XRay Basic Mode implementation through `XRAY_BASIC_OPTIONS`. We also rename files from `xray_inmemory_log` to `xray_basic_logging` to be more in line with the mode implementation. Depends on D46174. Reviewers: echristo, kpw, pelikan, eizan Reviewed By: kpw Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D46246 llvm-svn: 331507
* [XRay][compiler-rt] Support string-based config for FDR modeDean Michael Berris2018-05-041-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | Summary: In this chage we add support for the string-based configuration mechanism for configuring FDR mode. We deprecate most of the `xray_fdr_log_*` flags that are set with the `XRAY_OPTIONS` environment variable. Instead we make the FDR implementation take defaults from the `XRAY_FDR_OPTIONS` environment variable, and use the flags defined in `xray_fdr_flags.{h,cc,inc}` for the options we support. This change addresses http://llvm.org/PR36790. Depends on D46173. Reviewers: eizan, pelikan, kpw, echristo Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D46174 llvm-svn: 331506
* [XRay][compiler-rt+docs] Introduce __xray_log_init_mode(...).Dean Michael Berris2018-05-041-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This addresses http://llvm.org/PR36790. The change Deprecates a number of functions and types in `include/xray/xray_log_interface.h` to recommend using string-based configuration of XRay through the __xray_log_init_mode(...) function. In particular, this deprecates the following: - `__xray_set_log_impl(...)` -- users should instead use the `__xray_log_register_mode(...)` and `__xray_log_select_mode(...)` APIs. - `__xray_log_init(...)` -- users should instead use the `__xray_log_init_mode(...)` function, which also requires using the `__xray_log_register_mode(...)` and `__xray_log_select_mode(...)` functionality. - `__xray::FDRLoggingOptions` -- in following patches, we'll be migrating the FDR logging implementations (and tests) to use the string-based configuration. In later stages we'll remove the `__xray::FDRLoggingOptions` type, and ask users to migrate to using the string-based configuration mechanism instead. - `__xray::BasicLoggingOptions` -- same as `__xray::FDRLoggingOptions`, we'll be removing this type later and instead rely exclusively on the string-based configuration API. We also update the documentation to reflect the new advice and remove some of the deprecated notes. Reviewers: eizan, kpw, echristo, pelikan Reviewed By: kpw Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46173 llvm-svn: 331503
* [XRay][compiler-rt] Add APIs for processing logs in memoryDean Michael Berris2018-03-071-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change adds APIs to allow logging implementations to provide a function for iterating through in-memory buffers (if they hold in-memory buffers) and a way for users to generically deal with these buffers in-process. These APIs are: - __xray_log_set_buffer_iterator(...) and __xray_log_remove_buffer_iterator(): installs and removes an iterator function that takes an XRayBuffer and yields the next one. - __xray_log_process_buffers(...): takes a function pointer that can take a mode identifier (string) and an XRayBuffer to process this data as they see fit. The intent is to have the FDR mode implementation's buffers be available through this `__xray_log_process_buffers(...)` API, so that they can be streamed from memory instead of flushed to disk (useful for getting the data to a network, or doing in-process analysis). Basic mode logging will not support this mechanism as it's designed to write the data mostly to disk. Future implementations will may depend on this API as well, to allow for programmatically working through the XRay buffers exposed to the users in some fashion. Reviewers: eizan, kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43495 llvm-svn: 326866
* Try to fix the syntax in testKamil Rytarowski2018-02-221-1/+1
| | | | | | | | | | | | | | Reported on a buildbot: Error in XFAIL list: couldn't parse text: '| arm || aarch64 || mips' in expression: 'freebsd | arm || aarch64 || mips' Add || in the place of | Fallout from D43382 llvm-svn: 325751
* Xray instrumentation / enabling more testsKamil Rytarowski2018-02-2220-0/+906
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 llvm-svn: 325743
OpenPOWER on IntegriCloud