[Asterisk-code-review] channel.c: Clean up debug level 1. (asterisk[16])

Kevin Harwell asteriskteam at digium.com
Fri Feb 25 14:41:55 CST 2022


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/18086 )

Change subject: channel.c: Clean up debug level 1.
......................................................................

channel.c: Clean up debug level 1.

Although there are 10 debugs levels, over time,
many current debug calls have come to use
inappropriately low debug levels. In particular,
a select few debug calls (currently all debug 1)
can result in thousands of debug messages per minute
for a single call.

This can adds a lot of noise to core debug
which dilutes the value in having different
debug levels in the first place, as these
log messages are from the core internals are
are better suited for higher debug levels.

Some debugs levels are thus adjusted so that
debug level 1 is not inappropriately overloaded
with these extremely high-volume and general
debug messages.

ASTERISK-29897 #close

Change-Id: I55a71598993552d3d64a401a35ee99474770d4b4
---
M main/audiohook.c
M main/channel.c
2 files changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/main/audiohook.c b/main/audiohook.c
index 2278e5e..966d5f2 100644
--- a/main/audiohook.c
+++ b/main/audiohook.c
@@ -168,17 +168,17 @@
 	other_factory_ms = other_factory_samples / (audiohook->hook_internal_samp_rate / 1000);
 
 	if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && (our_factory_ms - other_factory_ms > AST_AUDIOHOOK_SYNC_TOLERANCE)) {
-		ast_debug(1, "Flushing audiohook %p so it remains in sync\n", audiohook);
+		ast_debug(4, "Flushing audiohook %p so it remains in sync\n", audiohook);
 		ast_slinfactory_flush(factory);
 		ast_slinfactory_flush(other_factory);
 	}
 
 	if (ast_test_flag(audiohook, AST_AUDIOHOOK_SMALL_QUEUE) && ((our_factory_ms > AST_AUDIOHOOK_SMALL_QUEUE_TOLERANCE) || (other_factory_ms > AST_AUDIOHOOK_SMALL_QUEUE_TOLERANCE))) {
-		ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
+		ast_debug(4, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
 		ast_slinfactory_flush(factory);
 		ast_slinfactory_flush(other_factory);
 	} else if ((our_factory_ms > AST_AUDIOHOOK_LONG_QUEUE_TOLERANCE) || (other_factory_ms > AST_AUDIOHOOK_LONG_QUEUE_TOLERANCE)) {
-		ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
+		ast_debug(4, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
 		ast_slinfactory_flush(factory);
 		ast_slinfactory_flush(other_factory);
 	}
@@ -254,7 +254,7 @@
 
 	if (!usable_read && !usable_write) {
 		/* If both factories are unusable bail out */
-		ast_debug(1, "Read factory %p and write factory %p both fail to provide %zu samples\n", &audiohook->read_factory, &audiohook->write_factory, samples);
+		ast_debug(3, "Read factory %p and write factory %p both fail to provide %zu samples\n", &audiohook->read_factory, &audiohook->write_factory, samples);
 		return NULL;
 	}
 
@@ -315,7 +315,7 @@
 			}
 		}
 	} else {
-		ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
+		ast_debug(3, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
 	}
 
 	frame.subclass.format = ast_format_cache_get_slin_by_rate(audiohook->hook_internal_samp_rate);
diff --git a/main/channel.c b/main/channel.c
index d2f0e18..d736622 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3216,7 +3216,7 @@
 		real_rate = max_rate;
 	}
 
-	ast_debug(1, "Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);
+	ast_debug(3, "Scheduling timer at (%u requested / %u actual) timer ticks per second\n", rate, real_rate);
 
 	res = ast_timer_set_rate(ast_channel_timer(c), real_rate);
 
@@ -5051,7 +5051,7 @@
 
 	/* Send an empty audio frame to get things moving */
 	if (ast_channel_state(chan) != AST_STATE_UP) {
-		ast_debug(1, "Prodding channel '%s'\n", ast_channel_name(chan));
+		ast_debug(3, "Prodding channel '%s'\n", ast_channel_name(chan));
 		a.subclass.format = ast_channel_rawwriteformat(chan);
 		a.data.ptr = nothing + AST_FRIENDLY_OFFSET;
 		a.src = "ast_prod"; /* this better match check in ast_write */

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18086
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I55a71598993552d3d64a401a35ee99474770d4b4
Gerrit-Change-Number: 18086
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220225/1381ae03/attachment.html>


More information about the asterisk-code-review mailing list