[{"id":2909,"web_url":"https://patchwork.libcamera.org/comment/2909/","msgid":"<20191015144211.GB3511@bigcity.dyn.berto.se>","date":"2019-10-15T14:42:11","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_device: Print control\n\tID in unknown type log messagge","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for breaking this out.\n\nOn 2019-10-15 17:02:07 +0300, Laurent Pinchart wrote:\n> When the type of a control enumerated from a V4L2 device is not\n> supported, we log a debug message that mentions the control type. This\n> makes it hard to figure out which control is faulty. Print the control\n> ID instead.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/v4l2_device.cpp | 7 +++++--\n>  1 file changed, 5 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index b47ba448f354..68f2d44d11f4 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -8,11 +8,13 @@\n>  #include \"v4l2_device.h\"\n>  \n>  #include <fcntl.h>\n> +#include <iomanip>\n>  #include <string.h>\n>  #include <sys/ioctl.h>\n>  #include <unistd.h>\n>  \n>  #include \"log.h\"\n> +#include \"utils.h\"\n>  #include \"v4l2_controls.h\"\n>  \n>  /**\n> @@ -371,8 +373,9 @@ void V4L2Device::listControls()\n>  \t\t\tbreak;\n>  \t\t/* \\todo Support compound controls. */\n>  \t\tdefault:\n> -\t\t\tLOG(V4L2, Debug) << \"Control type '\" << ctrl.type\n> -\t\t\t\t\t << \"' not supported\";\n> +\t\t\tLOG(V4L2, Debug)\n> +\t\t\t\t<< \"Control \" << utils::hex(ctrl.id)\n> +\t\t\t\t<< \" has unsupported type \" << ctrl.type;\n>  \t\t\tcontinue;\n>  \t\t}\n>  \n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x243.google.com (mail-lj1-x243.google.com\n\t[IPv6:2a00:1450:4864:20::243])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 52B4961562\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Oct 2019 16:42:13 +0200 (CEST)","by mail-lj1-x243.google.com with SMTP id f5so20539777ljg.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Oct 2019 07:42:13 -0700 (PDT)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tq19sm6283197lfj.9.2019.10.15.07.42.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 15 Oct 2019 07:42:11 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=WMeaIYpuz5bTg4SidSr0IOIBhHS5EvYGKuiD/FUee1Q=;\n\tb=HcgYG7E50e+KuQioDOk7Ywe1pOEbT7fNRs7ia5UG0bbeDxGG//KM66bL+QNWy6YRcw\n\tGetPpSWB1CFt6CEU7Y7g1RnHo0sEXydkHt7cluiSBllZ7yNcZ8ofR4X8A0EHRPvXK8IT\n\tjWkLNTF/ZgVunC7y/vAVz4+UHd0bdOSC8bfA85dHCsZUdrNuKByLq/nPx/Uh9c/XT/Sm\n\thKws4ecYMt0ziCVw/Gsix6SmnZsCBJ8ZaJ/4TnxFIBVSnlxgboxGdYZDbEb6huXLTzDE\n\tfgXTyNFfyRl2P6reO5NfGWJqNqHXQXAhirxXcCxwWfMYVPdPQh/Y6xAv98Xzkt+5aNcp\n\tJ+fw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=WMeaIYpuz5bTg4SidSr0IOIBhHS5EvYGKuiD/FUee1Q=;\n\tb=ScbsWphRHMNbMt55+pjFrx7IPCGMJXrhrCoM5icJE235I1VgEc6WIj/V2Ks5qixDJB\n\tCpX84RWuJ47Gsr1SwYUF7nytRhV0qOK9/1HqGsSf3it9Wd8f7MS2Blir2iJPfNr1pBIE\n\tlOTml1QbM/BJQRiV4EqENKnbAz5OQM7bNmBXYGQBSGP6nRlLjrf/KPzQpL2BFp7CHX/t\n\tzh0yVFoQBvqLibOjYqt6zlwDNrHGGbJ+6Tuv5+FCCv7Uf7xoz9Yx8uE7MIfxbC8z1hOq\n\tN3/47eczMTo3KUhpoaCvQtvWYdxiSpOTYHtaYCaIguBaxz1naJDKI6QQYoQ4ynbw/DOw\n\tTA8w==","X-Gm-Message-State":"APjAAAVZ/j7h11El1AoFcE/FNGej/qrg921M+H9Sr66bKlInhT57cKFL\n\t9IfzZcoo0wEwkiomQXJ3Is5++W2lm7k=","X-Google-Smtp-Source":"APXvYqxSd+ffi2AtiviP1XsqYDbAanEHCM1njcPs0Qh/Spu618TDa/TQOs3BLDfpg0OK9JFxH6HI+A==","X-Received":"by 2002:a2e:7404:: with SMTP id p4mr20450849ljc.13.1571150532385;\n\tTue, 15 Oct 2019 07:42:12 -0700 (PDT)","Date":"Tue, 15 Oct 2019 16:42:11 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191015144211.GB3511@bigcity.dyn.berto.se>","References":"<20191015000743.GA5976@bigcity.dyn.berto.se>\n\t<20191015140207.8227-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191015140207.8227-1-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_device: Print control\n\tID in unknown type log messagge","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 15 Oct 2019 14:42:13 -0000"}}]