tracing: use bitcoind pid in bcc tracing examples
BCC needs the PID of a bitcoind process to attach to the tracepoints
(instead of the binary path used before) when the tracepoints have a
semaphore.
For reference, we already use the PID in our tracepoint interface
tests. See 220a5a2841.
This commit is contained in:
5 files changed
+38
-29
No files matched your search
@@ -114,8 +114,9 @@ int trace_replaced(struct pt_regs *ctx) {
|
||||
"""
|
||||
|
||||
|
||||
def main(bitcoind_path):
|
||||
bitcoind_with_usdts = USDT(path=str(bitcoind_path))
|
||||
def main(pid):
|
||||
print(f"Hooking into bitcoind with pid {pid}")
|
||||
bitcoind_with_usdts = USDT(pid=int(pid))
|
||||
|
||||
# attaching the trace functions defined in the BPF program
|
||||
# to the tracepoints
|
||||
@@ -365,8 +366,8 @@ class Dashboard:
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print("USAGE: ", sys.argv[0], "path/to/bitcoind")
|
||||
print("USAGE: ", sys.argv[0], "<pid of bitcoind>")
|
||||
exit(1)
|
||||
|
||||
path = sys.argv[1]
|
||||
main(path)
|
||||
pid = sys.argv[1]
|
||||
main(pid)
|
||||
Reference in new issue
Block a user