Re: [PATCH] kallsyms: Fix sleeping function called from invalid context when CONFIG_KALLSYMS_SELFTEST=y
From: Leizhen (ThunderTown) <hidden>
Date: 2022-12-27 07:16:56
Also in:
lkml
From: Leizhen (ThunderTown) <hidden>
Date: 2022-12-27 07:16:56
Also in:
lkml
On 2022/12/21 20:37, Leizhen (ThunderTown) wrote:
quoted
quoted
quoted
I am not familiar with it. But task_cputime() in kernel/sched/cputime.c looks promising. And there must be the interface how the user space get this information. Some is available via /proc/<PID>/... I am not sure if there is a syscall.Please, try to investigate the above hints.Yes, I will. Thanks.
Function task_cputime() works well when CONFIG_VIRT_CPU_ACCOUNTING_GEN=y, but not when CONFIG_TICK_CPU_ACCOUNTING=y. The latter seems to be based on tick interrupt sampling, rather than recording timestamps during task switches.
-- Regards, Zhen Lei