geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Classes | Public Member Functions | List of all members
geopm::ApplicationRecordLogImp Class Reference

#include <ApplicationRecordLog.hpp>

Inheritance diagram for geopm::ApplicationRecordLogImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::ApplicationRecordLogImp:
Collaboration graph
[legend]

Public Member Functions

 ApplicationRecordLogImp (std::shared_ptr< SharedMemory > shmem)
 
 ApplicationRecordLogImp (std::shared_ptr< SharedMemory > shmem, int process, std::shared_ptr< Scheduler > scheduler)
 
virtual ~ApplicationRecordLogImp ()=default
 
void enter (uint64_t hash, const geopm_time_s &time) override
 Create a message in the log defining a region entry. More...
 
void exit (uint64_t hash, const geopm_time_s &time) override
 Create a message in the log defining a region exit. More...
 
void epoch (const geopm_time_s &time) override
 Create a message in the log defining an epoch event. More...
 
void dump (std::vector< record_s > &records, std::vector< short_region_s > &short_regions) override
 Get all events that have occurred since the last call to dump(). More...
 
void affinity (const geopm_time_s &time, int cpu_idx) override
 
void cpuset_changed (const geopm_time_s &time) override
 
void start_profile (const geopm_time_s &time, const std::string &profile_name) override
 
void stop_profile (const geopm_time_s &time, const std::string &profile_name) override
 
void overhead (const geopm_time_s &time, double overhead_sec) override
 
- Public Member Functions inherited from geopm::ApplicationRecordLog
virtual ~ApplicationRecordLog ()=default
 Destructor for pure virtual base class. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::ApplicationRecordLog
static std::unique_ptr< ApplicationRecordLogmake_unique (std::shared_ptr< SharedMemory > shmem)
 Factory constructor. More...
 
static size_t buffer_size (void)
 Gets the shared memory size requirement. More...
 
static size_t max_record (void)
 Gets the maximum number of records. More...
 
static size_t max_region (void)
 Gets the maximum number of short region events. More...
 
- Protected Member Functions inherited from geopm::ApplicationRecordLog
 ApplicationRecordLog ()=default
 
- Static Protected Attributes inherited from geopm::ApplicationRecordLog
static constexpr size_t M_LAYOUT_SIZE = 57384
 
static constexpr int M_MAX_RECORD = 1024
 
static constexpr int M_MAX_REGION = M_MAX_RECORD + 1
 

Constructor & Destructor Documentation

◆ ApplicationRecordLogImp() [1/2]

geopm::ApplicationRecordLogImp::ApplicationRecordLogImp ( std::shared_ptr< SharedMemory >  shmem)

◆ ApplicationRecordLogImp() [2/2]

geopm::ApplicationRecordLogImp::ApplicationRecordLogImp ( std::shared_ptr< SharedMemory >  shmem,
int  process,
std::shared_ptr< Scheduler scheduler 
)

◆ ~ApplicationRecordLogImp()

virtual geopm::ApplicationRecordLogImp::~ApplicationRecordLogImp ( )
virtualdefault

Member Function Documentation

◆ affinity()

void geopm::ApplicationRecordLogImp::affinity ( const geopm_time_s &  time,
int  cpu_idx 
)
overridevirtual

◆ cpuset_changed()

void geopm::ApplicationRecordLogImp::cpuset_changed ( const geopm_time_s &  time)
overridevirtual

◆ dump()

void geopm::ApplicationRecordLogImp::dump ( std::vector< record_s > &  records,
std::vector< short_region_s > &  short_regions 
)
overridevirtual

Get all events that have occurred since the last call to dump().

Called by the ApplicationSampler to gather all records that have been created by the Profile object since the last time the method was called. The call effectively removes all of the records and short region data from the table.

For optimal performance the user should reserve space in the output vectors using the max_record() and max_region() static methods:

records.reserve(ApplicationRecordLog::max_record());
short_regions.reserve(ApplicationRecordLog::max_region());

Note that the "signal" in any sort region events in the records output vector is the index into the short_regions output vector, and the length of the short_regions vector will be equal to the number of events with type "EVENT_SHORT_REGION" in the records output vector.

Parameters
[out]recordsVector of records written since last dump().
[out]short_regionsVector of short region data about any short regions events in the records output vector.

Implements geopm::ApplicationRecordLog.

◆ enter()

void geopm::ApplicationRecordLogImp::enter ( uint64_t  hash,
const geopm_time_s &  time 
)
overridevirtual

Create a message in the log defining a region entry.

Called by the Profile object when a region is entered. This creates a record_s in the log indicating entry if the region is entered for the first time since the last dump() call, or it sets the start time for a short region if the region was entered and exited since the last call to dump().

Parameters
[in]hashThe region hash that is entered.
[in]timeThe timestamp when the entry event occurred.

Implements geopm::ApplicationRecordLog.

◆ epoch()

void geopm::ApplicationRecordLogImp::epoch ( const geopm_time_s &  time)
overridevirtual

Create a message in the log defining an epoch event.

Called by the Profile object when an epoch event occurs. This creates a record_s in the log indicating that an epoch event occurred.

Parameters
time[in] The timestamp when the epoch event occurred.

Implements geopm::ApplicationRecordLog.

◆ exit()

void geopm::ApplicationRecordLogImp::exit ( uint64_t  hash,
const geopm_time_s &  time 
)
overridevirtual

Create a message in the log defining a region exit.

Called by the Profile object when a region is exited. This creates a record_s in the log indicating exit if the matching entry for the region was called prior to the last dump() call. If the region was entered since the last call to dump(), the first entry event will be converted into a short region event. The call to exit() for short regions has the effect of updating the short region event time and count values.

Parameters
hash[in] The region hash that was exited.
time[in] The timestamp when the exit event occurred.

Implements geopm::ApplicationRecordLog.

◆ overhead()

void geopm::ApplicationRecordLogImp::overhead ( const geopm_time_s &  time,
double  overhead_sec 
)
overridevirtual

◆ start_profile()

void geopm::ApplicationRecordLogImp::start_profile ( const geopm_time_s &  time,
const std::string &  profile_name 
)
overridevirtual

◆ stop_profile()

void geopm::ApplicationRecordLogImp::stop_profile ( const geopm_time_s &  time,
const std::string &  profile_name 
)
overridevirtual

The documentation for this class was generated from the following files: