Reads the /proc/[pid]/stat file for a thread.
More...
#include "util/linux/proc_stat_reader.h"
|
bool | Initialize (PtraceConnection *connection, pid_t tid) |
| Initializes the reader. More...
|
|
bool | UserCPUTime (timeval *user_time) const |
| Determines the time the thread has spent executing in user mode. More...
|
|
bool | SystemCPUTime (timeval *system_time) const |
| Determines the time the thread has spent executing in system mode. More...
|
|
bool | StartTime (const timeval &boot_time, timeval *start_time) const |
| Determines the target thread’s start time. More...
|
|
Reads the /proc/[pid]/stat file for a thread.
◆ Initialize()
bool crashpad::ProcStatReader::Initialize |
( |
PtraceConnection * |
connection, |
|
|
pid_t |
tid |
|
) |
| |
Initializes the reader.
This method must be successfully called before calling any other.
- Parameters
-
[in] | connection | A connection to the process to which the target thread belongs. |
[in] | tid | The thread ID to read the stat file for. |
◆ StartTime()
bool crashpad::ProcStatReader::StartTime |
( |
const timeval & |
boot_time, |
|
|
timeval * |
start_time |
|
) |
| const |
Determines the target thread’s start time.
- Parameters
-
[in] | boot_time | The kernel boot time. |
[out] | start_time | The time that the thread started. |
- Returns
true
on success, with start_time set. Otherwise, false
with a message logged.
◆ SystemCPUTime()
bool crashpad::ProcStatReader::SystemCPUTime |
( |
timeval * |
system_time | ) |
const |
Determines the time the thread has spent executing in system mode.
- Parameters
-
[out] | system_time | The time spent executing in system mode. |
- Returns
true
on success, with system_time set. Otherwise, false
with a message logged.
◆ UserCPUTime()
bool crashpad::ProcStatReader::UserCPUTime |
( |
timeval * |
user_time | ) |
const |
Determines the time the thread has spent executing in user mode.
- Parameters
-
[out] | user_time | The time spent executing in user mode. |
- Returns
true
on success, with user_time set. Otherwise, false
with a message logged.
The documentation for this class was generated from the following files:
- util/linux/proc_stat_reader.h
- util/linux/proc_stat_reader.cc