[libcamera-devel] [PATCH 2/2] libcamera: v4l2_videodevice: Print fd value in log prefix
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Mar 3 17:37:15 CET 2021
When opening a V4L2VideoDevice multiple times, for instance to run
multiple jobs on a M2M device, it's useful to attribute log messages to
a particular instance. Include the device fd in the log prefix.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
src/libcamera/v4l2_videodevice.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index c77e1aff7978..cb52d4cea3f6 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -711,7 +711,8 @@ void V4L2VideoDevice::close()
std::string V4L2VideoDevice::logPrefix() const
{
- return deviceNode() + (V4L2_TYPE_IS_OUTPUT(bufferType_) ? "[out]" : "[cap]");
+ return deviceNode() + "[" + std::to_string(fd()) +
+ (V4L2_TYPE_IS_OUTPUT(bufferType_) ? ":out]" : ":cap]");
}
/**
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list