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

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

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

+ Collaboration diagram for tim::component::user_mode_time:

Public Types

using ratio_t = std::micro
 
using value_type = int64_t
 
using this_type = user_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 user mode.

Definition at line 459 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ ratio_t

Definition at line 461 of file components.hpp.

◆ storage_type

Definition at line 66 of file declaration.hpp.

◆ this_type

◆ value_type

Definition at line 462 of file components.hpp.

Member Function Documentation

◆ description()

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

Definition at line 467 of file components.hpp.

468 {
469 return "CPU time spent executing in user mode (via rusage)";
470 }

◆ get()

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

Definition at line 474 of file components.hpp.

474{ return load() / static_cast<double>(base_type::get_unit()); }
static int64_t get_unit()

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

Referenced by get_display().

◆ get_display()

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

Definition at line 473 of file components.hpp.

473{ 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::user_mode_time::label ( )
inlinestatic

Definition at line 466 of file components.hpp.

466{ return "user_mode"; }

◆ record() [1/2]

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

Definition at line 471 of file components.hpp.

471{ return get_user_mode_time(); }

Referenced by start(), and stop().

◆ record() [2/2]

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

Definition at line 488 of file components.hpp.

489 {
490 return _cache.get_user_mode_time();
491 }

◆ start() [1/2]

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

Definition at line 476 of file components.hpp.

476{ value = record(); }
static value_type record()
Definition: components.hpp:471

References record().

◆ start() [2/2]

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

Definition at line 493 of file components.hpp.

493{ value = record(_cache); }

References record().

◆ stop() [1/2]

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

Definition at line 478 of file components.hpp.

479 {
480 auto tmp = record();
481 if(tmp > value)
482 {
483 value = (tmp - value);
484 accum += value;
485 }
486 }

References record().

◆ stop() [2/2]

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

Definition at line 495 of file components.hpp.

496 {
497 auto tmp = record(_cache);
498 if(tmp > value)
499 {
500 accum += (tmp - value);
501 value = tmp;
502 }
503 }

References record().


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