函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:perf_event_switch

函数原型:static void perf_event_switch(struct task_struct *task, struct task_struct *next_prev, bool sched_in)

返回类型:void

参数:

类型参数名称
struct task_struct *task
struct task_struct *next_prev
boolsched_in
8056  switch_event = (struct perf_switch_event){task = task, next_prev = next_prev, event_id = {header = {misc = sched_in ? 0 : PERF_RECORD_MISC_SWITCH_OUT, }, }, }
8070  如果非sched_in任务状态恒等于就绪态misc或等于PERF_RECORD_MISC_SWITCH_OUT_PREEMPT
8074  Iterate all events that need to receive side-band events.* For new callers; ensure that account_pmu_sb_event() includes* your event, otherwise it might not get delivered.
调用者
名称描述
__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_