From patchwork Thu May 6 12:05:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 12207 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C5313BDE7F for ; Thu, 6 May 2021 12:05:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F2A0268915; Thu, 6 May 2021 14:05:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WJGFaLwq"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C50A68901 for ; Thu, 6 May 2021 14:05:29 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8D85C4A5; Thu, 6 May 2021 14:05:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1620302728; bh=3F7Um/USRHu9C2E/fOUQjAtuQTfpVAdz+vKd/PO+6Gw=; h=From:To:Cc:Subject:Date:From; b=WJGFaLwqDzWeUmOYfH/BbVhA2tJRUZbiS1NWI+FdxbdJLJA5adHSQhK1Mwo0bv1G5 sYIVJqC+BbXm88u8i9PafaoahQkUToKe6gDPgeFTt87M2pMYeDsXr+MRcNiV8nsMla 7QqAnbNcxCQeqhFBxrS7jaiTi/sbXj1PBnHOngew= From: Kieran Bingham To: libcamera devel Date: Thu, 6 May 2021 13:05:23 +0100 Message-Id: <20210506120523.969609-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: v4l2_subdevice: Report subdev device node on logs X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The V4L2 Video device logs the deviceNode() as part of it's logging prefix, but the Subdevices have not been updated in the same way. There have been several occasions while debugging remotely, where users would benefit from knowing which subdevice node is referenced by the CameraSensor in the messages being printed, and adding it aligns the output of the Video class with the Subdevice class. This patch adds the /dev/v4l-subdev1 style string to the log message as demonstrated here (from a fictitious additional log message): [88:39:36.684494647] [969224] INFO V4L2 v4l2_subdevice.cpp:436 /dev/v4l-subdev1: 'Sensor B': Setting Format [88:36:13.308244848] [968664] DEBUG V4L2 v4l2_videodevice.cpp:1450 /dev/video6[22:cap]: Queueing buffer 0 Signed-off-by: Kieran Bingham --- Yes, this makes the lines longer ;-( which makes me a little sad, but aligns the two V4L2 types, and helps users find their device nodes when needed/debugging... src/libcamera/v4l2_subdevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 721ff5a92a2b..fd464b0481aa 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -461,7 +461,7 @@ V4L2Subdevice::fromEntityName(const MediaDevice *media, std::string V4L2Subdevice::logPrefix() const { - return "'" + entity_->name() + "'"; + return deviceNode() + ": '" + entity_->name() + "'"; } std::vector V4L2Subdevice::enumPadCodes(unsigned int pad)