Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::IPerformanceCounterService Class Referenceabstract

Interface of a service for accessing performance counters. More...

#include <arcane/utils/IPerformanceCounterService.h>

Inheritance diagram for Arcane::IPerformanceCounterService:
Collaboration diagram for Arcane::IPerformanceCounterService:

Public Member Functions

virtual void initialize ()=0
 Initializes the service.
virtual void start ()=0
 Starts tracking performance counters.
virtual void stop ()=0
 Stops tracking performance counters.
virtual bool isStarted () const =0
 Indicates if the service has started (start() has been called).
virtual Int32 getCounters (Int64ArrayView counters, bool do_substract)=0
 Retrieves the current values of the counters.
virtual Int64 getCycles ()=0
 Value of the counter for the number of CPU cycles.

Static Public Attributes

static const int MIN_COUNTER_SIZE = 8
 Minimum size of the view for getCounters().

Detailed Description

Interface of a service for accessing performance counters.

Definition at line 31 of file IPerformanceCounterService.h.

Member Function Documentation

◆ getCounters()

virtual Int32 Arcane::IPerformanceCounterService::getCounters ( Int64ArrayView counters,
bool do_substract )
pure virtual

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.
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

Implemented in Arcane::LinuxPerfPerformanceCounterService, and Arcane::PapiPerformanceCounterService.

◆ getCycles()

virtual Int64 Arcane::IPerformanceCounterService::getCycles ( )
pure virtual

Value of the counter for the number of CPU cycles.

Precondition
isStarted()==true

Implemented in Arcane::LinuxPerfPerformanceCounterService, and Arcane::PapiPerformanceCounterService.

◆ initialize()

virtual void Arcane::IPerformanceCounterService::initialize ( )
pure virtual

◆ isStarted()

virtual bool Arcane::IPerformanceCounterService::isStarted ( ) const
pure virtual

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

Implemented in Arcane::LinuxPerfPerformanceCounterService, and Arcane::PapiPerformanceCounterService.

◆ start()

virtual void Arcane::IPerformanceCounterService::start ( )
pure virtual

Starts tracking performance counters.

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

Implemented in Arcane::LinuxPerfPerformanceCounterService, and Arcane::PapiPerformanceCounterService.

◆ stop()

virtual void Arcane::IPerformanceCounterService::stop ( )
pure virtual

Stops tracking performance counters.

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

Implemented in Arcane::LinuxPerfPerformanceCounterService, and Arcane::PapiPerformanceCounterService.

Member Data Documentation

◆ MIN_COUNTER_SIZE

const int Arcane::IPerformanceCounterService::MIN_COUNTER_SIZE = 8
static

Minimum size of the view for getCounters().

Definition at line 36 of file IPerformanceCounterService.h.

Referenced by Arcane::PapiPerformanceCounterService::getCounters().


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