#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_file.h"
#include "sanitizer_common/sanitizer_internal_defs.h"
#if SANITIZER_POSIX
#include "sanitizer_common/sanitizer_posix.h"
#endif
#include "sanitizer_common/sanitizer_symbolizer.h"
#include "stats/stats.h"
#if SANITIZER_POSIX
#include <signal.h>
#endif
usingnamespace__sanitizer;
namespace {
InternalMmapVectorNoCtor<StatModule **> modules;
StaticSpinMutex modules_mutex;
fd_t stats_fd;
void WriteLE(fd_t fd, uptr val) { … }
void OpenStatsFile(const char *path_env) { … }
void WriteModuleReport(StatModule **smodp) { … }
}
extern "C"
SANITIZER_INTERFACE_ATTRIBUTE
unsigned __sanitizer_stats_register(StatModule **mod) { … }
extern "C"
SANITIZER_INTERFACE_ATTRIBUTE
void __sanitizer_stats_unregister(unsigned index) { … }
namespace {
void WriteFullReport() { … }
#if SANITIZER_POSIX
void USR2Handler(int sig) { … }
#endif
struct WriteReportOnExitOrSignal { … } wr;
}