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

This is the total amount of time spent executing in kernel mode. More...

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

+ Collaboration diagram for tim::component::kernel_mode_time:

Public Types

using ratio_t = std::micro
 
using value_type = int64_t
 
using this_type = kernel_mode_time
 
using base_type = base< this_type, value_type >
 
using storage_type = empty_storage
 

Public Member Functions

double get_display () const
 
double 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 &&...)
 

Detailed Description

This is the total amount of time spent executing in kernel mode.

Definition at line 510 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ ratio_t

Definition at line 512 of file components.hpp.

◆ storage_type

Definition at line 66 of file declaration.hpp.

◆ this_type

◆ value_type

Definition at line 513 of file components.hpp.

Member Function Documentation

◆ description()

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

Definition at line 518 of file components.hpp.

519 {
520 return "CPU time spent executing in kernel mode (via rusage)";
521 }

◆ get()

double tim::component::kernel_mode_time::get ( ) const
inline

◆ get_display()

double tim::component::kernel_mode_time::get_display ( ) const
inline

Definition at line 524 of file components.hpp.

524{ return get(); }

References 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::kernel_mode_time::label ( )
inlinestatic

Definition at line 517 of file components.hpp.

517{ return "kernel_mode"; }

◆ record() [1/2]

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

Definition at line 522 of file components.hpp.

522{ return get_kernel_mode_time(); }

Referenced by start(), and stop().

◆ record() [2/2]

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

Definition at line 539 of file components.hpp.

540 {
541 return _cache.get_kernel_mode_time();
542 }

◆ start() [1/2]

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

Definition at line 527 of file components.hpp.

527{ value = record(); }

References record().

◆ start() [2/2]

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

Definition at line 544 of file components.hpp.

544{ value = record(_cache); }

References record().

◆ stop() [1/2]

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

Definition at line 529 of file components.hpp.

530 {
531 auto tmp = record();
532 if(tmp > value)
533 {
534 value = (tmp - value);
535 accum += value;
536 }
537 }

References record().

◆ stop() [2/2]

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

Definition at line 546 of file components.hpp.

547 {
548 auto tmp = record(_cache);
549 if(tmp > value)
550 {
551 accum += (tmp - value);
552 value = tmp;
553 }
554 }

References record().


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