timemory  3.2.1
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 >
 

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)
 

Detailed Description

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

Definition at line 514 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ ratio_t

Definition at line 516 of file components.hpp.

◆ this_type

◆ value_type

Definition at line 517 of file components.hpp.

Member Function Documentation

◆ description()

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

Definition at line 522 of file components.hpp.

523  {
524  return "CPU time spent executing in kernel mode (via rusage)";
525  }

◆ get()

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

Definition at line 529 of file components.hpp.

530  {
531  auto val = base_type::load();
532  return static_cast<double>(val) / ratio_t::den * get_unit();
533  }
decltype(auto) load()

References tim::component::base< kernel_mode_time, int64_t >::get_unit(), and tim::component::base< Tp, Value >::load().

Referenced by get_display().

◆ get_display()

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

Definition at line 528 of file components.hpp.

528 { return get(); }

References get().

◆ label()

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

Definition at line 521 of file components.hpp.

521 { return "kernel_mode"; }

◆ record() [1/2]

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

Definition at line 526 of file components.hpp.

526 { 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 547 of file components.hpp.

548  {
549  return _cache.get_kernel_mode_time();
550  }

◆ start() [1/2]

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

Definition at line 535 of file components.hpp.

535 { value = record(); }

References record().

◆ start() [2/2]

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

Definition at line 552 of file components.hpp.

552 { value = record(_cache); }

References record().

◆ stop() [1/2]

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

Definition at line 537 of file components.hpp.

538  {
539  auto tmp = record();
540  if(tmp > value)
541  {
542  value = (tmp - value);
543  accum += value;
544  }
545  }

References record().

◆ stop() [2/2]

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

Definition at line 554 of file components.hpp.

555  {
556  auto tmp = record(_cache);
557  if(tmp > value)
558  {
559  accum += (tmp - value);
560  value = tmp;
561  }
562  }

References record().


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