Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\process.c Create Date:2022-07-28 07:48:53
Last Modify:2020-03-16 17:03:44 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Called from fs/proc with a reference on @p to find the function* which called into schedule(). This needs to be done carefully* because the task might wake up and we might look at a stack* changing under us.

Proto:unsigned long get_wchan(struct task_struct *p)

Type:unsigned long

Parameter:

TypeParameterName
struct task_struct *p
931  ret = 0
932  count = 0
934  If p == current process || run state == Used in tsk->state: Then Return 0
937  If Not try_get_task_stack(p) Then Return 0
940  start = task_stack_page(p)
941  If Not start Then Go to out
960  top = start + THREAD_SIZE - TOP_OF_KERNEL_STACK_PADDING
961  top -= 2 * sizeof(unsignedlong)
962  bottom = start
964  sp = READ_ONCE(sp)
965  If sp < bottom || sp > top Then Go to out
968  fp = Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need* to hide memory access from KASAN.(These two fields must be together. They form a stack frame header,* needed by get_frame_pointer().)
969  Do
970  If fp < bottom || fp > top Then Go to out
972  ip = Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need* to hide memory access from KASAN.( * (unsignedlong * )(fp + sizeof(unsignedlong)))
974  ret = ip
975  Go to out
977  fp = Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need* to hide memory access from KASAN.( * (unsignedlong * )fp)
978  When count++ < 16 && run state != Used in tsk->state: cycle
980  out :
981  put_task_stack(p)
982  Return ret