diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2008-01-29 00:27:30 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-02-20 15:55:37 -0500 |
commit | b64f34cdfe5bef9dfed1304c513220b0f2862eca (patch) | |
tree | 04cb9216a9de18afcb27f9bac3fda1f3c7bacbbd /arch/ia64/ia32 | |
parent | 5d9c4a7de64d398604a978d267a6987f1f4025b7 (diff) |
[IA64] VIRT_CPU_ACCOUNTING (accurate cpu time accounting)
This patch implements VIRT_CPU_ACCOUNTING for ia64,
which enable us to use more accurate cpu time accounting.
The VIRT_CPU_ACCOUNTING is an item of kernel config, which s390
and powerpc arch have. By turning this config on, these archs
change the mechanism of cpu time accounting from tick-sampling
based one to state-transition based one.
The state-transition based accounting is done by checking time
(cycle counter in processor) at every state-transition point,
such as entrance/exit of kernel, interrupt, softirq etc.
The difference between point to point is the actual time consumed
during in the state. There is no doubt about that this value is
more accurate than that of tick-sampling based accounting.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/ia32')
-rw-r--r-- | arch/ia64/ia32/elfcore32.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/ia64/ia32/elfcore32.h b/arch/ia64/ia32/elfcore32.h index 446c9aac924d..9a3abf58cea3 100644 --- a/arch/ia64/ia32/elfcore32.h +++ b/arch/ia64/ia32/elfcore32.h | |||
@@ -30,7 +30,19 @@ struct elf_siginfo | |||
30 | int si_errno; /* errno */ | 30 | int si_errno; /* errno */ |
31 | }; | 31 | }; |
32 | 32 | ||
33 | #define jiffies_to_timeval(a,b) do { (b)->tv_usec = 0; (b)->tv_sec = (a)/HZ; }while(0) | 33 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
34 | /* | ||
35 | * Hacks are here since types between compat_timeval (= pair of s32) and | ||
36 | * ia64-native timeval (= pair of s64) are not compatible, at least a file | ||
37 | * arch/ia64/ia32/../../../fs/binfmt_elf.c will get warnings from compiler on | ||
38 | * use of cputime_to_timeval(), which usually an alias of jiffies_to_timeval(). | ||
39 | */ | ||
40 | #define cputime_to_timeval(a,b) \ | ||
41 | do { (b)->tv_usec = 0; (b)->tv_sec = (a)/NSEC_PER_SEC; } while(0) | ||
42 | #else | ||
43 | #define jiffies_to_timeval(a,b) \ | ||
44 | do { (b)->tv_usec = 0; (b)->tv_sec = (a)/HZ; } while(0) | ||
45 | #endif | ||
34 | 46 | ||
35 | struct elf_prstatus | 47 | struct elf_prstatus |
36 | { | 48 | { |