From 39ace6f682cb38d1532479d58c00c05b9f4bb0bf Mon Sep 17 00:00:00 2001 From: Sasha Goldshtein Date: Mon, 19 Dec 2016 09:52:34 +0000 Subject: [PATCH] uobjnew: Attach uprobe only to the requested process When C allocations are traced, attach the `malloc` uprobe only to the requested process -- otherwise, we get allocation information from the entire system. --- tools/uobjnew.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/uobjnew.py b/tools/uobjnew.py index 7f14686..98bc01d 100755 --- a/tools/uobjnew.py +++ b/tools/uobjnew.py @@ -133,7 +133,8 @@ if args.verbose: bpf = BPF(text=program, usdt_contexts=[usdt]) if args.language == "c": - bpf.attach_uprobe(name="c", sym="malloc", fn_name="alloc_entry") + bpf.attach_uprobe(name="c", sym="malloc", fn_name="alloc_entry", + pid=args.pid) exit_signaled = False print("Tracing allocations in process %d (language: %s)... Ctrl-C to quit." % -- 2.7.4