303 Commits

Author SHA1 Message Date
云微
3a722c03d5 feat: add tcx and bpf token tutorials (#203)
* feat: add tcx and bpf token tutorials

* docs: auto-generate documentation

* docs: rewrite tcx and bpf_token tutorials with richer content and consistent style

Rewrote all 4 README files (EN/ZH for both tutorials) to match the
existing tutorial style with detailed background, full code listings,
step-by-step explanations, comparison tables, and proper references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style: replace em dashes with colons, commas, and parentheses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: auto-generate documentation

* ci: add tcx and bpf_token builds to CI; simplify execl in token_userns_demo

- Add make targets for src/50-tcx and src/features/bpf_token to the
  test-libbpf CI workflow.
- Replace four separate execl() calls with a single execv() using a
  dynamically built argv array, reducing complexity and eliminating
  CodeFactor command-injection false positives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ci: fix mkdocs path in trigger-sync workflow

Use .venv/bin/mkdocs instead of bare mkdocs, since make install
puts it inside a virtualenv.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: LinuxDev9002 <linuxdev8883@example.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 21:23:23 -07:00
github-actions[bot]
ee6d522e40 docs: auto-generate documentation 2026-03-06 22:49:21 +00:00
LinuxDev9002
f5564cfa77 fix: Update links in README files for kprobe examples and clarify base program descriptions 2026-03-06 14:47:38 -08:00
KEROLT
d06ec2f281 fix: Correct tutorial 12 profile folded stack format (#202)
- Reorder stack processing to place kernel frames at bottom and user frames on top
- Match expected flamegraph.pl input format
- Simplify output to standard folded format: "comm;stack1;stack2 count"
- Remove timestamp and CPU metadata
2026-02-20 22:17:08 -08:00
Copilot
bb994bf436 Fix curl hanging in XDP load balancer: backend servers reject mismatched Host headers (#198)
* Initial plan

* Add simple HTTP server and update docs to fix curl hanging issue

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Fix code review issues: remove unnecessary shutdown() and fix spacing

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Add test script to verify HTTP servers handle mismatched Host headers

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Add comprehensive solution documentation for curl hanging issue

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Update src/42-xdp-loadbalancer/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: 云微 <1067852565@qq.com>

* Update src/42-xdp-loadbalancer/README.zh.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: 云微 <1067852565@qq.com>

* Update src/42-xdp-loadbalancer/SOLUTION.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: 云微 <1067852565@qq.com>

* Delete src/42-xdp-loadbalancer/__pycache__/simple_http_server.cpython-312.pyc

Signed-off-by: 云微 <1067852565@qq.com>

* Delete src/42-xdp-loadbalancer/SOLUTION.md

Signed-off-by: 云微 <1067852565@qq.com>

---------

Signed-off-by: 云微 <1067852565@qq.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>
Co-authored-by: 云微 <1067852565@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-12 06:20:14 -08:00
Copilot
8e4e94c346 Remove incorrect cgroup filtering from runqlat (#201)
* Initial plan

* Fix incorrect cgroup filtering in runqlat - remove checks for waker instead of wakee

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Clarify that filter_cg is deprecated and has no effect

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Update docs to show DEPRECATED comment in code snippets and mention --filter_cg is no-op

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Remove filter_cg and cgroup_map completely from code and docs

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>
2026-02-11 22:51:53 -08:00
Copilot
251aa12262 Add troubleshooting guide for fentry attachment failures in 3-fentry-unlink (#200)
* Initial plan

* Add troubleshooting section for fentry-unlink example with kernel compatibility guidance

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>
2026-02-10 15:51:54 -08:00
Copilot
1d9958487a Fix Rust uprobe tutorial and add CI tests in dedicated workflow (#197)
* Initial plan

* Fix issue #173: Update Rust uprobe documentation to use debug build and correct function symbol

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Add CI tests for Rust uprobe tutorial (issue #173)

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Update src/37-uprobe-rust/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: 云微 <1067852565@qq.com>

* Update src/37-uprobe-rust/README.zh.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: 云微 <1067852565@qq.com>

* Use wildcard patterns for Rust symbol matching in bpftrace examples

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Add CI test to verify bpftrace can attach to Rust uprobe

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Separate bpftrace tests into new test-bpftrace.yml workflow

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

---------

Signed-off-by: 云微 <1067852565@qq.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>
Co-authored-by: 云微 <1067852565@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-10 12:57:01 -08:00
Copilot
95377603c6 Fix tutorial 1 compilation with ecc by using vmlinux.h (#199)
* Initial plan

* Fix tutorial 1 compilation by including vmlinux.h

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

* Update README documentation to reference vmlinux.h consistently

Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yunwei37 <34985212+yunwei37@users.noreply.github.com>
2026-02-10 12:04:28 -08:00
github-actions[bot]
98682eed04 docs: auto-generate documentation 2026-02-01 00:34:59 +00:00
github-actions[bot]
9d08062cb7 fix: Update struct references from config to dynptr_cfg in README files 2026-02-01 00:34:43 +00:00
github-actions[bot]
c42ba4f9ab Add BPF dynptr TC demo implementation
- Implement BPF program for TC ingress using dynptrs to safely parse packet headers and manage variable-length ringbuf records.
- Create user-space loader for the BPF program, allowing configuration of blocked ports and snapshot lengths for TCP payloads.
- Define necessary data structures and constants in header file for both BPF and user-space contexts.
- Add a comprehensive test script to validate functionality, including basic packet capture and port blocking tests.
2026-02-01 00:34:43 +00:00
github-actions[bot]
2fa73cbe3f docs: auto-generate documentation 2026-01-31 05:55:36 +00:00
github-actions[bot]
342acab9af docs: Update README and SUMMARY files to include Intel NPU kernel driver lessons and cgroup policy control
feat: Enhance TOC generation script to include non-numbered directories with .config files
chore: Add .config file for cgroup-based policy control
2026-01-31 05:55:22 +00:00
github-actions[bot]
6d3ba3ea34 feat: Add cgroup eBPF policy guard with TCP, device, and sysctl controls
- Implemented cgroup-based access control using eBPF with three main functionalities:
  1. Block TCP connections to specified ports.
  2. Deny access to specified devices.
  3. Control sysctl read/write operations.
- Added necessary Makefile and documentation for building and running the policy guard.
2026-01-31 05:37:35 +00:00
Littlefisher
42884e3cef docs: Revise README files for clarity on extending kernel behavior with BPF struct_ops 2026-01-11 23:39:46 -08:00
Littlefisher
34f690385e docs: Update README files to include information on extending GPU driver behavior with eBPF and the gpu_ext project 2026-01-11 23:27:20 -08:00
Littlefisher
48afb3265d docs: Enhance README files with examples of GPU scheduling and memory offloading using BPF struct_ops 2026-01-11 02:41:31 -08:00
github-actions[bot]
c1d56c531f docs: auto-generate documentation 2026-01-11 10:28:35 +00:00
Littlefisher
cbc6658f80 Add Chinese translation for eBPF tutorial on BPF struct_ops
This commit introduces a comprehensive Chinese translation of the eBPF tutorial focused on using BPF struct_ops to extend kernel subsystems. The tutorial covers the challenges of kernel development, the benefits of using BPF struct_ops, and provides detailed examples of implementing a kernel module, BPF program, and user-space loader. The content aims to enhance accessibility for Chinese-speaking developers interested in eBPF and kernel programming.
2026-01-11 02:28:21 -08:00
github-actions[bot]
8372e9bf1c feat: Enhance test_3 to safely read from kernel buffer and return length 2025-11-16 06:19:28 +00:00
github-actions[bot]
86c2f723f0 feat: Update struct_ops to change test_3 return type to int and add BPF helper support 2025-11-15 23:54:20 +00:00
github-actions[bot]
540ce67c47 fix: Remove bpf_printk calls from struct_ops BPF programs to comply with restrictions 2025-11-15 22:24:51 +00:00
github-actions[bot]
a1430cf552 docs: auto-generate documentation 2025-11-12 15:39:28 +00:00
Littlefisher
fd03b86248 feat: Update TOC generation functions to include output file directory parameter and adjust lesson paths in SUMMARY files 2025-11-12 07:39:14 -08:00
github-actions[bot]
78bad8296c docs: auto-generate documentation 2025-11-10 18:31:03 +00:00
github-actions[bot]
5ce10be3e1 feat: Implement BPF struct_ops example with custom kernel module and user-space loader 2025-11-10 18:30:48 +00:00
Yinzuo Jiang
ca927133b7 fix(32-wallclock-profiler): use absolute path to find tool paths (#186)
Problem:

`Path(__file__)` can be ".", in such case `self.oncpu_tool` is "oncputime", which can not be found by the shell.

Solution:

Translate `Path(__file__)` to absolute path.
2025-11-09 10:20:35 -08:00
Littlefisher
2c9870bf83 feat: Add initial implementation of struct_ops BPF program and kernel module with kfunc support 2025-11-08 15:51:36 -08:00
github-actions[bot]
134ee88067 docs: auto-generate documentation 2025-11-04 07:16:27 +00:00
Littlefisher
01ee4ea9ed fix: update image links to use absolute URLs in README and SUMMARY templates 2025-11-03 23:16:14 -08:00
github-actions[bot]
81be963985 docs: auto-generate documentation 2025-11-04 06:14:12 +00:00
Littlefisher
75ec466daa feat: Add book recommendation for eBPF observability and introduce configuration for GPU flamegraph 2025-11-03 22:13:59 -08:00
github-actions[bot]
b9b82fae6d docs: auto-generate documentation 2025-11-04 05:39:43 +00:00
Littlefisher
285e4f2579 feat: Add book recommendations and promotional content for eBPF learning resources 2025-11-03 21:39:29 -08:00
Littlefisher
cf6abdeaf2 Implement feature X to enhance user experience and optimize performance 2025-10-28 20:35:37 -07:00
Littlefisher
5afd7fd348 Enhance Flamegraph Documentation and GPU Profiling Scripts
- Added an example flamegraph for Qwen3 LLM inference, highlighting key insights and performance bottlenecks.
- Updated README.md to include detailed explanations of CPU and GPU profiling results, emphasizing the correlation between CPU stacks and GPU kernels.
- Modified gpuperf.py to ensure absolute paths are used for output files, improving reliability across different working directories.
- Enhanced merge_gpu_cpu_trace.py to strip ANSI escape sequences from CPU stack traces, ensuring cleaner output for analysis.
- Introduced a new SVG file for the Qwen3 flamegraph, providing a visual representation of profiling data with interactive features.
2025-10-28 13:23:16 -07:00
Littlefisher
ad583766a8 Implement structural updates and optimizations across multiple modules 2025-10-28 12:40:06 -07:00
Littlefisher
a9af348a46 feat: Enhance CUPTI activity selection and merge logic for improved profiling accuracy 2025-10-27 22:58:57 -07:00
Littlefisher
f5ee20e333 fix: Ensure CUPTI flushes events before stopping CPU profiler; update timestamp handling to use microseconds 2025-10-27 20:05:45 -07:00
Littlefisher
05ca05aa7c Refactor code structure for improved readability and maintainability 2025-10-27 19:41:40 -07:00
yunwei37
b8cc834d7f Enhance GPU and NPU kernel driver documentation and monitoring scripts
- Updated README.zh.md for GPU kernel driver to improve clarity and formatting.
- Added nvidia_driver.bt script for monitoring NVIDIA proprietary GPU driver activity using kernel probes.
- Revised README.md for NPU kernel driver to enhance explanations and correct minor grammatical issues.
2025-10-13 07:18:50 -07:00
github-actions[bot]
d4ec997ab2 docs: auto-generate documentation 2025-10-06 06:19:22 +00:00
yunwei37
dc2c40f6d6 feat: Add eBPF tutorial for dynamically fixing HID device issues without kernel patches
- Introduced a new tutorial on using HID-BPF to create virtual mouse devices and modify their input dynamically.
- Explained the common issues with HID devices and how traditional methods are cumbersome.
- Provided detailed implementation steps for creating a virtual HID device using uhid and modifying input with eBPF.
- Included example code for both user space and BPF programs, demonstrating how to intercept and modify HID reports.
- Highlighted the advantages of using virtual devices for learning and experimentation.
- Added references for further reading on HID-BPF and related projects.
2025-10-05 23:19:08 -07:00
github-actions[bot]
635b478184 docs: auto-generate documentation 2025-10-06 05:57:30 +00:00
yunwei37
cab7ab3919 docs: update README for eBPF tutorial on privilege escalation via file content manipulation 2025-10-05 22:57:19 -07:00
github-actions[bot]
7c335e2a23 docs: auto-generate documentation 2025-10-06 05:50:29 +00:00
yunwei37
5f29fd2d41 docs: add complete source code links to various eBPF tutorial README files 2025-10-05 22:47:39 -07:00
yunwei37
277ecbaf9d Add HID-BPF tutorial and implementation for virtual mouse input modification
- Introduced a comprehensive tutorial in README.md explaining how to fix broken HID devices using eBPF without kernel patches.
- Implemented a userspace program (hid-input-modifier.c) that creates a virtual HID mouse using the uhid interface and sends synthetic mouse events.
- Developed a BPF program (hid-input-modifier.bpf.c) that intercepts HID events and modifies mouse movement data, effectively doubling the X and Y movement.
- Created necessary header files (hid_bpf.h, hid_bpf_defs.h, hid_bpf_helpers.h) to define structures and helper functions for the BPF program.
- Added functionality to find and manage the virtual HID device, ensuring seamless integration with the BPF program.
2025-10-05 22:40:58 -07:00
yunwei37
5319e02c7c feat: add workflow for auto-generating documentation on push 2025-10-05 20:59:51 -07:00