[libcamera-devel,v1,1/5] v4l2: v4l2_compat_manager: Print path and fd in openat()
diff mbox series

Message ID 20211228215951.32396-2-laurent.pinchart@ideasonboard.com
State Accepted
Delegated to: Laurent Pinchart
Headers show
Series
  • libcamera: Improve debug messages in V4L2 compat layer
Related show

Commit Message

Laurent Pinchart Dec. 28, 2021, 9:59 p.m. UTC
The V4L2 compat layer prints debug messages that mention the file
descriptor of the video device, but no message that links the device
path to the file descriptor. Fix it by adding a debug message in
openat().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/v4l2/v4l2_compat_manager.cpp | 1 +
 1 file changed, 1 insertion(+)

Comments

Kieran Bingham Jan. 10, 2022, 4:41 p.m. UTC | #1
Quoting Laurent Pinchart (2021-12-28 21:59:47)
> The V4L2 compat layer prints debug messages that mention the file
> descriptor of the video device, but no message that links the device
> path to the file descriptor. Fix it by adding a debug message in
> openat().
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/v4l2/v4l2_compat_manager.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp
> index 690a191fe2bf..c64cdb862489 100644
> --- a/src/v4l2/v4l2_compat_manager.cpp
> +++ b/src/v4l2/v4l2_compat_manager.cpp
> @@ -158,6 +158,7 @@ int V4L2CompatManager::openat(int dirfd, const char *path, int oflag, mode_t mod
>         V4L2CameraProxy *proxy = proxies_[ret].get();
>         files_.emplace(efd, std::make_shared<V4L2CameraFile>(efd, oflag & O_NONBLOCK, proxy));
>  
> +       LOG(V4L2Compat, Debug) << "Opened " << path << " -> fd " << efd;
>         return efd;
>  }
>  
> -- 
> Regards,
> 
> Laurent Pinchart
>
Paul Elder Jan. 14, 2022, 9:42 a.m. UTC | #2
Hi Laurent,

On Tue, Dec 28, 2021 at 11:59:47PM +0200, Laurent Pinchart wrote:
> The V4L2 compat layer prints debug messages that mention the file
> descriptor of the video device, but no message that links the device
> path to the file descriptor. Fix it by adding a debug message in
> openat().
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/v4l2/v4l2_compat_manager.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp
> index 690a191fe2bf..c64cdb862489 100644
> --- a/src/v4l2/v4l2_compat_manager.cpp
> +++ b/src/v4l2/v4l2_compat_manager.cpp
> @@ -158,6 +158,7 @@ int V4L2CompatManager::openat(int dirfd, const char *path, int oflag, mode_t mod
>  	V4L2CameraProxy *proxy = proxies_[ret].get();
>  	files_.emplace(efd, std::make_shared<V4L2CameraFile>(efd, oflag & O_NONBLOCK, proxy));
>  
> +	LOG(V4L2Compat, Debug) << "Opened " << path << " -> fd " << efd;
>  	return efd;
>  }
>  
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp
index 690a191fe2bf..c64cdb862489 100644
--- a/src/v4l2/v4l2_compat_manager.cpp
+++ b/src/v4l2/v4l2_compat_manager.cpp
@@ -158,6 +158,7 @@  int V4L2CompatManager::openat(int dirfd, const char *path, int oflag, mode_t mod
 	V4L2CameraProxy *proxy = proxies_[ret].get();
 	files_.emplace(efd, std::make_shared<V4L2CameraFile>(efd, oflag & O_NONBLOCK, proxy));
 
+	LOG(V4L2Compat, Debug) << "Opened " << path << " -> fd " << efd;
 	return efd;
 }