Provides an abstraction for a shared memory buffer that can be used to pass entry, exit, epoch and short region events from Profile to ApplicationSampler.
More...
|
virtual | ~ApplicationRecordLog ()=default |
| Destructor for pure virtual base class. More...
|
|
virtual void | enter (uint64_t hash, const geopm_time_s &time)=0 |
| Create a message in the log defining a region entry. More...
|
|
virtual void | exit (uint64_t hash, const geopm_time_s &time)=0 |
| Create a message in the log defining a region exit. More...
|
|
virtual void | epoch (const geopm_time_s &time)=0 |
| Create a message in the log defining an epoch event. More...
|
|
virtual void | dump (std::vector< record_s > &records, std::vector< short_region_s > &short_regions)=0 |
| Get all events that have occurred since the last call to dump(). More...
|
|
virtual void | affinity (const geopm_time_s &time, int cpu_idx)=0 |
|
virtual void | cpuset_changed (const geopm_time_s &time)=0 |
|
virtual void | start_profile (const geopm_time_s &time, const std::string &profile_name)=0 |
|
virtual void | stop_profile (const geopm_time_s &time, const std::string &profile_name)=0 |
|
virtual void | overhead (const geopm_time_s &time, double overhead_sec)=0 |
|
Provides an abstraction for a shared memory buffer that can be used to pass entry, exit, epoch and short region events from Profile to ApplicationSampler.
This class provides a compression of short running regions to avoid overwhelming the controller with too many records.
If the Profile calls entry() and then exit() for the same region hash within a control interval (between two calls to dump()) the entry event is converted into a short region event. All future pairs of entry() and exit() using this hash but prior to the next dump() call will be aggregated into this short region event.
If a region hash was observed as a short region during a control interval (it was both entered and exited), but the dump() call occurs prior to an exit() call that would close the region, the subsequent exit() call to this region will be classified as a short region event and the intervening interval of time will be recorded in this event created by the exit() call.
There is a loss of information when a region is entered and exited within one control loop when compared to the case where a dump() call is made between an entry() and exit() call. In the former case, the exact timestamp associated with all region exit and entry events for a particular hash that occur after the first enter() call for that hash and prior to the next dump() call are lost. The short region event records the number of calls to the hashed region and the total amount of time in the region, but the exact sequence and timing of events following the first enter() is not recorded.
virtual void geopm::ApplicationRecordLog::dump |
( |
std::vector< record_s > & |
records, |
|
|
std::vector< short_region_s > & |
short_regions |
|
) |
| |
|
pure virtual |
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] | records | Vector of records written since last dump(). |
[out] | short_regions | Vector of short region data about any short regions events in the records output vector. |
Implemented in geopm::ApplicationRecordLogImp.