Commit 08dbf13f authored by Brendan Gregg's avatar Brendan Gregg Committed by GitHub

Merge pull request #1333 from samuelnair/fix-py-tut

Fix for bug in lesson 4 of the Python developer tutorial
parents 566597c7 e7a5bdc3
...@@ -123,7 +123,7 @@ b = BPF(text=""" ...@@ -123,7 +123,7 @@ b = BPF(text="""
BPF_HASH(last); BPF_HASH(last);
void do_trace(struct pt_regs *ctx) { int do_trace(struct pt_regs *ctx) {
u64 ts, *tsp, delta, key = 0; u64 ts, *tsp, delta, key = 0;
// attempt to read stored timestamp // attempt to read stored timestamp
...@@ -140,6 +140,7 @@ void do_trace(struct pt_regs *ctx) { ...@@ -140,6 +140,7 @@ void do_trace(struct pt_regs *ctx) {
// update stored timestamp // update stored timestamp
ts = bpf_ktime_get_ns(); ts = bpf_ktime_get_ns();
last.update(&key, &ts); last.update(&key, &ts);
return 0;
} }
""") """)
......
...@@ -18,7 +18,7 @@ b = BPF(text=""" ...@@ -18,7 +18,7 @@ b = BPF(text="""
BPF_HASH(last); BPF_HASH(last);
void do_trace(struct pt_regs *ctx) { int do_trace(struct pt_regs *ctx) {
u64 ts, *tsp, delta, key = 0; u64 ts, *tsp, delta, key = 0;
// attempt to read stored timestamp // attempt to read stored timestamp
...@@ -35,6 +35,7 @@ void do_trace(struct pt_regs *ctx) { ...@@ -35,6 +35,7 @@ void do_trace(struct pt_regs *ctx) {
// update stored timestamp // update stored timestamp
ts = bpf_ktime_get_ns(); ts = bpf_ktime_get_ns();
last.update(&key, &ts); last.update(&key, &ts);
return 0;
} }
""") """)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment