From 74bc38de1cc6f795f387f1b4f6662dce27d1f527 Mon Sep 17 00:00:00 2001 From: Hailong Liu Date: Tue, 30 May 2023 06:16:55 +0000 Subject: [PATCH] unity_nosched: Fix task->state found fail Signed-off-by: Hailong Liu --- .../collector/plugin/unity_nosched/unity_nosched.bpf.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/source/tools/monitor/unity/collector/plugin/unity_nosched/unity_nosched.bpf.c b/source/tools/monitor/unity/collector/plugin/unity_nosched/unity_nosched.bpf.c index 323d2097..21cc7331 100644 --- a/source/tools/monitor/unity/collector/plugin/unity_nosched/unity_nosched.bpf.c +++ b/source/tools/monitor/unity/collector/plugin/unity_nosched/unity_nosched.bpf.c @@ -72,13 +72,7 @@ static inline int test_tsk_thread_flag_low(struct task_struct *tsk, int flag) * return ture if struct thread_info is in task_struct */ static bool test_THREAD_INFO_IN_TASK(struct task_struct *p) { - volatile long *pstate; - size_t len; - - pstate = &(p->state); - - len = (u64)pstate - (u64)p; - return (len == sizeof(struct thread_info)); + return bpf_core_task_struct_thread_info_exist(p); } static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) -- Gitee