Commit e7a5bdc3 authored by Samuel Nair's avatar Samuel Nair

Modified the docs and example to make a fix for https://github.com/iovisor/bcc/issues/139

parent d9641bef
......@@ -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;
}
""")
......
......@@ -18,7 +18,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
......@@ -35,6 +35,7 @@ void do_trace(struct pt_regs *ctx) {
// update stored timestamp
ts = bpf_ktime_get_ns();
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