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::priority_context_switch Struct Reference

the number of times a context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice More...

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

+ Collaboration diagram for tim::component::priority_context_switch:

Public Types

using value_type = int64_t
 
using base_type = base< priority_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 higher priority process becoming runnable or because the current process exceeded its time slice

Definition at line 381 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ storage_type

Definition at line 66 of file declaration.hpp.

◆ value_type

Definition at line 383 of file components.hpp.

Member Function Documentation

◆ description()

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

Definition at line 391 of file components.hpp.

392 {
393 return "Number of context switch due to higher priority process becoming runnable"
394 " or because the current process exceeded its time slice";
395 }

◆ get()

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

Definition at line 402 of file components.hpp.

402{ return get_display(); }

References get_display().

◆ get_display()

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

Definition at line 397 of file components.hpp.

398 {
399 auto val = base_type::load();
400 return val;
401 }

References tim::component::base< priority_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::priority_context_switch::label ( )
inlinestatic

Definition at line 390 of file components.hpp.

390{ return "prio_cxt_swch"; }

◆ record() [1/2]

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

Definition at line 396 of file components.hpp.

396{ return get_num_priority_context_switch(); }

Referenced by start(), and stop().

◆ record() [2/2]

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

Definition at line 410 of file components.hpp.

411 {
412 return _cache.get_num_priority_context_switch();
413 }

◆ start() [1/2]

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

Definition at line 403 of file components.hpp.

403{ value = record(); }

References record().

◆ start() [2/2]

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

Definition at line 415 of file components.hpp.

415{ value = record(_cache); }

References record().

◆ stop() [1/2]

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

Definition at line 404 of file components.hpp.

405 {
406 value = (record() - value);
407 accum += value;
408 }

References record().

◆ stop() [2/2]

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

Definition at line 417 of file components.hpp.

418 {
419 auto tmp = record(_cache);
420 accum += (tmp - value);
421 value = tmp;
422 }

References record().

Member Data Documentation

◆ format_flags

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

Definition at line 388 of file components.hpp.

◆ precision

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

Definition at line 386 of file components.hpp.

◆ width

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

Definition at line 387 of file components.hpp.


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