Files
comaps/libs/base/pprof.cpp
Alexander Borsuk 76ffc99abd New cpp folder structure
Signed-off-by: Alexander Borsuk <me@alex.bio>
2025-08-14 20:52:04 +07:00

27 lines
380 B
C++

#include "base/pprof.hpp"
#include "base/assert.hpp"
#if defined(USE_PPROF)
#include <gperftools/profiler.h>
#endif
namespace base
{
PProf::PProf(std::string const & path)
{
#if defined(USE_PPROF)
ProfilerStart(path.c_str());
#endif
}
PProf::~PProf()
{
CHECK(m_checker.CalledOnOriginalThread(), ());
#if defined(USE_PPROF)
ProfilerStop();
#endif
}
} // namespace base