kernel/irq: Add irqbalance01
PATCH v3 1/1 kernel/irq: Add irqbalance01
Add first test specifically targeting interrupts and IRQ management.
This includes some comments inline because I think the parsing code is unavoidably confusing.
Note on the CPU mask parsing; there is already some code for parsing and manipulating bitmaps in the LTP. However it is absurdly complicated and we don't need actual bitmaps. In fact an array of bytes is more flexible.
---
V3:
* output length from read_proc_file
V2:
* Read proc files in at most 1-page blocks
As Cyril suggested this looks like the best way. seq_file will only expand the internal buffer above a page if a record does not fit in one page. In this case a record is the per-cpus counts for an irq. However it won't expand the buffer for multiple records. It just returns whatver fits in the buffer.
* Read in CPU masks from the end of the buffer
If nr_cpus is not a multiple of 4 then one of the hex digits has some padding. We either need to pad irq_affinity as well (which creates complication) or ignore the padding. It's easier to ignore it if we start at the end.
* Print headers and some minor format changes to printing
* Add a few more parsing checks
* Remove freeing of buffers
runtest/irq | 1 + testcases/kernel/irq/.gitignore | 1 + testcases/kernel/irq/Makefile | 7 + testcases/kernel/irq/irqbalance01.c | 315 ++++++++++++++++++++++++++++ 4 files changed, 324 insertions(+) create mode 100644 runtest/irq create mode 100644 testcases/kernel/irq/.gitignore create mode 100644 testcases/kernel/irq/Makefile create mode 100644 testcases/kernel/irq/irqbalance01.c
runtest/irq new file +1 -0
@@ -0,0 +1 @@ +irqbalance01 irqbalance01
testcases/kernel/irq/.gitignore new file +1 -0
@@ -0,0 +1 @@ +irqbalance01
testcases/kernel/irq/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/irq/irqbalance01.c new file +315 -0
315 lines not on this page · raw message
Signature · 5 lines
2.33.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp