Lines Matching refs:pmu_entry

484 static int init_pmu_entry_by_type_and_add(struct amdgpu_pmu_entry *pmu_entry,  in init_pmu_entry_by_type_and_add()  argument
488 &pmu_entry->fmt_attr_group, in init_pmu_entry_by_type_and_add()
489 &pmu_entry->evt_attr_group, in init_pmu_entry_by_type_and_add()
495 pmu_entry->pmu = (struct pmu){ in init_pmu_entry_by_type_and_add()
505 ret = amdgpu_pmu_alloc_pmu_attrs(&pmu_entry->fmt_attr_group, in init_pmu_entry_by_type_and_add()
506 &pmu_entry->fmt_attr, in init_pmu_entry_by_type_and_add()
507 &pmu_entry->evt_attr_group, in init_pmu_entry_by_type_and_add()
508 &pmu_entry->evt_attr, in init_pmu_entry_by_type_and_add()
514 amdgpu_pmu_create_attrs(&pmu_entry->fmt_attr_group, pmu_entry->fmt_attr, in init_pmu_entry_by_type_and_add()
517 if (pmu_entry->pmu_perf_type == AMDGPU_PMU_PERF_TYPE_ALL) { in init_pmu_entry_by_type_and_add()
522 &pmu_entry->evt_attr_group, in init_pmu_entry_by_type_and_add()
523 pmu_entry->evt_attr, in init_pmu_entry_by_type_and_add()
532 amdgpu_pmu_create_attrs(&pmu_entry->evt_attr_group, in init_pmu_entry_by_type_and_add()
533 pmu_entry->evt_attr, in init_pmu_entry_by_type_and_add()
538 pmu_entry->pmu.attr_groups = kmemdup(attr_groups, sizeof(attr_groups), in init_pmu_entry_by_type_and_add()
541 if (!pmu_entry->pmu.attr_groups) { in init_pmu_entry_by_type_and_add()
546 snprintf(pmu_name, PMU_NAME_SIZE, "%s_%d", pmu_entry->pmu_file_prefix, in init_pmu_entry_by_type_and_add()
547 adev_to_drm(pmu_entry->adev)->primary->index); in init_pmu_entry_by_type_and_add()
549 ret = perf_pmu_register(&pmu_entry->pmu, pmu_name, -1); in init_pmu_entry_by_type_and_add()
554 if (pmu_entry->pmu_perf_type != AMDGPU_PMU_PERF_TYPE_ALL) in init_pmu_entry_by_type_and_add()
556 pmu_entry->pmu_type_name, total_num_events); in init_pmu_entry_by_type_and_add()
561 list_add_tail(&pmu_entry->entry, &amdgpu_pmu_list); in init_pmu_entry_by_type_and_add()
565 kfree(pmu_entry->pmu.attr_groups); in init_pmu_entry_by_type_and_add()
567 kfree(pmu_entry->fmt_attr_group.attrs); in init_pmu_entry_by_type_and_add()
568 kfree(pmu_entry->fmt_attr); in init_pmu_entry_by_type_and_add()
569 kfree(pmu_entry->evt_attr_group.attrs); in init_pmu_entry_by_type_and_add()
570 kfree(pmu_entry->evt_attr); in init_pmu_entry_by_type_and_add()
573 pmu_entry->pmu_type_name); in init_pmu_entry_by_type_and_add()
601 struct amdgpu_pmu_entry *pmu_entry; in create_pmu_entry() local
603 pmu_entry = kzalloc(sizeof(struct amdgpu_pmu_entry), GFP_KERNEL); in create_pmu_entry()
605 if (!pmu_entry) in create_pmu_entry()
606 return pmu_entry; in create_pmu_entry()
608 pmu_entry->adev = adev; in create_pmu_entry()
609 pmu_entry->fmt_attr_group.name = "format"; in create_pmu_entry()
610 pmu_entry->fmt_attr_group.attrs = NULL; in create_pmu_entry()
611 pmu_entry->evt_attr_group.name = "events"; in create_pmu_entry()
612 pmu_entry->evt_attr_group.attrs = NULL; in create_pmu_entry()
613 pmu_entry->pmu_perf_type = pmu_type; in create_pmu_entry()
614 pmu_entry->pmu_type_name = pmu_type_name; in create_pmu_entry()
615 pmu_entry->pmu_file_prefix = pmu_file_prefix; in create_pmu_entry()
617 return pmu_entry; in create_pmu_entry()
624 struct amdgpu_pmu_entry *pmu_entry, *pmu_entry_df; in amdgpu_pmu_init() local
642 pmu_entry = create_pmu_entry(adev, AMDGPU_PMU_PERF_TYPE_ALL, in amdgpu_pmu_init()
645 if (!pmu_entry) { in amdgpu_pmu_init()
650 ret = init_pmu_entry_by_type_and_add(pmu_entry, in amdgpu_pmu_init()
654 kfree(pmu_entry); in amdgpu_pmu_init()
661 pmu_entry = create_pmu_entry(adev, AMDGPU_PMU_PERF_TYPE_ALL, in amdgpu_pmu_init()
663 if (!pmu_entry) in amdgpu_pmu_init()
666 ret = init_pmu_entry_by_type_and_add(pmu_entry, in amdgpu_pmu_init()
670 kfree(pmu_entry); in amdgpu_pmu_init()