39 if ((f = fopen(
"/proc/cpuinfo",
"r")) == 0) {
40 fatal <<
_(
"CycleTimer::get_mhz(): can't open /proc/cpuinfo") <<
endmsg;
51 if (fgets (buf,
sizeof(buf), f) == 0) {
52 fatal <<
_(
"CycleTimer::get_mhz(): cannot locate cpu MHz in /proc/cpuinfo") <<
endmsg;
62 ret = sscanf (buf,
"clock\t: %dMHz", &imhz);
66 ret = sscanf (buf,
"cpu MHz : %f", &mhz);
75 fatal <<
_(
"cannot locate cpu MHz in /proc/cpuinfo") <<
endmsg;
93 ofstream
f (file.c_str ());
95 f << min (_points, _max_points) <<
"\n";
97 for (
int i = 0; i < min (_points, _max_points); ++i) {
98 f << _point[i] <<
" " << _ref[i] <<
" " << _value[i] <<
"\n";
111 if (_points == _max_points) {
114 }
else if (_points > _max_points) {
120 _ref[_points] = _current_ref;
LIBPBD_API Transmitter fatal
void dump(std::string const &)
std::ostream & endmsg(std::ostream &ostr)
static float cycles_per_usec
static cycles_t get_cycles(void)