函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Cross CPU call to enable a performance event

函数原型:static void __perf_event_enable(struct perf_event *event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx, void *info)

返回类型:void

参数:

类型参数名称
struct perf_event *event
struct perf_cpu_context *cpuctx
struct perf_event_context *ctx
void *info
2781  leader等于group_leader
2784  如果state大于等于PERF_EVENT_STATE_INACTIVEstate小于等于PERF_EVENT_STATE_ERROR则返回
2788  如果is_activectx_sched_out(ctx, cpuctx, EVENT_TIME)
2791  perf_event_set_state(event, PERF_EVENT_STATE_INACTIVE)
2793  如果非is_active则返回
2796  如果非event_filter_match(event)则
2797  ctx_sched_in(ctx, cpuctx, EVENT_TIME, 当前进程)
2798  返回
2805  如果leader不等于eventstate不等于PERF_EVENT_STATE_ACTIVE
2806  ctx_sched_in(ctx, cpuctx, EVENT_TIME, 当前进程)
2807  返回
2810  task_ctx等于task_ctx
2811  如果taskWARN_ON_ONCE(task_ctx != ctx)
2814  We want to maintain the following priority of scheduling:* - CPU pinned (EVENT_CPU | EVENT_PINNED)* - task pinned (EVENT_PINNED)* - CPU flexible (EVENT_CPU | EVENT_FLEXIBLE)* - task flexible (EVENT_FLEXIBLE)