Skip to content

Commit

Permalink
Merge pull request iovisor#752 from goldshtn/mysqld-slower-fix
Browse files Browse the repository at this point in the history
mysqld_slower: Fix breakage after USDT API change
  • Loading branch information
drzaeus77 committed Oct 18, 2016
2 parents 203b4c9 + a2370ab commit 78a3341
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/reference_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ Constructors.

### 1. BPF

Syntax: ```BPF({text=BPF_program | src_file=filename} [, usdt=USDT_object])```
Syntax: ```BPF({text=BPF_program | src_file=filename} [, usdt_contexts=[USDT_object, ...]])```

Creates a BPF object. This is the main object for defining a BPF program, and interacting with its output.

Expand All @@ -569,7 +569,7 @@ b = BPF(src_file = "vfsreadlat.c")
# include a USDT object:
u = USDT(pid=int(pid))
[...]
b = BPF(text=bpf_text, usdt=u)
b = BPF(text=bpf_text, usdt_contexts=[u])
```

Examples in situ:
Expand All @@ -593,7 +593,7 @@ Examples:
# include a USDT object:
u = USDT(pid=int(pid))
[...]
b = BPF(text=bpf_text, usdt=u)
b = BPF(text=bpf_text, usdt_contexts=[u])
```

Examples in situ:
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial_bcc_python_developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ u = USDT(pid=int(pid))
u.enable_probe(probe="http__server__request", fn_name="do_trace")

# initialize BPF
b = BPF(text=bpf_text, usdt=u)
b = BPF(text=bpf_text, usdt_contexts=[u])
```

Things to learn:
Expand All @@ -638,7 +638,7 @@ Things to learn:
1. ```bpf_probe_read(&path, sizeof(path), (void *)addr)```: Now the string ```addr``` points to into our ```path``` variable.
1. ```u = USDT(pid=int(pid))```: Initialize USDT tracing for the given PID.
1. ```u.enable_probe(probe="http__server__request", fn_name="do_trace")```: Attach our ```do_trace()``` BPF C function to the Node.js ```http__server__request``` USDT probe.
1. ```b = BPF(text=bpf_text, usdt=u)```: Need to pass in our USDT object, ```u```, to BPF object creation.
1. ```b = BPF(text=bpf_text, usdt_contexts=[u])```: Need to pass in our USDT object, ```u```, to BPF object creation.

### Lesson 16. task_switch.c

Expand Down
2 changes: 1 addition & 1 deletion examples/tracing/mysqld_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
print(bpf_text)

# initialize BPF
b = BPF(text=bpf_text, usdt=u)
b = BPF(text=bpf_text, usdt_contexts=[u])

# header
print("%-18s %-16s %-6s %s" % ("TIME(s)", "COMM", "PID", "QUERY"))
Expand Down
2 changes: 1 addition & 1 deletion examples/tracing/nodejs_http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
print(bpf_text)

# initialize BPF
b = BPF(text=bpf_text, usdt=u)
b = BPF(text=bpf_text, usdt_contexts=[u])

# header
print("%-18s %-16s %-6s %s" % ("TIME(s)", "COMM", "PID", "ARGS"))
Expand Down
2 changes: 1 addition & 1 deletion tools/mysqld_qslower.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def usage():
print(bpf_text)

# initialize BPF
b = BPF(text=bpf_text, usdt=u)
b = BPF(text=bpf_text, usdt_contexts=[u])

# header
print("Tracing MySQL server queries for PID %d slower than %s ms..." % (pid,
Expand Down

0 comments on commit 78a3341

Please sign in to comment.