Skip to content

Commit

Permalink
Merge pull request #1333 from samuelnair/fix-py-tut
Browse files Browse the repository at this point in the history
Fix for bug in lesson 4 of the Python developer tutorial
  • Loading branch information
brendangregg committed Sep 7, 2017
2 parents 566597c + e7a5bdc commit 08dbf13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/tutorial_bcc_python_developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
""")

Expand Down
3 changes: 2 additions & 1 deletion examples/tracing/sync_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,6 +35,7 @@
// update stored timestamp
ts = bpf_ktime_get_ns();
last.update(&key, &ts);
return 0;
}
""")

Expand Down

0 comments on commit 08dbf13

Please sign in to comment.