media: dvb_demux: improve debug messages

Do some cleanup of debug messages, making them cleaner and
easier to be used to analyze what's going on.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Mauro Carvalho Chehab 2018-01-24 09:03:03 -05:00 committed by Mauro Carvalho Chehab
parent fed488b395
commit 0f3827351e
1 changed files with 22 additions and 21 deletions

View File

@ -119,7 +119,8 @@ static inline int dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed,
ccok = ((feed->cc + 1) & 0x0f) == cc; ccok = ((feed->cc + 1) & 0x0f) == cc;
feed->cc = cc; feed->cc = cc;
if (!ccok) if (!ccok)
dprintk("missed packet!\n"); dprintk("missed packet: %d instead of %d!\n",
cc, (feed->cc + 1) & 0x0f);
#endif #endif
if (buf[1] & 0x40) // PUSI ? if (buf[1] & 0x40) // PUSI ?
@ -188,7 +189,7 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed)
#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
if (sec->secbufp < sec->tsfeedp) { if (sec->secbufp < sec->tsfeedp) {
int i, n = sec->tsfeedp - sec->secbufp; int n = sec->tsfeedp - sec->secbufp;
/* /*
* Section padding is done with 0xff bytes entirely. * Section padding is done with 0xff bytes entirely.
@ -196,12 +197,9 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed)
* but just first and last. * but just first and last.
*/ */
if (sec->secbuf[0] != 0xff || sec->secbuf[n - 1] != 0xff) { if (sec->secbuf[0] != 0xff || sec->secbuf[n - 1] != 0xff) {
dprintk("dvb_demux.c section ts padding loss: %d/%d\n", dprintk("section ts padding loss: %d/%d\n",
n, sec->tsfeedp); n, sec->tsfeedp);
dprintk("dvb_demux.c pad data:"); dprintk("pad data: %*ph\n", n, sec->secbuf);
for (i = 0; i < n; i++)
pr_cont(" %02x", sec->secbuf[i]);
pr_cont("\n");
} }
} }
#endif #endif
@ -240,9 +238,9 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed,
if (sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) { if (sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) {
#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
dprintk("dvb_demux.c section buffer full loss: %d/%d\n", dprintk("section buffer full loss: %d/%d\n",
sec->tsfeedp + len - DMX_MAX_SECFEED_SIZE, sec->tsfeedp + len - DMX_MAX_SECFEED_SIZE,
DMX_MAX_SECFEED_SIZE); DMX_MAX_SECFEED_SIZE);
#endif #endif
len = DMX_MAX_SECFEED_SIZE - sec->tsfeedp; len = DMX_MAX_SECFEED_SIZE - sec->tsfeedp;
} }
@ -275,7 +273,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed,
dvb_dmx_swfilter_section_feed(feed); dvb_dmx_swfilter_section_feed(feed);
#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
else else
dprintk("dvb_demux.c pusi not seen, discarding section data\n"); dprintk("pusi not seen, discarding section data\n");
#endif #endif
sec->secbufp += seclen; /* secbufp and secbuf moving together is */ sec->secbufp += seclen; /* secbufp and secbuf moving together is */
sec->secbuf += seclen; /* redundant but saves pointer arithmetic */ sec->secbuf += seclen; /* redundant but saves pointer arithmetic */
@ -310,9 +308,12 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
if (!ccok || dc_i) { if (!ccok || dc_i) {
#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
dprintk("discontinuity %s: %d bytes lost\n", if (dc_i)
!ccok ? "detected" : "indicated", dprintk("%d frame with disconnect indicator\n",
count + 4); cc);
else
dprintk("discontinuity: %d instead of %d. %d bytes lost\n",
cc, (feed->cc + 1) & 0x0f, count + 4);
/* /*
* those bytes under sume circumstances will again be reported * those bytes under sume circumstances will again be reported
* in the following dvb_dmx_swfilter_section_new * in the following dvb_dmx_swfilter_section_new
@ -347,8 +348,7 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
} }
#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG #ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
else if (count > 0) else if (count > 0)
dprintk("dvb_demux.c PUSI=1 but %d bytes lost\n", dprintk("PUSI=1 but %d bytes lost\n", count);
count);
#endif #endif
} else { } else {
/* PUSI=0 (is not set), no section boundary */ /* PUSI=0 (is not set), no section boundary */
@ -418,9 +418,10 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
1024); 1024);
speed_timedelta = ktime_ms_delta(cur_time, speed_timedelta = ktime_ms_delta(cur_time,
demux->speed_last_time); demux->speed_last_time);
dprintk("TS speed %llu Kbits/sec \n", if (speed_timedelta)
div64_u64(speed_bytes, dprintk("TS speed %llu Kbits/sec \n",
speed_timedelta)); div64_u64(speed_bytes,
speed_timedelta));
} }
demux->speed_last_time = cur_time; demux->speed_last_time = cur_time;
@ -445,8 +446,8 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
if ((buf[3] & 0xf) != demux->cnt_storage[pid]) { if ((buf[3] & 0xf) != demux->cnt_storage[pid]) {
dprintk_tscheck("TS packet counter mismatch. PID=0x%x expected 0x%x got 0x%x\n", dprintk_tscheck("TS packet counter mismatch. PID=0x%x expected 0x%x got 0x%x\n",
pid, demux->cnt_storage[pid], pid, demux->cnt_storage[pid],
buf[3] & 0xf); buf[3] & 0xf);
demux->cnt_storage[pid] = buf[3] & 0xf; demux->cnt_storage[pid] = buf[3] & 0xf;
} }
} }