/* retoor */ #ifndef CPU_H #define CPU_H #define MAX_CPUS 256 typedef struct { unsigned long long user; unsigned long long nice; unsigned long long system; unsigned long long idle; unsigned long long iowait; unsigned long long irq; unsigned long long softirq; unsigned long long steal; unsigned long long guest; unsigned long long guest_nice; double usage_percent; } CpuCore; typedef struct { int num_cores; CpuCore total; CpuCore cores[MAX_CPUS]; CpuCore prev_total; CpuCore prev_cores[MAX_CPUS]; double frequency_mhz; double min_freq_mhz; double max_freq_mhz; double temperature; unsigned long context_switches; unsigned long prev_context_switches; double context_switches_per_sec; unsigned long interrupts; unsigned long prev_interrupts; double interrupts_per_sec; } CpuInfo; int cpu_info_init(CpuInfo *info); int cpu_info_update(CpuInfo *info, double interval); #endif