perf: qcom_l2: fix column exclusion check
Subsystems (2)
PATCH 1/1 perf: qcom_l2: fix column exclusion check
The check for column exclusion did not verify that the event being checked was an L2 event, and not a software event. Software events should not be checked for column exclusion. This resulted in a group with both software and L2 events sometimes incorrectly rejecting the L2 event for column exclusion and not counting it.
Add a check for PMU type before applying column exclusion logic.
--- drivers/perf/qcom_l2_pmu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/perf/qcom_l2_pmu.c +2 -0
@@ -546,6 +546,7 @@ static int l2_cache_event_init(struct perf_event *event) }if ((event != event->group_leader) && + !is_software_event (event->group_leader) && (L2_EVT_GROUP (event->group_leader->attr.config) ==L2_EVT_GROUP (event->attr.config))) { dev_dbg_ratelimited(&l2cache_pmu->pdev->dev,
@@ -558,6 +559,7 @@ static int l2_cache_event_init(struct perf_event *event)list_for_each_entry (sibling, &event->group_leader->sibling_list, group_entry) {if ((sibling != event) && + !is_software_event (sibling) && (L2_EVT_GROUP (sibling->attr.config) ==L2_EVT_GROUP (event->attr.config))) { dev_dbg_ratelimited(&l2cache_pmu->pdev->dev,
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
Quoted 10 lines · Neil Leeder
The check for column exclusion did not verify that the event being checked was an L2 event, and not a software event. Software events should not be checked for column exclusion. This resulted in a group with both software and L2 events sometimes incorrectly rejecting the L2 event for column exclusion and not counting it.
Add a check for PMU type before applying column exclusion logic.
Signed-off-by Neil Leeder <[email protected]>
This looks correct, so:
Should this have:
... ?
Quoted 17 lines
--- drivers/perf/qcom_l2_pmu.c | 2 ++ 1 file changed, 2 insertions(+)drivers/perf/qcom_l2_pmu.c +1
-0@@ -546,6 +546,7 @@ static int l2_cache_event_init(struct perf_event *event) }if ((event != event->group_leader) && + !is_software_event (event->group_leader) && (L2_EVT_GROUP (event->group_leader->attr.config) ==L2_EVT_GROUP (event->attr.config))) { dev_dbg_ratelimited(&l2cache_pmu->pdev->dev,
drivers/perf/qcom_l2_pmu.c static int l2_cache_event_init(struct perf_event *event) · line 565
Quoted 7 lines
drivers/perf/qcom_l2_pmu.c +1
-0@@ -558,6 +559,7 @@ static int l2_cache_event_init(struct perf_event *event)list_for_each_entry (sibling, &event->group_leader->sibling_list, group_entry) {if ((sibling != event) && + !is_software_event (sibling) && (L2_EVT_GROUP (sibling->attr.config) ==L2_EVT_GROUP (event->attr.config))) { dev_dbg_ratelimited(&l2cache_pmu->pdev->dev,
It's unfortunate that we duplicate the checks for the leader and siblings, but that's not a new problem, and we can fix that in a follow-up patch.
Thanks,
Mark.
Quoted 14 lines · Mark Rutland
Quoted 10 lines · Neil Leeder
The check for column exclusion did not verify that the event being checked was an L2 event, and not a software event. Software events should not be checked for column exclusion. This resulted in a group with both software and L2 events sometimes incorrectly rejecting the L2 event for column exclusion and not counting it.
Add a check for PMU type before applying column exclusion logic.
Signed-off-by Neil Leeder <[email protected]>This looks correct, so:
Quoted 8 lines
Acked-by Mark Rutland <[email protected]>Should this have:
Fixes 21bdbb7102edeaeb ("perf: add qcom l2 cache perf events driver")... ?
Thanks. I'll re-post with the Fixes tag.
Neil
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
Quoted 17 lines · Neil
Quoted 16 lines · Mark Rutland
Quoted 10 lines · Neil Leeder
The check for column exclusion did not verify that the event being checked was an L2 event, and not a software event. Software events should not be checked for column exclusion. This resulted in a group with both software and L2 events sometimes incorrectly rejecting the L2 event for column exclusion and not counting it.
Add a check for PMU type before applying column exclusion logic.
Signed-off-by Neil Leeder <[email protected]>This looks correct, so:
Acked-by Mark Rutland <[email protected]>
Quoted 7 lines
Quoted 6 lines
Should this have:
Fixes 21bdbb7102edeaeb ("perf: add qcom l2 cache perf events driver")... ?
Thanks. I'll re-post with the Fixes tag.
No need, I'll pick it up and add it when I apply.
Cheers,
Will