Skip to contentSkip to conversation

perf: qcom_l2: fix column exclusion check

PATCH Superseded Neil Leeder 3 participants 4 messages Jul 24, 2017 – Jul 26, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
index c259848..b242cce 100644
@@ -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.
maintainer Acked-by on v1 1/1
#1 lore raw
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.

This looks correct, so:

Should this have:

Fixes 21bdbb7102edeaeb ("perf: add qcom l2 cache perf events driver")

... ?

Quoted 17 lines
---
 drivers/perf/qcom_l2_pmu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/perf/qcom_l2_pmu.c +1 -0
index c259848..b242cce 100644
@@ -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.

#2 lore raw
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.

This looks correct, so:

Quoted 8 lines

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.
#3 lore raw
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.

This looks correct, so:

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