diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2007-10-22 06:52:39 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-10-22 06:52:47 -0400 |
commit | fae8b22d3e3e3a3d317a7746493997af02a3f35c (patch) | |
tree | 871aa91c51d713d7842ba1eb8661bde54d102842 /include/asm-s390 | |
parent | 32346f47dd46bed291464e194a6c47da6fdd1bc3 (diff) |
[S390] Add per-cpu idle time / idle count sysfs attributes.
Add two new sysfs entries per cpu: idle_count and idle_time.
idle_count contains the number of times a cpu went into idle state.
idle_time contains the time a cpu spent in idle state in microseconds.
This can be used e.g. by powertop to tell how often idle state is
entered and left.
# cat /sys/devices/system/cpu/cpu0/idle_count
504
# cat /sys/devices/system/cpu/cpu0/idle_time
469734037 us
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/asm-s390')
-rw-r--r-- | include/asm-s390/cpu.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/asm-s390/cpu.h b/include/asm-s390/cpu.h new file mode 100644 index 000000000000..352dde194f3c --- /dev/null +++ b/include/asm-s390/cpu.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * include/asm-s390/cpu.h | ||
3 | * | ||
4 | * Copyright IBM Corp. 2007 | ||
5 | * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com> | ||
6 | */ | ||
7 | |||
8 | #ifndef _ASM_S390_CPU_H_ | ||
9 | #define _ASM_S390_CPU_H_ | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/percpu.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | |||
15 | struct s390_idle_data { | ||
16 | spinlock_t lock; | ||
17 | unsigned int in_idle; | ||
18 | unsigned long long idle_count; | ||
19 | unsigned long long idle_enter; | ||
20 | unsigned long long idle_time; | ||
21 | }; | ||
22 | |||
23 | DECLARE_PER_CPU(struct s390_idle_data, s390_idle); | ||
24 | |||
25 | #endif /* _ASM_S390_CPU_H_ */ | ||