函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Attach a performance event to a context.* Very similar to event_function_call, see comment there.

函数原型:static void perf_install_in_context(struct perf_event_context *ctx, struct perf_event *event, int cpu)

返回类型:void

参数:

类型参数名称
struct perf_event_context *ctx
struct perf_event *event
intcpu
2670  task等于READ_ONCE(task)
2672  lockdep_assert_held( & Protect the list of events. Locking either mutex or lock* is sufficient to ensure the list doesn't change; to change* the list you need to lock both the mutex and the spinlock.)
2674  WARN_ON_ONCE(!exclusive_event_installable(event, ctx))
2676  如果cpu不等于负1则cpu等于cpu
2683  smp_store_release( & ctx, ctx)
2693  如果State based event timekeeping...* The basic idea is to use event->state to determine which (if any) time* fields to increment with the current delta. This means we only need to* update timestamps when we change state or when they are explicitly requested恒等于PERF_EVENT_STATE_OFFnr_events
2694  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & Protect the states of the events in the list,* nr_active, and the list:)
2695  如果task恒等于TASK_TOMBSTONE
2697  返回
2699  add_event_to_ctx(event, ctx)
2700  raw_spin_unlock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
2701  返回
2704  如果非task
2705  pu_function_call - call a function on the cpu*@func: the function to be called*@info: the function call argument* Calls the function @func on the remote cpu.* returns: @func return value or -ENXIO when the cpu is offline
2706  返回
2712  如果WARN_ON_ONCE(task == TASK_TOMBSTONE)则返回
2745  smp_mb()
2746  again :
2747  如果非ask_function_call - call a function on the cpu on which a task runs*@p: the task to evaluate*@func: the function to be called*@info: the function call argument* Calls the function @func when the task is currently running则返回
2750  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & Protect the states of the events in the list,* nr_active, and the list:)
2751  task等于task
2752  如果WARN_ON_ONCE(task == TASK_TOMBSTONE)则
2758  raw_spin_unlock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
2759  返回
2765  如果ask_curr - is this task currently executing on a CPU?*@p: the task in question.* Return: 1 if the task is currently executing. 0 otherwise.
2766  raw_spin_unlock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
2767  转到:again
2769  add_event_to_ctx(event, ctx)
2770  raw_spin_unlock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
调用者
名称描述
perf_event_create_kernel_counterperf_event_create_kernel_counter*@attr: attributes of the counter to create*@cpu: cpu in which the counter is bound*@task: task to profile (NULL for percpu)
perf_pmu_migrate_context