From patchwork Thu Oct 29 10:16:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10297 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 6BC67BDB9B for ; Thu, 29 Oct 2020 10:16:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3B90D628AF; Thu, 29 Oct 2020 11:16:43 +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="e/cYmfpc"; 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 91235627D7 for ; Thu, 29 Oct 2020 11:16:41 +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 B029350E; Thu, 29 Oct 2020 11:16:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603966601; bh=xGWnRd/3c+6hS82EcCiEaPcdOYKJQHO2ciEoPtMC0WA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e/cYmfpcSXEtem4/pmWqOHH5hdcXdt2y8yh8Q9mp6Qe7tlhigYdCwD5lWPJxJhuoT 8fJ2Y5+gZ1ZlKVqMGmPs8DJxqbRKnb+xNyoc2IZdh1GF7uMrDVkJtwc6yCRDqhg4JP 0LB2h79EkEMsUHSCetW2NUhGER8HaTdfhe3sIIHw= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 29 Oct 2020 19:16:24 +0900 Message-Id: <20201029101629.61798-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201029101629.61798-1-paul.elder@ideasonboard.com> References: <20201029101629.61798-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/6] libcamera: tracing: Implement tracing infrastructure 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 infrastructure in libcamera. It takes .tp files, as required by lttng, and generates a tracepoint header and C file, as lttng requires. meson is updated accordingly to get it to compile with the rest of libcamera. Update the documentation accordingly. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- Changes in v3: - rename the tracepoints header generateor in meson - add protection against accidental unused variables when tracing is disabled - make gen-tp-header.py read files as utf-8 - add macros LIBCAMERA_TRACEPOINT_IPA_{BEGIN,END} Changes in v2: - move header.tmpl to tracepoints.h.in - rename meson option 'tracepoints' to 'tracing' - make sure C++ objects work in tracepoint arguments - rename generate_header.py to gen-tp-header.py --- Documentation/Doxyfile.in | 2 + README.rst | 3 + include/libcamera/internal/meson.build | 9 +++ include/libcamera/internal/tracepoints.h.in | 62 +++++++++++++++++++ .../internal/tracepoints/meson.build | 4 ++ meson.build | 3 + meson_options.txt | 5 ++ src/libcamera/meson.build | 7 +++ src/libcamera/tracepoints.cpp | 10 +++ utils/meson.build | 1 + utils/tracepoints/gen-tp-header.py | 38 ++++++++++++ utils/tracepoints/meson.build | 5 ++ 12 files changed, 149 insertions(+) create mode 100644 include/libcamera/internal/tracepoints.h.in create mode 100644 include/libcamera/internal/tracepoints/meson.build create mode 100644 src/libcamera/tracepoints.cpp create mode 100644 utils/tracepoints/gen-tp-header.py create mode 100644 utils/tracepoints/meson.build diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in index 5ccd0d05..9a7a3fb4 100644 --- a/Documentation/Doxyfile.in +++ b/Documentation/Doxyfile.in @@ -842,6 +842,8 @@ EXCLUDE = @TOP_SRCDIR@/include/libcamera/span.h \ @TOP_SRCDIR@/src/libcamera/ipa_ipc_unixsocket.cpp \ @TOP_SRCDIR@/src/libcamera/pipeline/ \ @TOP_SRCDIR@/src/libcamera/proxy/ \ + @TOP_SRCDIR@/src/libcamera/tracepoints.cpp \ + @TOP_BUILDDIR@/include/libcamera/internal/tracepoints.h \ @TOP_BUILDDIR@/include/libcamera/ipa/ \ @TOP_BUILDDIR@/src/libcamera/proxy/ diff --git a/README.rst b/README.rst index fc8f4948..5c4b6989 100644 --- a/README.rst +++ b/README.rst @@ -81,6 +81,9 @@ for gstreamer: [optional] for qcam: [optional] qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5 qttools5-dev-tools libtiff-dev +for tracing with lttng: [optional] + lttng-ust-dev python3-jinja2 + Using GStreamer plugin ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 8dd744fd..592635a9 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -1,5 +1,14 @@ # SPDX-License-Identifier: CC0-1.0 +subdir('tracepoints') + +libcamera_tracepoint_header = custom_target( + 'tp_header', + input: [ 'tracepoints.h.in', tracepoint_files ], + output: 'tracepoints.h', + command: [ gen_tracepoints_header, '@OUTPUT@', '@INPUT@' ], +) + libcamera_internal_headers = files([ 'byte_stream_buffer.h', 'camera_controls.h', diff --git a/include/libcamera/internal/tracepoints.h.in b/include/libcamera/internal/tracepoints.h.in new file mode 100644 index 00000000..830c61d7 --- /dev/null +++ b/include/libcamera/internal/tracepoints.h.in @@ -0,0 +1,62 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) {{year}}, Google Inc. + * + * tracepoints.h - Tracepoints with lttng + * + * This file is auto-generated. Do not edit. + */ +#ifndef __LIBCAMERA_INTERNAL_TRACEPOINTS_H__ +#define __LIBCAMERA_INTERNAL_TRACEPOINTS_H__ + +#if HAVE_TRACING +#define LIBCAMERA_TRACEPOINT(...) tracepoint(libcamera, __VA_ARGS__) + +#define LIBCAMERA_TRACEPOINT_IPA_BEGIN(pipe, func) \ +tracepoint(libcamera, ipa_call_begin, #pipe, #func) + +#define LIBCAMERA_TRACEPOINT_IPA_END(pipe, func) \ +tracepoint(libcamera, ipa_call_end, #pipe, #func) + +#else + +namespace { + +template +inline void unused([[maybe_unused]] Args&& ...args) +{ +} + +} /* namespace */ + +#define LIBCAMERA_TRACEPOINT(category, ...) unused(__VA_ARGS__) + +#define LIBCAMERA_TRACEPOINT_IPA_BEGIN(pipe, func) unused(#pipe, #func) + +#define LIBCAMERA_TRACEPOINT_IPA_END(pipe, func) unused(#pipe, #func) + +#endif /* HAVE_TRACING */ + +#endif /* __LIBCAMERA_INTERNAL_TRACEPOINTS_H__ */ + + +#if HAVE_TRACING + +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER libcamera + +#undef TRACEPOINT_INCLUDE +#define TRACEPOINT_INCLUDE "{{path}}" + +#if !defined(INCLUDE_LIBCAMERA_INTERNAL_TRACEPOINTS_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ) +#define INCLUDE_LIBCAMERA_INTERNAL_TRACEPOINTS_TP_H + +#include + +{{source}} + +#endif /* INCLUDE_LIBCAMERA_INTERNAL_TRACEPOINTS_TP_H */ + +#include + +#endif /* HAVE_TRACING */ diff --git a/include/libcamera/internal/tracepoints/meson.build b/include/libcamera/internal/tracepoints/meson.build new file mode 100644 index 00000000..2dd6733e --- /dev/null +++ b/include/libcamera/internal/tracepoints/meson.build @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: CC0-1.0 + +tracepoint_files = files([ +]) diff --git a/meson.build b/meson.build index e6f6c84a..55cf36e1 100644 --- a/meson.build +++ b/meson.build @@ -108,6 +108,9 @@ libcamera_includes = include_directories('include') # Sub-directories fill py_modules with their dependencies. py_modules = [] +# Libraries used by multiple components +liblttng = cc.find_library('lttng-ust', required : get_option('tracing')) + # Utilities are parsed first to provide support for other components. subdir('utils') diff --git a/meson_options.txt b/meson_options.txt index 7f7b3e59..53f2675e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -28,6 +28,11 @@ option('test', type : 'boolean', description: 'Compile and include the tests') +option('tracing', + type : 'feature', + value : 'auto', + description: 'Enable tracing (based on lttng)') + option('v4l2', type : 'boolean', value : false, diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 24f7ea3d..51925bd6 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -58,6 +58,7 @@ libcamera_sources = files([ libcamera_sources += libcamera_public_headers libcamera_sources += libcamera_generated_ipa_headers +libcamera_sources += libcamera_tracepoint_header includes = [ libcamera_includes, @@ -75,6 +76,11 @@ if libgnutls.found() config_h.set('HAVE_GNUTLS', 1) endif +if liblttng.found() + config_h.set('HAVE_TRACING', 1) + libcamera_sources += files(['tracepoints.cpp']) +endif + if libudev.found() config_h.set('HAVE_LIBUDEV', 1) libcamera_sources += files([ @@ -117,6 +123,7 @@ libcamera_deps = [ libatomic, libdl, libgnutls, + liblttng, libudev, dependency('threads'), ] diff --git a/src/libcamera/tracepoints.cpp b/src/libcamera/tracepoints.cpp new file mode 100644 index 00000000..0173b75a --- /dev/null +++ b/src/libcamera/tracepoints.cpp @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2020, Google Inc. + * + * tracepoints.cpp - Tracepoints with lttng + */ +#define TRACEPOINT_CREATE_PROBES +#define TRACEPOINT_DEFINE + +#include "libcamera/internal/tracepoints.h" diff --git a/utils/meson.build b/utils/meson.build index 383d5285..8e28ada7 100644 --- a/utils/meson.build +++ b/utils/meson.build @@ -2,6 +2,7 @@ subdir('ipc') subdir('ipu3') +subdir('tracepoints') ## Code generation py_modules += ['yaml'] diff --git a/utils/tracepoints/gen-tp-header.py b/utils/tracepoints/gen-tp-header.py new file mode 100644 index 00000000..9500e474 --- /dev/null +++ b/utils/tracepoints/gen-tp-header.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2020, Google Inc. +# +# Author: Paul Elder +# +# gen-tp-header.py - Generate header file to contain lttng tracepoints + +import datetime +import jinja2 +import os +import sys + +def main(argv): + if len(argv) < 3: + print(f'Usage: {argv[0]} output template tp_files...') + return 1 + + output = argv[1] + template = argv[2] + + year = datetime.datetime.now().year + path = output.replace('include/', '', 1) + + source = '' + for fname in argv[3:]: + source += open(fname, 'r', encoding='utf-8').read() + '\n\n' + + template = jinja2.Template(open(template, 'r').read()) + string = template.render(year=year, path=path, source=source) + + f = open(output, 'w').write(string) + + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/utils/tracepoints/meson.build b/utils/tracepoints/meson.build new file mode 100644 index 00000000..807230fc --- /dev/null +++ b/utils/tracepoints/meson.build @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: CC0-1.0 + +py_modules += ['jinja2'] + +gen_tracepoints_header = find_program('./gen-tp-header.py') From patchwork Thu Oct 29 10:16:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10298 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 4285EBDB9B for ; Thu, 29 Oct 2020 10:16:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0F894628CA; Thu, 29 Oct 2020 11:16:46 +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="MG3S3qZP"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 04875627D7 for ; Thu, 29 Oct 2020 11:16:44 +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 EDB8750E; Thu, 29 Oct 2020 11:16:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603966603; bh=3eqqcxqeH2Jvk7Zx/jETZOyuKYpmbmxPiz8Al5x2Los=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MG3S3qZP1FubdIsJaBAcd98HFV+W4Fs9CYr4EvTbua/v8794ghGHD2IzJSu7vv8Z8 gPWrep6GKhpY3/fxarqqcCIbxzKGWbEPeV5gJ6i9B+qiio0bkXZATwS0Vu/3CFLElp bPGRChwiwvjLSnQrEqaaAL9Va3Xb2EOhz0Mqx9O8= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 29 Oct 2020 19:16:25 +0900 Message-Id: <20201029101629.61798-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201029101629.61798-1-paul.elder@ideasonboard.com> References: <20201029101629.61798-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/6] libcamera: request: Add tracepoints 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" Add and use tracepoints in Request. Requests are core to libcamera operation, thus detecting delays in their processing is important, and serves as a good usage example of tracepoints. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- I wasn't sure what the best way to handle the FrameBuffer enum in the tp file... should it go in a separate file? Will we ever need to use the FrameBuffer status enum in other tracepoints? If we do, it can't be defined multiple times, so it'll have to go in its own tp file, and in the meson tp file list it will have to go first. I guess that's the drawback of concating all the tp files together... Changes in v3: - expand the changelog - add enum tracepoint values so that request status and buffer status are strings instead of ints in the trace - remove cancelled from all request tracepoints, except complete_buffer - expand the complete_buffer tracepoint to include information on the buffer - display the address of the request in all tracepoints - remove tracepoints for add_buffer and find_buffer Changes in v2: - remove tracepoints from uvcvideo - remove comment in changelog that this is only used for demonstration - use Request pointers instead of feeding the fields manually to the tracepoint --- .../internal/tracepoints/meson.build | 1 + .../libcamera/internal/tracepoints/request.tp | 90 +++++++++++++++++++ src/libcamera/request.cpp | 11 +++ 3 files changed, 102 insertions(+) create mode 100644 include/libcamera/internal/tracepoints/request.tp diff --git a/include/libcamera/internal/tracepoints/meson.build b/include/libcamera/internal/tracepoints/meson.build index 2dd6733e..8410c205 100644 --- a/include/libcamera/internal/tracepoints/meson.build +++ b/include/libcamera/internal/tracepoints/meson.build @@ -1,4 +1,5 @@ # SPDX-License-Identifier: CC0-1.0 tracepoint_files = files([ + 'request.tp', ]) diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp new file mode 100644 index 00000000..92308dcd --- /dev/null +++ b/include/libcamera/internal/tracepoints/request.tp @@ -0,0 +1,90 @@ +#include +#include + +TRACEPOINT_ENUM( + libcamera, + request_status, + TP_ENUM_VALUES( + ctf_enum_value("RequestPending", 0) + ctf_enum_value("RequestComplete", 1) + ctf_enum_value("RequestCancelled", 2) + ) +) + +TRACEPOINT_ENUM( + libcamera, + buffer_status, + TP_ENUM_VALUES( + ctf_enum_value("FrameSuccess", 0) + ctf_enum_value("FrameError", 1) + ctf_enum_value("FrameCancelled", 2) + ) +) + +TRACEPOINT_EVENT_CLASS( + libcamera, + request, + TP_ARGS( + libcamera::Request *, req + ), + TP_FIELDS( + ctf_integer_hex(uintptr_t, request, reinterpret_cast(req)) + ctf_integer(uint64_t, cookie, req->cookie()) + ctf_enum(libcamera, request_status, uint32_t, status, req->status()) + ) +) + +TRACEPOINT_EVENT_INSTANCE( + libcamera, + request, + request_construct, + TP_ARGS( + libcamera::Request *, req + ) +) + +TRACEPOINT_EVENT_INSTANCE( + libcamera, + request, + request_destroy, + TP_ARGS( + libcamera::Request *, req + ) +) + +TRACEPOINT_EVENT_INSTANCE( + libcamera, + request, + request_reuse, + TP_ARGS( + libcamera::Request *, req + ) +) + +TRACEPOINT_EVENT_INSTANCE( + libcamera, + request, + request_complete, + TP_ARGS( + libcamera::Request *, req + ) +) + + +TRACEPOINT_EVENT( + libcamera, + request_complete_buffer, + TP_ARGS( + libcamera::Request *, req, + int, cancelled, + libcamera::FrameBuffer *, buf + ), + TP_FIELDS( + ctf_integer_hex(uintptr_t, request, reinterpret_cast(req)) + ctf_integer(uint64_t, cookie, req->cookie()) + ctf_integer(int, status, req->status()) + ctf_integer(int, cancelled, cancelled) + ctf_integer_hex(uintptr_t, buffer, reinterpret_cast(buf)) + ctf_enum(libcamera, buffer_status, uint32_t, buf_status, buf->metadata().status) + ) +) diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index ae8b1660..d1b43697 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -16,6 +16,7 @@ #include "libcamera/internal/camera_controls.h" #include "libcamera/internal/log.h" +#include "libcamera/internal/tracepoints.h" /** * \file request.h @@ -85,10 +86,14 @@ Request::Request(Camera *camera, uint64_t cookie) * \todo: Add a validator for metadata controls. */ metadata_ = new ControlList(controls::controls); + + LIBCAMERA_TRACEPOINT(request_construct, this); } Request::~Request() { + LIBCAMERA_TRACEPOINT(request_destroy, this); + delete metadata_; delete controls_; delete validator_; @@ -106,6 +111,8 @@ Request::~Request() */ void Request::reuse(ReuseFlag flags) { + LIBCAMERA_TRACEPOINT(request_reuse, this); + pending_.clear(); if (flags & ReuseBuffers) { for (auto pair : bufferMap_) { @@ -259,6 +266,8 @@ void Request::complete() LOG(Request, Debug) << "Request has completed - cookie: " << cookie_ << (cancelled_ ? " [Cancelled]" : ""); + + LIBCAMERA_TRACEPOINT(request_complete, this); } /** @@ -276,6 +285,8 @@ void Request::complete() */ bool Request::completeBuffer(FrameBuffer *buffer) { + LIBCAMERA_TRACEPOINT(request_complete_buffer, this, cancelled_, buffer); + int ret = pending_.erase(buffer); ASSERT(ret == 1); From patchwork Thu Oct 29 10:16:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10299 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 A5F16BDB9B for ; Thu, 29 Oct 2020 10:16:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 74FA3628A5; Thu, 29 Oct 2020 11:16:47 +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="G6A0HhP4"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 26B39628D2 for ; Thu, 29 Oct 2020 11:16:46 +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 692AF50E; Thu, 29 Oct 2020 11:16:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603966605; bh=rf6yf+MG3GNKVkI4ie9nH1MXpfgFJfPyAFzcWq5NiQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G6A0HhP4gfJ5KtUvL+aImxJs3E8edZFJ9fqZACOm/jyEpqb5Mvtd9zyobaVi0g/dx GttKKJLiq6uIuRAuEz+gHUmE8as86bzHbJBy2SeLN8f1ahVq/wv4gcriuYbn1BZtoT 0p+jB7RxPI9VoGVh8KUUCWU2PlJ4FovtL7B0PhyU= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 29 Oct 2020 19:16:26 +0900 Message-Id: <20201029101629.61798-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201029101629.61798-1-paul.elder@ideasonboard.com> References: <20201029101629.61798-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 3/6] tracepoints: Add pipeline tracepoints for tracing 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" Add a pair of tracepoints to a general pipeline tracepoints file, libcamera:ipa_call_start and libcamera:ipa_call_finish, to trace IPA calls. This allows us to obtain the time taken for the IPA call. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v3: - rename the ipa tracepoints to ipa_call_begin and ipa_call_end - make string args const, so that strings can be passed directly New in v2 --- .../internal/tracepoints/meson.build | 1 + .../internal/tracepoints/pipeline.tp | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 include/libcamera/internal/tracepoints/pipeline.tp diff --git a/include/libcamera/internal/tracepoints/meson.build b/include/libcamera/internal/tracepoints/meson.build index 8410c205..a34135ce 100644 --- a/include/libcamera/internal/tracepoints/meson.build +++ b/include/libcamera/internal/tracepoints/meson.build @@ -1,5 +1,6 @@ # SPDX-License-Identifier: CC0-1.0 tracepoint_files = files([ + 'pipeline.tp', 'request.tp', ]) diff --git a/include/libcamera/internal/tracepoints/pipeline.tp b/include/libcamera/internal/tracepoints/pipeline.tp new file mode 100644 index 00000000..c0a94635 --- /dev/null +++ b/include/libcamera/internal/tracepoints/pipeline.tp @@ -0,0 +1,25 @@ +TRACEPOINT_EVENT( + libcamera, + ipa_call_begin, + TP_ARGS( + const char *, pipe, + const char *, func + ), + TP_FIELDS( + ctf_string(pipeline_name, pipe) + ctf_string(function_name, func) + ) +) + +TRACEPOINT_EVENT( + libcamera, + ipa_call_end, + TP_ARGS( + const char *, pipe, + const char *, func + ), + TP_FIELDS( + ctf_string(pipeline_name, pipe) + ctf_string(function_name, func) + ) +) From patchwork Thu Oct 29 10:16:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10300 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 03E79BDB9B for ; Thu, 29 Oct 2020 10:16:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C72AD6288A; Thu, 29 Oct 2020 11:16:49 +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="uC5mg+nt"; 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 257A3627D7 for ; Thu, 29 Oct 2020 11:16:48 +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 95C1C527; Thu, 29 Oct 2020 11:16:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603966607; bh=vi3OxJ67/22U5qV+aplWDOAjaP8lkXS29F/BZF83+Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uC5mg+ntjrO5eGvdEyS7hnywhDeLckq6EfSdaWX9t+qjnE1V/U2zId3TefhB/jRsL m4rfK+IZhSOzaILlSO0AOlIyF2PQKmI4T1oRERCpu204ToOZxYYU4oRLOzn+RIpVu2 Q4YVClquGApkGxO+SPU4bSIWgC/blfieaoM1qN1w= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 29 Oct 2020 19:16:27 +0900 Message-Id: <20201029101629.61798-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201029101629.61798-1-paul.elder@ideasonboard.com> References: <20201029101629.61798-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/6] pipeline: raspberrypi: Add IPA call tracepoints 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" Emit tracepoints for IPA calls in the raspberrypi pipeline handler, to allow profiling of IPA calls. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v3: - rename the tracepoints to ipa_call_begin and ipa_call_end - remove the char * casts for the strings passed to the tracepoints - use the new ipa call tracepoint macros New in v2 --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 0a5a7288..07c9c25a 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -31,6 +31,7 @@ #include "libcamera/internal/ipa_manager.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/pipeline_handler.h" +#include "libcamera/internal/tracepoints.h" #include "libcamera/internal/utils.h" #include "libcamera/internal/v4l2_controls.h" #include "libcamera/internal/v4l2_videodevice.h" @@ -1240,6 +1241,8 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList &controls) { + LIBCAMERA_TRACEPOINT_IPA_END(rpi, signalStatReady); + if (state_ == State::Stopped) handleState(); @@ -1273,6 +1276,8 @@ void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList & void RPiCameraData::runIsp(uint32_t bufferId) { + LIBCAMERA_TRACEPOINT_IPA_END(rpi, signalIspPrepare); + if (state_ == State::Stopped) handleState(); @@ -1406,6 +1411,7 @@ void RPiCameraData::ispOutputDequeue(FrameBuffer *buffer) * application until after the IPA signals so. */ if (stream == &isp_[Isp::Stats]) { + LIBCAMERA_TRACEPOINT_IPA_BEGIN(rpi, signalStatReady); ipa_->signalStatReady(RPi::BufferMask::STATS | static_cast(index)); } else { /* Any other ISP output can be handed back to the application now. */ @@ -1658,7 +1664,9 @@ void RPiCameraData::tryRunPipeline() * queue the ISP output buffer listed in the request to start the HW * pipeline. */ + LIBCAMERA_TRACEPOINT_IPA_BEGIN(rpi, signalQueueRequest); ipa_->signalQueueRequest(request->controls()); + LIBCAMERA_TRACEPOINT_IPA_END(rpi, signalQueueRequest); /* Ready to use the buffers, pop them off the queue. */ bayerQueue_.pop(); @@ -1677,6 +1685,7 @@ void RPiCameraData::tryRunPipeline() ipa::rpi::IspPreparePayload ispPrepare; ispPrepare.embeddedbufferId_ = RPi::BufferMask::EMBEDDED_DATA | embeddedId; ispPrepare.bayerbufferId_ = RPi::BufferMask::BAYER_DATA | bayerId; + LIBCAMERA_TRACEPOINT_IPA_BEGIN(rpi, signalIspPrepare); ipa_->signalIspPrepare(ispPrepare); } From patchwork Thu Oct 29 10:16:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10301 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 71335BDB9B for ; Thu, 29 Oct 2020 10:16:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3F5046289D; Thu, 29 Oct 2020 11:16: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="Xsd2XpnZ"; 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 EFA9B628BF for ; Thu, 29 Oct 2020 11:16:49 +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 8383A527; Thu, 29 Oct 2020 11:16:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603966609; bh=PpjVvGziD0VNQq6Y8hEJvtg3OTTrnFtQxH9dJCSGwdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xsd2XpnZMBzkLDtWg7m8/I9Yyr7OvNAUlVJtwHA7ByNjQH9THr+KHAQ+8fGWBBw79 S/s+XOuAC+tGBwxXircWGMt1D2LvJ0nskX5KcpVLTpaYr/Wzn0Psryp3ho64PeylIO 6Y0gjcp5ApTppzui/jkHkJTm5/Wlvk2lgkUyhcx8= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 29 Oct 2020 19:16:28 +0900 Message-Id: <20201029101629.61798-6-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201029101629.61798-1-paul.elder@ideasonboard.com> References: <20201029101629.61798-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 5/6] utils: tracepoints: Add simple statistics script 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" Add a script that scans a trace for IPA call tracepoints, and returns statistics on the time taken for IPA calls. Signed-off-by: Paul Elder --- I'll fix output indentation in the next version. Changes in v3: - check for the new tracepoint names, ipa_call_begin and ipa_call_end - fix babeltrace2 parsing in the case that the event doesn't have a pipeline_name field - change script description - add argparse description - add example for trace_path argument - change double quotes to single quotes New in v2 --- utils/tracepoints/analyze.py | 66 ++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 utils/tracepoints/analyze.py diff --git a/utils/tracepoints/analyze.py b/utils/tracepoints/analyze.py new file mode 100755 index 00000000..43da9b1f --- /dev/null +++ b/utils/tracepoints/analyze.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2020, Google Inc. +# +# Author: Paul Elder +# +# analyze.py - Example of how to extract information from libcamera lttng traces + +import argparse +import bt2 +import statistics as stats +import sys + +# pipeline -> {function -> stack(timestamps)} +timestamps = {} + +# pipeline:function -> samples[] +samples = {} + +def main(argv): + parser = argparse.ArgumentParser( + description='A simple analysis script to get statistics on time taken for IPA calls') + parser.add_argument('-p', '--pipeline', type=str, + help='Name of pipeline to filter for') + parser.add_argument('trace_path', type=str, + help='Path to lttng trace (eg. ~/lttng-traces/demo-20201029-184003)') + args = parser.parse_args(argv[1:]) + + traces = bt2.TraceCollectionMessageIterator(args.trace_path) + for msg in traces: + if type(msg) is not bt2._EventMessageConst or \ + 'pipeline_name' not in msg.event.payload_field or \ + (args.pipeline is not None and \ + msg.event.payload_field['pipeline_name'] != args.pipeline): + continue + + pipeline = msg.event.payload_field['pipeline_name'] + event = msg.event.name + func = msg.event.payload_field['function_name'] + timestamp_ns = msg.default_clock_snapshot.ns_from_origin + + if event == 'libcamera:ipa_call_begin': + if pipeline not in timestamps: + timestamps[pipeline] = {} + if func not in timestamps[pipeline]: + timestamps[pipeline][func] = [] + timestamps[pipeline][func].append(timestamp_ns) + + if event == 'libcamera:ipa_call_end': + ts = timestamps[pipeline][func].pop() + key = f'{pipeline}:{func}' + if key not in samples: + samples[key] = [] + samples[key].append(timestamp_ns - ts) + + print('pipeline:function\t:\tmin\tmax\tmean\tstddev') + for k, v in samples.items(): + mean = int(stats.mean(v)) + stddev = int(stats.stdev(v)) + minv = min(v) + maxv = max(v) + print(f'{k}\t:\t{minv}\t{maxv}\t{mean}\t{stddev}') + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) From patchwork Thu Oct 29 10:16:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10302 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 D92F7BDB9B for ; Thu, 29 Oct 2020 10:16:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A643A628CE; Thu, 29 Oct 2020 11:16:53 +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="jP5WCARN"; 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 CADD362053 for ; Thu, 29 Oct 2020 11:16: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 5A598576; Thu, 29 Oct 2020 11:16:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603966611; bh=7WEBy7EFgLRC53y9bbenLESDUZD1JGsest6VoxhBnPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jP5WCARNS4wzSmq3LQxI7ZYbZFwkQsdbJBOmczwKMBPpyPgB3wodrUiV0NjoAaIKi eXnmv7DwGbkDZnWnVddzhhCJQPqwoeWwWrS8BTH+XHbmb5/rI6nVzdzWAqJOFTWI2k tYTJ9vx0yxj4sOvDGNaaTT9cuhdptcXIx1epTr9k= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 29 Oct 2020 19:16:29 +0900 Message-Id: <20201029101629.61798-7-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201029101629.61798-1-paul.elder@ideasonboard.com> References: <20201029101629.61798-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 6/6] Documentation: tracing: Add tracing guide 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" Add guide for tracepoints, including how to define and use them. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v3: - fix compilation error - reword english - add stuff about the new IPA call tracepoint macros New in v2 --- Documentation/guides/tracing.rst | 140 +++++++++++++++++++++++++++++++ Documentation/index.rst | 1 + Documentation/meson.build | 1 + 3 files changed, 142 insertions(+) create mode 100644 Documentation/guides/tracing.rst diff --git a/Documentation/guides/tracing.rst b/Documentation/guides/tracing.rst new file mode 100644 index 00000000..8c59e7ed --- /dev/null +++ b/Documentation/guides/tracing.rst @@ -0,0 +1,140 @@ +.. SPDX-License-Identifier: CC-BY-SA-4.0 + +Tracing Guide +============= + +Guide to tracing in libcamera. + +Profiling vs Tracing +-------------------- + +Tracing is recording timestamps at specific locations. libcamera provides a +tracing facility. This guide shows how to use this tracing facility. + +Tracing should not be confused with profiling, which samples execution +at periodic points in time. This can be done with other tools such as +callgrind, perf, gprof, etc., without modification to the application, +and is out of scope for this guide. + +Compiling +--------- + +To compile libcamera with tracing support, it must be enabled through the +meson ``tracing`` option. It depends on the lttng-ust library (available in the +``liblttng-ust-dev`` package for Debian-based distributions). +By default the tracing option in meson is set to ``auto``, so if +liblttng is detected, it will be enabled by default. Conversely, if the option +is set to disabled, then libcamera will be compiled without tracing support. + +Defining tracepoints +-------------------- + +The first of two steps to using tracepoints is to define the tracepoints. + +Create a file ``include/libcamera/internal/tracepoints/{file}.tp``, where +``file`` is a reasonable name related to the category of tracepoints that +you wish to define. For example, a tracepoints file for the Request object +would be called ``request.tp``. An entry for this file must be added in +``include/libcamera/internal/tracepoints/meson.build``. + +In this tracepoints file, define your tracepoints `as mandated by lttng +`_. The header boilerplate must *not* be +included (as it will conflict with the rest of our infrastructure), and +only the tracepoint definitions (with the ``TRACEPOINT_*`` macros) should be +included. + +All tracepoint providers shall be ``libcamera``. According to lttng, the +tracepoint provider should be per-project; this is the rationale for this +decision. To group tracepoint events, we recommend using +``{class_name}_{tracepoint_name}``, for example, ``request_construct`` for a +tracepoint for the constructor of the Request class. + +Tracepoint arguments may take C++ objects pointers, in which case the usual +C++ namespacing rules apply. The header that contains the necessary class +definitions must be included at the top of the tracepoint provider file. + +Note: the final parameter in ``TP_ARGS`` *must not* have a trailing comma, and +the parameters to ``TP_FIELDS`` are *space-separated*. Not following these will +cause compilation errors. + +Using tracepoints (in libcamera) +-------------------------------- + +To use tracepoints in libcamera, first the header needs to be included: + +``#include "libcamera/internal/tracepoints.h"`` + +Then to use the tracepoint: + +``LIBCAMERA_TRACEPOINT({tracepoint_event}, args...)`` + +This macro must be used, as opposed to lttng's macros directly, because +lttng is an optional dependency of libcamera, so the code must compile and run +even when lttng is not present or when tracing is disabled. + +The tracepoint provider name, as declared in the tracepoint definition, is not +included in the parameters of the tracepoint. + +There are also two special tracepoints available for tracing IPA calls: + +``LIBCAMERA_TRACEPOINT_IPA_BEGIN({pipeline_name}, {ipa_function})`` + +``LIBCAMERA_TRACEPOINT_IPA_END({pipeline_name}, {ipa_function})`` + +These shall be placed where an IPA function is called from the pipeline handler, +and when the pipeline handler receives the corresponding response from the IPA, +respecively. These are the tracepoints that our sample analysis script +(see "Analyzing a trace") scans for when computing statistics on IPA call time. + +Using tracepoints (from an application) +--------------------------------------- + +As applications are not part of libcamera, but rather users of libcamera, +applications should seek their own tracing mechanisms. For ease of tracing +the application alongside tracing libcamera, it is recommended to also +`use lttng `_. + +Using tracepoints (from closed-source IPA) +------------------------------------------ + +Similar to applications, closed-source IPAs can simply use lttng on their own, +or any other tracing mechanism if desired. + +Collecting a trace +------------------ + +A trace can be collected fairly simply from lttng: + +.. code-block:: bash + + lttng create $SESSION_NAME + lttng enable-event -u libcamera:\* + lttng start + # run libcamera application + lttng stop + lttng view + lttng destroy $SESSION_NAME + +See the `lttng documentation `_ for further details. + +Analyzing a trace +----------------- + +As mentioned above, while an lttng tracing session exists and the trace is not +running, the trace output can be viewd as text by ``lttng view``. + +The trace log can also be viewed as text using babeltrace2. See the +`lttng trace analysis documentation `_ +for further details. + +babeltrace2 also has a C API and python bindings that can be used to process +traces. See the +`lttng python bindings documentation `_ +and the +`lttng C API documentation `_ +for more details. + +As an example, there is a script ``utils/tracepoints/analyze.py`` that gathers +statistics for the time taken for an IPA function call, by measuring the time +difference between pairs of events ``libcamera:ipa_call_start`` and +``libcamera:ipa_call_finish``. diff --git a/Documentation/index.rst b/Documentation/index.rst index 173c326f..8bc8922e 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -17,3 +17,4 @@ Application Writer's Guide Pipeline Handler Writer's Guide IPA Writer's guide + Tracing guide diff --git a/Documentation/meson.build b/Documentation/meson.build index f2300dac..17f3b9d7 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -55,6 +55,7 @@ if sphinx.found() 'guides/ipa.rst', 'guides/application-developer.rst', 'guides/pipeline-handler.rst', + 'guides/tracing.rst', ] release = 'release=v' + libcamera_git_version