mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-10-29 03:34:44 +08:00
Document fsession deadline regression test
This commit is contained in:
@@ -172,7 +172,7 @@ The repository uses bpftool v7.7.0, whose nested libbpf is v1.7.0. libbpf 1.7.0
|
||||
|
||||
## Running the Tests
|
||||
|
||||
The integration test runs three scenarios against the built binary:
|
||||
The integration test runs four scenarios against the built binary:
|
||||
|
||||
```bash
|
||||
sudo make test
|
||||
@@ -183,6 +183,7 @@ The test validates:
|
||||
1. An unmatched PID (2^32 - 1) produces zero calls, proving the TGID filter works.
|
||||
2. A 10-second threshold (10,000,000 us) produces no slow events even though reads complete, proving the threshold comparison works.
|
||||
3. A 10 ms threshold with a pipe read delayed by 50 ms produces at least one slow event, proving the end-to-end reporting path works.
|
||||
4. Threshold 0 with continuous target-TGID reads through the one-second deadline produces calls and events, and the CLI still exits successfully. This protects the normal-success exit path when the final `ring_buffer__poll()` call consumes events.
|
||||
|
||||
## Requirements
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ extern __u64 *bpf_session_cookie(void *ctx) __ksym;
|
||||
|
||||
## 运行测试
|
||||
|
||||
集成测试对构建产物运行三个场景:
|
||||
集成测试对构建产物运行四个场景:
|
||||
|
||||
```bash
|
||||
sudo make test
|
||||
@@ -183,6 +183,7 @@ sudo make test
|
||||
1. 不匹配的 PID (2^32 - 1) 产生零次调用,证明 TGID 过滤器有效。
|
||||
2. 10 秒阈值 (10,000,000 us) 即使有读操作完成也不产生慢事件,证明阈值比较逻辑正确。
|
||||
3. 10 ms 阈值加上延迟 50 ms 的管道读产生至少一个慢事件,证明端到端上报路径正常工作。
|
||||
4. 阈值为 0 时,持续对目标 TGID 执行读操作直到一秒截止时间结束,产生调用和事件,且 CLI 仍然成功退出。该场景保护最后一次 `ring_buffer__poll()` 消费事件后的正常退出路径。
|
||||
|
||||
## 环境要求
|
||||
|
||||
|
||||
Reference in New Issue
Block a user