diff --git a/docs/tutorial_bcc_python_developer.md b/docs/tutorial_bcc_python_developer.md index 183db5545525..d72ace4ea50b 100644 --- a/docs/tutorial_bcc_python_developer.md +++ b/docs/tutorial_bcc_python_developer.md @@ -123,7 +123,7 @@ b = BPF(text=""" BPF_HASH(last); -void do_trace(struct pt_regs *ctx) { +int do_trace(struct pt_regs *ctx) { u64 ts, *tsp, delta, key = 0; // attempt to read stored timestamp @@ -140,6 +140,7 @@ void do_trace(struct pt_regs *ctx) { // update stored timestamp ts = bpf_ktime_get_ns(); last.update(&key, &ts); + return 0; } """) diff --git a/examples/tracing/sync_timing.py b/examples/tracing/sync_timing.py index 983d8c9d3421..4fdcb6d89344 100755 --- a/examples/tracing/sync_timing.py +++ b/examples/tracing/sync_timing.py @@ -18,7 +18,7 @@ BPF_HASH(last); -void do_trace(struct pt_regs *ctx) { +int do_trace(struct pt_regs *ctx) { u64 ts, *tsp, delta, key = 0; // attempt to read stored timestamp @@ -35,6 +35,7 @@ // update stored timestamp ts = bpf_ktime_get_ns(); last.update(&key, &ts); + return 0; } """)