Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Cross CPU call to install and enable a performance event* Very similar to remote_function() + event_function() but cannot assume that* things like ctx->is_active and cpuctx->task_ctx are set.

Proto:static int __perf_install_in_context(void *info)

Type:int

Parameter:

TypeParameterName
void *info
2600  event = info
2601  ctx = ctx
2602  cpuctx = __get_cpu_context(ctx)
2603  task_ctx = task_ctx
2604  bool reprogram = true
2605  ret = 0
2607  raw_spin_lock( & Protect the states of the events in the list,* nr_active, and the list:)
2608  If task Then
2609  raw_spin_lock( & Protect the states of the events in the list,* nr_active, and the list:)
2610  task_ctx = ctx
2612  reprogram = task == current process
2622  ret = -ESRCH
2623  Go to unlock
2626  WARN_ON_ONCE(reprogram && task_ctx && task_ctx != ctx)
2627  Else if task_ctx Then
2628  raw_spin_lock( & Protect the states of the events in the list,* nr_active, and the list:)
2643  If reprogram Then
2644  ctx_sched_out(ctx, cpuctx, EVENT_TIME)
2645  add_event_to_ctx(event, ctx)
2646  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)
2647  Else
2648  add_event_to_ctx(event, ctx)
2651  unlock :
2652  perf_ctx_unlock(cpuctx, task_ctx)
2654  Return ret