Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::LinuxPerfPerformanceCounterService Class Reference
Inheritance diagram for Arcane::LinuxPerfPerformanceCounterService:
Collaboration diagram for Arcane::LinuxPerfPerformanceCounterService:

Public Member Functions

 LinuxPerfPerformanceCounterService (const ServiceBuildInfo &sbi)
void build ()
void initialize () override
 Initializes the service.
bool _addEvent (int event_type, int event_config, bool is_optional=false)
 Adds an event and returns true if it fails.
void start () override
 Starts tracking performance counters.
void stop () override
 Stops tracking performance counters.
bool isStarted () const override
 Indicates if the service has started (start() has been called).
Integer getCounters (Int64ArrayView counters, bool do_substract) override
 Retrieves the current values of the counters.
Int64 getCycles () override
 Value of the counter for the number of CPU cycles.
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const

Private Member Functions

void _closeAll ()
Int64 _getOneCounter (Int32 index)
void _checkInitialize ()

Private Attributes

UniqueArray< int > m_events_file_descriptor
bool m_is_started = false
bool m_is_init = false
pid_t m_process_id = -1

Additional Inherited Members

Static Public Attributes inherited from Arcane::IPerformanceCounterService
static const int MIN_COUNTER_SIZE = 8
 Minimum size of the view for getCounters().
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Definition at line 36 of file LinuxPerfPerformanceCounterService.cc.

Constructor & Destructor Documentation

◆ LinuxPerfPerformanceCounterService()

Arcane::LinuxPerfPerformanceCounterService::LinuxPerfPerformanceCounterService ( const ServiceBuildInfo & sbi)
inlineexplicit

Definition at line 42 of file LinuxPerfPerformanceCounterService.cc.

◆ ~LinuxPerfPerformanceCounterService()

Arcane::LinuxPerfPerformanceCounterService::~LinuxPerfPerformanceCounterService ( )
inline

Definition at line 46 of file LinuxPerfPerformanceCounterService.cc.

Member Function Documentation

◆ _addEvent()

bool Arcane::LinuxPerfPerformanceCounterService::_addEvent ( int event_type,
int event_config,
bool is_optional = false )
inline

Adds an event and returns true if it fails.

Definition at line 61 of file LinuxPerfPerformanceCounterService.cc.

References ARCANE_FATAL, and Arcane::TraceAccessor::info().

Here is the call graph for this function:

◆ _checkInitialize()

void Arcane::LinuxPerfPerformanceCounterService::_checkInitialize ( )
inlineprivate

Definition at line 164 of file LinuxPerfPerformanceCounterService.cc.

◆ _closeAll()

void Arcane::LinuxPerfPerformanceCounterService::_closeAll ( )
inlineprivate

Definition at line 144 of file LinuxPerfPerformanceCounterService.cc.

◆ _getOneCounter()

Int64 Arcane::LinuxPerfPerformanceCounterService::_getOneCounter ( Int32 index)
inlineprivate

Definition at line 153 of file LinuxPerfPerformanceCounterService.cc.

◆ build()

void Arcane::LinuxPerfPerformanceCounterService::build ( )
inline

Definition at line 53 of file LinuxPerfPerformanceCounterService.cc.

◆ getCounters()

Integer Arcane::LinuxPerfPerformanceCounterService::getCounters ( Int64ArrayView counters,
bool do_substract )
inlineoverridevirtual

Retrieves the current values of the counters.

This method must only be called if isStarted() is true.

If do_substract is false, fills counters with the current values of the counters. If do_substract is true, fills counters with the difference between the current values and those in counters during the call.

Int64ArrayView counters = ...;
p->getCounters(counters,false);
... // Operation.
p->getCounters(counters,true);
info() << "Nb cycle=" << counters[0].
Interface of a service for accessing performance counters.
virtual Int32 getCounters(Int64ArrayView counters, bool do_substract)=0
Retrieves the current values of the counters.
TraceMessage info() const
Flow for an information message.
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:451

The counter at index 0 is always the number of cycles. counters must have enough elements to provide at least MIN_COUNTER_SIZE counters.

Return values
thenumber of counters provided.
Precondition
isStarted()==true

Implements Arcane::IPerformanceCounterService.

Definition at line 119 of file LinuxPerfPerformanceCounterService.cc.

◆ getCycles()

Int64 Arcane::LinuxPerfPerformanceCounterService::getCycles ( )
inlineoverridevirtual

Value of the counter for the number of CPU cycles.

Precondition
isStarted()==true

Implements Arcane::IPerformanceCounterService.

Definition at line 130 of file LinuxPerfPerformanceCounterService.cc.

◆ initialize()

void Arcane::LinuxPerfPerformanceCounterService::initialize ( )
inlineoverridevirtual

Initializes the service.

Implements Arcane::IPerformanceCounterService.

Definition at line 55 of file LinuxPerfPerformanceCounterService.cc.

◆ isStarted()

bool Arcane::LinuxPerfPerformanceCounterService::isStarted ( ) const
inlineoverridevirtual

Indicates if the service has started (start() has been called).

Implements Arcane::IPerformanceCounterService.

Definition at line 114 of file LinuxPerfPerformanceCounterService.cc.

◆ start()

void Arcane::LinuxPerfPerformanceCounterService::start ( )
inlineoverridevirtual

Starts tracking performance counters.

Precondition
isStarted()==false.
Postcondition
isStarted()==true.

Implements Arcane::IPerformanceCounterService.

Definition at line 89 of file LinuxPerfPerformanceCounterService.cc.

References ARCANE_FATAL, and Arcane::TraceAccessor::info().

Here is the call graph for this function:

◆ stop()

void Arcane::LinuxPerfPerformanceCounterService::stop ( )
inlineoverridevirtual

Stops tracking performance counters.

Precondition
isStarted()==true.
Postcondition
isStarted()==false.

Implements Arcane::IPerformanceCounterService.

Definition at line 102 of file LinuxPerfPerformanceCounterService.cc.

References ARCANE_FATAL, and Arcane::TraceAccessor::info().

Here is the call graph for this function:

Member Data Documentation

◆ m_events_file_descriptor

UniqueArray<int> Arcane::LinuxPerfPerformanceCounterService::m_events_file_descriptor
private

Definition at line 137 of file LinuxPerfPerformanceCounterService.cc.

◆ m_is_init

bool Arcane::LinuxPerfPerformanceCounterService::m_is_init = false
private

Definition at line 139 of file LinuxPerfPerformanceCounterService.cc.

◆ m_is_started

bool Arcane::LinuxPerfPerformanceCounterService::m_is_started = false
private

Definition at line 138 of file LinuxPerfPerformanceCounterService.cc.

◆ m_process_id

pid_t Arcane::LinuxPerfPerformanceCounterService::m_process_id = -1
private

Definition at line 140 of file LinuxPerfPerformanceCounterService.cc.


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