From ce7adaadb6eceaf86942f9f01240655c55aa872b Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Wed, 22 Oct 2025 19:57:47 +0530 Subject: [PATCH] Fix examples/hello_world to use latest pylibbpf --- examples/hello_world.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/hello_world.py b/examples/hello_world.py index 5ce35f9..3377466 100644 --- a/examples/hello_world.py +++ b/examples/hello_world.py @@ -1,4 +1,4 @@ -from pythonbpf import bpf, section, bpfglobal, BPF +from pythonbpf import bpf, section, bpfglobal, BPF, trace_pipe from ctypes import c_void_p, c_int64 # Instructions to how to run this program @@ -21,10 +21,6 @@ def LICENSE() -> str: b = BPF() -b.load_and_attach() -if b.is_loaded() and b.is_attached(): - print("Successfully loaded and attached") -else: - print("Could not load successfully") - -# Now cat /sys/kernel/debug/tracing/trace_pipe to see results of the execve syscall. +b.load() +b.attach_all() +trace_pipe()