From patchwork Thu Jan 28 09:04:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11036 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 BE443C33BB for ; Thu, 28 Jan 2021 09:04:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4583A6837C; Thu, 28 Jan 2021 10:04:43 +0100 (CET) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C27896030A for ; Thu, 28 Jan 2021 10:04:41 +0100 (CET) Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 8E410240003 for ; Thu, 28 Jan 2021 09:04:41 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Jan 2021 10:04:54 +0100 Message-Id: <20210128090454.515268-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: Improve Request life cycle tracking 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 current logging to track the status of a Request when running the Android camera HAL provide the following information: When a Request is queued to libcamera: HAL camera_device.cpp:1776 '\_SB_.PCI0.I2C2.CAM0': Queueing Request to libcamera with 1 HAL streams When a Request completes: Request request.cpp:268 Request has completed - cookie: 138508601719648 The queueing of a Request reports the number of streams it contains while the completion of a Request reports the address of the associated cookie. This makes very hard to keep track of what Requests have completed, as the logging associated with a queue/complete event does not allow to identify a Request easily. Add two more printouts to make it easier to track a Request life cycle. The result looks like the following trace: Request request.cpp:92 Created request - cookie: 138508601718368 HAL camera_device.cpp:1776 '\_SB_.PCI0.I2C2.CAM0': Queueing Request to libcamera with 1 HAL streams HAL camera_device.cpp:1813 '\_SB_.PCI0.I2C2.CAM0': 0 - (640x480)[0x00000022] -> (640x480)[NV12] (direct) ... ... Request request.cpp:268 Request has completed - cookie: 138508601718368 HAL camera_device.cpp:1866 '\_SB_.PCI0.I2C2.CAM0': Request completed by libcamera with 1 streams Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Paul Elder --- src/android/camera_device.cpp | 3 +++ src/libcamera/request.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index a9634f4e4198..513f000b1854 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1863,6 +1863,9 @@ void CameraDevice::requestComplete(Request *request) status = CAMERA3_BUFFER_STATUS_ERROR; } + LOG(HAL, Debug) << "Request completed by libcamera with " + << descriptor->numBuffers_ << " streams"; + /* * \todo The timestamp used for the metadata is currently always taken * from the first buffer (which may be the first stream) in the Request. diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index a68684ef9fd3..e561ce1d5d0e 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -88,6 +88,8 @@ Request::Request(Camera *camera, uint64_t cookie) metadata_ = new ControlList(controls::controls); LIBCAMERA_TRACEPOINT(request_construct, this); + + LOG(Request, Debug) << "Created request - cookie: " << cookie_; } Request::~Request()