procfs: cleanup /proc/idle format
This commit is contained in:
parent
3a08644de6
commit
42146f042c
@ -395,11 +395,8 @@ static void get_cpu_info(int cpus[]) {
|
||||
|
||||
char * buffer = buf;
|
||||
for (int i = 0; i < cpu_count; ++i) {
|
||||
char * a = strchr(buffer, ':');
|
||||
a += 2;
|
||||
char * b = strchr(a, ' ');
|
||||
char * b = strchr(buffer, ':');
|
||||
b++;
|
||||
|
||||
cpus[i] = 1000 - atoi(b);
|
||||
if (cpus[i] < 0) cpus[i] = 0;
|
||||
buffer = strchr(b, '\n');
|
||||
|
@ -653,7 +653,7 @@ static ssize_t idle_func(fs_node_t *node, off_t offset, size_t size, uint8_t *bu
|
||||
unsigned int soffset = 0;
|
||||
|
||||
for (int i = 0; i < processor_count; ++i) {
|
||||
soffset += snprintf(&buf[soffset], 100, "%d: %4d %4d %d %4d\n",
|
||||
soffset += snprintf(&buf[soffset], 100, "%d: %4d %4d %4d %4d\n",
|
||||
i,
|
||||
processor_local_data[i].kernel_idle_task->usage[0],
|
||||
processor_local_data[i].kernel_idle_task->usage[1],
|
||||
|
Loading…
x
Reference in New Issue
Block a user