Skip to content

Commit ce7adaa

Browse files
committed
Fix examples/hello_world to use latest pylibbpf
1 parent 5ac316a commit ce7adaa

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

examples/hello_world.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonbpf import bpf, section, bpfglobal, BPF
1+
from pythonbpf import bpf, section, bpfglobal, BPF, trace_pipe
22
from ctypes import c_void_p, c_int64
33

44
# Instructions to how to run this program
@@ -21,10 +21,6 @@ def LICENSE() -> str:
2121

2222

2323
b = BPF()
24-
b.load_and_attach()
25-
if b.is_loaded() and b.is_attached():
26-
print("Successfully loaded and attached")
27-
else:
28-
print("Could not load successfully")
29-
30-
# Now cat /sys/kernel/debug/tracing/trace_pipe to see results of the execve syscall.
24+
b.load()
25+
b.attach_all()
26+
trace_pipe()

0 commit comments

Comments
 (0)