|
PatchworkOS
|
Performance Statistics driver. More...
Data Structures | |
| struct | statistics_cpu_ctx_t |
| Per-CPU statistics context. More... | |
Functions | |
| void | statistics_cpu_ctx_init (statistics_cpu_ctx_t *ctx) |
| Initializes a per-CPU statistics context. | |
| void | statistics_init (void) |
| Initializes the statistics driver. | |
| void | statistics_interrupt_begin (interrupt_frame_t *frame, cpu_t *self) |
| Called at the beginning of an interrupt. | |
| void | statistics_interrupt_end (interrupt_frame_t *frame, cpu_t *self) |
| Called at the end of an interrupt. | |
Performance Statistics driver.
The Performance Statistics driver is exposed in the /dev/stat directory. Below is an overview of the files in this directory.
The /dev/stat/cpu file contains per-CPU statistics in the following format:
The /dev/stat/mem file contains memory statistics in the following format:
| void statistics_cpu_ctx_init | ( | statistics_cpu_ctx_t * | ctx | ) |
Initializes a per-CPU statistics context.
| ctx | The context to initialize. |
Definition at line 24 of file statistics.c.
References statistics_cpu_ctx_t::activeClocks, statistics_cpu_ctx_t::idleClocks, statistics_cpu_ctx_t::interruptBegin, statistics_cpu_ctx_t::interruptClocks, statistics_cpu_ctx_t::interruptEnd, statistics_cpu_ctx_t::lock, and lock_init().
Referenced by cpu_init().
| void statistics_init | ( | void | ) |
Initializes the statistics driver.
Definition at line 100 of file statistics.c.
References cpuFile, cpuOps, memFile, memOps, NULL, panic(), statDir, sysfs_dir_new(), and sysfs_file_new().
Referenced by init_finalize().
| void statistics_interrupt_begin | ( | interrupt_frame_t * | frame, |
| cpu_t * | self | ||
| ) |
Called at the beginning of an interrupt.
Will measure the time spent in interrupts and time spent idle/active.
| frame | The interrupt frame. |
| self | The current CPU. |
Definition at line 120 of file statistics.c.
References LOCK_SCOPE, sched_is_idle(), cpu_t::stat, stat(), and timer_uptime().
Referenced by interrupt_handler().
| void statistics_interrupt_end | ( | interrupt_frame_t * | frame, |
| cpu_t * | self | ||
| ) |
Called at the end of an interrupt.
| frame | The interrupt frame. |
| self | The current CPU. |
Definition at line 140 of file statistics.c.
References LOCK_SCOPE, cpu_t::stat, stat(), and timer_uptime().
Referenced by interrupt_handler().