Skip to content

Commit e7a5bdc

Browse files
committed
Modified the docs and example to make a fix for iovisor#139
1 parent d9641be commit e7a5bdc

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

docs/tutorial_bcc_python_developer.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ b = BPF(text="""
123123
124124
BPF_HASH(last);
125125
126-
void do_trace(struct pt_regs *ctx) {
126+
int do_trace(struct pt_regs *ctx) {
127127
u64 ts, *tsp, delta, key = 0;
128128
129129
// attempt to read stored timestamp
@@ -140,6 +140,7 @@ void do_trace(struct pt_regs *ctx) {
140140
// update stored timestamp
141141
ts = bpf_ktime_get_ns();
142142
last.update(&key, &ts);
143+
return 0;
143144
}
144145
""")
145146

examples/tracing/sync_timing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
BPF_HASH(last);
2020
21-
void do_trace(struct pt_regs *ctx) {
21+
int do_trace(struct pt_regs *ctx) {
2222
u64 ts, *tsp, delta, key = 0;
2323
2424
// attempt to read stored timestamp
@@ -35,6 +35,7 @@
3535
// update stored timestamp
3636
ts = bpf_ktime_get_ns();
3737
last.update(&key, &ts);
38+
return 0;
3839
}
3940
""")
4041

0 commit comments

Comments
 (0)