diff --git a/docs/user-guide/helpers.md b/docs/user-guide/helpers.md index 9719758..acc0873 100644 --- a/docs/user-guide/helpers.md +++ b/docs/user-guide/helpers.md @@ -487,6 +487,15 @@ If `trace_pipe()` fails: * Check `/sys/kernel/tracing/` is accessible * Verify tracing is enabled in kernel config +## Examples + +Check out these examples in the `BCC-Examples/` directory that demonstrate helper functions: + +* [hello_world.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/hello_world.py) - Basic tracing with `print()` +* [sync_timing.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/sync_timing.py) - Using `ktime()` for timing measurements +* [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 +* [vfsreadlat.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/vfsreadlat.py) - Latency measurement with `ktime()` in kprobes + ## Next Steps * Explore {doc}`maps` for data storage with helpers diff --git a/docs/user-guide/maps.md b/docs/user-guide/maps.md index a0b7c36..939783b 100644 --- a/docs/user-guide/maps.md +++ b/docs/user-guide/maps.md @@ -459,6 +459,16 @@ If you get type-related errors: * Verify key and value types match the definition * Check that structs are properly defined +## Examples + +Check out these examples in the `BCC-Examples/` directory that demonstrate map usage: + +* [sync_timing.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/sync_timing.py) - HashMap for storing timestamps +* [sync_count.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/sync_count.py) - HashMap for counting events +* [hello_perf_output.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/hello_perf_output.py) - PerfEventArray for sending structs to userspace +* [sync_perf_output.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/sync_perf_output.py) - PerfEventArray with timing data +* [disksnoop.py](https://github.com/pythonbpf/Python-BPF/blob/main/BCC-Examples/disksnoop.py) - HashMap for tracking disk I/O + ## Next Steps * Learn about {doc}`structs` for defining custom value types