pcp/SOURCES/s390x-interrupts.patch

109 lines
14 KiB
Diff

commit 04be64dc8a08203decc6fe206700dcb1f06c8d79
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Feb 24 17:28:48 2020 +1100
pmdalinux: fix interrupts file parser for s390x /proc/interrupts layout
The s390x interrupts file produced by the kernel was causing a failure
in pmdalinux because the code expected first numeric interrupt lines &
then named (text) lines, whereas on this platform they're intermixed.
Add a sample interrupts file from these kernels for qa/886 to test.
Resolves Red Hat BZ #1798058
diff --git a/qa/886.out.bz2 b/qa/886.out.bz2
index 59bfae0e2..8db30e566 100644
Binary files a/qa/886.out.bz2 and b/qa/886.out.bz2 differ
diff --git a/qa/linux/interrupts-16cpu-s390x b/qa/linux/interrupts-16cpu-s390x
new file mode 100644
index 000000000..574dec6b0
--- /dev/null
+++ b/qa/linux/interrupts-16cpu-s390x
@@ -0,0 +1,59 @@
+ CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 CPU8 CPU9 CPU10 CPU11 CPU12 CPU13 CPU14 CPU15
+EXT: 30368 5872 22695 18176 19463 5347 21306 15838 21533 6333 32165 7468 23182 5010 28665 6909
+I/O: 675 559 764 682 764 631 646 645 822 909 464 463 645 653 574 377
+AIO: 39 32 101 122 58 67 87 65 156 145 33 50 64 51 48 34
+ 3: 6 4 43 44 13 22 37 26 64 55 11 29 20 15 10 7 PCI-MSI mlx5_async@pci:0002:00:00.0
+ 4: 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 PCI-MSI mlx5_comp0@pci:0002:00:00.0
+ 5: 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 PCI-MSI mlx5_comp1@pci:0002:00:00.0
+ 6: 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 PCI-MSI mlx5_comp2@pci:0002:00:00.0
+ 7: 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 PCI-MSI mlx5_comp3@pci:0002:00:00.0
+ 8: 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 PCI-MSI mlx5_comp4@pci:0002:00:00.0
+ 9: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 PCI-MSI mlx5_comp5@pci:0002:00:00.0
+ 10: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 PCI-MSI mlx5_comp6@pci:0002:00:00.0
+ 11: 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 PCI-MSI mlx5_comp7@pci:0002:00:00.0
+ 12: 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 PCI-MSI mlx5_comp8@pci:0002:00:00.0
+ 13: 15 11 39 49 24 25 18 13 64 64 3 12 27 13 22 7 PCI-MSI mlx5_async@pci:0003:00:00.0
+ 14: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 PCI-MSI mlx5_comp0@pci:0003:00:00.0
+ 15: 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 PCI-MSI mlx5_comp1@pci:0003:00:00.0
+ 16: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 PCI-MSI mlx5_comp2@pci:0003:00:00.0
+ 17: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 PCI-MSI mlx5_comp3@pci:0003:00:00.0
+ 18: 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 PCI-MSI mlx5_comp4@pci:0003:00:00.0
+ 19: 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 PCI-MSI mlx5_comp5@pci:0003:00:00.0
+ 20: 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 PCI-MSI mlx5_comp6@pci:0003:00:00.0
+ 21: 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 PCI-MSI mlx5_comp7@pci:0003:00:00.0
+ 22: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 PCI-MSI mlx5_comp8@pci:0003:00:00.0
+ 23: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 PCI-MSI 0000:00:00.0
+ 24: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 PCI-MSI 0001:00:00.0
+CLK: 2876 2246 9129 14527 2478 1653 2830 3374 8696 1867 12976 3002 2341 1935 3066 3063 [EXT] Clock Comparator
+EXC: 27474 3626 13527 3649 16970 3694 18487 12464 12834 4466 19188 4466 20848 3077 25599 3846 [EXT] External Call
+EMS: 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] Emergency Signal
+TMR: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] CPU Timer
+TAL: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] Timing Alert
+PFL: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] Pseudo Page Fault
+DSD: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] DASD Diag
+VRT: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] Virtio
+SCP: 18 0 39 0 15 0 5 0 3 0 1 0 0 0 0 0 [EXT] Service Call
+IUC: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] IUCV
+CMS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] CPU-Measurement: Sampling
+CMC: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] CPU-Measurement: Counter
+FTP: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [EXT] HMC FTP Service
+CIO: 62 57 80 90 101 81 91 81 93 112 59 46 70 97 46 37 [I/O] Common I/O Layer Interrupt
+DAS: 613 502 684 592 663 550 555 564 729 797 405 417 575 556 528 340 [I/O] DASD
+C15: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] 3215
+C70: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] 3270
+TAP: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] Tape
+VMR: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] Unit Record Devices
+LCS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] LCS
+CTC: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] CTC
+ADM: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] EADM Subchannel
+CSC: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] CHSC Subchannel
+VIR: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [I/O] Virtual I/O Devices
+QAI: 18 17 18 27 20 20 31 26 28 25 18 7 15 20 15 18 [AIO] QDIO Adapter Interrupt
+APB: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [AIO] AP Bus
+PCF: 21 15 83 95 38 48 56 39 128 120 15 43 49 31 33 16 [AIO] PCI Floating Interrupt
+PCD: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [AIO] PCI Directed Interrupt
+MSI: 21 15 83 95 38 48 56 39 128 120 15 43 49 31 33 16 [AIO] MSI Interrupt
+VAI: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [AIO] Virtual I/O Devices AI
+GAL: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [AIO] GIB Alert
+NMI: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [NMI] Machine Check
+RST: 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [CPU] CPU Restart
diff --git a/src/pmdas/linux/interrupts.c b/src/pmdas/linux/interrupts.c
index f8a4d9b1b..f57af9e43 100644
--- a/src/pmdas/linux/interrupts.c
+++ b/src/pmdas/linux/interrupts.c
@@ -456,7 +456,9 @@ refresh_interrupt_values(void)
while (fgets(iobuf, iobufsz, fp) != NULL) {
iobuf[iobufsz - 1] = '\0';
/* next we parse each interrupt line row (starting with a digit) */
- sts = extract_interrupt_lines(iobuf, ncolumns, i++);
+ sts = extract_interrupt_lines(iobuf, ncolumns, i);
+ if (sts > 0)
+ i++;
if (sts > 1)
resized++;
if (sts)
@@ -466,7 +468,9 @@ refresh_interrupt_values(void)
if (extract_interrupt_misses(iobuf))
continue;
/* parse other per-CPU interrupt counter rows (starts non-digit) */
- sts = extract_interrupt_other(iobuf, ncolumns, j++);
+ sts = extract_interrupt_other(iobuf, ncolumns, j);
+ if (sts > 0)
+ j++;
if (sts > 1)
resized++;
if (!sts)