summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-09-10 16:27:04 +0300
committerVadim Yanitskiy <axilirator@gmail.com>2017-12-31 12:20:59 +0100
commit9e7e88927851fd6b2fa42d0a187bd7e65ccaccf1 (patch)
tree6f29db04909dc6ccac60b0cd00d64b8f41fdb97e
parent3839a88ea681024752048c902b23144c42f4fa42 (diff)
procqueue: use queue / item names in logging
-rw-r--r--src/pq_alsa.c8
-rw-r--r--src/pq_codec.c5
-rw-r--r--src/pq_file.c6
-rw-r--r--src/pq_format.c8
-rw-r--r--src/pq_rtp.c6
-rw-r--r--src/procqueue.c5
6 files changed, 22 insertions, 16 deletions
diff --git a/src/pq_alsa.c b/src/pq_alsa.c
index 5cdd9ce..84d2e20 100644
--- a/src/pq_alsa.c
+++ b/src/pq_alsa.c
@@ -178,8 +178,8 @@ out_print:
int
osmo_gapk_pq_queue_alsa_input(struct osmo_gapk_pq *pq, const char *hwdev, unsigned int blk_len)
{
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding ALSA input "
- "(dev='%s', blk_len=%u)\n", hwdev, blk_len);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding ALSA input "
+ "(dev='%s', blk_len=%u)\n", pq->name, hwdev, blk_len);
return pq_queue_alsa_op(pq, hwdev, blk_len, 1);
}
@@ -192,8 +192,8 @@ osmo_gapk_pq_queue_alsa_input(struct osmo_gapk_pq *pq, const char *hwdev, unsign
int
osmo_gapk_pq_queue_alsa_output(struct osmo_gapk_pq *pq, const char *hwdev, unsigned int blk_len)
{
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding ALSA output "
- "(dev='%s', blk_len=%u)\n", hwdev, blk_len);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding ALSA output "
+ "(dev='%s', blk_len=%u)\n", pq->name, hwdev, blk_len);
return pq_queue_alsa_op(pq, hwdev, blk_len, 0);
}
diff --git a/src/pq_codec.c b/src/pq_codec.c
index b5dac5d..87afd82 100644
--- a/src/pq_codec.c
+++ b/src/pq_codec.c
@@ -78,8 +78,9 @@ osmo_gapk_pq_queue_codec(struct osmo_gapk_pq *pq, const struct osmo_gapk_codec_d
item->cat_name = "codec";
item->sub_name = codec->name;
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding codec %s, %s format %s\n", codec->name,
- enc_dec_n ? "encoding to" : "decoding from", fmt->name);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding codec %s, %s format %s\n",
+ pq->name, codec->name, enc_dec_n ?
+ "encoding to" : "decoding from", fmt->name);
if (!item->proc)
return -ENOTSUP;
diff --git a/src/pq_file.c b/src/pq_file.c
index 8a8f9c6..8ad26d5 100644
--- a/src/pq_file.c
+++ b/src/pq_file.c
@@ -106,7 +106,8 @@ pq_queue_file_op(struct osmo_gapk_pq *pq, FILE *fh, unsigned int blk_len, int in
int
osmo_gapk_pq_queue_file_input(struct osmo_gapk_pq *pq, FILE *src, unsigned int blk_len)
{
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding file input (blk_len=%u)\n", blk_len);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding file input (blk_len=%u)\n",
+ pq->name, blk_len);
return pq_queue_file_op(pq, src, blk_len, 1);
}
@@ -119,6 +120,7 @@ osmo_gapk_pq_queue_file_input(struct osmo_gapk_pq *pq, FILE *src, unsigned int b
int
osmo_gapk_pq_queue_file_output(struct osmo_gapk_pq *pq, FILE *dst, unsigned int blk_len)
{
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding file output (blk_len=%u)\n", blk_len);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding file output (blk_len=%u)\n",
+ pq->name, blk_len);
return pq_queue_file_op(pq, dst, blk_len, 0);
}
diff --git a/src/pq_format.c b/src/pq_format.c
index c2bb52e..2c4a2fd 100644
--- a/src/pq_format.c
+++ b/src/pq_format.c
@@ -56,14 +56,14 @@ osmo_gapk_pq_queue_fmt_convert(struct osmo_gapk_pq *pq, const struct osmo_gapk_f
return -ENOMEM;
if (to_from_n) {
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding conversion from canon "
- "to %s (for codec %s)\n", fmt->name, codec->name);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding conversion from canon "
+ "to %s (for codec %s)\n", pq->name, fmt->name, codec->name);
item->len_in = codec->canon_frame_len;
item->len_out = fmt->frame_len;
item->state = fmt->conv_from_canon;
} else {
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding conversion from %s "
- "to canon (for codec %s)\n", fmt->name, codec->name);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding conversion from %s "
+ "to canon (for codec %s)\n", pq->name, fmt->name, codec->name);
item->len_in = fmt->frame_len;
item->len_out = codec->canon_frame_len;
item->state = fmt->conv_to_canon;
diff --git a/src/pq_rtp.c b/src/pq_rtp.c
index faab6c8..c1d9ffb 100644
--- a/src/pq_rtp.c
+++ b/src/pq_rtp.c
@@ -251,7 +251,8 @@ pq_queue_rtp_op(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len, int i
int
osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len)
{
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding RTP input (blk_len=%u)\n", blk_len);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding RTP input (blk_len=%u)\n",
+ pq->name, blk_len);
return pq_queue_rtp_op(pq, udp_fd, blk_len, 1);
}
@@ -263,6 +264,7 @@ osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int udp_fd, unsigned int b
int
osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len)
{
- LOGPGAPK(LOGL_DEBUG, "PQ: Adding RTP output (blk_len=%u)\n", blk_len);
+ LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding RTP output (blk_len=%u)\n",
+ pq->name, blk_len);
return pq_queue_rtp_op(pq, udp_fd, blk_len, 0);
}
diff --git a/src/procqueue.c b/src/procqueue.c
index b95b3ec..c6661b5 100644
--- a/src/procqueue.c
+++ b/src/procqueue.c
@@ -199,8 +199,9 @@ osmo_gapk_pq_execute(struct osmo_gapk_pq *pq)
/* Call item's processing handler */
rv = item->proc(item->state, item->buf, buf_prev, len_prev);
if (rv < 0) {
- LOGPGAPK(LOGL_ERROR, "Queue execution aborted: "
- "item returned %d\n", rv);
+ LOGPGAPK(LOGL_ERROR, "PQ '%s': execution aborted: "
+ "item '%s/%s' returned %d\n", pq->name,
+ item->cat_name, item->sub_name, rv);
return rv;
}