libbpf-tools/softirqslower: Add libbpf CO-RE port of softirqslower - #5516
Open
ismhong wants to merge 1 commit into
Open
libbpf-tools/softirqslower: Add libbpf CO-RE port of softirqslower#5516ismhong wants to merge 1 commit into
ismhong wants to merge 1 commit into
Conversation
ismhong
requested review from
brendangregg,
chenhengqi,
ekyooo and
yonghong-song
as code owners
May 29, 2026 02:30
Contributor
There was a problem hiding this comment.
Pull request overview
Ports the BCC Python softirqslower tool to a libbpf CO-RE implementation under libbpf-tools/. The new tool traces two latency dimensions of softirq processing — raise→entry and entry→exit — emitting events via a perf buffer when latency exceeds a configurable threshold, with optional per-CPU filtering and tp_btf/raw_tp fallback paths.
Changes:
- New
softirqslower.bpf.cwith per-CPU arrays indexed by vector and matched tp_btf/raw_tp programs for raise/entry/exit. - New
softirqslower.cuserspace driver (argp, rodata configuration, BTF probe, perf buffer polling). - Shared
softirqslower.hdefining event layout and stage enum; MakefileAPPSupdated.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| libbpf-tools/softirqslower.h | Shared event struct, stage enum, NR_SOFTIRQS constant. |
| libbpf-tools/softirqslower.bpf.c | BPF programs and helpers for raise/entry/exit tracking. |
| libbpf-tools/softirqslower.c | Userspace argp, BTF/raw_tp selection, perf buffer loop. |
| libbpf-tools/Makefile | Adds softirqslower to APPS. |
Port softirqslower from BCC Python to libbpf CO-RE. The tool traces two latency dimensions of softirq processing: - raise->entry: delay from raise_softirq() until handler starts - entry->exit: actual handler execution duration Uses PERCPU_ARRAY maps indexed by softirq vector for lock-free per-CPU tracking, with tp_btf (preferred) and raw_tp fallback. Change-Id: Ie1d6eae35397a3181e9432d24137e92d66f815af
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Convert from legacy Python/bcc to modern libbpf-based C implementation. This tool traces slow softirq events by measuring two critical latency dimensions of softirq handling.
Features:
Test on x86_64/Manjaro/5.15.60
Test on arm64/Android/6.12.38
Why this approach
Just port softirqslower from BCC to libbpf
Checklist
tools/toolname:,libbpf-tools/toolname:,src/cc:,docs:,build:,tests/python:)