The Pedigree Project 0.1
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ThreadTimeAccounting Class Reference

#include <DeferredTimeAccounting.h>

+ Collaboration diagram for ThreadTimeAccounting:

Classes

struct  Entry
 

Public Member Functions

void record (CpuTimeMode mode, Time::Timestamp now, size_t processor=0)
 
ALWAYS_INLINE void recordAtInterruptDisabled (CpuTimeMode mode, Time::Timestamp now, size_t processor=0)
 
Time::Timestamp elapsed (CpuTimeMode mode, Time::Timestamp now, size_t processor=0)
 
ALWAYS_INLINE Time::Timestamp elapsedAtInterruptDisabled (CpuTimeMode mode, Time::Timestamp now, size_t processor=0)
 

Private Member Functions

ALWAYS_INLINE Entryentry (CpuTimeMode mode)
 
 ThreadTimeAccounting (const ThreadTimeAccounting &)=delete
 
ThreadTimeAccountingoperator= (const ThreadTimeAccounting &)=delete
 

Static Private Member Functions

static bool installProcessorBaseline (Entry *state, size_t processor, Time::Timestamp now)
 

Private Attributes

Entry m_Kernel
 
Entry m_User
 

Detailed Description

Independent monotonic CPU-time baselines owned by one schedulable Thread.

Definition at line 45 of file DeferredTimeAccounting.h.

Constructor & Destructor Documentation

◆ ThreadTimeAccounting()

ThreadTimeAccounting::ThreadTimeAccounting ( )
inline

Definition at line 47 of file DeferredTimeAccounting.h.

Member Function Documentation

◆ elapsed()

Time::Timestamp ThreadTimeAccounting::elapsed ( CpuTimeMode  mode,
Time::Timestamp  now,
size_t  processor = 0 
)
inline

Definition at line 81 of file DeferredTimeAccounting.h.

◆ elapsedAtInterruptDisabled()

ALWAYS_INLINE Time::Timestamp ThreadTimeAccounting::elapsedAtInterruptDisabled ( CpuTimeMode  mode,
Time::Timestamp  now,
size_t  processor = 0 
)
inline

Returns and advances a current Thread's baseline with IRQs disabled.

Definition at line 104 of file DeferredTimeAccounting.h.

Referenced by Thread::trackTime(), and Thread::transitionTime().

+ Here is the caller graph for this function:

◆ entry()

ALWAYS_INLINE Entry * ThreadTimeAccounting::entry ( CpuTimeMode  mode)
inlineprivate

Definition at line 141 of file DeferredTimeAccounting.h.

◆ installProcessorBaseline()

static bool ThreadTimeAccounting::installProcessorBaseline ( Entry state,
size_t  processor,
Time::Timestamp  now 
)
inlinestaticprivate

Definition at line 128 of file DeferredTimeAccounting.h.

◆ record()

void ThreadTimeAccounting::record ( CpuTimeMode  mode,
Time::Timestamp  now,
size_t  processor = 0 
)
inline

Definition at line 49 of file DeferredTimeAccounting.h.

◆ recordAtInterruptDisabled()

ALWAYS_INLINE void ThreadTimeAccounting::recordAtInterruptDisabled ( CpuTimeMode  mode,
Time::Timestamp  now,
size_t  processor = 0 
)
inline

Updates a current Thread's baseline while its CPU has interrupts masked. The owning Thread cannot migrate or execute concurrently in this window, so the compare-exchange loop used by the standalone helper is unnecessary.

Definition at line 72 of file DeferredTimeAccounting.h.

Referenced by Thread::recordTime(), and Thread::transitionTime().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_Kernel

Entry ThreadTimeAccounting::m_Kernel
private

Definition at line 145 of file DeferredTimeAccounting.h.

◆ m_User

Entry ThreadTimeAccounting::m_User
private

Definition at line 146 of file DeferredTimeAccounting.h.


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