guanaqo 1.0.0-alpha.26
Utilities for scientific software
Loading...
Searching...
No Matches
guanaqo::pcm::ScopedCounters< F > Struct Template Reference

#include <guanaqo/pcm/counters.hpp>

Detailed Description

template<class F>
struct guanaqo::pcm::ScopedCounters< F >

Pins the thread to the current CPU and records a snapshot of performance events.

When stop is called or when the object is destroyed, another snapshot is taken and the counters for the thread are updated. The updated counters are passed to the provided function, which can be used for logging Perfetto counters or for other purposes.

Definition at line 69 of file counters.hpp.

Collaboration diagram for guanaqo::pcm::ScopedCounters< F >:

Public Member Functions

 ScopedCounters (F &&func)
 ScopedCounters (const ScopedCounters &)=delete
ScopedCountersoperator= (const ScopedCounters &)=delete
 ~ScopedCounters ()
ThreadPerfCountersget ()
void stop ()

Public Attributes

func
std::unique_ptr< detail::ScopedCountersimpl

Constructor & Destructor Documentation

◆ ScopedCounters() [1/2]

template<class F>
guanaqo::pcm::ScopedCounters< F >::ScopedCounters ( F && func)
inline

Definition at line 73 of file counters.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScopedCounters() [2/2]

template<class F>
guanaqo::pcm::ScopedCounters< F >::ScopedCounters ( const ScopedCounters< F > & )
delete
Here is the call graph for this function:

◆ ~ScopedCounters()

template<class F>
guanaqo::pcm::ScopedCounters< F >::~ScopedCounters ( )
inline

Definition at line 77 of file counters.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ operator=()

template<class F>
ScopedCounters & guanaqo::pcm::ScopedCounters< F >::operator= ( const ScopedCounters< F > & )
delete
Here is the call graph for this function:

◆ get()

template<class F>
ThreadPerfCounters * guanaqo::pcm::ScopedCounters< F >::get ( )
inline

Definition at line 78 of file counters.hpp.

◆ stop()

template<class F>
void guanaqo::pcm::ScopedCounters< F >::stop ( )
inline

Definition at line 79 of file counters.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ func

template<class F>
F guanaqo::pcm::ScopedCounters< F >::func

Definition at line 70 of file counters.hpp.

◆ impl

template<class F>
std::unique_ptr<detail::ScopedCounters> guanaqo::pcm::ScopedCounters< F >::impl

Definition at line 71 of file counters.hpp.


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