summaryrefslogtreecommitdiffstats
path: root/compiler-rt/include
diff options
context:
space:
mode:
authorSergey Matveev <earthdok@google.com>2014-05-19 12:53:03 +0000
committerSergey Matveev <earthdok@google.com>2014-05-19 12:53:03 +0000
commit6cb47a083bf52d2bea227ab2da5cb00c6b7eb816 (patch)
tree4845696f3e4b4b9f79b0e72d218e2d3be6c4e7c6 /compiler-rt/include
parentfcfc213c3f2279fe12a6fc343937874a7dbbde62 (diff)
downloadbcm5719-llvm-6cb47a083bf52d2bea227ab2da5cb00c6b7eb816.tar.gz
bcm5719-llvm-6cb47a083bf52d2bea227ab2da5cb00c6b7eb816.zip
[sanitizer] Support sandboxing in sanitizer coverage.
Summary: Sandboxed code may now pass additional arguments to __sanitizer_sandbox_on_notify() to force all coverage data to be dumped to a single file (the default is one file per module). The user may supply a file or socket to write to. The latter option can be used to broker out the file writing functionality. If -1 is passed, we pre-open a file. llvm-svn: 209121
Diffstat (limited to 'compiler-rt/include')
-rw-r--r--compiler-rt/include/sanitizer/common_interface_defs.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/compiler-rt/include/sanitizer/common_interface_defs.h b/compiler-rt/include/sanitizer/common_interface_defs.h
index fa3c14d1b53..dce95d9d8e1 100644
--- a/compiler-rt/include/sanitizer/common_interface_defs.h
+++ b/compiler-rt/include/sanitizer/common_interface_defs.h
@@ -24,13 +24,28 @@
#ifdef __cplusplus
extern "C" {
#endif
+ // Arguments for __sanitizer_sandbox_on_notify() below.
+ typedef struct {
+ // Enable sandbox support in sanitizer coverage.
+ int coverage_sandboxed;
+ // File descriptor to write coverage data to. If -1 is passed, a file will
+ // be pre-opened by __sanitizer_sandobx_on_notify(). This field has no
+ // effect if coverage_sandboxed == 0.
+ intptr_t coverage_fd;
+ // If non-zero, split the coverage data into well-formed blocks. This is
+ // useful when coverage_fd is a socket descriptor. Each block will contain
+ // a header, allowing data from multiple processes to be sent over the same
+ // socket.
+ unsigned int coverage_max_block_size;
+ } __sanitizer_sandbox_arguments;
+
// Tell the tools to write their reports to "path.<pid>" instead of stderr.
void __sanitizer_set_report_path(const char *path);
// Notify the tools that the sandbox is going to be turned on. The reserved
// parameter will be used in the future to hold a structure with functions
// that the tools may call to bypass the sandbox.
- void __sanitizer_sandbox_on_notify(void *reserved);
+ void __sanitizer_sandbox_on_notify(__sanitizer_sandbox_arguments *args);
// This function is called by the tool when it has just finished reporting
// an error. 'error_summary' is a one-line string that summarizes
OpenPOWER on IntegriCloud