函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-27 14:52:43
Last Modify:2022-05-20 07:50:19 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This function provides the context switch callback to the lower code* layer. It is invoked ONLY when the context switch callback is enabled.* This callback is relevant even to per-cpu events; for example multi event

函数原型:static void perf_pmu_sched_task(struct task_struct *prev, struct task_struct *next, bool sched_in)

返回类型:void

参数:

类型参数名称
struct task_struct *prev
struct task_struct *next
boolsched_in
3323  如果prev恒等于next则返回
3327  pmu等于pmu
3329  如果WARN_ON_ONCE(!sched_task)则继续下一循环
3332  perf_ctx_lock(cpuctx, task_ctx)
3333  perf_pmu_disable(pmu)
3335  sched_task(task_ctx, sched_in)
3337  perf_pmu_enable(pmu)
3338  perf_ctx_unlock(cpuctx, task_ctx)
调用者
名称描述
__perf_event_task_sched_outCalled from scheduler to remove the events of the current task,* with interrupts disabled
__perf_event_task_sched_inCalled from scheduler to add the events of the current task* with interrupts disabled.* We restore the event value and then enable it.* This does not protect us against NMI, but enable()* sets the enabled bit in the control field of event _before_