[{"id":15668,"web_url":"https://patchwork.libcamera.org/comment/15668/","msgid":"<YE1uuc5FTCnWJDWx@pendragon.ideasonboard.com>","date":"2021-03-14T02:02:33","subject":"Re: [libcamera-devel] [PATCH 5/8] libcamera: pipeline: ipu3:\n\tframes: Add FrameInfo state tracing","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Fri, Mar 12, 2021 at 06:11:28AM +0000, Kieran Bingham wrote:\n> Provide a toString() function on the IPU3Frames::Info structure so that\n> it can be reported during debug logs.\n> \n> Provide a public helper on the IPU3Frames class to report the state of\n> all Info structures it holds.\n> \n> This method can be used when debugging the contexts that are associated\n> with requests.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/ipu3/frames.cpp | 23 +++++++++++++++++++++++\n>  src/libcamera/pipeline/ipu3/frames.h   |  4 ++++\n>  2 files changed, 27 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/frames.cpp b/src/libcamera/pipeline/ipu3/frames.cpp\n> index 4198e2019f3f..b8b471c3c561 100644\n> --- a/src/libcamera/pipeline/ipu3/frames.cpp\n> +++ b/src/libcamera/pipeline/ipu3/frames.cpp\n> @@ -131,4 +131,27 @@ IPU3Frames::Info *IPU3Frames::find(FrameBuffer *buffer)\n>  \treturn nullptr;\n>  }\n>  \n> +const std::string IPU3Frames::Info::toString() const\n> +{\n> +\tstd::stringstream ss;\n\nMissing header (same in the Request patch that uses std::stringstream).\n\n> +\n> +\tss << request->toString()\n> +\t   << (metadataProcessed ? \"\" : \"[!metadata]\")\n> +\t   << (paramDequeued ? \"\" : \"[!param]\");\n> +\n\nSame comment as for Request::toString().\n\n> +\treturn ss.str();\n> +}\n> +\n> +void IPU3Frames::dump() const\n> +{\n> +\tLOG(IPU3, Error) << \"Frames:\";\n\nDebug ?\n\n> +\n> +\tfor (auto const &itInfo : frameInfo_) {\n\nitInfo isn't an iterator, but a pair. You can name it elem, element,\nentry, ... if you want a generic name.\n\n> +\t\tInfo *info = itInfo.second.get();\n> +\n> +\t\tLOG(IPU3, Error)\n\nDebug ?\n\n> +\t\t\t<< \" - \" << info->toString();\n> +\t}\n> +}\n> +\n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h\n> index 4acdf48eca9d..c769ae864d32 100644\n> --- a/src/libcamera/pipeline/ipu3/frames.h\n> +++ b/src/libcamera/pipeline/ipu3/frames.h\n> @@ -34,6 +34,8 @@ public:\n>  \n>  \t\tbool paramDequeued;\n>  \t\tbool metadataProcessed;\n> +\n> +\t\tconst std::string toString() const;\n\nYou can drop the first const, and you should include <string>.\n\n>  \t};\n>  \n>  \tIPU3Frames();\n> @@ -49,6 +51,8 @@ public:\n>  \tInfo *find(unsigned int id);\n>  \tInfo *find(FrameBuffer *buffer);\n>  \n> +\tvoid dump() const;\n> +\n>  private:\n>  \tstd::queue<FrameBuffer *> availableParamBuffers_;\n>  \tstd::queue<FrameBuffer *> availableStatBuffers_;","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 BF05EBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 14 Mar 2021 02:03:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 390F66084D;\n\tSun, 14 Mar 2021 03:03:11 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CD0AB6084D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 14 Mar 2021 03:03:09 +0100 (CET)","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 3A57E55C;\n\tSun, 14 Mar 2021 03:03:09 +0100 (CET)"],"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=\"Rm5dNe3p\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615687389;\n\tbh=lGoj2Hd1/Dtnzji3QuGiloJ5opNKv0Y0FRYe+dQhMMk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Rm5dNe3pmzmZjIrf5t4u3CzuVFvtNkK7f+LsCuUfiJf823wkgENLcqVknAPlkmRiE\n\tPLBNyhZlo2HRJy4Td3q5niVK4iR1qe1qn4Ep29Ir7NQ8SQS1/gtAca2CP6aTz8m6We\n\tZN0zTaF2Ub3RPyiy8uHJrreBk4zsve3iKw/Nw/LA=","Date":"Sun, 14 Mar 2021 04:02:33 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YE1uuc5FTCnWJDWx@pendragon.ideasonboard.com>","References":"<20210312061131.854849-1-kieran.bingham@ideasonboard.com>\n\t<20210312061131.854849-6-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210312061131.854849-6-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 5/8] libcamera: pipeline: ipu3:\n\tframes: Add FrameInfo state tracing","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>"}}]