Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-28 13:34:06
Last Modify:2022-05-20 07:50:19 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:static void perf_event_enable_on_exec(int ctxn)

Type:void

Parameter:

TypeParameterName
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  If Not ctx || Not nr_events Then Go to 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  If enabled Then
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  Else
3959  ctx_sched_in(ctx, cpuctx, EVENT_TIME, current process)
3961  perf_ctx_unlock(cpuctx, ctx)
3963  out :
3964  local_irq_restore(flags)
3966  If clone_ctx Then put_ctx(clone_ctx)
Caller
NameDescribe
perf_event_exec