summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-12-13 06:37:13 +0000
committerDean Michael Berris <dberris@google.com>2017-12-13 06:37:13 +0000
commiteec462f0e888d662c4f9d60018e1460285708c5d (patch)
treea3aa4931b2ab19e38d121f1656219419467cd13c
parentc80e76cdf582610c381caa671799a5247335d63a (diff)
downloadbcm5719-llvm-eec462f0e888d662c4f9d60018e1460285708c5d.tar.gz
bcm5719-llvm-eec462f0e888d662c4f9d60018e1460285708c5d.zip
[XRay][compiler-rt] Reduce XRay log spam
This change makes XRay print the log file output only when the verbosity level is higher than 0. It reduces the log spam in the default case when we want XRay running silently, except when there are actual fatal/serious errors. We also update the documentation to show how to get the information after the change to the default behaviour. llvm-svn: 320550
-rw-r--r--compiler-rt/lib/xray/xray_utils.cc3
-rw-r--r--llvm/docs/XRay.rst3
-rw-r--r--llvm/docs/XRayExample.rst2
3 files changed, 6 insertions, 2 deletions
diff --git a/compiler-rt/lib/xray/xray_utils.cc b/compiler-rt/lib/xray/xray_utils.cc
index b9a38d1b98e..cf800d3aeaf 100644
--- a/compiler-rt/lib/xray/xray_utils.cc
+++ b/compiler-rt/lib/xray/xray_utils.cc
@@ -117,7 +117,8 @@ int getLogFD() XRAY_NEVER_INSTRUMENT {
TmpFilename);
return -1;
}
- Report("XRay: Log file in '%s'\n", TmpFilename);
+ if (__sanitizer::Verbosity())
+ Report("XRay: Log file in '%s'\n", TmpFilename);
return Fd;
}
diff --git a/llvm/docs/XRay.rst b/llvm/docs/XRay.rst
index 942b479af74..ebf02567830 100644
--- a/llvm/docs/XRay.rst
+++ b/llvm/docs/XRay.rst
@@ -164,6 +164,9 @@ variable, where we list down the options and their defaults below.
| | | | Data Recorder |
| | | | (FDR) mode. |
+-------------------+-----------------+---------------+------------------------+
+| verbosity | ``int`` | ``0`` | Runtime verbosity |
+| | | | level. |
++-------------------+-----------------+---------------+------------------------+
If you choose to not use the default logging implementation that comes with the
diff --git a/llvm/docs/XRayExample.rst b/llvm/docs/XRayExample.rst
index 9f74442bceb..f8e7d943fed 100644
--- a/llvm/docs/XRayExample.rst
+++ b/llvm/docs/XRayExample.rst
@@ -60,7 +60,7 @@ to enable XRay at application start. To do this, XRay checks the
$ ./bin/llc input.ll
# We need to set the XRAY_OPTIONS to enable some features.
- $ XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic" ./bin/llc input.ll
+ $ XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic verbosity=1" ./bin/llc input.ll
==69819==XRay: Log file in 'xray-log.llc.m35qPB'
At this point we now have an XRay trace we can start analysing.
OpenPOWER on IntegriCloud