[libcamera-devel] [PATCH 11/11] Adds useful debug print statements.

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Oct 25 13:13:15 CEST 2022


Hi Laurent,

Quoting Laurent Pinchart via libcamera-devel (2022-10-25 00:59:07)
> Hi Nicholas,
> 
> Thank you for the patch.
> 
> On Mon, Oct 24, 2022 at 12:55:43AM -0500, Nicholas Roth via libcamera-devel wrote:
> > From: Nicholas Roth <nicholas at rothemail.net>
> > 
> > ---
> >  src/android/camera_capabilities.cpp           | 12 +++++++++---
> >  src/android/camera_hal_manager.cpp            |  3 ++-
> >  src/libcamera/base/log.cpp                    |  6 +++++-
> >  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  2 ++
> >  src/libcamera/v4l2_subdevice.cpp              |  3 ++-
> >  5 files changed, 20 insertions(+), 6 deletions(-)
> > 
> > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
> > index 64bd8dde..ef0d10d0 100644

<snip android parts>

> > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
> > index 15e8206a..8f86387b 100644
> > --- a/src/libcamera/v4l2_subdevice.cpp
> > +++ b/src/libcamera/v4l2_subdevice.cpp
> > @@ -392,7 +392,8 @@ int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,
> >       if (ret < 0) {
> >               LOG(V4L2, Error)
> >                       << "Unable to get rectangle " << target << " on pad "
> > -                     << pad << ": " << strerror(-ret);
> > +                     << pad << ": " << strerror(-ret) << "."
> > +                     << "device path: " << devicePath() << " device node: " << deviceNode();
> 
> If the device path and device node are useful in error messages, they
> should be printed in all of them, not just this one. This should then be
> done through the logPrefix() function. The code currently uses the
> entity name as a log prefix, is that not enough ? The device path, in
> particular, seems too verbose to me.

This makes me remember https://patchwork.libcamera.org/patch/12207/, and
wish it was something that could get more traction. It can help to see
what device nodes are being worked on when the logs are reported.

Your earlier comment of:
> I don't have a very strong opinion here, but I wonder if we could print
> the video node and entity name at open time, and only the entity name in
> other places ?

still stands, and is likely reasonable. I'll see if I can post a v2 with
that.

--
Kieran


> >               return ret;
> >       }
> >  
> 
> -- 
> Regards,
> 
> Laurent Pinchart


More information about the libcamera-devel mailing list