[libcamera-devel] [PATCH v1 0/6] libcamera: Improve debug messages in V4L2 compat layer

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Jan 9 00:11:58 CET 2022


On Tue, Dec 28, 2021 at 11:59:46PM +0200, Laurent Pinchart wrote:
> Hello,
> 
> This patch series improves the debug messages printed by the file
> operation handlers in the V4L2 compat layer.
> 
> Before the series, the log messages printed the file descriptor of the
> V4L2 file as an integer:
> 
> [207:37:26.959469077] [32330] DEBUG V4L2Compat v4l2_camera_proxy.cpp:531 Servicing vidioc_querybuf fd = 3
> [207:37:26.959608478] [32330] DEBUG V4L2Compat v4l2_camera_proxy.cpp:549 Servicing vidioc_qbuf, index = 0 fd = 3
> 
> Now, the file path is printed as well, and the message is formated as a
> function call for better readability:
> 
> [207:32:30.769491737] [32181] DEBUG V4L2Compat v4l2_camera_proxy.cpp:544 [/dev/video2 (fd:3)] vidioc_querybuf()
> [207:32:30.769565454] [32181] DEBUG V4L2Compat v4l2_camera_proxy.cpp:563 [/dev/video2 (fd:3)] vidioc_qbuf(index=0)

Ping ?

To answer a question I've heard in an separate discussion, we can't use
Loggable here, as the information that needs to be logged is not part of
the V4L2CameraProxy class. It comes from the V4L2CameraFile class,
passed as an argument to the different ioctl handlers.

> Laurent Pinchart (5):
>   v4l2: v4l2_compat_manager: Print path and fd in openat()
>   v4l2: v4l2_camera_file: Store file description
>   v4l2: v4l2_camera_proxy: Drop trace message from freeBuffers()
>   v4l2: v4l2_compat_manager: Store V4L2CameraFile in mmaps_
>   v4l2: v4l2_camera_proxy: Use file description in debug messages
> 
>  src/v4l2/v4l2_camera_file.cpp    | 28 +++++++++++-
>  src/v4l2/v4l2_camera_file.h      |  8 +++-
>  src/v4l2/v4l2_camera_proxy.cpp   | 76 ++++++++++++++++++++------------
>  src/v4l2/v4l2_camera_proxy.h     |  7 +--
>  src/v4l2/v4l2_compat_manager.cpp | 18 ++++----
>  src/v4l2/v4l2_compat_manager.h   |  2 +-
>  6 files changed, 95 insertions(+), 44 deletions(-)
> 
> 
> base-commit: 94a1afd0fc27216d6eca9506d8794c7a907f8121

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list