From patchwork Wed Feb 17 09:29:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11316 X-Patchwork-Delegate: paul.elder@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 E42EBBD1F1 for ; Wed, 17 Feb 2021 09:29:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 69CD4637FD; Wed, 17 Feb 2021 10:29:52 +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="GfgUs3M0"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A6966602F9 for ; Wed, 17 Feb 2021 10:29:51 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1D9D48C4; Wed, 17 Feb 2021 10:29:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613554191; bh=EIqhrsi5Z/y8QQh/z2INovpIWM4lGK1q7IF6HUhy5z0=; h=From:To:Cc:Subject:Date:From; b=GfgUs3M0WVGGMmqpcMEwg78f7SsYjgnvoK7x6jQQaYFeqk5Y7LmaWaH6WkAHhtGHn +9EWsRoEQ2IeZmAgBiP2nMYzoIGzRm5iIRwz1/ju2jKVAKO5liNzVhvdbPx9BBuZPa jcy0bEoIRnWgNV4HGFMjYV6ctWQo5kRgAhNvmwI8= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 17 Feb 2021 18:29:36 +0900 Message-Id: <20210217092937.17167-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] utils: ipc: Generate tracepoints for IPA calls 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" To ease benchmarking IPA calls, automatically generate tracepoints for IPA calls in the IPAProxy. Signed-off-by: Paul Elder --- .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl index ba34a361..5e0d3976 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl @@ -33,6 +33,7 @@ #include "libcamera/internal/log.h" #include "libcamera/internal/process.h" #include "libcamera/internal/thread.h" +#include "libcamera/internal/tracepoints.h" namespace libcamera { @@ -125,6 +126,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data) {% for method in interface_main.methods %} {{proxy_funcs.func_sig(proxy_name, method)}} { + LIBCAMERA_TRACEPOINT_IPA_BEGIN({{module_name}}, {{method.mojom_name}}); if (isolate_) {{"return " if method|method_return_value != "void"}}{{method.mojom_name}}IPC( {%- for param in method|method_param_names -%} @@ -137,6 +139,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data) {{param}}{{- ", " if not loop.last}} {%- endfor -%} ); + LIBCAMERA_TRACEPOINT_IPA_END({{module_name}}, {{method.mojom_name}}); } {{proxy_funcs.func_sig(proxy_name, method, "Thread")}} From patchwork Wed Feb 17 09:29:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11317 X-Patchwork-Delegate: paul.elder@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 03B4BBD1F1 for ; Wed, 17 Feb 2021 09:29:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C48BC637FA; Wed, 17 Feb 2021 10:29:54 +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="hrFjpYFf"; 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 9251B637FA for ; Wed, 17 Feb 2021 10:29:53 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EB3718C4; Wed, 17 Feb 2021 10:29:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613554193; bh=SU8/E068vHsuNjFU0poZ7rITK9w2vs+6KmVek7pZxIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hrFjpYFfeDuDvVwFKAmTTA+zuu14VFtqWyAE0jUrFdg8Mr8wnSEmDVFCRpc/CucmH N6NBg/XQd43VgLNra2K/CbmtXHpyc4VaAhHAVn8Q9N/MXfl+ZL5o+X9Qi5VXABmxad iidz4M7auqah8tKVpHvhoiM0nZXzsybvKDubpx20= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 17 Feb 2021 18:29:37 +0900 Message-Id: <20210217092937.17167-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210217092937.17167-1-paul.elder@ideasonboard.com> References: <20210217092937.17167-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] utils: tracepoints: ipa call analyzer: Fix std dev calculation for single value 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" Some IPA calls might only be called once, such as configure(), start(), stop(), etc. This causes the analyzer to break as stddev() on a single value is invalid. Set the stddev to zero if there is only one datapoint. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- utils/tracepoints/analyze-ipa-trace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/tracepoints/analyze-ipa-trace.py b/utils/tracepoints/analyze-ipa-trace.py index 50fbbf42..cd7e9ffc 100755 --- a/utils/tracepoints/analyze-ipa-trace.py +++ b/utils/tracepoints/analyze-ipa-trace.py @@ -58,7 +58,7 @@ def main(argv): rows.append(['pipeline:function', 'min', 'max', 'mean', 'stddev']) for k, v in samples.items(): mean = int(stats.mean(v)) - stddev = int(stats.stdev(v)) + stddev = int(stats.stdev(v)) if len(v) > 1 else 0 minv = min(v) maxv = max(v) rows.append([k, str(minv), str(maxv), str(mean), str(stddev)])