diff options
author | Jan Glauber <jang@linux.vnet.ibm.com> | 2012-12-11 08:53:35 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-12-14 04:01:17 -0500 |
commit | d0b0885316ab7a97cc8a19027905de3ff7bd1e79 (patch) | |
tree | 43a490c63baf2da1d4768f7d083e2e9d6cf8467b /arch/s390/include/asm/pci_debug.h | |
parent | 7313264b899bbf3988841296265a6e0e8a7b6521 (diff) |
s390/pci: performance statistics and debug infrastructure
Add support for reading the PCI function measurement block counters
provided by the hypervisor. Add two s390 debug features, one for
critical errors and one for tracing and provide wrappers to log data.
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/pci_debug.h')
-rw-r--r-- | arch/s390/include/asm/pci_debug.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/s390/include/asm/pci_debug.h b/arch/s390/include/asm/pci_debug.h new file mode 100644 index 000000000000..6bbec4265b6e --- /dev/null +++ b/arch/s390/include/asm/pci_debug.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef _S390_ASM_PCI_DEBUG_H | ||
2 | #define _S390_ASM_PCI_DEBUG_H | ||
3 | |||
4 | #include <asm/debug.h> | ||
5 | |||
6 | extern debug_info_t *pci_debug_msg_id; | ||
7 | extern debug_info_t *pci_debug_err_id; | ||
8 | |||
9 | #ifdef CONFIG_PCI_DEBUG | ||
10 | #define zpci_dbg(fmt, args...) \ | ||
11 | do { \ | ||
12 | if (pci_debug_msg_id->level >= 2) \ | ||
13 | debug_sprintf_event(pci_debug_msg_id, 2, fmt , ## args);\ | ||
14 | } while (0) | ||
15 | |||
16 | #else /* !CONFIG_PCI_DEBUG */ | ||
17 | #define zpci_dbg(fmt, args...) do { } while (0) | ||
18 | #endif | ||
19 | |||
20 | #define zpci_err(text...) \ | ||
21 | do { \ | ||
22 | char debug_buffer[16]; \ | ||
23 | snprintf(debug_buffer, 16, text); \ | ||
24 | debug_text_event(pci_debug_err_id, 0, debug_buffer); \ | ||
25 | } while (0) | ||
26 | |||
27 | static inline void zpci_err_hex(void *addr, int len) | ||
28 | { | ||
29 | while (len > 0) { | ||
30 | debug_event(pci_debug_err_id, 0, (void *) addr, len); | ||
31 | len -= pci_debug_err_id->buf_size; | ||
32 | addr += pci_debug_err_id->buf_size; | ||
33 | } | ||
34 | } | ||
35 | |||
36 | #endif | ||