You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/helpers.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -487,6 +487,15 @@ If `trace_pipe()` fails:
487
487
* Check `/sys/kernel/tracing/` is accessible
488
488
* Verify tracing is enabled in kernel config
489
489
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
+
490
499
## Next Steps
491
500
492
501
* Explore {doc}`maps` for data storage with helpers
Copy file name to clipboardExpand all lines: docs/user-guide/maps.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -459,6 +459,16 @@ If you get type-related errors:
459
459
* Verify key and value types match the definition
460
460
* Check that structs are properly defined
461
461
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
+
462
472
## Next Steps
463
473
464
474
* Learn about {doc}`structs` for defining custom value types
0 commit comments