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

#include <TimeTracker.h>

+ Collaboration diagram for TimeTracker:

Public Member Functions

ALWAYS_INLINE TimeTracker (Process *pProcess, bool fromUserspace, bool entryInterruptsAlreadyDisabled=false, Thread *currentThread=nullptr)
 
void finish ()
 
void finishInKernel ()
 
ALWAYS_INLINE void finishForUserReturn ()
 
void attributeSyscall (size_t rawNumber)
 

Private Member Functions

void initialise (bool entryInterruptsAlreadyDisabled)
 

Private Attributes

Processm_pProcess
 
Threadm_pThread
 
bool m_bFromUserspace
 

Detailed Description

Tracks time spent and assigns it to the given process, in an RAII way.

Mostly useful for things like syscalls where there's a definitive entry and exit at which time should be tracked differently.

Definition at line 36 of file TimeTracker.h.

Constructor & Destructor Documentation

◆ TimeTracker()

ALWAYS_INLINE TimeTracker::TimeTracker ( Process pProcess,
bool  fromUserspace,
bool  entryInterruptsAlreadyDisabled = false,
Thread currentThread = nullptr 
)
inline

Definition at line 40 of file TimeTracker.h.

◆ ~TimeTracker()

ALWAYS_INLINE TimeTracker::~TimeTracker ( )
inline

Definition at line 54 of file TimeTracker.h.

Member Function Documentation

◆ attributeSyscall()

void TimeTracker::attributeSyscall ( size_t  rawNumber)

Attributes this userspace Linux syscall to the active Process.

Definition at line 56 of file TimeTracker.cc.

Referenced by HostedSyscallManager::syscall(), and X64SyscallManager::syscall().

+ Here is the caller graph for this function:

◆ finish()

void TimeTracker::finish ( )

Completes accounting before a no-return architectural transition.

Definition at line 72 of file TimeTracker.cc.

References Thread::transitionTime().

Referenced by HostedSyscallManager::syscall().

+ Here is the caller graph for this function:

◆ finishForUserReturn()

ALWAYS_INLINE void TimeTracker::finishForUserReturn ( )
inline

Retires the tracker while leaving the kernel interval for user return.

Definition at line 66 of file TimeTracker.h.

Referenced by X64SyscallManager::syscall().

+ Here is the caller graph for this function:

◆ finishInKernel()

void TimeTracker::finishInKernel ( )

Completes accounting before restoring a saved kernel continuation.

Definition at line 90 of file TimeTracker.cc.

References Thread::transitionTime().

Referenced by HostedSyscallManager::syscall(), and X64SyscallManager::syscall().

+ Here is the caller graph for this function:

◆ initialise()

void TimeTracker::initialise ( bool  entryInterruptsAlreadyDisabled)
private

Definition at line 26 of file TimeTracker.cc.

Member Data Documentation

◆ m_bFromUserspace

bool TimeTracker::m_bFromUserspace
private

Definition at line 91 of file TimeTracker.h.

◆ m_pProcess

Process* TimeTracker::m_pProcess
private

Definition at line 89 of file TimeTracker.h.

◆ m_pThread

Thread* TimeTracker::m_pThread
private

Definition at line 90 of file TimeTracker.h.


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