aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/perf/arm-ccn.c
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2018-05-21 13:19:49 -0400
committerWill Deacon <will.deacon@arm.com>2018-05-21 13:21:32 -0400
commit1898eb61fbc9703efee886d3abec27a388cf28c3 (patch)
treed32338cd5bbf458f77d7c70a056e18e78236cf60 /drivers/perf/arm-ccn.c
parent8b0c93c20ef78f15d8b760964ff79bda7f68c610 (diff)
drivers/perf: arm-ccn: don't log to dmesg in event_init
The ARM CCN PMU driver uses dev_warn() to complain about parameters in the user-provided perf_event_attr. This means that under normal operation (e.g. a single invocation of the perf tool), a number of messages warnings may be logged to dmesg. Tools may issue multiple syscalls to probe for feature support, and multiple applications (from multiple users) can attempt to open events simultaneously, so this is not very helpful, even if a user happens to have access to dmesg. Worse, this can push important information out of the dmesg ring buffer, and can significantly slow down syscall fuzzers, vastly increasing the time it takes to find critical bugs. Demote the dev_warn() instances to dev_dbg(), as is the case for all other PMU drivers under drivers/perf/. Users who wish to debug PMU event initialisation can enable dynamic debug to receive these messages. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/perf/arm-ccn.c')
-rw-r--r--drivers/perf/arm-ccn.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c
index 917b47e776df..b416ee18e6bb 100644
--- a/drivers/perf/arm-ccn.c
+++ b/drivers/perf/arm-ccn.c
@@ -736,7 +736,7 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
736 ccn = pmu_to_arm_ccn(event->pmu); 736 ccn = pmu_to_arm_ccn(event->pmu);
737 737
738 if (hw->sample_period) { 738 if (hw->sample_period) {
739 dev_warn(ccn->dev, "Sampling not supported!\n"); 739 dev_dbg(ccn->dev, "Sampling not supported!\n");
740 return -EOPNOTSUPP; 740 return -EOPNOTSUPP;
741 } 741 }
742 742
@@ -744,12 +744,12 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
744 event->attr.exclude_kernel || event->attr.exclude_hv || 744 event->attr.exclude_kernel || event->attr.exclude_hv ||
745 event->attr.exclude_idle || event->attr.exclude_host || 745 event->attr.exclude_idle || event->attr.exclude_host ||
746 event->attr.exclude_guest) { 746 event->attr.exclude_guest) {
747 dev_warn(ccn->dev, "Can't exclude execution levels!\n"); 747 dev_dbg(ccn->dev, "Can't exclude execution levels!\n");
748 return -EINVAL; 748 return -EINVAL;
749 } 749 }
750 750
751 if (event->cpu < 0) { 751 if (event->cpu < 0) {
752 dev_warn(ccn->dev, "Can't provide per-task data!\n"); 752 dev_dbg(ccn->dev, "Can't provide per-task data!\n");
753 return -EOPNOTSUPP; 753 return -EOPNOTSUPP;
754 } 754 }
755 /* 755 /*
@@ -771,13 +771,13 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
771 switch (type) { 771 switch (type) {
772 case CCN_TYPE_MN: 772 case CCN_TYPE_MN:
773 if (node_xp != ccn->mn_id) { 773 if (node_xp != ccn->mn_id) {
774 dev_warn(ccn->dev, "Invalid MN ID %d!\n", node_xp); 774 dev_dbg(ccn->dev, "Invalid MN ID %d!\n", node_xp);
775 return -EINVAL; 775 return -EINVAL;
776 } 776 }
777 break; 777 break;
778 case CCN_TYPE_XP: 778 case CCN_TYPE_XP:
779 if (node_xp >= ccn->num_xps) { 779 if (node_xp >= ccn->num_xps) {
780 dev_warn(ccn->dev, "Invalid XP ID %d!\n", node_xp); 780 dev_dbg(ccn->dev, "Invalid XP ID %d!\n", node_xp);
781 return -EINVAL; 781 return -EINVAL;
782 } 782 }
783 break; 783 break;
@@ -785,11 +785,11 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
785 break; 785 break;
786 default: 786 default:
787 if (node_xp >= ccn->num_nodes) { 787 if (node_xp >= ccn->num_nodes) {
788 dev_warn(ccn->dev, "Invalid node ID %d!\n", node_xp); 788 dev_dbg(ccn->dev, "Invalid node ID %d!\n", node_xp);
789 return -EINVAL; 789 return -EINVAL;
790 } 790 }
791 if (!arm_ccn_pmu_type_eq(type, ccn->node[node_xp].type)) { 791 if (!arm_ccn_pmu_type_eq(type, ccn->node[node_xp].type)) {
792 dev_warn(ccn->dev, "Invalid type 0x%x for node %d!\n", 792 dev_dbg(ccn->dev, "Invalid type 0x%x for node %d!\n",
793 type, node_xp); 793 type, node_xp);
794 return -EINVAL; 794 return -EINVAL;
795 } 795 }
@@ -808,19 +808,19 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
808 if (event_id != e->event) 808 if (event_id != e->event)
809 continue; 809 continue;
810 if (e->num_ports && port >= e->num_ports) { 810 if (e->num_ports && port >= e->num_ports) {
811 dev_warn(ccn->dev, "Invalid port %d for node/XP %d!\n", 811 dev_dbg(ccn->dev, "Invalid port %d for node/XP %d!\n",
812 port, node_xp); 812 port, node_xp);
813 return -EINVAL; 813 return -EINVAL;
814 } 814 }
815 if (e->num_vcs && vc >= e->num_vcs) { 815 if (e->num_vcs && vc >= e->num_vcs) {
816 dev_warn(ccn->dev, "Invalid vc %d for node/XP %d!\n", 816 dev_dbg(ccn->dev, "Invalid vc %d for node/XP %d!\n",
817 vc, node_xp); 817 vc, node_xp);
818 return -EINVAL; 818 return -EINVAL;
819 } 819 }
820 valid = 1; 820 valid = 1;
821 } 821 }
822 if (!valid) { 822 if (!valid) {
823 dev_warn(ccn->dev, "Invalid event 0x%x for node/XP %d!\n", 823 dev_dbg(ccn->dev, "Invalid event 0x%x for node/XP %d!\n",
824 event_id, node_xp); 824 event_id, node_xp);
825 return -EINVAL; 825 return -EINVAL;
826 } 826 }