timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::component::voluntary_context_switch Struct Reference

the number of times a context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource). More...

#include "timemory/components/rusage/components.hpp"

+ Collaboration diagram for tim::component::voluntary_context_switch:

Public Types

using value_type = int64_t
 
using base_type = base< voluntary_context_switch >
 
using storage_type = empty_storage
 

Public Member Functions

value_type get_display () const
 
value_type get () const
 
void start ()
 
void stop ()
 
void start (const cache_type &_cache)
 
void stop (const cache_type &_cache)
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static value_type record ()
 
static value_type record (const cache_type &_cache)
 
template<typename... Args>
static opaque get_opaque (Args &&...)
 

Static Public Attributes

static const short precision = 0
 
static const short width = 3
 
static const std::ios_base::fmtflags format_flags = {}
 

Detailed Description

the number of times a context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource).

Definition at line 329 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ storage_type

Definition at line 66 of file declaration.hpp.

◆ value_type

Definition at line 331 of file components.hpp.

Member Function Documentation

◆ description()

static std::string tim::component::voluntary_context_switch::description ( )
inlinestatic

Definition at line 339 of file components.hpp.

340 {
341 return "Number of context switches due to a process voluntarily giving up the "
342 "processor before its time slice was completed";
343 }

◆ get()

value_type tim::component::voluntary_context_switch::get ( ) const
inline

Definition at line 350 of file components.hpp.

350{ return get_display(); }

References get_display().

◆ get_display()

value_type tim::component::voluntary_context_switch::get_display ( ) const
inline

Definition at line 345 of file components.hpp.

346 {
347 auto val = base_type::load();
348 return val;
349 }

References tim::component::base< voluntary_context_switch >::load().

Referenced by get().

◆ get_opaque()

template<typename... Args>
static opaque tim::component::empty_base::get_opaque ( Args &&  ...)
inlinestaticinherited

Definition at line 72 of file declaration.hpp.

73 {
74 return opaque{};
75 }

◆ label()

static std::string tim::component::voluntary_context_switch::label ( )
inlinestatic

Definition at line 338 of file components.hpp.

338{ return "vol_cxt_swch"; }

◆ record() [1/2]

static value_type tim::component::voluntary_context_switch::record ( )
inlinestatic

Definition at line 344 of file components.hpp.

344{ return get_num_voluntary_context_switch(); }

Referenced by start(), and stop().

◆ record() [2/2]

static value_type tim::component::voluntary_context_switch::record ( const cache_type _cache)
inlinestatic

Definition at line 358 of file components.hpp.

359 {
360 return _cache.get_num_voluntary_context_switch();
361 }

◆ start() [1/2]

void tim::component::voluntary_context_switch::start ( )
inline

Definition at line 351 of file components.hpp.

351{ value = record(); }

References record().

◆ start() [2/2]

void tim::component::voluntary_context_switch::start ( const cache_type _cache)
inline

Definition at line 363 of file components.hpp.

363{ value = record(_cache); }

References record().

◆ stop() [1/2]

void tim::component::voluntary_context_switch::stop ( )
inline

Definition at line 352 of file components.hpp.

353 {
354 value = (record() - value);
355 accum += value;
356 }

References record().

◆ stop() [2/2]

void tim::component::voluntary_context_switch::stop ( const cache_type _cache)
inline

Definition at line 365 of file components.hpp.

366 {
367 auto tmp = record(_cache);
368 accum += (tmp - value);
369 value = tmp;
370 }

References record().

Member Data Documentation

◆ format_flags

const std::ios_base::fmtflags tim::component::voluntary_context_switch::format_flags = {}
static

Definition at line 336 of file components.hpp.

◆ precision

const short tim::component::voluntary_context_switch::precision = 0
static

Definition at line 334 of file components.hpp.

◆ width

const short tim::component::voluntary_context_switch::width = 3
static

Definition at line 335 of file components.hpp.


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