Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:perf_try_init_event

Proto:static int perf_try_init_event(struct pmu *pmu, struct perf_event *event)

Type:int

Parameter:

TypeParameterName
struct pmu *pmu
struct perf_event *event
10448  struct perf_event_context * ctx = NULL
10451  If Not try_module_get(module) Then Return -ENODEV
10460  If group_leader != event && task_ctx_nr != perf_sw_context Then
10465  ctx = Because of perf_event::ctx migration in sys_perf_event_open::move_group and* perf_pmu_migrate_context() we need some magic.* Those places that change perf_event::ctx will hold both* perf_event_ctx::mutex of the 'old' and 'new' ctx value.
10467  BUG_ON(!ctx)
10470  pmu = pmu
10471  ret = event_init(event)
10473  If ctx Then perf_event_ctx_unlock(group_leader, ctx)
10476  If Not ret Then
10477  If Not (various common per-pmu feature flags & PERF_PMU_CAP_EXTENDED_REGS) && has_extended_regs(event) Then ret = -EOPNOTSUPP
10481  If various common per-pmu feature flags & PERF_PMU_CAP_NO_EXCLUDE && event_has_any_exclude_flag(event) Then ret = -EINVAL
10485  If ret && destroy Then destroy(event)
10489  If ret Then module_put(module)
10492  Return ret
Caller
NameDescribe
perf_init_event