Skip to content

Commit 3bff930

Browse files
committed
docs: Include cross-references to BCC-Examples
1 parent 036830c commit 3bff930

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

docs/user-guide/helpers.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,15 @@ If `trace_pipe()` fails:
487487
* Check `/sys/kernel/tracing/` is accessible
488488
* Verify tracing is enabled in kernel config
489489

490+
## Examples
491+
492+
Check out these examples in the `BCC-Examples/` directory that demonstrate helper functions:
493+
494+
* [hello_world.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/hello_world.py) - Basic tracing with `print()`
495+
* [sync_timing.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/sync_timing.py) - Using `ktime()` for timing measurements
496+
* [hello_perf_output.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/hello_perf_output.py) - Using `pid()`, `ktime()`, and `comm()` with perf events
497+
* [vfsreadlat.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/vfsreadlat.py) - Latency measurement with `ktime()` in kprobes
498+
490499
## Next Steps
491500

492501
* Explore {doc}`maps` for data storage with helpers

docs/user-guide/maps.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,16 @@ If you get type-related errors:
459459
* Verify key and value types match the definition
460460
* Check that structs are properly defined
461461

462+
## Examples
463+
464+
Check out these examples in the `BCC-Examples/` directory that demonstrate map usage:
465+
466+
* [sync_timing.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/sync_timing.py) - HashMap for storing timestamps
467+
* [sync_count.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/sync_count.py) - HashMap for counting events
468+
* [hello_perf_output.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/hello_perf_output.py) - PerfEventArray for sending structs to userspace
469+
* [sync_perf_output.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/sync_perf_output.py) - PerfEventArray with timing data
470+
* [disksnoop.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/disksnoop.py) - HashMap for tracking disk I/O
471+
462472
## Next Steps
463473

464474
* Learn about {doc}`structs` for defining custom value types

0 commit comments

Comments
 (0)