Skip to content

Commit dc995a1

Browse files
authored
Fix variable initialization in BPF tracepoint example
1 parent 0fd6bea commit dc995a1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,14 @@ def hist() -> HashMap:
8888
@section("tracepoint/syscalls/sys_enter_clone")
8989
def hello(ctx: c_void_p) -> c_int64:
9090
process_id = pid()
91-
one = 1
9291
prev = hist.lookup(process_id)
9392
if prev:
9493
previous_value = prev + 1
9594
print(f"count: {previous_value} with {process_id}")
9695
hist.update(process_id, previous_value)
97-
return c_int64(0)
96+
return 0
9897
else:
99-
hist.update(process_id, one)
98+
hist.update(process_id, 1)
10099
return 0
101100

102101

0 commit comments

Comments
 (0)