diff options
author | Kostya Serebryany <kcc@google.com> | 2015-02-03 19:40:53 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-02-03 19:40:53 +0000 |
commit | 10a9c395b0c5f5777e7a89329f2b5ecd67081e7a (patch) | |
tree | 387d73ab5d65d4e719979dd2bdcfd62a324cd0ee /include/sanitizer/coverage_interface.h | |
parent | 463638060ede43ff28467925fa8b7ee213aae7fd (diff) |
[sanitizer] move the coverage interface into a separate header, <sanitizer/coverage_interface.h>. NFC, except for the header name change. This may break existing users, but in this case it's better this way (not too many users so far)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@228017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/sanitizer/coverage_interface.h')
-rw-r--r-- | include/sanitizer/coverage_interface.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/sanitizer/coverage_interface.h b/include/sanitizer/coverage_interface.h new file mode 100644 index 000000000..88a7e4800 --- /dev/null +++ b/include/sanitizer/coverage_interface.h @@ -0,0 +1,46 @@ +//===-- sanitizer/coverage_interface.h --------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Public interface for sanitizer coverage. +//===----------------------------------------------------------------------===// + +#ifndef SANITIZER_COVERAG_INTERFACE_H +#define SANITIZER_COVERAG_INTERFACE_H + +#include <sanitizer/common_interface_defs.h> + +#ifdef __cplusplus +extern "C" { +#endif + + // Initialize coverage. + void __sanitizer_cov_init(); + // Record and dump coverage info. + void __sanitizer_cov_dump(); + // Open <name>.sancov.packed in the coverage directory and return the file + // descriptor. Returns -1 on failure, or if coverage dumping is disabled. + // This is intended for use by sandboxing code. + intptr_t __sanitizer_maybe_open_cov_file(const char *name); + // Get the number of total unique covered entities (blocks, edges, calls). + // This can be useful for coverage-directed in-process fuzzers. + uintptr_t __sanitizer_get_total_unique_coverage(); + + // Reset the basic-block (edge) coverage to the initial state. + // Useful for in-process fuzzing to start collecting coverage from scratch. + // Experimental, will likely not work for multi-threaded process. + void __sanitizer_reset_coverage(); + // Set *data to the array of covered PCs and return the size of that array. + // Some of the entries in *data will be zero. + uintptr_t __sanitizer_get_coverage_guards(uintptr_t **data); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_COVERAG_INTERFACE_H |