diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-08-21 16:05:32 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-10-14 14:32:06 +0200 |
commit | b5a6b71b1901b9ca495f669c9ad86f2181960aba (patch) | |
tree | 26279ca6f071672d96ac6713c7ce4997d84482de /arch/s390/kernel/diag.c | |
parent | s390/diag: add a statistic for diagnose calls (diff) | |
download | linux-b5a6b71b1901b9ca495f669c9ad86f2181960aba.tar.xz linux-b5a6b71b1901b9ca495f669c9ad86f2181960aba.zip |
s390/diag: add tracepoint for diagnose calls
To be able to analyse problems in regard to hypervisor overhead
add a tracepoing for diagnose calls. It reports the number of
the diagnose issued, e.g.
sshd-1385 [002] .... 42.701431: diagnose: nr=0x9c
<idle>-0 [001] ..s. 43.587528: diagnose: nr=0x9c
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/diag.c')
-rw-r--r-- | arch/s390/kernel/diag.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c index 4ddb5200ddf0..f98766ede4e1 100644 --- a/arch/s390/kernel/diag.c +++ b/arch/s390/kernel/diag.c @@ -10,9 +10,13 @@ #include <linux/seq_file.h> #include <linux/debugfs.h> #include <asm/diag.h> +#include <asm/trace/diag.h> -DEFINE_PER_CPU(struct diag_stat, diag_stat); -EXPORT_PER_CPU_SYMBOL(diag_stat); +struct diag_stat { + unsigned int counter[NR_DIAG_STAT]; +}; + +static DEFINE_PER_CPU(struct diag_stat, diag_stat); struct diag_desc { int code; @@ -114,6 +118,20 @@ static int __init show_diag_stat_init(void) device_initcall(show_diag_stat_init); +void diag_stat_inc(enum diag_stat_enum nr) +{ + this_cpu_inc(diag_stat.counter[nr]); + trace_diagnose(diag_map[nr].code); +} +EXPORT_SYMBOL(diag_stat_inc); + +void diag_stat_inc_norecursion(enum diag_stat_enum nr) +{ + this_cpu_inc(diag_stat.counter[nr]); + trace_diagnose_norecursion(diag_map[nr].code); +} +EXPORT_SYMBOL(diag_stat_inc_norecursion); + /* * Diagnose 14: Input spool file manipulation */ |