[{"id":38181,"web_url":"https://patchwork.libcamera.org/comment/38181/","msgid":"<3b821145-3042-471e-84b4-f815cfb60103@ideasonboard.com>","date":"2026-02-11T17:44:05","subject":"Re: [PATCH 2/2] software_isp: benchmark: Print what is being\n\tbenchmarked","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2026. 02. 11. 18:00 keltezéssel, Hans de Goede írta:\n> With the GPU accelerated softISP 2 separate benchmark results are printed,\n> 1 for the generation of the output images on the GPU and a separate one\n> for generating the statistics on the CPU.\n> \n> Add a new name argument to the Benchmark class descriptor and print this\n> out when printing the benchmark result.\n> \n> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>\n> ---\n>   include/libcamera/internal/software_isp/benchmark.h | 3 ++-\n>   src/libcamera/software_isp/benchmark.cpp            | 5 +++--\n>   src/libcamera/software_isp/debayer.cpp              | 3 ++-\n>   src/libcamera/software_isp/swstats_cpu.cpp          | 2 +-\n>   4 files changed, 8 insertions(+), 5 deletions(-)\n> \n> diff --git a/include/libcamera/internal/software_isp/benchmark.h b/include/libcamera/internal/software_isp/benchmark.h\n> index 46bdb86d..9c181927 100644\n> --- a/include/libcamera/internal/software_isp/benchmark.h\n> +++ b/include/libcamera/internal/software_isp/benchmark.h\n\n#include <string>\n\n\n> @@ -20,13 +20,14 @@ namespace libcamera {\n>   class Benchmark\n>   {\n>   public:\n> -\tBenchmark(const GlobalConfiguration &configuration);\n> +\tBenchmark(const GlobalConfiguration &configuration, const std::string &name);\n>   \t~Benchmark();\n>   \n>   \tvoid startFrame(void);\n>   \tvoid finishFrame(void);\n>   \n>   private:\n> +\tstd::string name_;\n>   \ttimespec frameStartTime_;\n>   \tbool measure_;\n>   \t/* Skip 30 frames for things to stabilize then measure 30 frames */\n> diff --git a/src/libcamera/software_isp/benchmark.cpp b/src/libcamera/software_isp/benchmark.cpp\n> index 4ffb6773..e0fffaba 100644\n> --- a/src/libcamera/software_isp/benchmark.cpp\n> +++ b/src/libcamera/software_isp/benchmark.cpp\n> @@ -26,8 +26,9 @@ LOG_DEFINE_CATEGORY(Benchmark)\n>   /**\n>    * \\brief Constructs a Benchmark object\n>    */\n> -Benchmark::Benchmark(const GlobalConfiguration &configuration)\n> +Benchmark::Benchmark(const GlobalConfiguration &configuration, const std::string &name)\n\n   : name_(name)\n\ninstead of\n\n>   {\n> +\tname_ = name;\n\n\n\n>   \tskipBeforeMeasure_ = configuration.option<unsigned int>(\n>   \t\t\t\t\t\t{ \"software_isp\", \"measure\", \"skip\" })\n>   \t\t\t\t\t\t\t.value_or(skipBeforeMeasure_);\n> @@ -81,7 +82,7 @@ void Benchmark::finishFrame(void)\n>   \t\tframeProcessTime_ += timeDiff(frameEndTime, frameStartTime_);\n>   \t\tif (encounteredFrames_ == skipBeforeMeasure_ + framesToMeasure_) {\n>   \t\t\tLOG(Benchmark, Info)\n> -\t\t\t\t<< \"Processed \" << framesToMeasure_\n> +\t\t\t\t<< name_ << \" processed \" << framesToMeasure_\n>   \t\t\t\t<< \" frames in \" << frameProcessTime_ / 1000 << \"us, \"\n>   \t\t\t\t<< frameProcessTime_ / (1000 * framesToMeasure_)\n>   \t\t\t\t<< \" us/frame\";\n> diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\n> index dccdd86b..a6bceb58 100644\n> --- a/src/libcamera/software_isp/debayer.cpp\n> +++ b/src/libcamera/software_isp/debayer.cpp\n> @@ -58,7 +58,8 @@ namespace libcamera {\n>   \n>   LOG_DEFINE_CATEGORY(Debayer)\n>   \n> -Debayer::Debayer(const GlobalConfiguration &configuration) : bench_(configuration)\n> +Debayer::Debayer(const GlobalConfiguration &configuration)\n> +\t: bench_(configuration, \"Debayer\")\n>   {\n>   }\n>   \n> diff --git a/src/libcamera/software_isp/swstats_cpu.cpp b/src/libcamera/software_isp/swstats_cpu.cpp\n> index 5c3011a7..1cedcfbc 100644\n> --- a/src/libcamera/software_isp/swstats_cpu.cpp\n> +++ b/src/libcamera/software_isp/swstats_cpu.cpp\n> @@ -155,7 +155,7 @@ namespace libcamera {\n>   LOG_DEFINE_CATEGORY(SwStatsCpu)\n>   \n>   SwStatsCpu::SwStatsCpu(const GlobalConfiguration &configuration)\n> -\t: sharedStats_(\"softIsp_stats\"), bench_(configuration)\n> +\t: sharedStats_(\"softIsp_stats\"), bench_(configuration, \"CPU stats\")\n>   {\n>   \tif (!sharedStats_)\n>   \t\tLOG(SwStatsCpu, Error)","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 9306FBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Feb 2026 17:44:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8C7E9621BD;\n\tWed, 11 Feb 2026 18:44:11 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 450DB620C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Feb 2026 18:44:09 +0100 (CET)","from [192.168.33.65] (185.221.141.206.nat.pool.zt.hu\n\t[185.221.141.206])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B919FC6F;\n\tWed, 11 Feb 2026 18:43:21 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"XSDd5SJm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770831801;\n\tbh=TFVs2XptQJKuXzRIn+/NnvJ38FcjXiMXUMfMbQfaSMg=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=XSDd5SJmpvQ/T6dLtXXOuZ+I807MyphhIXWdz7wUszH1MpuvdDp6LMBDGGxyP3CtE\n\tTkatlbBCmKci2TpiHpaZf3EnCRpwvmRE8VJPMJgx8L5G6AEqXGlkgkyv8CJkFQU6zo\n\tai546f5jieFCoKIsc2FjrYYG5QtYHA2cJiH8YdZ0=","Message-ID":"<3b821145-3042-471e-84b4-f815cfb60103@ideasonboard.com>","Date":"Wed, 11 Feb 2026 18:44:05 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 2/2] software_isp: benchmark: Print what is being\n\tbenchmarked","To":"Hans de Goede <johannes.goede@oss.qualcomm.com>,\n\tlibcamera-devel@lists.libcamera.org, Milan Zamazal <mzamazal@redhat.com>","References":"<20260211170037.131630-1-johannes.goede@oss.qualcomm.com>\n\t<20260211170037.131630-2-johannes.goede@oss.qualcomm.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260211170037.131630-2-johannes.goede@oss.qualcomm.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]