Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Attach a performance event to a context.* Very similar to event_function_call, see comment there.

Proto:static void perf_install_in_context(struct perf_event_context *ctx, struct perf_event *event, int cpu)

Type:void

Parameter:

TypeParameterName
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  If cpu != -1 Then cpu = cpu
2683  smp_store_release( & ctx, ctx)
2693  If 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_OFF && nr_events Then
2694  raw_spin_lock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
2695  If task == TASK_TOMBSTONE Then
2697  Return
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  Return
2704  If Not task Then
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  Return
2712  If WARN_ON_ONCE(task == TASK_TOMBSTONE) Then Return
2745  smp_mb()
2746  again :
2747  If Not 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 Then Return
2750  raw_spin_lock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
2751  task = task
2752  If WARN_ON_ONCE(task == TASK_TOMBSTONE) Then
2758  raw_spin_unlock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
2759  Return
2765  If 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. Then
2766  raw_spin_unlock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
2767  Go to 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:)
Caller
NameDescribe
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