diff options
author | Mike Kravetz <kravetz@us.ibm.com> | 2006-09-06 16:23:12 -0700 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-09-13 18:39:53 +1000 |
commit | 57852a853b0d6761f270be0961d5d8387e98c8bb (patch) | |
tree | f3c3ff7ec94014a9acba27761dd489fdce1c66db /include/asm-powerpc/hvcall.h | |
parent | ab06ff3af34a6288b314862abfebd86ad918c5d9 (diff) | |
download | linux-stable-57852a853b0d6761f270be0961d5d8387e98c8bb.tar.gz linux-stable-57852a853b0d6761f270be0961d5d8387e98c8bb.tar.bz2 linux-stable-57852a853b0d6761f270be0961d5d8387e98c8bb.zip |
[POWERPC] powerpc: Instrument Hypervisor Calls
Add instrumentation for hypervisor calls on pseries. Call statistics
include number of calls, wall time and cpu cycles (if available) and
are made available via debugfs. Instrumentation code is behind the
HCALL_STATS config option and has no impact if not enabled.
Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/hvcall.h')
-rw-r--r-- | include/asm-powerpc/hvcall.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index 63ce1ac8c1f4..257d1cecb8c9 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h @@ -208,7 +208,7 @@ #define H_JOIN 0x298 #define H_VASI_STATE 0x2A4 #define H_ENABLE_CRQ 0x2B0 -#define MAX_HCALL_OPCODES (H_ENABLE_CRQ >> 2) +#define MAX_HCALL_OPCODE H_ENABLE_CRQ #ifndef __ASSEMBLY__ @@ -246,6 +246,16 @@ long plpar_hcall(unsigned long opcode, unsigned long *retbuf, ...); #define PLPAR_HCALL9_BUFSIZE 9 long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...); +/* For hcall instrumentation. One structure per-hcall, per-CPU */ +struct hcall_stats { + unsigned long num_calls; /* number of calls (on this CPU) */ + unsigned long tb_total; /* total wall time (mftb) of calls. */ + unsigned long purr_total; /* total cpu time (PURR) of calls. */ +}; +void update_hcall_stats(unsigned long opcode, unsigned long tb_delta, + unsigned long purr_delta); +#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1) + #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_HVCALL_H */ |