Thank you for your reply.
I’d like to see “v4l2_dbg” message in the kernel driver.
For example, I want to see v4l2_dbg message to dmesg command on console of the Linux_for_Tegra_tx2/sources/kernel/kernel-4.4/drivers/media/i2c/tc358840.c file.
Is it possible with your command without kernel build?
if you’re working with v4l2_dbg,
there will be additional debug flags for each modules,
please check the debug flag as below path, and modify the parameter to change the log level.
Maybe, Is it possible that would be install v4l2-src and v4l2-ctl?
That is, Is the v4l2_dbg involved with v4l2-ctl? Or not, Is it just only set the log level?
How dosn’t it see the debug message with “dmesg”?
I want to konw with method as below.
A. kernel log level of the v4l2_dbg is set. (same with printk log level)
B. build the kernel.
C. boot and “dmesg” command on the console, v4l2_dbg log message check.
For example, v4l2_dbg(1, debug, sd, “%s: no valid signal\n”, func);
print output “%s: no valid signal”
i’ve verified v4l2_dbg macro works.
since default imx274 did not enable this feature, please refer to below code snippet and steps as an example.
thanks
diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c
index 2c60402..c8815c0 100644
--- a/drivers/media/i2c/imx274.c
+++ b/drivers/media/i2c/imx274.c
@@ -58,6 +58,10 @@
#define IMX274_1080P_MODE_MIN_VMAX 4620
#define IMX274_1080P_MODE_OFFSET 112
+static int debug;
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "debug level (0-3)");
+
struct imx274 {
struct camera_common_power_rail power;
int num_ctrls;
@@ -414,6 +418,7 @@ static int imx274_s_stream(struct v4l2_subdev *sd, int enable)
int err;
dev_dbg(&client->dev, "%s++\n", __func__);
+ v4l2_dbg(1, debug, sd, "[v4l2_dbg] %s++\n", __func__);
imx274_write_table(priv, mode_table[IMX274_MODE_STOP_STREAM]);
@@ -463,6 +468,7 @@ static int imx274_s_stream(struct v4l2_subdev *sd, int enable)
if (err)
goto exit;
+ v4l2_dbg(1, debug, sd, "[v4l2_dbg] %s--\n", __func__);
enable the debug flag
# echo 1 > /sys/module/imx274/parameters/debug
execute the commands to launch the camera sensor, and saw below debug message,