From patchwork Fri Mar 12 06:11:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11565 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 E2D2CBD1F1 for ; Fri, 12 Mar 2021 06:11:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9B019602ED; Fri, 12 Mar 2021 07:11:43 +0100 (CET) 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="ddyoaOsa"; 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 D753168C75 for ; Fri, 12 Mar 2021 07:11:37 +0100 (CET) Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4642BB60; Fri, 12 Mar 2021 07:11:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615529497; bh=mjb9EEd8Zf5PA1G9OwUMexHAJ/QoKzQTvOaU/OXhVFs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ddyoaOsaj3vEl8xj/FtzrGI2Lk7IKsPcdFZB+3ClUx053NEUErDeLo2tNcDVqoycP 4Mh0CoihcY2LFS0+BApfAHLaZfQzdA/sBDJlnONxz4PyIR01k8axlV8EyE6fiyg3Tl sK5omrcXtVKqvqNOsUjjF5KGAaa4rb/CSVEVmpGM= From: Kieran Bingham To: libcamera devel Date: Fri, 12 Mar 2021 06:11:28 +0000 Message-Id: <20210312061131.854849-6-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210312061131.854849-1-kieran.bingham@ideasonboard.com> References: <20210312061131.854849-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 5/8] libcamera: pipeline: ipu3: frames: Add FrameInfo state tracing 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" Provide a toString() function on the IPU3Frames::Info structure so that it can be reported during debug logs. Provide a public helper on the IPU3Frames class to report the state of all Info structures it holds. This method can be used when debugging the contexts that are associated with requests. Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/ipu3/frames.cpp | 23 +++++++++++++++++++++++ src/libcamera/pipeline/ipu3/frames.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/frames.cpp b/src/libcamera/pipeline/ipu3/frames.cpp index 4198e2019f3f..b8b471c3c561 100644 --- a/src/libcamera/pipeline/ipu3/frames.cpp +++ b/src/libcamera/pipeline/ipu3/frames.cpp @@ -131,4 +131,27 @@ IPU3Frames::Info *IPU3Frames::find(FrameBuffer *buffer) return nullptr; } +const std::string IPU3Frames::Info::toString() const +{ + std::stringstream ss; + + ss << request->toString() + << (metadataProcessed ? "" : "[!metadata]") + << (paramDequeued ? "" : "[!param]"); + + return ss.str(); +} + +void IPU3Frames::dump() const +{ + LOG(IPU3, Error) << "Frames:"; + + for (auto const &itInfo : frameInfo_) { + Info *info = itInfo.second.get(); + + LOG(IPU3, Error) + << " - " << info->toString(); + } +} + } /* namespace libcamera */ diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h index 4acdf48eca9d..c769ae864d32 100644 --- a/src/libcamera/pipeline/ipu3/frames.h +++ b/src/libcamera/pipeline/ipu3/frames.h @@ -34,6 +34,8 @@ public: bool paramDequeued; bool metadataProcessed; + + const std::string toString() const; }; IPU3Frames(); @@ -49,6 +51,8 @@ public: Info *find(unsigned int id); Info *find(FrameBuffer *buffer); + void dump() const; + private: std::queue availableParamBuffers_; std::queue availableStatBuffers_;