From: Ezequiel Garcia <ezequiel@collabora.com>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
kernel@collabora.com, Ezequiel Garcia <ezequiel@collabora.com>
Subject: [PATCH 3/4] media: v4l: Add a module parameter to control global debugging
Date: Mon, 18 Feb 2019 17:15:27 -0300 [thread overview]
Message-ID: <20190218201528.21545-4-ezequiel@collabora.com> (raw)
In-Reply-To: <20190218201528.21545-1-ezequiel@collabora.com>
In addition to the dev_debug device attribute, which controls
per-device debugging, we now add a module parameter to control
debugging globally.
This will allow to add debugging of v4l2 control logic,
using the newly introduced debug parameter.
In addition, this module parameter adds consistency to the
subsystem, since other v4l2 modules expose the same parameter.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
drivers/media/v4l2-core/v4l2-dev.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index 35e429ac888f..4f7821b13721 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -36,8 +36,16 @@
#define VIDEO_NUM_DEVICES 256
#define VIDEO_NAME "video4linux"
+unsigned int videodev_debug;
+module_param_named(debug, videodev_debug, uint, 0644);
+
+/*
+ * The videodev_debug module parameter controls the global debug level,
+ * while the dev_debug device attribute controls the local
+ * per-device debug level.
+ */
#define dprintk(vdev, flags, fmt, arg...) do { \
- if (vdev->dev_debug & flags) \
+ if ((videodev_debug & flags) || (vdev->dev_debug & flags)) \
printk(KERN_DEBUG pr_fmt("%s: " fmt), \
__func__, ##arg); \
} while (0)
--
2.20.1
next prev parent reply other threads:[~2019-02-18 20:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-18 20:15 [PATCH 0/4] Add debug messages to v4l2-ctrls Ezequiel Garcia
2019-02-18 20:15 ` [PATCH 1/4] media: v4l: Simplify dev_debug flags Ezequiel Garcia
2019-02-18 20:15 ` [PATCH 2/4] media: v4l: Improve debug dprintk macro Ezequiel Garcia
2019-02-18 20:15 ` Ezequiel Garcia [this message]
2019-02-18 20:15 ` [PATCH 4/4] media: v4l: ctrls: Add debug messages Ezequiel Garcia
2019-02-25 21:25 ` Ezequiel Garcia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190218201528.21545-4-ezequiel@collabora.com \
--to=ezequiel@collabora.com \
--cc=hans.verkuil@cisco.com \
--cc=kernel@collabora.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox