mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[XRay][llvm+clang] Consolidate attribute list files
Summary: This change consolidates the always/never lists that may be provided to clang to externally control which functions should be XRay instrumented by imbuing attributes. The files follow the same format as defined in https://clang.llvm.org/docs/SanitizerSpecialCaseList.html for the sanitizer blacklist. We also deprecate the existing `-fxray-instrument-always=` and `-fxray-instrument-never=` flags, in favour of `-fxray-attr-list=`. This fixes http://llvm.org/PR34721. Reviewers: echristo, vlad.tsyrklevich, eugenis Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D45357 llvm-svn: 329543
This commit is contained in:
parent
e15a25d24e
commit
3153e6c6d9
@ -117,6 +117,27 @@ it gets instrumented.
|
||||
; ...
|
||||
}
|
||||
|
||||
Special Case File
|
||||
-----------------
|
||||
|
||||
Attributes can be imbued through the use of special case files instead of
|
||||
adding them to the original source files. You can use this to mark certain
|
||||
functions and classes to be never, always, or instrumented with first-argument
|
||||
logging from a file. The file's format is described below:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Comments are supported
|
||||
[always]
|
||||
fun:always_instrument
|
||||
fun:log_arg1=arg1 # Log the first argument for the function
|
||||
|
||||
[never]
|
||||
fun:never_instrument
|
||||
|
||||
These files can be provided through the ``-fxray-attr-list=`` flag to clang.
|
||||
You may have multiple files loaded through multiple instances of the flag.
|
||||
|
||||
XRay Runtime Library
|
||||
--------------------
|
||||
|
||||
|
@ -178,22 +178,22 @@ add the attribute to the source.
|
||||
To use this feature, you can define one file for the functions to always
|
||||
instrument, and another for functions to never instrument. The format of these
|
||||
files are exactly the same as the SanitizerLists files that control similar
|
||||
things for the sanitizer implementations. For example, we can have two
|
||||
different files like below:
|
||||
things for the sanitizer implementations. For example:
|
||||
|
||||
::
|
||||
|
||||
# always-instrument.txt
|
||||
# xray-attr-list.txt
|
||||
# always instrument functions that match the following filters:
|
||||
[always]
|
||||
fun:main
|
||||
|
||||
# never-instrument.txt
|
||||
# never instrument functions that match the following filters:
|
||||
[never]
|
||||
fun:__cxx_*
|
||||
|
||||
Given the above two files we can re-build by providing those two files as
|
||||
arguments to clang as ``-fxray-always-instrument=always-instrument.txt`` or
|
||||
``-fxray-never-instrument=never-instrument.txt``.
|
||||
Given the file above we can re-build by providing it to the
|
||||
``-fxray-attr-list=`` flag to clang. You can have multiple files, each defining
|
||||
different sets of attribute sets, to be combined into a single list by clang.
|
||||
|
||||
The XRay stack tool
|
||||
-------------------
|
||||
|
Loading…
Reference in New Issue
Block a user