Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:perf_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)

Proto:struct perf_event *perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, struct task_struct *task, perf_overflow_handler_t overflow_handler, void *context)

Type:struct perf_event

Parameter:

TypeParameterName
struct perf_event_attr *attr
intcpu
struct task_struct *task
perf_overflow_handler_toverflow_handler
void *context
11630  If generate AUX records instead of events Then Return ERR_PTR( - EINVAL)
11633  event = Allocate and initialize an event structure
11635  If IS_ERR(event) Then
11636  err = PTR_ERR(event)
11637  Go to err
11641  owner = TASK_TOMBSTONE
11646  ctx = Returns a matching context with refcount and pincount.
11647  If IS_ERR(ctx) Then
11648  err = PTR_ERR(ctx)
11649  Go to err_free
11652  WARN_ON_ONCE(These fields let us detect when two contexts have both* been cloned (inherited) from a common ancestor.)
11653  mutex_lock( & 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.)
11654  If task == TASK_TOMBSTONE Then
11655  err = -ESRCH
11656  Go to err_unlock
11659  If Not task Then
11666  cpuctx = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(ctx, structperf_cpu_context, ctx)
11668  If Not online Then
11669  err = -ENODEV
11670  Go to err_unlock
11674  If Not exclusive_event_installable(event, ctx) Then
11675  err = -EBUSY
11676  Go to err_unlock
11679  Attach a performance event to a context.* Very similar to event_function_call, see comment there.
11680  perf_unpin_context(ctx)
11681  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
11683  Return event
11685  err_unlock :
11686  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
11687  perf_unpin_context(ctx)
11688  put_ctx(ctx)
11689  err_free :
11690  Used to free events which have a known refcount of 1, such as in error paths* where the event isn't exposed yet and inherited events.
11691  err :
11692  Return ERR_PTR(err)
Caller
NameDescribe
measure_residency_fn
hardlockup_detector_event_create
register_user_hw_breakpointgister_user_hw_breakpoint - register a hardware breakpoint for user space*@attr: breakpoint attributes*@triggered: callback to trigger when we hit the breakpoint*@tsk: pointer to 'task_struct' of the process to which the address belongs
register_wide_hw_breakpoint a set of per_cpu pointers to perf events