#include <Profile.hpp>
|
| ProfileImp () |
| ProfileImp constructor. More...
|
|
| ProfileImp (const std::string &prof_name, const std::string &report, int num_cpu, std::set< int > cpu_set, std::shared_ptr< ApplicationStatus > app_status, std::shared_ptr< ApplicationRecordLog > app_record_log, bool do_profile, std::shared_ptr< ServiceProxy > service_proxy, std::shared_ptr< Scheduler > scheduler, int registered_pid) |
| ProfileImp testable constructor. More...
|
|
| ProfileImp (const ProfileImp &other)=delete |
|
ProfileImp | operator= (const ProfileImp &other)=delete |
|
virtual | ~ProfileImp () |
| ProfileImp destructor, virtual. More...
|
|
uint64_t | region (const std::string ®ion_name, long hint) override |
| Register a region of code to be profiled. More...
|
|
void | enter (uint64_t region_id) override |
| Mark a region entry point. More...
|
|
void | exit (uint64_t region_id) override |
| Mark a region exit point. More...
|
|
void | epoch (void) override |
| Signal pass through outer loop. More...
|
|
void | shutdown (void) override |
|
void | thread_init (uint32_t num_work_unit) override |
| Update the total work for all CPUs. This method should be called by one thread in the same parallel region with the total work units expected to be completed by the entire group. More...
|
|
void | thread_post (int cpu) override |
| Mark one unit of work completed by the thread on this CPU. More...
|
|
std::vector< std::string > | region_names (void) override |
|
void | reset_cpu_set (void) override |
|
void | overhead (double overhead_sec) override |
|
void | connect (void) override |
|
| Profile ()=default |
|
virtual | ~Profile ()=default |
|
◆ ProfileImp() [1/3]
geopm::ProfileImp::ProfileImp |
( |
void |
| ) |
|
ProfileImp constructor.
The ProfileImp object is used by the application to instrument regions of code and post profile information to a shared memory region to be read by the geopm::Controller process.
◆ ProfileImp() [2/3]
geopm::ProfileImp::ProfileImp |
( |
const std::string & |
prof_name, |
|
|
const std::string & |
report, |
|
|
int |
num_cpu, |
|
|
std::set< int > |
cpu_set, |
|
|
std::shared_ptr< ApplicationStatus > |
app_status, |
|
|
std::shared_ptr< ApplicationRecordLog > |
app_record_log, |
|
|
bool |
do_profile, |
|
|
std::shared_ptr< ServiceProxy > |
service_proxy, |
|
|
std::shared_ptr< Scheduler > |
scheduler, |
|
|
int |
registered_pid |
|
) |
| |
ProfileImp testable constructor.
- Parameters
-
[in] | prof_name | Name associated with the profile. This name will be printed in the header of the report. |
[in] | report | Report file name. |
[in] | num_cpu | Number of CPUs for the platform |
[in] | cpu_set | Set of CPUs assigned to the process owning the Profile object |
◆ ProfileImp() [3/3]
geopm::ProfileImp::ProfileImp |
( |
const ProfileImp & |
other | ) |
|
|
delete |
◆ ~ProfileImp()
geopm::ProfileImp::~ProfileImp |
( |
| ) |
|
|
virtual |
◆ connect()
void geopm::ProfileImp::connect |
( |
void |
| ) |
|
|
overridevirtual |
◆ enter()
void geopm::ProfileImp::enter |
( |
uint64_t |
region_id | ) |
|
|
overridevirtual |
Mark a region entry point.
Called to denote the beginning of region of code that was assigned the region_id when it was registered. Nesting of regions is not supported: calls to this method from within a region previously entered but not yet exited are silently ignored.
- Parameters
-
[in] | region_id | The identifier returned by Profile::region() when the region was registered. |
Implements geopm::Profile.
◆ epoch()
void geopm::ProfileImp::epoch |
( |
void |
| ) |
|
|
overridevirtual |
Signal pass through outer loop.
Called once for each pass through the outer most computational loop executed by the application. This function call should occur exactly once in the application source at the beginning of the loop that encapsulates the primary computational region of the application.
Implements geopm::Profile.
◆ exit()
void geopm::ProfileImp::exit |
( |
uint64_t |
region_id | ) |
|
|
overridevirtual |
Mark a region exit point.
Called to denote the end of a region of code that was assigned the region_id when it was registered. Nesting of regions is not supported: calls to this method that are not exiting from the oldest unclosed entry point with the same region_id are silently ignored.
- Parameters
-
[in] | region_id | The identifier returned by Profile::region() when the region was registered. |
Implements geopm::Profile.
◆ operator=()
◆ overhead()
void geopm::ProfileImp::overhead |
( |
double |
overhead_sec | ) |
|
|
overridevirtual |
◆ region()
uint64_t geopm::ProfileImp::region |
( |
const std::string & |
region_name, |
|
|
long |
hint |
|
) |
| |
|
overridevirtual |
Register a region of code to be profiled.
The statistics gathered for each region are aggregated in the final report, and the power policy will be determined distinctly for each region. The registration of a region is idempotent, and the first call will have more overhead than subsequent attempts to re-register the same region.
- Parameters
-
[in] | region_name | Unique name that identifies the region being profiled. This name will be printed next to the region statistics in the report. |
[in] | hint | Value from the #geopm_hint_e structure which is used to derive a starting policy before the application has been profiled. |
- Returns
- Returns the region_id which is a unique identifier derived from the region_name. This value is passed to Profile::enter() and Profile::exit() to associate these calls with the registered region.
Record hint when registering a region.
Implements geopm::Profile.
◆ region_names()
std::vector< std::string > geopm::ProfileImp::region_names |
( |
void |
| ) |
|
|
overridevirtual |
◆ reset_cpu_set()
void geopm::ProfileImp::reset_cpu_set |
( |
void |
| ) |
|
|
overridevirtual |
◆ shutdown()
void geopm::ProfileImp::shutdown |
( |
void |
| ) |
|
|
overridevirtual |
◆ thread_init()
void geopm::ProfileImp::thread_init |
( |
uint32_t |
num_work_unit | ) |
|
|
overridevirtual |
Update the total work for all CPUs. This method should be called by one thread in the same parallel region with the total work units expected to be completed by the entire group.
- Parameters
-
[in] | num_work_unit | The total work units for all threads in the same parallel region. |
Implements geopm::Profile.
◆ thread_post()
void geopm::ProfileImp::thread_post |
( |
int |
cpu | ) |
|
|
overridevirtual |
Mark one unit of work completed by the thread on this CPU.
- Parameters
-
[in] | cpu | The Linux logical CPU obtained with get_cpu(). |
Implements geopm::Profile.
◆ m_is_enabled
bool geopm::ProfileImp::m_is_enabled |
|
protected |
The documentation for this class was generated from the following files: