From ab133d2d3b0f28a523aa901c1514220ad8057b46 Mon Sep 17 00:00:00 2001 From: Mark Drayton Date: Fri, 4 Mar 2016 00:51:20 -0800 Subject: [PATCH] Fix stacksnoop PID filter The function FILTER is injected into (trace_stack()) returns void, not int. --- tools/stacksnoop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/stacksnoop.py b/tools/stacksnoop.py index d8ced4e..3bf4732 100755 --- a/tools/stacksnoop.py +++ b/tools/stacksnoop.py @@ -93,7 +93,7 @@ void trace_stack(struct pt_regs *ctx) { if args.pid: bpf_text = bpf_text.replace('FILTER', ('u32 pid; pid = bpf_get_current_pid_tgid(); ' + - 'if (pid != %s) { return 0; }') % (args.pid)) + 'if (pid != %s) { return; }') % (args.pid)) else: bpf_text = bpf_text.replace('FILTER', '') if debug: -- 2.7.4