#include </builds/gaudi/Gaudi/GaudiAud/src/ProcStats.h>
Definition at line 38 of file ProcStats.h.
◆ ProcStats()
◆ fetch()
bool ProcStats::fetch |
( |
procInfo & |
fill_me | ) |
|
Definition at line 259 of file ProcStats.cpp.
260 if ( !
m_valid ) {
return false; }
264 #if defined( __linux__ ) or defined( __APPLE__ )
266 auto read_proc = [&]() {
271 m_ufd.lseek( 0, SEEK_SET );
272 if ( ( cnt =
m_ufd.read( buf,
sizeof( buf ) ) ) < 0 ) { ok =
false; }
279 "%d %s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %llu %lu %ld %lu %lu %lu %lu "
280 "%lu %lu %lu %lu %lu %lu %lu",
288 const auto pr_size =
static_cast<double>( pinfo.
vsize );
289 const auto pr_rssize =
static_cast<double>( pinfo.
rss );
290 constexpr
double MB = 1.0 / ( 1024 * 1024 );
291 f.vsize = pr_size *
MB;
293 if ( 0 == pinfo.
vsize ) { ok =
false; }
299 if ( !read_proc() ) {
300 std::cerr <<
"ProcStats : -> Problems reading proc file. Will try reopening..." <<
std::endl;
302 if ( !read_proc() ) {
return false; }
309 #endif // __linux__ or __APPLE__
◆ instance()
◆ open_ufd()
void ProcStats::open_ufd |
( |
| ) |
|
|
private |
Definition at line 244 of file ProcStats.cpp.
246 #if defined( __linux__ ) or defined( __APPLE__ )
249 const auto fname =
"/proc/" +
std::to_string( getpid() ) +
"/stat";
256 #endif // __linux__ or __APPLE__
◆ pageSize()
auto ProcStats::pageSize |
( |
| ) |
const |
|
inlinenoexcept |
◆ m_curr
◆ m_mutex
◆ m_pg_size
double ProcStats::m_pg_size { 0 } |
|
private |
◆ m_ufd
◆ m_valid
bool ProcStats::m_valid { false } |
|
private |
The documentation for this class was generated from the following files: