[{"id":16811,"web_url":"https://patchwork.libcamera.org/comment/16811/","msgid":"<YJPmvQ5B9lo/9QmN@pendragon.ideasonboard.com>","date":"2021-05-06T12:53:17","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_subdevice: Report\n\tsubdev device node on logs","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, May 06, 2021 at 01:05:23PM +0100, Kieran Bingham wrote:\n> The V4L2 Video device logs the deviceNode() as part of it's logging\n> prefix, but the Subdevices have not been updated in the same way.\n> \n> There have been several occasions while debugging remotely, where users\n> would benefit from knowing which subdevice node is referenced by the\n> CameraSensor in the messages being printed, and adding it aligns the\n> output of the Video class with the Subdevice class.\n> \n> This patch adds the /dev/v4l-subdev1 style string to the log message as\n> demonstrated here (from a fictitious additional log message):\n> \n> [88:39:36.684494647] [969224]  INFO V4L2 v4l2_subdevice.cpp:436 /dev/v4l-subdev1: 'Sensor B': Setting Format\n> [88:36:13.308244848] [968664] DEBUG V4L2 v4l2_videodevice.cpp:1450 /dev/video6[22:cap]: Queueing buffer 0\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n> \n> Yes, this makes the lines longer ;-( which makes me a little sad, but\n> aligns the two V4L2 types, and helps users find their device nodes when\n> needed/debugging...\n\nI have the same concern :-/ Aligning V4L2Subdevice and V4L2VideoDevice\nisn't really a goal in my opinion, what matters is printing the most\nuseful information. If that differs between the two classes, so be it.\nNote that if you really wanted to unify them, you'd have to add the\nentity name to video nodes, as well as the file descriptor number to\nsubdevs.\n\nI don't have a very strong opinion here, but I wonder if we could print\nthe video node and entity name at open time, and only the entity name in\nother places ?\n\n>  src/libcamera/v4l2_subdevice.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 721ff5a92a2b..fd464b0481aa 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -461,7 +461,7 @@ V4L2Subdevice::fromEntityName(const MediaDevice *media,\n>  \n>  std::string V4L2Subdevice::logPrefix() const\n>  {\n> -\treturn \"'\" + entity_->name() + \"'\";\n> +\treturn deviceNode() + \": '\" + entity_->name() + \"'\";\n>  }\n>  \n>  std::vector<unsigned int> V4L2Subdevice::enumPadCodes(unsigned int pad)","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 89593BF825\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 May 2021 12:53:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D16B06891B;\n\tThu,  6 May 2021 14:53:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6839868909\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 May 2021 14:53:22 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B4E454A5;\n\tThu,  6 May 2021 14:53:21 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"j85LYg1R\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1620305601;\n\tbh=GQNSKw02OEjDcBhhZq8Zu3Z/j+P+TGVhPW9Cb8urRlw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=j85LYg1RHgfGw4f8A3vXu5gHwS7etAwPaFSCPjCbUNZLOEdLhJiUKxOmiWu1s5XHk\n\tyVEVm/xiCGzyO65+A+likXB6KRj0pAO2p6fkY6V+GeO5cPIyqKQSgRmpKHj6exZ4jW\n\tuyS8p/ChghxPv1ygXX0H8UlRt0NsP4YChahZw3qE=","Date":"Thu, 6 May 2021 15:53:17 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YJPmvQ5B9lo/9QmN@pendragon.ideasonboard.com>","References":"<20210506120523.969609-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210506120523.969609-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_subdevice: Report\n\tsubdev device node on logs","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]