PatchworkOS  3984a1d
A non-POSIX operating system.
Loading...
Searching...
No Matches
perf.c File Reference
#include <kernel/cpu/interrupt.h>
#include <kernel/drivers/perf.h>
#include <kernel/cpu/cpu.h>
#include <kernel/fs/devfs.h>
#include <kernel/fs/file.h>
#include <kernel/fs/vfs.h>
#include <kernel/log/log.h>
#include <kernel/log/panic.h>
#include <kernel/mem/pmm.h>
#include <kernel/sched/clock.h>
#include <kernel/sched/sched.h>
#include <kernel/sched/timer.h>
#include <kernel/sync/lock.h>
#include <kernel/utils/utils.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/io.h>
#include <sys/list.h>
#include <sys/math.h>
Include dependency graph for perf.c:

Go to the source code of this file.

Functions

static size_t perf_cpu_read (file_t *file, void *buffer, size_t count, size_t *offset)
 
static size_t perf_mem_read (file_t *file, void *buffer, size_t count, size_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_tperfDir = NULL
 
static dentry_tcpuFile = NULL
 
static dentry_tmemFile = NULL
 
static file_ops_t cpuOps
 
static file_ops_t memOps
 

Function Documentation

◆ perf_cpu_read()

static size_t perf_cpu_read ( file_t file,
void buffer,
size_t  count,
size_t offset 
)
static

Definition at line 28 of file perf.c.

Here is the call graph for this function:

◆ perf_mem_read()

static size_t perf_mem_read ( file_t file,
void buffer,
size_t  count,
size_t offset 
)
static

Definition at line 84 of file perf.c.

Here is the call graph for this function:

Variable Documentation

◆ perfDir

dentry_t* perfDir = NULL
static

Definition at line 24 of file perf.c.

◆ cpuFile

dentry_t* cpuFile = NULL
static

Definition at line 25 of file perf.c.

◆ memFile

dentry_t* memFile = NULL
static

Definition at line 26 of file perf.c.

◆ cpuOps

file_ops_t cpuOps
static
Initial value:
= {
.read = perf_cpu_read,
}
static size_t perf_cpu_read(file_t *file, void *buffer, size_t count, size_t *offset)
Definition perf.c:28

Definition at line 80 of file perf.c.

◆ memOps

file_ops_t memOps
static
Initial value:
= {
.read = perf_mem_read,
}
static size_t perf_mem_read(file_t *file, void *buffer, size_t count, size_t *offset)
Definition perf.c:84

Definition at line 109 of file perf.c.