fix wakeuptime's raw_tp: get awakened task from ctx not current
authorWenbo Zhang <ethercflow@gmail.com>
Mon, 1 Mar 2021 14:31:27 +0000 (22:31 +0800)
committeryonghong-song <ys114321@gmail.com>
Tue, 2 Mar 2021 06:12:55 +0000 (22:12 -0800)
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
tools/wakeuptime.py

index 9fefca6fa02d0bd369a8dcbfe49849f4fe618703..0723f8af5904eb07cf7350885762468ad82c2411 100755 (executable)
@@ -164,7 +164,7 @@ RAW_TRACEPOINT_PROBE(sched_switch)
 RAW_TRACEPOINT_PROBE(sched_wakeup)
 {
     // TP_PROTO(struct task_struct *p)
-    struct task_struct *p = (struct task_struct *) bpf_get_current_task();
+    struct task_struct *p = (struct task_struct *)ctx->args[0];
     return wakeup(ctx, p);
 }
 """