Lines Matching refs:pmu_entry

483 static int init_pmu_entry_by_type_and_add(struct amdgpu_pmu_entry *pmu_entry,  in init_pmu_entry_by_type_and_add()  argument
487 &pmu_entry->fmt_attr_group, in init_pmu_entry_by_type_and_add()
488 &pmu_entry->evt_attr_group, in init_pmu_entry_by_type_and_add()
494 pmu_entry->pmu = (struct pmu){ in init_pmu_entry_by_type_and_add()
504 ret = amdgpu_pmu_alloc_pmu_attrs(&pmu_entry->fmt_attr_group, in init_pmu_entry_by_type_and_add()
505 &pmu_entry->fmt_attr, in init_pmu_entry_by_type_and_add()
506 &pmu_entry->evt_attr_group, in init_pmu_entry_by_type_and_add()
507 &pmu_entry->evt_attr, in init_pmu_entry_by_type_and_add()
513 amdgpu_pmu_create_attrs(&pmu_entry->fmt_attr_group, pmu_entry->fmt_attr, in init_pmu_entry_by_type_and_add()
516 if (pmu_entry->pmu_perf_type == AMDGPU_PMU_PERF_TYPE_ALL) { in init_pmu_entry_by_type_and_add()
521 &pmu_entry->evt_attr_group, in init_pmu_entry_by_type_and_add()
522 pmu_entry->evt_attr, in init_pmu_entry_by_type_and_add()
531 amdgpu_pmu_create_attrs(&pmu_entry->evt_attr_group, in init_pmu_entry_by_type_and_add()
532 pmu_entry->evt_attr, in init_pmu_entry_by_type_and_add()
537 pmu_entry->pmu.attr_groups = kmemdup(attr_groups, sizeof(attr_groups), in init_pmu_entry_by_type_and_add()
540 if (!pmu_entry->pmu.attr_groups) { in init_pmu_entry_by_type_and_add()
545 snprintf(pmu_name, PMU_NAME_SIZE, "%s_%d", pmu_entry->pmu_file_prefix, in init_pmu_entry_by_type_and_add()
546 adev_to_drm(pmu_entry->adev)->primary->index); in init_pmu_entry_by_type_and_add()
548 ret = perf_pmu_register(&pmu_entry->pmu, pmu_name, -1); in init_pmu_entry_by_type_and_add()
553 if (pmu_entry->pmu_perf_type != AMDGPU_PMU_PERF_TYPE_ALL) in init_pmu_entry_by_type_and_add()
555 pmu_entry->pmu_type_name, total_num_events); in init_pmu_entry_by_type_and_add()
560 list_add_tail(&pmu_entry->entry, &amdgpu_pmu_list); in init_pmu_entry_by_type_and_add()
564 kfree(pmu_entry->pmu.attr_groups); in init_pmu_entry_by_type_and_add()
566 kfree(pmu_entry->fmt_attr_group.attrs); in init_pmu_entry_by_type_and_add()
567 kfree(pmu_entry->fmt_attr); in init_pmu_entry_by_type_and_add()
568 kfree(pmu_entry->evt_attr_group.attrs); in init_pmu_entry_by_type_and_add()
569 kfree(pmu_entry->evt_attr); in init_pmu_entry_by_type_and_add()
572 pmu_entry->pmu_type_name); in init_pmu_entry_by_type_and_add()
600 struct amdgpu_pmu_entry *pmu_entry; in create_pmu_entry() local
602 pmu_entry = kzalloc(sizeof(struct amdgpu_pmu_entry), GFP_KERNEL); in create_pmu_entry()
604 if (!pmu_entry) in create_pmu_entry()
605 return pmu_entry; in create_pmu_entry()
607 pmu_entry->adev = adev; in create_pmu_entry()
608 pmu_entry->fmt_attr_group.name = "format"; in create_pmu_entry()
609 pmu_entry->fmt_attr_group.attrs = NULL; in create_pmu_entry()
610 pmu_entry->evt_attr_group.name = "events"; in create_pmu_entry()
611 pmu_entry->evt_attr_group.attrs = NULL; in create_pmu_entry()
612 pmu_entry->pmu_perf_type = pmu_type; in create_pmu_entry()
613 pmu_entry->pmu_type_name = pmu_type_name; in create_pmu_entry()
614 pmu_entry->pmu_file_prefix = pmu_file_prefix; in create_pmu_entry()
616 return pmu_entry; in create_pmu_entry()
623 struct amdgpu_pmu_entry *pmu_entry, *pmu_entry_df; in amdgpu_pmu_init() local
641 pmu_entry = create_pmu_entry(adev, AMDGPU_PMU_PERF_TYPE_ALL, in amdgpu_pmu_init()
644 if (!pmu_entry) { in amdgpu_pmu_init()
649 ret = init_pmu_entry_by_type_and_add(pmu_entry, in amdgpu_pmu_init()
653 kfree(pmu_entry); in amdgpu_pmu_init()
660 pmu_entry = create_pmu_entry(adev, AMDGPU_PMU_PERF_TYPE_ALL, in amdgpu_pmu_init()
662 if (!pmu_entry) in amdgpu_pmu_init()
665 ret = init_pmu_entry_by_type_and_add(pmu_entry, in amdgpu_pmu_init()
669 kfree(pmu_entry); in amdgpu_pmu_init()