PatchworkOS  3984a1d
A non-POSIX operating system.
Loading...
Searching...
No Matches
Performance Driver

Performance driver. More...

Collaboration diagram for Performance Driver:

Detailed Description

Performance driver.

The Performance driver is exposed in the /dev/perf directory. Below is an overview of the files in this directory.

Cpu performance

The /dev/perf/cpu file contains per-CPU performance data in the following format:

%lu %lu %lu %lu
%lu %lu %lu %lu
...
%lu %lu %lu %lu
int64_t y
Definition main.c:153

Memory performance

The /dev/perf/mem file contains memory performance data in the following format:

See also
Process for per-process performance data.

Data Structures

struct  perf_cpu_ctx_t
 Per-CPU performance context. More...
 
struct  perf_process_ctx_t
 
struct  perf_thread_ctx_t
 Per-Thread performance context. More...
 
struct  stat_process_ctx_t
 Per-Process performance context. More...
 

Functions

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.
 

Function Documentation

◆ perf_cpu_ctx_init()

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.

Parameters
ctxThe context to initialize.

Definition at line 113 of file perf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ perf_process_ctx_init()

void perf_process_ctx_init ( perf_process_ctx_t ctx)

Initializes a per-process performance context.

Parameters
ctxThe context to initialize.

Definition at line 123 of file perf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ perf_thread_ctx_init()

void perf_thread_ctx_init ( perf_thread_ctx_t ctx)

Initializes a per-thread performance context.

Parameters
ctxThe context to initialize.

Definition at line 130 of file perf.c.

Here is the caller graph for this function:

◆ perf_init()

void perf_init ( void  )

Initializes the performance driver.

Definition at line 136 of file perf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ perf_interrupt_begin()

void perf_interrupt_begin ( cpu_t self)

Called at the beginning of an interrupt to update cpu performance data.

Must be called with interrupts disabled.

Parameters
selfThe current CPU.

Definition at line 156 of file perf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ perf_interrupt_end()

void perf_interrupt_end ( cpu_t self)

Called at the end of an interrupt to update cpu performance data.

Must be called with interrupts disabled.

Parameters
selfThe current CPU.

Definition at line 192 of file perf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ perf_syscall_begin()

void perf_syscall_begin ( void  )

Called at the beginning of a syscall to update process performance data.

Definition at line 210 of file perf.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ perf_syscall_end()

void perf_syscall_end ( void  )

Called at the end of a syscall to update process performance data.

Definition at line 234 of file perf.c.

Here is the call graph for this function:
Here is the caller graph for this function: