|
PatchworkOS
3984a1d
A non-POSIX operating system.
|
#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/io.h>#include <sys/proc.h>#include <threads.h>#include <time.h>Go to the source code of this file.
Data Structures | |
| struct | cpu_perfs_t |
| struct | mem_perfs_t |
| struct | proc_perfs_t |
| struct | perfs_t |
Macros | |
| #define | SAMPLE_INTERVAL (CLOCKS_PER_SEC) |
Enumerations | |
| enum | sort_mode_t { SORT_PID , SORT_MEMORY , SORT_CPU } |
Functions | |
| static void | terminal_size_get (void) |
| static uint64_t | cpu_perf_count_cpus (void) |
| static uint64_t | cpu_perf_read (cpu_perfs_t *cpuPerfs) |
| static uint64_t | mem_perf_read (mem_perfs_t *memPerfs) |
| static proc_perfs_t * | proc_perfs_read (uint64_t *procAmount) |
| static void | calculate_cpu_percentages (perfs_t *perfs) |
| static int | compare_by_pid (const void *a, const void *b) |
| static int | compare_by_memory (const void *a, const void *b) |
| static int | compare_by_cpu (const void *a, const void *b) |
| static void | sort_processes (perfs_t *perfs) |
| static void | perfs_update (perfs_t *perfs) |
| static void | perf_percentage (clock_t part, clock_t total, uint64_t *whole, uint64_t *thousandths) |
| static void | perfs_print (perfs_t *perfs) |
| int | main (void) |
| #define SAMPLE_INTERVAL (CLOCKS_PER_SEC) |
|
static |
|
static |
|
static |
|
static |