函数逻辑报告 |
Source Code:kernel\events\core.c |
Create Date:2022-07-27 14:53:48 |
Last Modify:2022-05-20 07:50:19 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Returns a matching context with refcount and pincount.
函数原型:static struct perf_event_context *find_get_context(struct pmu *pmu, struct task_struct *task, struct perf_event *event)
返回类型:struct perf_event_context
参数:
类型 | 参数 | 名称 |
---|---|---|
struct pmu * | pmu | |
struct task_struct * | task | |
struct perf_event * | event |
4269 | struct perf_event_context * ctx, * clone_ctx = NULL |
4271 | void * task_ctx_data = NULL |
4276 | 如果非task则 |
4278 | err等于perf_allow_cpu( & attr) |
4282 | cpuctx等于per_cpu_ptr(pmu_cpu_context, cpu) |
4285 | pin_count先自加 |
4287 | 返回:ctx |
4291 | ctxn等于task_ctx_nr |
4295 | 如果attach_state按位与PERF_ATTACH_TASK_DATA则 |
4303 | retry : |
4304 | ctx等于Get the perf_event_context for a task and lock it.* This has to cope with with the fact that until it is locked,* the context could get moved to another task. |
4305 | 如果ctx则 |
4307 | pin_count先自加 |
4309 | 如果task_ctx_data且非pmu specific data 则 |
4310 | pmu specific data 等于task_ctx_data |
4311 | task_ctx_data = NULL |
4317 | 否则 |
4318 | ctx等于alloc_perf_context(pmu, task) |
4323 | 如果task_ctx_data则 |
4324 | pmu specific data 等于task_ctx_data |
4325 | task_ctx_data = NULL |
4328 | err等于0 |
4329 | mutex_lock( & perf_event_mutex) |
4334 | 如果任务标志按位与Getting shut down 则err等于负ESRCH |
4336 | 否则如果perf_event_ctxp[ctxn]则err等于负EAGAIN |
4338 | 否则 |
4340 | pin_count先自加 |
4345 | 如果此条件成立可能性小(为编译器优化)(err)则 |
4354 | kfree(task_ctx_data) |
4355 | 返回:ctx |
4357 | errout : |
4358 | kfree(task_ctx_data) |
4359 | 返回:错误号 |
名称 | 描述 |
---|---|
perf_event_create_kernel_counter | 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) |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |