mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-02-07 13:40:59 +00:00
docs: Include cross-references to BCC-Examples
This commit is contained in:
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user