-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contrib: add script to dump irq stats. #336
Conversation
Hi @imran-kn, Nice work. However it looks like this script supports pretty old kernel level 4.14.307 and fails with upstream kernel level v6.4+. Is there any plan to get this script working for upstream kernel as well ? $ sudo python3 -m drgn contrib/irq.py |
Hello Mahesh, |
ouch my bad.. After pointing it to debuginfo vmlinux using '-s' option it started working.. $ sudo python3 -m drgn -s /usr/lib/debug/lib/modules/6.4.15-200.fc38.x86_64/vmlinux contrib/irq.py |
No problem. Thanks for the timely update :) |
be5dd93
to
9c899f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really cool to visualize this on my workstation :) a few comments on the new helper.
983da10
to
9c899f0
Compare
…nges. In some cases (for example getting affinity of an irq), it is better to have an easily understandable list of cpus corresonding to a given cpumask. This helper converts a given cpumask to string, such that the string represents the range of CPUs that are present in the given mask. Signed-off-by: Imran Khan <imran.f.khan@oracle.com>
9c899f0
to
2baf40b
Compare
Sample output: python3 -m drgn -s vmlinux -c vmcore contrib/irq.py List of IRQs irq: 0 name: timer (struct irq_desc *)0xffff9b42fd00d400 (struct irqaction *)0xffffffff88425240 irq: 1 name: i8042 (struct irq_desc *)0xffff9b42fd00d600 (struct irqaction *)0xffff9b42fcb13c00 irq: 4 name: ttyS0 (struct irq_desc *)0xffff9b42fd00dc00 (struct irqaction *)0xffff9b42fcb2bc00 irq: 8 name: rtc0 (struct irq_desc *)0xffff9b42fd00e400 (struct irqaction *)0xffff9b42fcb59380 irq: 9 name: acpi (struct irq_desc *)0xffff9b42fd00e600 (struct irqaction *)0xffff9b42fcafca80 irq: 11 name: eth0 (struct irq_desc *)0xffff9b42fd00ea00 (struct irqaction *)0xffff9b42fc878d80 irq: 12 name: i8042 (struct irq_desc *)0xffff9b42fd00ec00 (struct irqaction *)0xffff9b42fcb13900 irq: 14 name: ata_piix (struct irq_desc *)0xffff9b42fd00f000 (struct irqaction *)0xffff9b42fc690800 irq: 15 name: ata_piix (struct irq_desc *)0xffff9b42fd00f200 (struct irqaction *)0xffff9b42fc690780 IRQ affinities irq: 0 name: timer affinity: 0-7 irq: 1 name: i8042 affinity: 0-7 irq: 4 name: ttyS0 affinity: 0-7 irq: 8 name: rtc0 affinity: 0-7 irq: 9 name: acpi affinity: 0-7 irq: 11 name: eth0 affinity: 0-7 irq: 12 name: i8042 affinity: 0-7 irq: 14 name: ata_piix affinity: 0-7 irq: 15 name: ata_piix affinity: 0-7 IRQ stats irq: 0 name: timer (struct irq_desc *)0xffff9b42fd00d400 CPU: 0 count: 162 Total: 162 irq: 1 name: i8042 (struct irq_desc *)0xffff9b42fd00d600 CPU: 0 count: 10 Total: 10 irq: 4 name: ttyS0 (struct irq_desc *)0xffff9b42fd00dc00 CPU: 0 count: 220 Total: 220 irq: 8 name: rtc0 (struct irq_desc *)0xffff9b42fd00e400 CPU: 0 count: 1 Total: 1 Total: 0 irq: 11 name: eth0 (struct irq_desc *)0xffff9b42fd00ea00 CPU: 0 count: 85 Total: 85 irq: 12 name: i8042 (struct irq_desc *)0xffff9b42fd00ec00 CPU: 0 count: 125 Total: 125 irq: 14 name: ata_piix (struct irq_desc *)0xffff9b42fd00f000 CPU: 0 count: 496 Total: 496 irq: 15 name: ata_piix (struct irq_desc *)0xffff9b42fd00f200 CPU: 0 count: 11 Total: 11 cpuwise IRQ stats IRQ stats for cpu: 0 irq: 0 name: timer (struct irq_desc *)0xffff9b42fd00d400 count: 162 irq: 1 name: i8042 (struct irq_desc *)0xffff9b42fd00d600 count: 10 irq: 4 name: ttyS0 (struct irq_desc *)0xffff9b42fd00dc00 count: 220 irq: 8 name: rtc0 (struct irq_desc *)0xffff9b42fd00e400 count: 1 irq: 11 name: eth0 (struct irq_desc *)0xffff9b42fd00ea00 count: 85 irq: 12 name: i8042 (struct irq_desc *)0xffff9b42fd00ec00 count: 125 irq: 14 name: ata_piix (struct irq_desc *)0xffff9b42fd00f000 count: 496 irq: 15 name: ata_piix (struct irq_desc *)0xffff9b42fd00f200 count: 11 Total: 1110 IRQ stats for cpu: 1 Total: 0 IRQ stats for cpu: 2 Total: 0 IRQ stats for cpu: 3 Total: 0 IRQ stats for cpu: 4 Total: 0 IRQ stats for cpu: 5 Total: 0 IRQ stats for cpu: 6 Total: 0 IRQ stats for cpu: 7 Total: 0 Signed-off-by: Imran Khan <imran.f.khan@oracle.com>
2baf40b
to
46d9446
Compare
script to dump irq stats.
A sample output:
python3 -m drgn -s ~/Local-vmcores/sched-study/v4.14/vmlinux -c ~/Local-vmcores/sched-study/v4.14/vmcore contrib/irq.py
warning: could not get debugging information for:
kernel modules (could not read depmod: open: /lib/modules/4.14.307/modules.dep.bin: No such file or directory)
###################################################
List of IRQs
###################################################
irq: 0 name: timer (struct irq_desc *)0xffff9b42fd00d400 (struct irqaction *)0xffffffff88425240
irq: 1 name: i8042 (struct irq_desc *)0xffff9b42fd00d600 (struct irqaction *)0xffff9b42fcb13c00
irq: 4 name: ttyS0 (struct irq_desc *)0xffff9b42fd00dc00 (struct irqaction *)0xffff9b42fcb2bc00
irq: 8 name: rtc0 (struct irq_desc *)0xffff9b42fd00e400 (struct irqaction *)0xffff9b42fcb59380
irq: 9 name: acpi (struct irq_desc *)0xffff9b42fd00e600 (struct irqaction *)0xffff9b42fcafca80
irq: 11 name: eth0 (struct irq_desc *)0xffff9b42fd00ea00 (struct irqaction *)0xffff9b42fc878d80
irq: 12 name: i8042 (struct irq_desc *)0xffff9b42fd00ec00 (struct irqaction *)0xffff9b42fcb13900
irq: 14 name: ata_piix (struct irq_desc *)0xffff9b42fd00f000 (struct irqaction *)0xffff9b42fc690800
irq: 15 name: ata_piix (struct irq_desc *)0xffff9b42fd00f200 (struct irqaction *)0xffff9b42fc690780
###################################################
IRQ affinities
###################################################
irq: 0 name: timer affinity: 0-7
irq: 1 name: i8042 affinity: 0-7
irq: 4 name: ttyS0 affinity: 0-7
irq: 8 name: rtc0 affinity: 0-7
irq: 9 name: acpi affinity: 0-7
irq: 11 name: eth0 affinity: 0-7
irq: 12 name: i8042 affinity: 0-7
irq: 14 name: ata_piix affinity: 0-7
irq: 15 name: ata_piix affinity: 0-7
###################################################
IRQ stats
###################################################
irq: 0 name: timer (struct irq_desc *)0xffff9b42fd00d400
CPU: 0 count: 162
Total: 162
irq: 1 name: i8042 (struct irq_desc *)0xffff9b42fd00d600
CPU: 0 count: 10
Total: 10
irq: 4 name: ttyS0 (struct irq_desc *)0xffff9b42fd00dc00
CPU: 0 count: 220
Total: 220
irq: 8 name: rtc0 (struct irq_desc *)0xffff9b42fd00e400
CPU: 0 count: 1
Total: 1
Total: 0
irq: 11 name: eth0 (struct irq_desc *)0xffff9b42fd00ea00
CPU: 0 count: 85
Total: 85
irq: 12 name: i8042 (struct irq_desc *)0xffff9b42fd00ec00
CPU: 0 count: 125
Total: 125
irq: 14 name: ata_piix (struct irq_desc *)0xffff9b42fd00f000
CPU: 0 count: 496
Total: 496
irq: 15 name: ata_piix (struct irq_desc *)0xffff9b42fd00f200
CPU: 0 count: 11
Total: 11
###################################################
cpuwise IRQ stats
###################################################
IRQ stats for cpu: 0
irq: 0 name: timer (struct irq_desc *)0xffff9b42fd00d400 count: 162
irq: 1 name: i8042 (struct irq_desc *)0xffff9b42fd00d600 count: 10
irq: 4 name: ttyS0 (struct irq_desc *)0xffff9b42fd00dc00 count: 220
irq: 8 name: rtc0 (struct irq_desc *)0xffff9b42fd00e400 count: 1
irq: 11 name: eth0 (struct irq_desc *)0xffff9b42fd00ea00 count: 85
irq: 12 name: i8042 (struct irq_desc *)0xffff9b42fd00ec00 count: 125
irq: 14 name: ata_piix (struct irq_desc *)0xffff9b42fd00f000 count: 496
irq: 15 name: ata_piix (struct irq_desc *)0xffff9b42fd00f200 count: 11
Total: 1110
IRQ stats for cpu: 1
Total: 0
IRQ stats for cpu: 2
Total: 0
IRQ stats for cpu: 3
Total: 0
IRQ stats for cpu: 4
Total: 0
IRQ stats for cpu: 5
Total: 0
IRQ stats for cpu: 6
Total: 0
IRQ stats for cpu: 7
Total:0