|
PatchworkOS
28a9544
A non-POSIX operating system.
|
#include <kernel/drivers/perf.h>#include <kernel/cpu/cpu.h>#include <kernel/fs/file.h>#include <kernel/fs/sysfs.h>#include <kernel/fs/vfs.h>#include <kernel/log/panic.h>#include <kernel/mem/pmm.h>#include <kernel/sched/sched.h>#include <kernel/sched/sys_time.h>#include <kernel/sched/timer.h>#include <kernel/sync/lock.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <sys/io.h>#include <sys/list.h>#include <sys/math.h>Go to the source code of this file.
Functions | |
| static uint64_t | perf_cpu_read (file_t *file, void *buffer, uint64_t count, uint64_t *offset) |
| static uint64_t | perf_mem_read (file_t *file, void *buffer, uint64_t count, uint64_t *offset) |
| void | perf_cpu_ctx_init (perf_cpu_ctx_t *ctx) |
| Initializes a per-CPU performance context, must be called on the CPU that owns the context. | |
| void | perf_process_ctx_init (perf_process_ctx_t *ctx) |
| Initializes a per-process performance context. | |
| void | perf_thread_ctx_init (perf_thread_ctx_t *ctx) |
| Initializes a per-thread performance context. | |
| void | perf_init (void) |
| Initializes the performance driver. | |
| void | perf_interrupt_begin (cpu_t *self) |
| Called at the beginning of an interrupt to update cpu performance data. | |
| void | perf_interrupt_end (cpu_t *self) |
| Called at the end of an interrupt to update cpu performance data. | |
| void | perf_syscall_begin (void) |
| Called at the beginning of a syscall to update process performance data. | |
| void | perf_syscall_end (void) |
| Called at the end of a syscall to update process performance data. | |
Variables | |
| static dentry_t * | perfDir = NULL |
| static dentry_t * | cpuFile = NULL |
| static dentry_t * | memFile = NULL |
| static file_ops_t | cpuOps |
| static file_ops_t | memOps |
|
static |
Definition at line 25 of file perf.c.
References perf_cpu_ctx_t::activeClocks, buffer, BUFFER_READ, count, cpu_amount(), CPU_FOR_EACH, EIO, ERR, errno, file, free(), cpu_t::id, perf_cpu_ctx_t::idleClocks, perf_cpu_ctx_t::interruptClocks, perf_cpu_ctx_t::interruptEnd, perf_cpu_ctx_t::lock, lock_acquire(), lock_release(), malloc(), NULL, cpu_t::perf, sched_is_idle(), sprintf(), strcpy(), strlen(), sys_time_uptime(), and uptime().
|
static |
Definition at line 80 of file perf.c.
References buffer, BUFFER_READ, count, EIO, ERR, errno, file, free(), malloc(), NULL, pmm_free_amount(), pmm_total_amount(), pmm_used_amount(), and sprintf().
Definition at line 22 of file perf.c.
Referenced by perf_init().
|
static |
Definition at line 76 of file perf.c.
Referenced by perf_init().
Definition at line 23 of file perf.c.
Referenced by perf_init().
|
static |
Definition at line 104 of file perf.c.
Referenced by perf_init().
Definition at line 21 of file perf.c.
Referenced by perf_init().