From f67832a064b2fe529b25f37e127ba5896715128e Mon Sep 17 00:00:00 2001 From: Brendan Gregg Date: Tue, 15 Mar 2016 17:26:18 -0700 Subject: [PATCH] fix -p --- tools/offwaketime.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/offwaketime.py b/tools/offwaketime.py index 13c8c98..3b5bb36 100755 --- a/tools/offwaketime.py +++ b/tools/offwaketime.py @@ -129,12 +129,11 @@ out: } int oncpu(struct pt_regs *ctx, struct task_struct *p) { - u32 pid; + u32 pid = p->pid; u64 ts, *tsp; // record previous thread sleep time if (FILTER) { - pid = p->pid; ts = bpf_ktime_get_ns(); start.update(&pid, &ts); } -- 2.7.4