From 5d4997b17d8e88d45ef2b5fd0a5a74024af34298 Mon Sep 17 00:00:00 2001 From: Shaojie Sun Date: Tue, 10 Sep 2013 18:34:04 +0800 Subject: Add cpu topology info We read cpu top[ology info from /sys/devices/system/cpuX/topology. Packed them into cpu_topology struct. And print in next format. clusterA: coreX cpuA cpuB coreY cpuC cpuD clusterB: coreS cpuE cpuF coreT cpuG cpuH ... When cpu topology info could be read, CPU idle state is shown ordered by topology. When cpu topology info could not be read, CPU idle state is shown in old order. Signed-off-by: Shaojie Sun Signed-off-by: Daniel Lezcano --- utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'utils.h') diff --git a/utils.h b/utils.h index 950cf26..acd226a 100644 --- a/utils.h +++ b/utils.h @@ -5,5 +5,7 @@ extern int write_int(const char *path, int val); extern int read_int(const char *path, int *val); extern int store_line(const char *line, void *data); +extern int file_read_value(const char *path, const char *name, + const char *format, void *value); #endif -- cgit v1.2.3