Ver código fonte

src/helpers.rs: fix documentation and example for `bpf_trace_printf()`

Quentin Monnet 8 anos atrás
pai
commit
07009b20a5
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      src/helpers.rs

+ 3 - 3
src/helpers.rs

@@ -42,13 +42,13 @@ pub const BPF_TRACE_PRINTK_IDX: u32 = 6;
 /// ```
 /// use rbpf::helpers;
 ///
-/// helpers::bpf_trace_printf(1, 15, 32, 0, 0);
+/// helpers::bpf_trace_printf(0, 0, 1, 15, 32);
 /// ```
 ///
 /// This will print `bpf_trace_printf: 0x1, 0xf, 0x20`.
 ///
-/// The eBPF code produced would be nearly the same as when compiling the following code from C to
-/// eBPF with clang:
+/// The eBPF code needed to perform the call in this example would be nearly identical to the code
+/// obtained by compiling the following code from C to eBPF with clang:
 ///
 /// ```c
 /// #include <linux/bpf.h>