1 //===-- sanitizer/esan_interface.h ------------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of EfficiencySanitizer, a family of performance tuners.
10 // Public interface header.
11 //===----------------------------------------------------------------------===//
12 #ifndef SANITIZER_ESAN_INTERFACE_H
13 #define SANITIZER_ESAN_INTERFACE_H
15 #include <sanitizer/common_interface_defs.h>
17 // We declare our interface routines as weak to allow the user to avoid
18 // ifdefs and instead use this pattern to allow building the same sources
19 // with and without our runtime library:
23 /* selectany is as close to weak as we'll get. */
24 #define COMPILER_RT_WEAK __declspec(selectany)
26 #define COMPILER_RT_WEAK __attribute__((weak))
28 #define COMPILER_RT_WEAK
35 // This function can be called mid-run (or at the end of a run for
36 // a server process that doesn't shut down normally) to request that
37 // data for that point in the run be reported from the tool.
38 void COMPILER_RT_WEAK
__esan_report();
40 // This function returns the number of samples that the esan tool has collected
41 // to this point. This is useful for testing.
42 unsigned int COMPILER_RT_WEAK
__esan_get_sample_count();
48 #endif // SANITIZER_ESAN_INTERFACE_H