Skip to content

kernel: make irq and Interrupts timer parsing CPU-count agnostic#375

Merged
bhargav0610 merged 3 commits intoqualcomm-linux:mainfrom
smuppand:kernel
Mar 31, 2026
Merged

kernel: make irq and Interrupts timer parsing CPU-count agnostic#375
bhargav0610 merged 3 commits intoqualcomm-linux:mainfrom
smuppand:kernel

Conversation

@smuppand
Copy link
Copy Markdown
Contributor

@smuppand smuppand commented Mar 31, 2026

This PR fixes the irq and Interrupts tests reported #374 so they no longer assume a fixed
number of CPU interrupt columns in /proc/interrupts.

What changed

  • add shared interrupt parsing helpers in Runner/utils/functestlib.sh
  • update Runner/suites/Kernel/Baseport/irq/run.sh to use the shared helpers
  • update Runner/suites/Kernel/Baseport/Interrupts/run.sh to use the shared helpers

Why this is needed

The previous implementation assumed fixed fields for per-CPU timer counters.
On targets with fewer CPU columns, the scripts started parsing trailing tokens
such as GICv3, Level, and arch_timer as if they were interrupt counters,
causing integer parsing errors and incorrect PASS/FAIL behavior.

RB1 validation results: https://lava.infra.foundries.io/scheduler/job/167608

Add reusable helpers in Runner/utils/functestlib.sh for interrupt-based
tests:

- get_interrupt_line_by_name()
- extract_interrupt_cpu_counts()
- count_interrupt_cpu_counts()

These helpers parse only numeric per-CPU interrupt counters from
/proc/interrupts and avoid hardcoded assumptions about CPU count.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Update the irq test to use shared interrupt parsing helpers from
functestlib.sh instead of assuming a fixed number of CPU interrupt
columns.

The test now:
- locates the arch_timer line through a shared helper
- extracts only numeric per-CPU interrupt counters
- validates the detected counter count before comparison

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Update the Interrupts test to use shared interrupt parsing helpers from
functestlib.sh instead of assuming a fixed number of CPU interrupt
columns.

The test now:
- locates the arch_timer line through a shared helper
- extracts only numeric per-CPU interrupt counters
- validates the detected counter count before comparison

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
@bhargav0610 bhargav0610 merged commit 77b06ae into qualcomm-linux:main Mar 31, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants