Add bpf_task_state and bpf_pystack#14
Open
albertxu216 wants to merge 4 commits intoOpenCloudOS:mainfrom
Open
Conversation
… state transitions, latency, memory usage, IO, and stack traces in Linux.
Features:
- Collects per-process and system-wide state statistics (running, sleeping, etc.)
- Supports filtering by PID and process name (comm), with wildcard and multi-process support
- Tracks memory usage, read/write bytes, and page delay metrics (FreePages, Thrashing, SwapIn)
- Outputs kernel and user stack traces for each process, with symbol resolution
- Supports interval and event-driven sampling, latency threshold filtering, and per-instance statistics
- Provides flame graph data for performance analysis
Usage examples:
- Show all process state statistics every second:
perf-prof bpf:task-state -i 1000
- Filter by PID:
perf-prof bpf:task-state -p 1234 -i 1000
- Filter by process name (supports wildcards):
perf-prof bpf:task-state --filter 'java,python*' -i 1000
- Only show events with latency greater than 20ms and print stack traces:
perf-prof bpf:task-state -p 1234 -SD --than 20ms -g
- Output per-instance statistics with latency threshold:
perf-prof bpf:task-state --perins --than 1ms -i 1000
…on threads outputs python call stacks together with kernel-stack and user-stacks at appropriate times. Compared to pystack, bpf-pystack supports stack maintenance for newly created processes. Usage examples: --bpf-python-callchain <libpython_path> (--bpf-python-callchain /usr/local/lib/libpython3.6m.so.1.0)
…on threads bpf-pystack: Uses eBPF technology to maintain the call stacks of Python threads Outputs python-stack together with kernel and user call stacks at appropriate times. Compared to pystack, bpf-pystack supports stack maintenance for newly created processes.
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.
bpf_task_state: a BPF-based tool for collecting and analyzing process state transitions, latency, memory usage, IO, and stack traces in Linux.
Features:
Usage examples:
bpf-pystack: Uses eBPF technology to maintain the call stacks of Python threads;
