-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Martin Schwidefsky
committed
Oct 14, 2015
1 parent
1ec2772
commit b5a6b71
Showing
6 changed files
with
98 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Tracepoint header for s390 diagnose calls | ||
* | ||
* Copyright IBM Corp. 2015 | ||
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
*/ | ||
|
||
#undef TRACE_SYSTEM | ||
#define TRACE_SYSTEM s390 | ||
|
||
#if !defined(_TRACE_S390_DIAG_H) || defined(TRACE_HEADER_MULTI_READ) | ||
#define _TRACE_S390_DIAG_H | ||
|
||
#include <linux/tracepoint.h> | ||
|
||
#undef TRACE_INCLUDE_PATH | ||
#undef TRACE_INCLUDE_FILE | ||
|
||
#define TRACE_INCLUDE_PATH asm/trace | ||
#define TRACE_INCLUDE_FILE diag | ||
|
||
TRACE_EVENT(diagnose, | ||
TP_PROTO(unsigned short nr), | ||
TP_ARGS(nr), | ||
TP_STRUCT__entry( | ||
__field(unsigned short, nr) | ||
), | ||
TP_fast_assign( | ||
__entry->nr = nr; | ||
), | ||
TP_printk("nr=0x%x", __entry->nr) | ||
); | ||
|
||
#ifdef CONFIG_TRACEPOINTS | ||
void trace_diagnose_norecursion(int diag_nr); | ||
#else | ||
static inline void trace_diagnose_norecursion(int diag_nr) { } | ||
#endif | ||
|
||
#endif /* _TRACE_S390_DIAG_H */ | ||
|
||
/* This part must be outside protection */ | ||
#include <trace/define_trace.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Tracepoint definitions for s390 | ||
* | ||
* Copyright IBM Corp. 2015 | ||
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
*/ | ||
|
||
#include <linux/percpu.h> | ||
#define CREATE_TRACE_POINTS | ||
#include <asm/trace/diag.h> | ||
|
||
EXPORT_TRACEPOINT_SYMBOL(diagnose); | ||
|
||
static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth); | ||
|
||
void trace_diagnose_norecursion(int diag_nr) | ||
{ | ||
unsigned long flags; | ||
unsigned int *depth; | ||
|
||
local_irq_save(flags); | ||
depth = this_cpu_ptr(&diagnose_trace_depth); | ||
if (*depth == 0) { | ||
(*depth)++; | ||
trace_diagnose(diag_nr); | ||
(*depth)--; | ||
} | ||
local_irq_restore(flags); | ||
} |