From patchwork Thu Oct 29 10:16:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10296 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 3D6F5BDB9B for ; Thu, 29 Oct 2020 10:16:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B6CA662882; Thu, 29 Oct 2020 11:16:40 +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="ZAD3quy6"; 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 76AFF62053 for ; Thu, 29 Oct 2020 11:16:39 +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 C135350E; Thu, 29 Oct 2020 11:16:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603966599; bh=O3StPoTnh6uOzw/zVDvToc5FbrFoF0K8z568lGQDbZE=; h=From:To:Cc:Subject:Date:From; b=ZAD3quy603LMIAHMYmyB8/K6hqkUb8lL/p+3Pv+JoOEvQ7NmqblUbZrO913S3VVjz ug9xXhZ7+hdLlP9lNmPi/TNA2tcDTTa80tKQ32185WuGdUD9NaWl24lMRHeGOBBIQ2 eeI/y6rQbkilww9ujts1fze4VYuIeasds0x8x4Dk= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 29 Oct 2020 19:16:23 +0900 Message-Id: <20201029101629.61798-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/6] 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" Implament tracing in libcamera. Add tracepoints to Request. Also add a pair of tracepoints for measuring time taken for IPA calls, and make the raspberry pi pipeline handler use them. Add a script to show how one can analyze traces programatically. The script gathers statistics on time taken for IPA calls. Add tracing documentation. Changes in v3: - add macros LIBCAMERA_TRACEPOINT_IPA_{BEGIN,END} for convenience for tracing IPA calls - this macro also makes it so that we can pass the pipeline and function name as symbols and not strings - add enum tracepoint values so we get nice enum strings in the trace output, instead of just ints - add pointer addresses to tracepoint fields so we can get addresses of objects in the trace output - upgrade the Request tracepoints - fix passing const strings into tracepoints without the need to cast - expand and fix documentation Paul Elder (6): libcamera: tracing: Implement tracing infrastructure libcamera: request: Add tracepoints tracepoints: Add pipeline tracepoints for tracing IPA calls pipeline: raspberrypi: Add IPA call tracepoints utils: tracepoints: Add simple statistics script Documentation: tracing: Add tracing guide Documentation/Doxyfile.in | 2 + Documentation/guides/tracing.rst | 140 ++++++++++++++++++ Documentation/index.rst | 1 + Documentation/meson.build | 1 + README.rst | 3 + include/libcamera/internal/meson.build | 9 ++ include/libcamera/internal/tracepoints.h.in | 62 ++++++++ .../internal/tracepoints/meson.build | 6 + .../internal/tracepoints/pipeline.tp | 25 ++++ .../libcamera/internal/tracepoints/request.tp | 90 +++++++++++ meson.build | 3 + meson_options.txt | 5 + src/libcamera/meson.build | 7 + .../pipeline/raspberrypi/raspberrypi.cpp | 9 ++ src/libcamera/request.cpp | 11 ++ src/libcamera/tracepoints.cpp | 10 ++ utils/meson.build | 1 + utils/tracepoints/analyze.py | 66 +++++++++ utils/tracepoints/gen-tp-header.py | 38 +++++ utils/tracepoints/meson.build | 5 + 20 files changed, 494 insertions(+) create mode 100644 Documentation/guides/tracing.rst create mode 100644 include/libcamera/internal/tracepoints.h.in create mode 100644 include/libcamera/internal/tracepoints/meson.build create mode 100644 include/libcamera/internal/tracepoints/pipeline.tp create mode 100644 include/libcamera/internal/tracepoints/request.tp create mode 100644 src/libcamera/tracepoints.cpp create mode 100755 utils/tracepoints/analyze.py create mode 100644 utils/tracepoints/gen-tp-header.py create mode 100644 utils/tracepoints/meson.build