Skip to content

linux.core: fix irq exit handler not finding quark#424

Merged
MatthewKhouzam merged 1 commit into
eclipse-tracecompass:masterfrom
arfio:fix-irq-exit-handler
Jul 7, 2026
Merged

linux.core: fix irq exit handler not finding quark#424
MatthewKhouzam merged 1 commit into
eclipse-tracecompass:masterfrom
arfio:fix-irq-exit-handler

Conversation

@arfio

@arfio arfio commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What it does

The IRQ exit handler assumes that a quark will always be found. This patch fixes that assumption, and avoid making the whole Linux Analysis fail. Fixes #423.

How to test

Run with the trace submitted in #423.

Follow-ups

N/A

Review checklist

  • As an author, I have thoroughly tested my changes and carefully followed the instructions in this template

Summary by CodeRabbit

  • Bug Fixes
    • Prevented invalid IRQ state updates when no matching IRQ entry is active.
    • Improved stability by safely skipping processing if no valid IRQ attribute is found.

Signed-off-by: Arnaud Fiorini <fiorini.arnaud@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a guard in IrqExitHandler.handleEvent to check for an invalid IRQ attribute quark and return early, preventing an IndexOutOfBoundsException when processing irq_handler_exit events lacking a matching irq_handler_entry event.

Changes

IRQ Exit Handler Fix

Layer / File(s) Summary
Early-return guard for invalid IRQ quark
analysis/.../handlers/IrqExitHandler.java
Adds a check that returns early from handleEvent when the attribute quark is ITmfStateSystem.INVALID_ATTRIBUTE, avoiding invalid state access for unmatched irq exit events.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Related issues: Fixes error thrown when opening a kernel trace containing an irq_handler_exit event without a matching irq_handler_entry, which previously caused an IndexOutOfBoundsException and an empty Control Flow view (#423).

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main fix in IrqExitHandler for missing IRQ quarks.
Linked Issues check ✅ Passed The change directly addresses issue #423 by returning early when no matching IRQ entry is found, preventing the crash on unmatched irq_handler_exit events.
Out of Scope Changes check ✅ Passed The patch is narrowly scoped to the IRQ exit handler and adds no unrelated behavior or files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/IrqExitHandler.java (1)

59-62: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider logging when the guard triggers.

Silent early-return on unmatched exit events works, but a trace-level log (or comment noting it's expected for truncated/incomplete traces) would aid future debugging of similar data-quality issues.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/IrqExitHandler.java`
around lines 59 - 62, The early return in IrqExitHandler.handleEvent when quark
is ITmfStateSystem.INVALID_ATTRIBUTE is silent, so add a trace-level log or an
explanatory comment there to note the unmatched IRQ exit is expected for
truncated or incomplete traces. Keep the guard behavior unchanged, but use the
existing handleEvent path and the invalid-attribute check to make future
debugging of data-quality issues easier.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/IrqExitHandler.java`:
- Around line 59-62: The early return in IrqExitHandler.handleEvent when quark
is ITmfStateSystem.INVALID_ATTRIBUTE is silent, so add a trace-level log or an
explanatory comment there to note the unmatched IRQ exit is expected for
truncated or incomplete traces. Keep the guard behavior unchanged, but use the
existing handleEvent path and the invalid-attribute check to make future
debugging of data-quality issues easier.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7531ad41-2adb-4ca0-9a7f-0ab6f0571a7c

📥 Commits

Reviewing files that changed from the base of the PR and between aeb3ed6 and 04ec569.

📒 Files selected for processing (1)
  • analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/IrqExitHandler.java

@MatthewKhouzam MatthewKhouzam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MatthewKhouzam

Copy link
Copy Markdown
Contributor

No need to bump the version as the produced state system will be identical when it's made.

@MatthewKhouzam
MatthewKhouzam merged commit 7c8ca0b into eclipse-tracecompass:master Jul 7, 2026
5 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.

Error when opening kernel trace with unmatched irq events

2 participants