函数逻辑报告 |
Source Code:kernel\events\core.c |
Create Date:2022-07-27 15:00:18 |
| Last Modify:2022-05-20 07:50:19 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:perf_pmu_register
函数原型:int perf_pmu_register(struct pmu *pmu, const char *name, int type)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct pmu * | pmu | |
| const char * | name | |
| int | type |
| 10285 | mutex_lock( & pmus_lock) |
| 10287 | pmu_disable_count等于alloc_percpu(int) |
| 10288 | 如果非pmu_disable_count则转到:unlock |
| 10291 | type等于负1 |
| 10296 | 如果type不等于PERF_TYPE_SOFTWARE则 |
| 10310 | 如果pmu_bus_running则 |
| 10311 | ret等于pmu_dev_alloc(pmu) |
| 10316 | skip_type : |
| 10317 | 如果task_ctx_nr恒等于perf_hw_context则 |
| 10318 | hw_context_taken等于0 |
| 10325 | 如果WARN_ON_ONCE(hw_context_taken && !(various common per-pmu feature flags & PERF_PMU_CAP_HETEROGENEOUS_CPUS))则task_ctx_nr等于perf_invalid_context |
| 10329 | hw_context_taken等于1 |
| 10332 | pmu_cpu_context等于Ensures all contexts with the same task_ctx_nr have the same* pmu_cpu_context too. |
| 10333 | 如果pmu_cpu_context则转到:got_cpu_context |
| 10337 | pmu_cpu_context等于alloc_percpu(structperf_cpu_context) |
| 10338 | 如果非pmu_cpu_context则转到:free_dev |
| 10344 | cpuctx等于per_cpu_ptr(pmu_cpu_context, cpu) |
| 10347 | lockdep_set_class( & Protect the states of the events in the list,* nr_active, and the list:, & cpuctx_lock) |
| 10351 | __perf_mux_hrtimer_init(cpuctx, cpu) |
| 10354 | got_cpu_context : |
| 10355 | 如果非start_txn则 |
| 10356 | 如果pmu_enable则 |
| 10362 | start_txn等于perf_pmu_start_txn |
| 10363 | commit_txn等于perf_pmu_commit_txn |
| 10364 | cancel_txn等于perf_pmu_cancel_txn |
| 10365 | 否则 |
| 10366 | start_txn等于perf_pmu_nop_txn |
| 10367 | commit_txn等于perf_pmu_nop_int |
| 10368 | cancel_txn等于perf_pmu_nop_void |
| 10372 | 如果非pmu_enable则 |
| 10373 | pmu_enable等于perf_pmu_nop_void |
| 10374 | pmu_disable等于perf_pmu_nop_void |
| 10377 | 如果非check_period则check_period等于perf_event_nop_int |
| 10380 | 如果非event_idx则event_idx等于perf_event_idx_default |
| 10388 | 如果type恒等于PERF_TYPE_SOFTWARE或非name则添加RCU保护项 |
| 10390 | 否则添加RCU链表项 |
| 10393 | atomic_set( & < 0: cpu; > 0: tsk , 0) |
| 10394 | ret等于0 |
| 10395 | unlock : |
| 10398 | 返回:ret |
| 10400 | free_dev : |
| 10401 | device_del(dev) |
| 10402 | put_device(dev) |
| 10404 | free_idr : |
| 10405 | 如果type不等于PERF_TYPE_SOFTWARE则删除释放idr |
| 10408 | free_pdc : |
| 10409 | 释放内存 |
| 10410 | 转到:unlock |
| 名称 | 描述 |
|---|---|
| perf_event_init | |
| init_hw_breakpoint |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |