Function report |
Source Code:kernel\events\core.c |
Create Date:2022-07-28 13:40:14 |
| Last Modify:2022-05-20 07:50:19 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:perf_pmu_register
Proto:int perf_pmu_register(struct pmu *pmu, const char *name, int type)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct pmu * | pmu | |
| const char * | name | |
| int | type |
| 10285 | mutex_lock( & pmus_lock) |
| 10287 | pmu_disable_count = alloc_percpu(int) |
| 10288 | If Not pmu_disable_count Then Go to unlock |
| 10291 | type = -1 |
| 10296 | If type != PERF_TYPE_SOFTWARE Then |
| 10310 | If pmu_bus_running Then |
| 10311 | ret = pmu_dev_alloc(pmu) |
| 10316 | skip_type : |
| 10317 | If task_ctx_nr == perf_hw_context Then |
| 10318 | hw_context_taken = 0 |
| 10325 | If WARN_ON_ONCE(hw_context_taken && !(various common per-pmu feature flags & PERF_PMU_CAP_HETEROGENEOUS_CPUS)) Then 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 | If pmu_cpu_context Then Go to got_cpu_context |
| 10337 | pmu_cpu_context = alloc_percpu(structperf_cpu_context) |
| 10338 | If Not pmu_cpu_context Then Go to free_dev |
| 10341 | for_each_possible_cpu(cpu) |
| 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) |
| 10349 | online = pumask_test_cpu - test for a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@cpumask: the cpumask pointer* Returns 1 if @cpu is set in @cpumask, else returns 0 |
| 10351 | __perf_mux_hrtimer_init(cpuctx, cpu) |
| 10354 | got_cpu_context : |
| 10355 | If Not start_txn Then |
| 10356 | If pmu_enable Then |
| 10362 | start_txn = perf_pmu_start_txn |
| 10363 | commit_txn = perf_pmu_commit_txn |
| 10364 | cancel_txn = perf_pmu_cancel_txn |
| 10365 | Else |
| 10366 | start_txn = perf_pmu_nop_txn |
| 10367 | commit_txn = perf_pmu_nop_int |
| 10368 | cancel_txn = perf_pmu_nop_void |
| 10372 | If Not pmu_enable Then |
| 10373 | pmu_enable = perf_pmu_nop_void |
| 10374 | pmu_disable = perf_pmu_nop_void |
| 10377 | If Not check_period Then check_period = perf_event_nop_int |
| 10380 | If Not event_idx Then event_idx = perf_event_idx_default |
| 10393 | atomic_set( & < 0: cpu; > 0: tsk , 0) |
| 10394 | ret = 0 |
| 10395 | unlock : |
| 10398 | Return ret |
| 10400 | free_dev : |
| 10401 | device_del(dev) |
| 10402 | put_device(dev) |
| 10404 | free_idr : |
| 10405 | If type != PERF_TYPE_SOFTWARE Then dr_remove() - Remove an ID from the IDR |
| 10408 | free_pdc : |
| 10410 | Go to unlock |
| Name | Describe |
|---|---|
| perf_event_init | |
| init_hw_breakpoint |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |