procqueue: use queue / item names in logging

This commit is contained in:
Vadim Yanitskiy 2017-09-10 16:27:04 +03:00
parent 3839a88ea6
commit 9e7e889278
6 changed files with 22 additions and 16 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;
}