From patchwork Fri Oct 30 08:57:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10305 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 0D9F7BDB1E for ; Fri, 30 Oct 2020 08:58:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8631062979; Fri, 30 Oct 2020 09:58:05 +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="dF49LWpU"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F4DA62034 for ; Fri, 30 Oct 2020 09:58:04 +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 93B2D9B7; Fri, 30 Oct 2020 09:58:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1604048283; bh=jL9sQPk9snXWXusgSQ8CiD8Bse+FzMqkdC3UKFFXiOQ=; h=From:To:Cc:Subject:Date:From; b=dF49LWpUElHX8HcS1f5GSuAAPgYb6H4qkGD7G0nd6agd++ZLX7C/JvjTB4dDJ7aTI m3sJVuKZrJ9bP/rY9+EoZLu/aOQxLjWYW2EjQ7iDbkptKfZnxGBHCz0k0UmWfimzCT 9lmSpGk0e8A+oPWTupwUYMUg/6p2eRiExf2INZIs= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 30 Oct 2020 17:57:51 +0900 Message-Id: <20201030085756.79329-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/5] 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" Implement tracing in libcamera. Add tracepoints to Request. Also add a pair of tracepoints for measuring time taken for IPA calls. Add a script to show how one can analyze traces programatically. The script gathers statistics on time taken for IPA calls. Add tracing documentation. Since this series is intended to be merged before IPC, but the raspberry pi tracepoint emission for measure IPA call time depends on the IPC series, that patch has been broken off (v4). Changes in v4: - rebase on master instead of IPC - move enum tp definitions to their own files - they need to be concated and won't work with #include with include guards - broke out the raspeberry pi tracepoint emission to separate patch, intended to be merged after IPC (I'll probably just append it to the IPC series) - cosmetic changes 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 (5): libcamera: tracing: Implement tracing infrastructure libcamera: request: Add tracepoints tracepoints: Add pipeline tracepoints for tracing IPA calls utils: tracepoints: Add simple statistics script Documentation: tracing: Add tracing guide Documentation/Doxyfile.in | 4 +- Documentation/guides/tracing.rst | 141 ++++++++++++++++++ Documentation/index.rst | 1 + Documentation/meson.build | 1 + README.rst | 3 + include/libcamera/internal/meson.build | 9 ++ include/libcamera/internal/tracepoints.h.in | 61 ++++++++ .../internal/tracepoints/buffer_enums.tp | 9 ++ .../internal/tracepoints/meson.build | 10 ++ .../internal/tracepoints/pipeline.tp | 25 ++++ .../libcamera/internal/tracepoints/request.tp | 68 +++++++++ .../internal/tracepoints/request_enums.tp | 9 ++ meson.build | 3 + meson_options.txt | 5 + src/libcamera/meson.build | 7 + src/libcamera/request.cpp | 11 ++ src/libcamera/tracepoints.cpp | 10 ++ utils/meson.build | 1 + utils/tracepoints/analyze-ipa-trace.py | 77 ++++++++++ utils/tracepoints/gen-tp-header.py | 38 +++++ utils/tracepoints/meson.build | 5 + 21 files changed, 497 insertions(+), 1 deletion(-) create mode 100644 Documentation/guides/tracing.rst create mode 100644 include/libcamera/internal/tracepoints.h.in create mode 100644 include/libcamera/internal/tracepoints/buffer_enums.tp 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 include/libcamera/internal/tracepoints/request_enums.tp create mode 100644 src/libcamera/tracepoints.cpp create mode 100755 utils/tracepoints/analyze-ipa-trace.py create mode 100644 utils/tracepoints/gen-tp-header.py create mode 100644 utils/tracepoints/meson.build