ClickHouse/base/common/coverage.cpp
Ivan 38b2dec354
Arcadia (#9729)
* Move getFQDNOrHostName to base/common/
* Add argsToConfig to ya.make
* Add coverage.cpp to ya.make
  Also remove WITH_COVERAGE from config file
2020-03-18 21:54:27 +03:00

33 lines
519 B
C++

#include "coverage.h"
#if WITH_COVERAGE
# include <mutex>
# include <unistd.h>
# if defined(__clang__)
extern "C" void __llvm_profile_dump();
# elif defined(__GNUC__) || defined(__GNUG__)
extern "C" void __gcov_exit();
# endif
#endif
void dumpCoverageReportIfPossible()
{
#if WITH_COVERAGE
static std::mutex mutex;
std::lock_guard lock(mutex);
# if defined(__clang__)
__llvm_profile_dump();
# elif defined(__GNUC__) || defined(__GNUG__)
__gcov_exit();
# endif
#endif
}