提交 eebd097b 编写于 作者: H Hao Chen 提交者: Jiantao Xiao

perf: hns3: default use hardware event 0 as group leader event.

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7BY7T
CVE: NA

----------------------------------------------------------------------

For hns3 pmu events, we use command as below before:
perf stat -g -e hns3_pmu_sicl_0/config=0x00105,global=1/
-e hns3_pmu_sicl_0/config=0x10105,global=1/ -I 1000

We want 0x00105 event and 0x10105 event share a hardware event, but for
kernel 6.2 'commit 5f8f9567 ("perf evlist: Remove group option.")'
remove -g parameter.

So add this patch to set default related event idx as 0 to share
the first hardware event.

Fixes: 66637ab1 ("drivers/perf: hisi: add driver for HNS3 PMU")
Signed-off-by: NHao Chen <chenhao418@huawei.com>
上级 60ceb206
......@@ -804,9 +804,11 @@ static int hns3_pmu_find_related_event_idx(struct hns3_pmu *hns3_pmu,
if (!hns3_pmu_cmp_event(sibling, event))
continue;
/* Related events is used in group */
/* Related events is used in group, else we use index 0 event as related event */
if (sibling->group_leader == event->group_leader)
return idx;
else
return 0;
}
/* No related event and all hardware events are used up */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册