函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Enable all of a task's events that have been marked enable-on-exec.* This expects task == current.

函数原型:static void perf_event_enable_on_exec(int ctxn)

返回类型:void

参数:

类型参数名称
intctxn
3932  struct perf_event_context * ctx, * clone_ctx = NULL
3933  event_type等于0
3937  enabled等于0
3939  local_irq_save(flags)
3940  ctx等于perf_event_ctxp[ctxn]
3941  如果非ctx或非nr_events则转到:out
3944  cpuctx等于__get_cpu_context(ctx)
3945  perf_ctx_lock(cpuctx, ctx)
3946  ctx_sched_out(ctx, cpuctx, EVENT_TIME)
3948  enabled或等于event_enable_on_exec(event, ctx)
3949  event_type或等于get_event_type(event)
3955  如果enabled
3956  clone_ctx等于This must be done under the ctx->lock, such as to serialize against* context_equiv(), therefore we cannot call put_ctx() since that might end up* calling scheduler related locks and ctx->lock nests inside those.
3957  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)
3958  否则
3959  ctx_sched_in(ctx, cpuctx, EVENT_TIME, 当前进程)
3961  perf_ctx_unlock(cpuctx, ctx)
3963  out :
3964  local_irq_restore(flags)
3966  如果clone_ctxput_ctx(clone_ctx)
调用者
名称描述
perf_event_exec