[PATCH 4/4] Improve logging
Neil Jerram
neil at ossau.homelinux.net
Sat Jan 26 02:07:16 CET 2013
The pcm_name (e.g. "hw:1,0") is just clutter so I think we can safely
remove it. Add a loop counter so we can see if any overruns are
clustered, or if they're spread out across the call duration.
---
gsm-voice-routing.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gsm-voice-routing.c b/gsm-voice-routing.c
index 1143791..d1c7626 100644
--- a/gsm-voice-routing.c
+++ b/gsm-voice-routing.c
@@ -99,6 +99,7 @@ period - this is our latency.
FILE *logfile;
int terminating = 0;
+unsigned int loop_count = 0;
struct route_stream
{
@@ -126,7 +127,7 @@ static int err(const char *msg, int snd_err, struct route_stream *s,
return ERR_TERMINATING;
}
- fprintf(logfile, "%s (%s): %s", s->id, s->pcm_name, msg);
+ fprintf(logfile, "[%u] %s: %s", loop_count, s->id, msg);
if (snd_err < 0) {
fprintf(logfile, ": %s", snd_strerror(snd_err));
}
@@ -620,7 +621,9 @@ int main()
#endif
/* Route sound */
+ loop_count = 0;
while (!terminating) {
+ loop_count++;
/* Recording - first from internal card (so that we always clean the
recording buffer), then UMTS, which can fail */
--
1.7.10.4
--=-=-=--
More information about the community
mailing list