Skip to contentSkip to conversation

OPP: rate-limit debug messages when no change in OPP is required

PATCH Applied Adrián Larumbe 2 participants 2 messages May 20, 2023 – May 22, 2023 Operating performance points (OPP)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OPP: rate-limit debug messages when no change in OPP is required

Otherwise, when enabling a debug build and dynamic debug in the kernel, it quickly floods the kernel ring buffer and makes debugging of other subsystems almost impossible, unless manually disabled.

---
 drivers/opp/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/opp/core.c +1 -1
index 954c94865cf5..85cbc8de407c 100644
@@ -1091,7 +1091,7 @@ static int _set_opp(struct device *dev, struct opp_table *opp_table,
 
 	/* Return early if nothing to do */
 	if (!forced && old_opp == opp && opp_table->enabled) {
-		dev_dbg(dev, "%s: OPPs are same, nothing to do\n", __func__);
+		dev_dbg_ratelimited(dev, "%s: OPPs are same, nothing to do\n", __func__);
 		return 0;
 	}
 
Signature · 1 line
2.40.0
Applied
#1 lore raw
Quoted 14 lines · Adrián Larumbe

Otherwise, when enabling a debug build and dynamic debug in the kernel, it quickly floods the kernel ring buffer and makes debugging of other subsystems almost impossible, unless manually disabled.

---
 drivers/opp/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/opp/core.c +0 -0
index 954c94865cf5..85cbc8de407c 100644

drivers/opp/core.c static int _set_opp(struct device *dev, struct opp_table *opp_table, · line 1096

Quoted 7 lines
drivers/opp/core.c +1 -1
@@ -1091,7 +1091,7 @@ static int _set_opp(struct device *dev, struct opp_table *opp_table,
 
 	/* Return early if nothing to do */
 	if (!forced && old_opp == opp && opp_table->enabled) {
-		dev_dbg(dev, "%s: OPPs are same, nothing to do\n", __func__);
+		dev_dbg_ratelimited(dev, "%s: OPPs are same, nothing to do\n", __func__);
 		return 0;
 	}

Applied. Thanks.

Signature · 1 line
viresh