@@ -181,7 +181,7 @@ def count_clones(ctx: c_void_p) -> c_int64:
181181 process_count.update(process_id, count + 1 )
182182 else :
183183 process_count.update(process_id, c_uint64(1 ))
184- return c_int64( 0 )
184+ return 0
185185```
186186
187187See {doc}` maps ` for more details on available map types.
@@ -208,7 +208,7 @@ class Event:
208208
209209Structs allow you to define custom data types for use in BPF programs. They can be used:
210210
211- * As map values
211+ * As map keys and values
212212* For perf event output
213213* In ring buffer submissions
214214* As local variables
@@ -248,11 +248,10 @@ def track_processes(ctx: c_void_p) -> c_int64:
248248 event = ProcessEvent()
249249 event.timestamp = ktime()
250250 event.pid = pid()
251- # Note: comm() requires a buffer parameter
252- # comm(event.comm) # Fills event.comm with process name
251+ comm(event.comm) # Fills event.comm with process name
253252
254253 events.output(event)
255- return c_int64( 0 )
254+ return 0
256255```
257256
258257See {doc}` structs ` for more details on working with structs.
@@ -392,9 +391,7 @@ def LICENSE() -> str:
392391
3933921 . ** Always use @bpf first** - It must be the outermost decorator
3943932 . ** Provide type hints** - Required for proper code generation
395- 3 . ** Use descriptive names** - Makes code easier to understand and debug
396- 4 . ** Keep functions simple** - BPF has restrictions on complexity
397- 5 . ** Test incrementally** - Verify each component works before combining
394+ 3 . ** Test incrementally** - Verify each component works before combining
398395
399396## Common Errors
400397
0 commit comments