未验证 提交 63c8f4b4 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!1007 perf: hns3: add event suppport for ROH and default use hardware event 0 as group leader event

Merge Pull Request from: @svishen 
 
This pull request add ROH event and default use hardware event 0 as group leader event

(1)perf: hns3: add event suppport for ROH
(2)perf: hns3: default use hardware event 0 as group leader event

issue:
https://gitee.com/openeuler/kernel/issues/I7BY7T 
 
Link:https://gitee.com/openeuler/kernel/pulls/1007 

Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> 
...@@ -223,6 +223,8 @@ static enum cpuhp_state hns3_pmu_online; ...@@ -223,6 +223,8 @@ static enum cpuhp_state hns3_pmu_online;
/* interrupt rate events */ /* interrupt rate events */
#define HNS3_PMU_EVT_PPS_MSIX_NIC_INTR_NUM 0x00300 #define HNS3_PMU_EVT_PPS_MSIX_NIC_INTR_NUM 0x00300
#define HNS3_PMU_EVT_PPS_MSIX_NIC_TIME 0x10300 #define HNS3_PMU_EVT_PPS_MSIX_NIC_TIME 0x10300
#define HNS3_PMU_EVT_PPS_MSIX_ROH_INTR_NUM 0x00301
#define HNS3_PMU_EVT_PPS_MSIX_ROH_TIME 0x10301
/* filter mode supported by each bandwidth event */ /* filter mode supported by each bandwidth event */
#define HNS3_PMU_FILTER_BW_SSU_EGU 0x07 #define HNS3_PMU_FILTER_BW_SSU_EGU 0x07
...@@ -286,6 +288,7 @@ static enum cpuhp_state hns3_pmu_online; ...@@ -286,6 +288,7 @@ static enum cpuhp_state hns3_pmu_online;
/* filter mode supported by each interrupt rate event */ /* filter mode supported by each interrupt rate event */
#define HNS3_PMU_FILTER_INTR_MSIX_NIC 0x01 #define HNS3_PMU_FILTER_INTR_MSIX_NIC 0x01
#define HNS3_PMU_FILTER_INTR_MSIX_ROH 0x01
enum hns3_pmu_hw_filter_mode { enum hns3_pmu_hw_filter_mode {
HNS3_PMU_HW_FILTER_GLOBAL, HNS3_PMU_HW_FILTER_GLOBAL,
...@@ -580,6 +583,7 @@ static struct attribute *hns3_pmu_events_attr[] = { ...@@ -580,6 +583,7 @@ static struct attribute *hns3_pmu_events_attr[] = {
/* interrupt rate events */ /* interrupt rate events */
HNS3_PMU_INTR_EVT_PAIR(pps_intr_msix_nic, MSIX_NIC), HNS3_PMU_INTR_EVT_PAIR(pps_intr_msix_nic, MSIX_NIC),
HNS3_PMU_INTR_EVT_PAIR(pps_intr_msix_roh, MSIX_ROH),
NULL NULL
}; };
...@@ -647,6 +651,7 @@ static struct attribute *hns3_pmu_filter_mode_attr[] = { ...@@ -647,6 +651,7 @@ static struct attribute *hns3_pmu_filter_mode_attr[] = {
/* interrupt rate events */ /* interrupt rate events */
HNS3_PMU_INTR_FLT_MODE_PAIR(pps_intr_msix_nic, MSIX_NIC), HNS3_PMU_INTR_FLT_MODE_PAIR(pps_intr_msix_nic, MSIX_NIC),
HNS3_PMU_INTR_FLT_MODE_PAIR(pps_intr_msix_roh, MSIX_ROH),
NULL NULL
}; };
...@@ -799,9 +804,11 @@ static int hns3_pmu_find_related_event_idx(struct hns3_pmu *hns3_pmu, ...@@ -799,9 +804,11 @@ static int hns3_pmu_find_related_event_idx(struct hns3_pmu *hns3_pmu,
if (!hns3_pmu_cmp_event(sibling, event)) if (!hns3_pmu_cmp_event(sibling, event))
continue; 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) if (sibling->group_leader == event->group_leader)
return idx; return idx;
else
return 0;
} }
/* No related event and all hardware events are used up */ /* 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.
先完成此消息的编辑!
想要评论请 注册