Unverified Commit 4332a1c1 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1186 Fix NULL pointer and Keep PERF_PMU_CAP_EXCLUSIVE

Merge Pull Request from: @ci-robot 
 
PR sync from: Junhao He <hejunhao3@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/SFPID77Q7WRTZVPTFE5WSEDPJADFTQAY/ 
1) Fix NULL pointer for hisi_ptt
2) Keep to advertise PERF_PMU_CAP_EXCLUSIVE. Such ptt pmus can
   only have one event scheduled at a time.

Junhao He (2):
  hwtracing: hisi_ptt: Add dummy callback pmu::read()
  hwtracing: hisi_ptt: Keep to advertise PERF_PMU_CAP_EXCLUSIVE


-- 
2.33.0
 
 
Link:https://gitee.com/openeuler/kernel/pulls/1186

 

Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents aa829760 118d1014
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1178,6 +1178,10 @@ static void hisi_ptt_pmu_del(struct perf_event *event, int flags)
	hisi_ptt_pmu_stop(event, PERF_EF_UPDATE);
}

static void hisi_ptt_pmu_read(struct perf_event *event)
{
}

static void hisi_ptt_remove_cpuhp_instance(void *hotplug_node)
{
	cpuhp_state_remove_instance_nocalls(hisi_ptt_pmu_online, hotplug_node);
@@ -1211,7 +1215,7 @@ static int hisi_ptt_register_pmu(struct hisi_ptt *hisi_ptt)

	hisi_ptt->hisi_ptt_pmu = (struct pmu) {
		.module		= THIS_MODULE,
		.capabilities	= PERF_PMU_CAP_NO_EXCLUDE,
		.capabilities	= PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_EXCLUSIVE,
		.task_ctx_nr	= perf_sw_context,
		.attr_groups	= hisi_ptt_pmu_groups,
		.event_init	= hisi_ptt_pmu_event_init,
@@ -1221,6 +1225,7 @@ static int hisi_ptt_register_pmu(struct hisi_ptt *hisi_ptt)
		.stop		= hisi_ptt_pmu_stop,
		.add		= hisi_ptt_pmu_add,
		.del		= hisi_ptt_pmu_del,
		.read		= hisi_ptt_pmu_read,
	};

	reg = readl(hisi_ptt->iobase + HISI_PTT_LOCATION);