Project 7: Interrupt Latency Profiler

A tool that measures and visualizes interrupt latency on your system, showing how long it takes from hardware interrupt to handler execution, and identifying sources of latency.

Quick Reference

Attribute Value
Primary Language See main guide
Alternative Languages N/A
Difficulty Level 4: Expert
Time Estimate 2 weeks
Knowledge Area OS Performance / Kernel
Tooling ftrace / eBPF
Prerequisites Understanding of userspace profiling, basic kernel concepts

What You Will Build

A tool that measures and visualizes interrupt latency on your system, showing how long it takes from hardware interrupt to handler execution, and identifying sources of latency.

Why It Matters

This project builds core skills that appear repeatedly in real-world systems and tooling.

Core Challenges

  • Accessing interrupt statistics from /proc/interrupts (maps to interrupt subsystem)
  • Using ftrace to trace interrupt handlers (maps to kernel tracing)
  • Understanding IRQ affinity and distribution (maps to SMP interrupt handling)
  • Measuring time accurately at microsecond scale (maps to timekeeping)
  • Correlating latency spikes with system activity (maps to system analysis)

Key Concepts

  • Interrupt handling: “Linux Kernel Development” Ch. 7 - Robert Love
  • Top/bottom halves: “Linux Kernel Development” Ch. 8 - Robert Love
  • ftrace: Kernel documentation + Steven Rostedt’s articles
  • /proc/interrupts: “Understanding the Linux Kernel” Ch. 4 - Bovet & Cesati

Real-World Outcome

Deliver a working demo with observable output that proves the feature is correct.


Implementation Guide

  1. Reproduce the simplest happy-path scenario.
  2. Build the smallest working version of the core feature.
  3. Add input validation and error handling.
  4. Add instrumentation/logging to confirm behavior.
  5. Refactor into clean modules with tests.

Milestones

  • Milestone 1: Minimal working program that runs end-to-end.
  • Milestone 2: Correct outputs for typical inputs.
  • Milestone 3: Robust handling of edge cases.
  • Milestone 4: Clean structure and documented usage.

Validation Checklist

  • Output matches the real-world outcome example
  • Handles invalid inputs safely
  • Provides clear errors and exit codes
  • Repeatable results across runs

References

  • Main guide: TRACK_A_OS_KERNEL_PROJECTS.md
  • “Systems Performance” by Brendan Gregg