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 323d2097e410b9b455cacd242a2991d6ff284466..21cc7331d573831ef7bbefd5d634e6494e1420a4 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)