函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型: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)

返回类型:struct perf_event

参数:

类型参数名称
struct perf_event_attr *attr
intcpu
struct task_struct *task
perf_overflow_handler_toverflow_handler
void *context
11630  如果generate AUX records instead of events 则返回:错误号
11633  event等于Allocate and initialize an event structure
11635  如果是错误
11636  err等于错误
11637  转到:err
11641  owner等于TASK_TOMBSTONE
11646  ctx等于Returns a matching context with refcount and pincount.
11647  如果是错误
11648  err等于错误
11649  转到: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  如果task恒等于TASK_TOMBSTONE
11655  err等于负ESRCH
11656  转到:err_unlock
11659  如果非task
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  如果非online
11669  err等于负ENODEV
11670  转到:err_unlock
11674  如果非exclusive_event_installable(event, ctx)则
11675  err等于负EBUSY
11676  转到: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  返回: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  返回:错误号
调用者
名称描述
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