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)])