From patchwork Fri Jan 11 16:07:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 210 Return-Path: Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B8AF260B13 for ; Fri, 11 Jan 2019 17:07:36 +0100 (CET) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 47273200004; Fri, 11 Jan 2019 16:07:36 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 11 Jan 2019 17:07:37 +0100 Message-Id: <20190111160737.25094-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: Add debug printouts X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2019 16:07:36 -0000 Add a few debug printouts that help follow the library intialization process: what pipeline handlers are registered, what media devices are created, and which pipeline manager gets matches with the current system. The resulting output is the following, on IPU3 devices: DBG pipeline_handler.cpp:119 Pipeline handler: "PipeHandlerVimc" registered DBG pipeline_handler.cpp:119 Pipeline handler: "PipelineHandlerIPU3" registered DBG device_enumerator.cpp:214 New media device: ipu3-imgu created from: /dev/media0 DBG device_enumerator.cpp:214 New media device: ipu3-cio2 created from: /dev/media1 DBG device_enumerator.cpp:255 Succesfull match for media device: ipu3-cio2 DBG device_enumerator.cpp:255 Succesfull match for media device: ipu3-imgu DBG pipeline_handler.cpp:150 Pipeline handler: "PipelineHandlerIPU3" matched Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/device_enumerator.cpp | 8 +++++++- src/libcamera/pipeline_handler.cpp | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp index 0d18e75..c1ddd7c 100644 --- a/src/libcamera/device_enumerator.cpp +++ b/src/libcamera/device_enumerator.cpp @@ -211,6 +211,9 @@ int DeviceEnumerator::addDevice(const std::string &devnode) return ret; } + LOG(Debug) << "New media device: " << media->driver() + << " created from: " << devnode; + /* Associate entities to device node paths. */ for (MediaEntity *entity : media->entities()) { if (entity->deviceMajor() == 0 && entity->deviceMinor() == 0) @@ -248,8 +251,11 @@ MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm) const if (dev->busy()) continue; - if (dm.match(dev)) + if (dm.match(dev)) { + LOG(Debug) << "Succesfull match for media device: " + << dev->driver(); return dev; + } } return nullptr; diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index ee76948..9299c28 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -116,6 +116,7 @@ void PipelineHandlerFactory::registerType(const std::string &name, return; } + LOG(Debug) << "Pipeline handler: \"" << name << "\" registered"; factories[name] = factory; } @@ -145,8 +146,10 @@ PipelineHandler *PipelineHandlerFactory::create(const std::string &name, PipelineHandler *pipe = it->second->create(); - if (pipe->match(enumerator)) + if (pipe->match(enumerator)) { + LOG(Debug) << "Pipeline handler: \"" << name << "\" matched"; return pipe; + } delete pipe; return nullptr;