#include <SimpleProfiler.h>
Definition at line 12 of file SimpleProfiler.h.
SimpleProfiler::SimpleProfiler |
( |
| ) |
|
|
private |
Definition at line 597 of file SimpleProfiler.cc.
References fd_, and filename_.
605 S_IRWXU|S_IRGRP|S_IROTH|S_IWGRP|S_IWOTH)),
612 std::ostringstream ost;
613 ost <<
"failed to open profiler output file " <<
filename_;
614 throw std::runtime_error(ost.str().c_str());
std::string makeFileName(const std::string &base, int num)
SimpleProfiler::~SimpleProfiler |
( |
| ) |
|
|
private |
void SimpleProfiler::commitFrame |
( |
void ** |
first, |
|
|
void ** |
last |
|
) |
| |
void SimpleProfiler::complete |
( |
| ) |
|
|
private |
Definition at line 719 of file SimpleProfiler.cc.
References benchmark_cfg::cerr, doWrite(), fd_, filename_, edmtest::makeFileName(), and writeProfileData().
Referenced by stop().
723 if(lseek(
fd_,0,SEEK_SET)<0)
725 std::cerr <<
"SimpleProfiler: could not seek to the start of the profile\n"
726 <<
" data file during completion. Data will be lost.\n";
734 totsname +=
"_sample_info";
735 std::ofstream ost(totsname.c_str());
737 ost <<
"samples_total " << samples_total <<
"\n"
738 <<
"samples_missing_framepointer " << samples_missing_framepointer <<
"\n" ;
std::string makeFileName(const std::string &base, int num)
void writeProfileData(int fd, const std::string &prefix)
void SimpleProfiler::doWrite |
( |
| ) |
|
|
private |
Definition at line 639 of file SimpleProfiler.cc.
References curr_, fd_, frame_data_, and start().
Referenced by commitFrame(), and complete().
642 if(
curr_ == start)
return;
643 unsigned int cnt = std::distance(start,
curr_) *
sizeof(
void*);
644 unsigned int totwr=0;
646 while (cnt>0 && (totwr=write(
fd_,start,cnt)) != cnt) {
648 throw std::runtime_error(
"SimpleProfiler::doWrite wrote zero bytes");
649 start+=(totwr/
sizeof(
void*));
void* SimpleProfiler::stackTop |
( |
| ) |
|
|
inline |
void SimpleProfiler::start |
( |
void |
| ) |
|
void SimpleProfiler::stop |
( |
| ) |
|
void** SimpleProfiler::tempStack |
( |
| ) |
|
|
inline |
void** SimpleProfiler::curr_ |
|
private |
std::string SimpleProfiler::filename_ |
|
private |
VoidVec SimpleProfiler::frame_data_ |
|
private |
void** SimpleProfiler::high_water_ |
|
private |
bool SimpleProfiler::installed_ |
|
private |
pthread_t SimpleProfiler::owner_ |
|
private |
bool SimpleProfiler::running_ |
|
private |
void* SimpleProfiler::stacktop_ |
|
private |