mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
[media] dvb_demux: convert an internal ifdef into a Kconfig option
There are some ifdefs inside the dvb_demux that are meant to enable advanced debug capabilities, at the cost of being very verbose. Keeping those as internal ifdefs is a very bad idea, as it doesn't make easy to check if the code there was broken by some patch. So, let's add an explicit Kconfig option for it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
b3ad24d2e0
commit
bbd02f6aa9
2 changed files with 18 additions and 9 deletions
|
@ -27,3 +27,16 @@ config DVB_DYNAMIC_MINORS
|
||||||
will be required to manage the device nodes.
|
will be required to manage the device nodes.
|
||||||
|
|
||||||
If you are unsure about this, say N here.
|
If you are unsure about this, say N here.
|
||||||
|
|
||||||
|
config DVB_DEMUX_SECTION_LOSS_LOG
|
||||||
|
bool "Enable DVB demux section packet loss log"
|
||||||
|
depends on DVB_CORE
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enable extra log messages meant to detect packet loss
|
||||||
|
inside the Kernel.
|
||||||
|
|
||||||
|
Should not be enabled on normal cases, as logs can
|
||||||
|
be very verbose.
|
||||||
|
|
||||||
|
If you are unsure about this, say N here.
|
||||||
|
|
|
@ -37,10 +37,6 @@
|
||||||
#include "dvb_demux.h"
|
#include "dvb_demux.h"
|
||||||
|
|
||||||
#define NOBUFS
|
#define NOBUFS
|
||||||
/*
|
|
||||||
** #define DVB_DEMUX_SECTION_LOSS_LOG to monitor payload loss in the syslog
|
|
||||||
*/
|
|
||||||
// #define DVB_DEMUX_SECTION_LOSS_LOG
|
|
||||||
|
|
||||||
static int dvb_demux_tscheck;
|
static int dvb_demux_tscheck;
|
||||||
module_param(dvb_demux_tscheck, int, 0644);
|
module_param(dvb_demux_tscheck, int, 0644);
|
||||||
|
@ -194,7 +190,7 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed)
|
||||||
{
|
{
|
||||||
struct dmx_section_feed *sec = &feed->feed.sec;
|
struct dmx_section_feed *sec = &feed->feed.sec;
|
||||||
|
|
||||||
#ifdef 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 i, n = sec->tsfeedp - sec->secbufp;
|
||||||
|
|
||||||
|
@ -247,7 +243,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) {
|
if (sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) {
|
||||||
#ifdef DVB_DEMUX_SECTION_LOSS_LOG
|
#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
|
||||||
dprintk("dvb_demux.c section buffer full loss: %d/%d\n",
|
dprintk("dvb_demux.c 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);
|
||||||
|
@ -281,7 +277,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed,
|
||||||
/* dump [secbuf .. secbuf+seclen) */
|
/* dump [secbuf .. secbuf+seclen) */
|
||||||
if (feed->pusi_seen)
|
if (feed->pusi_seen)
|
||||||
dvb_dmx_swfilter_section_feed(feed);
|
dvb_dmx_swfilter_section_feed(feed);
|
||||||
#ifdef 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("dvb_demux.c pusi not seen, discarding section data\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -317,7 +313,7 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ccok || dc_i) {
|
if (!ccok || dc_i) {
|
||||||
#ifdef DVB_DEMUX_SECTION_LOSS_LOG
|
#ifdef CONFIG_DVB_DEMUX_SECTION_LOSS_LOG
|
||||||
dprintk("dvb_demux.c discontinuity detected %d bytes lost\n",
|
dprintk("dvb_demux.c discontinuity detected %d bytes lost\n",
|
||||||
count);
|
count);
|
||||||
/*
|
/*
|
||||||
|
@ -349,7 +345,7 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
|
||||||
dvb_dmx_swfilter_section_copy_dump(feed, after,
|
dvb_dmx_swfilter_section_copy_dump(feed, after,
|
||||||
after_len);
|
after_len);
|
||||||
}
|
}
|
||||||
#ifdef 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("dvb_demux.c PUSI=1 but %d bytes lost\n",
|
||||||
count);
|
count);
|
||||||
|
|
Loading…
Reference in a new issue