Skip to content

Commit 4172980

Browse files
Yicong Yangwilldeacon
authored andcommitted
drivers/perf: hisi: Define a symbol namespace for HiSilicon Uncore PMUs
The HiSilicon Uncore PMU framework implements some common functions and exported them to the drivers. Use a specific HISI_PMU namespace for the exported symbols to avoid pollute the generic ones. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Link: https://lore.kernel.org/r/20241210141525.37788-2-yangyicong@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 5fcccba commit 4172980

File tree

8 files changed

+25
-18
lines changed

8 files changed

+25
-18
lines changed

drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ static void __exit hisi_cpa_pmu_module_exit(void)
389389
}
390390
module_exit(hisi_cpa_pmu_module_exit);
391391

392+
MODULE_IMPORT_NS("HISI_PMU");
392393
MODULE_DESCRIPTION("HiSilicon SoC CPA PMU driver");
393394
MODULE_LICENSE("GPL v2");
394395
MODULE_AUTHOR("Qi Liu <liuqi115@huawei.com>");

drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ static void __exit hisi_ddrc_pmu_module_exit(void)
579579
}
580580
module_exit(hisi_ddrc_pmu_module_exit);
581581

582+
MODULE_IMPORT_NS("HISI_PMU");
582583
MODULE_DESCRIPTION("HiSilicon SoC DDRC uncore PMU driver");
583584
MODULE_LICENSE("GPL v2");
584585
MODULE_AUTHOR("Shaokun Zhang <zhangshaokun@hisilicon.com>");

drivers/perf/hisilicon/hisi_uncore_hha_pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ static void __exit hisi_hha_pmu_module_exit(void)
581581
}
582582
module_exit(hisi_hha_pmu_module_exit);
583583

584+
MODULE_IMPORT_NS("HISI_PMU");
584585
MODULE_DESCRIPTION("HiSilicon SoC HHA uncore PMU driver");
585586
MODULE_LICENSE("GPL v2");
586587
MODULE_AUTHOR("Shaokun Zhang <zhangshaokun@hisilicon.com>");

drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ static void __exit hisi_l3c_pmu_module_exit(void)
615615
}
616616
module_exit(hisi_l3c_pmu_module_exit);
617617

618+
MODULE_IMPORT_NS("HISI_PMU");
618619
MODULE_DESCRIPTION("HiSilicon SoC L3C uncore PMU driver");
619620
MODULE_LICENSE("GPL v2");
620621
MODULE_AUTHOR("Anurup M <anurup.m@huawei.com>");

drivers/perf/hisilicon/hisi_uncore_pa_pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ static void __exit hisi_pa_pmu_module_exit(void)
569569
}
570570
module_exit(hisi_pa_pmu_module_exit);
571571

572+
MODULE_IMPORT_NS("HISI_PMU");
572573
MODULE_DESCRIPTION("HiSilicon Protocol Adapter uncore PMU driver");
573574
MODULE_LICENSE("GPL v2");
574575
MODULE_AUTHOR("Shaokun Zhang <zhangshaokun@hisilicon.com>");

drivers/perf/hisilicon/hisi_uncore_pmu.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ssize_t hisi_event_sysfs_show(struct device *dev,
3434

3535
return sysfs_emit(page, "config=0x%lx\n", (unsigned long)eattr->var);
3636
}
37-
EXPORT_SYMBOL_GPL(hisi_event_sysfs_show);
37+
EXPORT_SYMBOL_NS_GPL(hisi_event_sysfs_show, "HISI_PMU");
3838

3939
/*
4040
* sysfs cpumask attributes. For uncore PMU, we only have a single CPU to show
@@ -46,7 +46,7 @@ ssize_t hisi_cpumask_sysfs_show(struct device *dev,
4646

4747
return sysfs_emit(buf, "%d\n", hisi_pmu->on_cpu);
4848
}
49-
EXPORT_SYMBOL_GPL(hisi_cpumask_sysfs_show);
49+
EXPORT_SYMBOL_NS_GPL(hisi_cpumask_sysfs_show, "HISI_PMU");
5050

5151
static bool hisi_validate_event_group(struct perf_event *event)
5252
{
@@ -96,7 +96,7 @@ int hisi_uncore_pmu_get_event_idx(struct perf_event *event)
9696

9797
return idx;
9898
}
99-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_get_event_idx);
99+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_get_event_idx, "HISI_PMU");
100100

101101
ssize_t hisi_uncore_pmu_identifier_attr_show(struct device *dev,
102102
struct device_attribute *attr,
@@ -106,7 +106,7 @@ ssize_t hisi_uncore_pmu_identifier_attr_show(struct device *dev,
106106

107107
return sysfs_emit(page, "0x%08x\n", hisi_pmu->identifier);
108108
}
109-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_identifier_attr_show);
109+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_identifier_attr_show, "HISI_PMU");
110110

111111
static void hisi_uncore_pmu_clear_event_idx(struct hisi_pmu *hisi_pmu, int idx)
112112
{
@@ -165,7 +165,7 @@ int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu,
165165

166166
return 0;
167167
}
168-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_init_irq);
168+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_init_irq, "HISI_PMU");
169169

170170
int hisi_uncore_pmu_event_init(struct perf_event *event)
171171
{
@@ -219,7 +219,7 @@ int hisi_uncore_pmu_event_init(struct perf_event *event)
219219

220220
return 0;
221221
}
222-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_event_init);
222+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_event_init, "HISI_PMU");
223223

224224
/*
225225
* Set the counter to count the event that we're interested in,
@@ -273,7 +273,7 @@ void hisi_uncore_pmu_set_event_period(struct perf_event *event)
273273
/* Write start value to the hardware event counter */
274274
hisi_pmu->ops->write_counter(hisi_pmu, hwc, val);
275275
}
276-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_set_event_period);
276+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_set_event_period, "HISI_PMU");
277277

278278
void hisi_uncore_pmu_event_update(struct perf_event *event)
279279
{
@@ -294,7 +294,7 @@ void hisi_uncore_pmu_event_update(struct perf_event *event)
294294
HISI_MAX_PERIOD(hisi_pmu->counter_bits);
295295
local64_add(delta, &event->count);
296296
}
297-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_event_update);
297+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_event_update, "HISI_PMU");
298298

299299
void hisi_uncore_pmu_start(struct perf_event *event, int flags)
300300
{
@@ -317,7 +317,7 @@ void hisi_uncore_pmu_start(struct perf_event *event, int flags)
317317
hisi_uncore_pmu_enable_event(event);
318318
perf_event_update_userpage(event);
319319
}
320-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_start);
320+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_start, "HISI_PMU");
321321

322322
void hisi_uncore_pmu_stop(struct perf_event *event, int flags)
323323
{
@@ -334,7 +334,7 @@ void hisi_uncore_pmu_stop(struct perf_event *event, int flags)
334334
hisi_uncore_pmu_event_update(event);
335335
hwc->state |= PERF_HES_UPTODATE;
336336
}
337-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_stop);
337+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_stop, "HISI_PMU");
338338

339339
int hisi_uncore_pmu_add(struct perf_event *event, int flags)
340340
{
@@ -357,7 +357,7 @@ int hisi_uncore_pmu_add(struct perf_event *event, int flags)
357357

358358
return 0;
359359
}
360-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_add);
360+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_add, "HISI_PMU");
361361

362362
void hisi_uncore_pmu_del(struct perf_event *event, int flags)
363363
{
@@ -369,14 +369,14 @@ void hisi_uncore_pmu_del(struct perf_event *event, int flags)
369369
perf_event_update_userpage(event);
370370
hisi_pmu->pmu_events.hw_events[hwc->idx] = NULL;
371371
}
372-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_del);
372+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_del, "HISI_PMU");
373373

374374
void hisi_uncore_pmu_read(struct perf_event *event)
375375
{
376376
/* Read hardware counter and update the perf counter statistics */
377377
hisi_uncore_pmu_event_update(event);
378378
}
379-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_read);
379+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_read, "HISI_PMU");
380380

381381
void hisi_uncore_pmu_enable(struct pmu *pmu)
382382
{
@@ -389,15 +389,15 @@ void hisi_uncore_pmu_enable(struct pmu *pmu)
389389

390390
hisi_pmu->ops->start_counters(hisi_pmu);
391391
}
392-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_enable);
392+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_enable, "HISI_PMU");
393393

394394
void hisi_uncore_pmu_disable(struct pmu *pmu)
395395
{
396396
struct hisi_pmu *hisi_pmu = to_hisi_pmu(pmu);
397397

398398
hisi_pmu->ops->stop_counters(hisi_pmu);
399399
}
400-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_disable);
400+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_disable, "HISI_PMU");
401401

402402

403403
/*
@@ -484,7 +484,7 @@ int hisi_uncore_pmu_online_cpu(unsigned int cpu, struct hlist_node *node)
484484

485485
return 0;
486486
}
487-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_online_cpu);
487+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_online_cpu, "HISI_PMU");
488488

489489
int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
490490
{
@@ -515,7 +515,7 @@ int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
515515

516516
return 0;
517517
}
518-
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_offline_cpu);
518+
EXPORT_SYMBOL_NS_GPL(hisi_uncore_pmu_offline_cpu, "HISI_PMU");
519519

520520
void hisi_pmu_init(struct hisi_pmu *hisi_pmu, struct module *module)
521521
{
@@ -535,7 +535,7 @@ void hisi_pmu_init(struct hisi_pmu *hisi_pmu, struct module *module)
535535
pmu->attr_groups = hisi_pmu->pmu_events.attr_groups;
536536
pmu->capabilities = PERF_PMU_CAP_NO_EXCLUDE;
537537
}
538-
EXPORT_SYMBOL_GPL(hisi_pmu_init);
538+
EXPORT_SYMBOL_NS_GPL(hisi_pmu_init, "HISI_PMU");
539539

540540
MODULE_DESCRIPTION("HiSilicon SoC uncore Performance Monitor driver framework");
541541
MODULE_LICENSE("GPL v2");

drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ static void __exit hisi_sllc_pmu_module_exit(void)
507507
}
508508
module_exit(hisi_sllc_pmu_module_exit);
509509

510+
MODULE_IMPORT_NS("HISI_PMU");
510511
MODULE_DESCRIPTION("HiSilicon SLLC uncore PMU driver");
511512
MODULE_LICENSE("GPL v2");
512513
MODULE_AUTHOR("Shaokun Zhang <zhangshaokun@hisilicon.com>");

drivers/perf/hisilicon/hisi_uncore_uc_pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ static void __exit hisi_uc_pmu_module_exit(void)
613613
}
614614
module_exit(hisi_uc_pmu_module_exit);
615615

616+
MODULE_IMPORT_NS("HISI_PMU");
616617
MODULE_DESCRIPTION("HiSilicon SoC UC uncore PMU driver");
617618
MODULE_LICENSE("GPL");
618619
MODULE_AUTHOR("Junhao He <hejunhao3@huawei.com>");

0 commit comments

Comments
 (0)