函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static int __perf_install_in_context(void *info)

返回类型:int

参数:

类型参数名称
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  如果task
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恒等于当前进程
2622  ret等于负ESRCH
2623  转到:unlock
2626  WARN_ON_ONCE(reprogram && task_ctx && task_ctx != ctx)
2627  否则如果task_ctx
2628  raw_spin_lock( & Protect the states of the events in the list,* nr_active, and the list:)
2643  如果reprogram
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  否则
2648  add_event_to_ctx(event, ctx)
2651  unlock :
2652  perf_ctx_unlock(cpuctx, task_ctx)
2654  返回:ret