ATLAS Offline Software
Loading...
Searching...
No Matches
PerfMonMTUtils.h File Reference
#include "CxxUtils/checker_macros.h"
#include <dlfcn.h>
#include <fcntl.h>
#include <malloc.h>
#include <sys/stat.h>
#include <chrono>
#include <cstdint>
#include <ctime>
#include <fstream>
#include <map>
#include <string>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PMonMT::StepComp
struct  PMonMT::ComponentMeasurement
struct  PMonMT::ComponentData
struct  PMonMT::SnapshotMeasurement
struct  PMonMT::EventLevelData
struct  PMonMT::SnapshotData

Namespaces

namespace  PMonMT

Typedefs

typedef std::map< std::string, int64_t > MemoryMap_t

Functions

MemoryMap_t operator- (const MemoryMap_t &map1, const MemoryMap_t &map2)
double PMonMT::get_thread_cpu_time ()
double PMonMT::get_process_cpu_time ()
double PMonMT::get_wall_time ()
MemoryMap_t PMonMT::get_mem_stats ()
double PMonMT::get_vmem ()
bool PMonMT::doesDirectoryExist (const std::string &dir)
double get_malloc_kb PMonMT::ATLAS_NOT_THREAD_SAFE ()
const char * PMonMT::symb2lib (const char *symbol, const char *failstr)
struct mallinfo2 tc_mallinfo2 (void)
double PMonMT::get_malloc_kb ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options.

Typedef Documentation

◆ MemoryMap_t

typedef std::map<std::string, int64_t> MemoryMap_t

Definition at line 30 of file PerfMonMTUtils.h.

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

double PMonMT::get_malloc_kb ATLAS_NOT_THREAD_SAFE ( void )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Install fatal handler with default options.

Definition at line 428 of file PerfMonMTUtils.h.

428 {
429#ifndef __linux
430 return 0.0;
431#else
432 // Use tc_mallinfo2 when tcmalloc is preloaded, else fall back to mallinfo2().
433 const struct mallinfo2 m = (tc_mallinfo2 != nullptr) ? tc_mallinfo2() : mallinfo2();
434 return (m.uordblks + m.hblkhd) / 1024.0;
435#endif
436}
struct mallinfo2 tc_mallinfo2(void)

◆ operator-()

MemoryMap_t operator- ( const MemoryMap_t & map1,
const MemoryMap_t & map2 )
inline

Definition at line 404 of file PerfMonMTUtils.h.

404 {
405 MemoryMap_t result_map;
406 for (const auto& it : map1) {
407 result_map[it.first] = map1.at(it.first) - map2.at(it.first);
408 }
409 return result_map;
410}
std::map< std::string, int64_t > MemoryMap_t

◆ tc_mallinfo2()

struct mallinfo2 tc_mallinfo2 ( void )