Show a patch.

GET /api/1.1/patches/16221/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 16221,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16221/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16221/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20220615142051.450396-2-chenghaoyang@google.com>",
    "date": "2022-06-15T14:20:51",
    "name": "[libcamera-devel,1/1] Use tracing with perfetto in ChromeOS",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "25d74725c5b2c4414611f714da0c6641f4e5ae15",
    "submitter": {
        "id": 117,
        "url": "https://patchwork.libcamera.org/api/1.1/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16221/mbox/",
    "series": [
        {
            "id": 3175,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3175/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3175",
            "date": "2022-06-15T14:20:50",
            "name": "Use tracing with perfetto in ChromeOS",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3175/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16221/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16221/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3925DC3273\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Jun 2022 14:21:07 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B19A965631;\n\tWed, 15 Jun 2022 16:21:06 +0200 (CEST)",
            "from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com\n\t[IPv6:2607:f8b0:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D2BD865633\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jun 2022 16:21:03 +0200 (CEST)",
            "by mail-pf1-x42d.google.com with SMTP id y196so11587959pfb.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Jun 2022 07:21:03 -0700 (PDT)",
            "from chenghaoyang-low.c.googlers.com.com\n\t(21.160.199.104.bc.googleusercontent.com. [104.199.160.21])\n\tby smtp.gmail.com with ESMTPSA id\n\tg1-20020a17090adac100b001e67e01158fsm1840882pjx.30.2022.06.15.07.21.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 15 Jun 2022 07:21:01 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655302866;\n\tbh=nMAc1j8FJs0JjYhAp4E87/F6jWd21tyVB9y7m1p01eI=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=wGjUIuxx/BBPklqPl68Hh0Y0hL0KgoENaAVR3B9W/YkZqnyGlIs2hFC0Nv4eeM5QQ\n\tqcb18ABveV9nyMZ4pwAnUBbXWzmonqC/RbAucILkkhPCH+pRAHH594Lv4Prb/7gLZj\n\tGklXZKeGRdY7V18VkomXwwcOmcHTl2LbhZpNa8RFaB/LMKOmO4XcJXP9xRvBO0Q/IM\n\tT/5I/85crIue1hf3yPe06d0BH4rNmDfk3lDg5cr0tKoCfiDX40IYkTdsmmb0TDXIpk\n\t1fZUzoAtldfulqnwcq4vTcdZVxlNBgB6ROixzeeW6/IrfS3yST9Yz6+2ZjOFyf5Vy5\n\tzEYQWYfjUNctw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=9OLAcsVCzHt8jCzrhRnAiGvEAXSX5xpHVInwaeywD3g=;\n\tb=PqVeCXxTB8I8JaICnVAMIq/QYsR5r3vViC2KNLID/M2u4QTu+EmeDqdymRjTGko4Pk\n\tTLqmvNQLH6b1QuxtX1GrVqcC7NIxKZMh+L/vjJUIDlI93FBJYBhc69pxafCaO+uWUicA\n\tOrLl6qf55Qu8RPZ+9QC/97IUgVZNSJ5en+y90="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"PqVeCXxT\"; \n\tdkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=9OLAcsVCzHt8jCzrhRnAiGvEAXSX5xpHVInwaeywD3g=;\n\tb=XJj3ugH5pTwHqsLTw0qXR9RaVHalHll8AtoIQFVgGg/KhH+07IVDRWDAKVLH9l2KqH\n\tkyJdkG4UxXFCrxZTsG7Mi3BntS8XPSOdC3xxYUDKl+W/0bIOWE/Bs0N8OSpXByt+FkO0\n\tGWf0fnxBUiD6HnfesD6Z6qTb2B+8E8dbT8E0RMhsRT1atLRxKI65THWMDwLijH82UI9J\n\tQldnrHGCKoyHs0e61pmaFP5ihz2zjq/0PDmoYseoWAJKzrXw32C0XP5WbOsk/XqYDChd\n\tk543Ruo7L3jH1ZziNYcWq3+g9yzO33Rdx61oBy7xav2ZUvmUSe+akyAzSs5DNKLlEObd\n\tgFZQ==",
        "X-Gm-Message-State": "AJIora9+h91jos+mZvNLu2hpN1JxCqaN5WWCnVgJIkO0b70VcKBEmGEd\n\tSbdUj+P81wbW23smvchTn8sJKwRPCX0rZw==",
        "X-Google-Smtp-Source": "AGRyM1tzdYi0R8Os9kXFpNidb1tEqsCgmhSbux8S/FrZMbfoZV6dfAHSbd3qSPkpjeuwpMS9CKkxEg==",
        "X-Received": "by 2002:a63:5703:0:b0:408:b2c3:8df9 with SMTP id\n\tl3-20020a635703000000b00408b2c38df9mr36067pgb.247.1655302861753; \n\tWed, 15 Jun 2022 07:21:01 -0700 (PDT)",
        "X-Google-Original-From": "Harvey Yang <chenghaoyang@google.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 15 Jun 2022 14:20:51 +0000",
        "Message-Id": "<20220615142051.450396-2-chenghaoyang@google.com>",
        "X-Mailer": "git-send-email 2.36.1.476.g0c4daa206d-goog",
        "In-Reply-To": "<20220615142051.450396-1-chenghaoyang@google.com>",
        "References": "<20220615142051.450396-1-chenghaoyang@google.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 1/1] Use tracing with perfetto in ChromeOS",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Harvey Yang via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Harvey Yang <chenghaoyang@chromium.org>",
        "Cc": "Harvey Yang <chenghaoyang@google.com>,\n\tHarvey Yang <chenghaoyang@chromium.org>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "As ChromeOS is using perfetto (project named as CrOSetto). When ChromeOS\nuses libcamera, it should use perfetto to collect traces instead of\nlttng.\n\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n include/libcamera/internal/tracepoints.h.in   | 37 +++++++++--\n .../internal/tracepoints/meson.build          | 25 ++++---\n .../internal/tracepoints/pipeline.perfetto    | 10 +++\n .../internal/tracepoints/request.perfetto     | 30 +++++++++\n meson.build                                   |  1 +\n src/android/cros/camera3_hal.cpp              |  5 ++\n src/android/cros/meson.build                  |  1 +\n src/libcamera/meson.build                     | 18 ++++-\n src/libcamera/pipeline_perfetto.cpp           | 22 +++++++\n src/libcamera/request_perfetto.cpp            | 65 +++++++++++++++++++\n src/libcamera/tracepoints.cpp                 | 11 ++++\n 11 files changed, 209 insertions(+), 16 deletions(-)\n create mode 100644 include/libcamera/internal/tracepoints/pipeline.perfetto\n create mode 100644 include/libcamera/internal/tracepoints/request.perfetto\n create mode 100644 src/libcamera/pipeline_perfetto.cpp\n create mode 100644 src/libcamera/request_perfetto.cpp",
    "diff": "diff --git a/include/libcamera/internal/tracepoints.h.in b/include/libcamera/internal/tracepoints.h.in\nindex d0fc1365..d91fadd7 100644\n--- a/include/libcamera/internal/tracepoints.h.in\n+++ b/include/libcamera/internal/tracepoints.h.in\n@@ -9,7 +9,24 @@\n #ifndef __LIBCAMERA_INTERNAL_TRACEPOINTS_H__\n #define __LIBCAMERA_INTERNAL_TRACEPOINTS_H__\n \n-#if HAVE_TRACING\n+#if HAVE_PERFETTO\n+\n+#include <perfetto/perfetto.h>\n+\n+PERFETTO_DEFINE_CATEGORIES(\n+\tperfetto::Category(\"libcamera\")\n+\t\t.SetDescription(\"Events from libcamera\"));\n+\n+#define LIBCAMERA_TRACEPOINT(t_name, ...) \\\n+LIBCAMERA_TRACE_EVENT_##t_name(__VA_ARGS__)\n+\n+#define LIBCAMERA_TRACEPOINT_IPA_BEGIN(pipe, func) \\\n+LIBCAMERA_TRACE_EVENT_ipa_call_begin(#pipe, #func)\n+\n+#define LIBCAMERA_TRACEPOINT_IPA_END(pipe, func) \\\n+LIBCAMERA_TRACE_EVENT_ipa_call_end(#pipe, #func)\n+\n+#elif HAVE_TRACING /* !HAVE_PERFETTO */\n #define LIBCAMERA_TRACEPOINT(...) tracepoint(libcamera, __VA_ARGS__)\n \n #define LIBCAMERA_TRACEPOINT_IPA_BEGIN(pipe, func) \\\n@@ -18,7 +35,7 @@ tracepoint(libcamera, ipa_call_begin, #pipe, #func)\n #define LIBCAMERA_TRACEPOINT_IPA_END(pipe, func) \\\n tracepoint(libcamera, ipa_call_end, #pipe, #func)\n \n-#else\n+#else /* HAVE_PERFETTO */\n \n namespace {\n \n@@ -34,12 +51,15 @@ inline void unused([[maybe_unused]] Args&& ...args)\n #define LIBCAMERA_TRACEPOINT_IPA_BEGIN(pipe, func)\n #define LIBCAMERA_TRACEPOINT_IPA_END(pipe, func)\n \n-#endif /* HAVE_TRACING */\n+#endif /* HAVE_PERFETTO */\n \n #endif /* __LIBCAMERA_INTERNAL_TRACEPOINTS_H__ */\n \n+#if HAVE_PERFETTO\n+\n+#include <perfetto/perfetto.h>\n \n-#if HAVE_TRACING\n+#elif HAVE_TRACING\n \n #undef TRACEPOINT_PROVIDER\n #define TRACEPOINT_PROVIDER libcamera\n@@ -52,10 +72,15 @@ inline void unused([[maybe_unused]] Args&& ...args)\n \n #include <lttng/tracepoint.h>\n \n-{{source}}\n \n #endif /* INCLUDE_LIBCAMERA_INTERNAL_TRACEPOINTS_TP_H */\n \n #include <lttng/tracepoint-event.h>\n \n-#endif /* HAVE_TRACING */\n+#endif /* HAVE_PERFETTO */\n+\n+#if HAVE_PERFETTO || HAVE_TRACING\n+\n+{{source}}\n+\n+#endif /* HAVE_PERFETTO || HAVE_TRACING */\ndiff --git a/include/libcamera/internal/tracepoints/meson.build b/include/libcamera/internal/tracepoints/meson.build\nindex d9b2fca5..ff5aece6 100644\n--- a/include/libcamera/internal/tracepoints/meson.build\n+++ b/include/libcamera/internal/tracepoints/meson.build\n@@ -1,12 +1,19 @@\n # SPDX-License-Identifier: CC0-1.0\n \n-# enum files must go first\n-tracepoint_files = files([\n-    'buffer_enums.tp',\n-    'request_enums.tp',\n-])\n+if get_option('android').enabled() and get_option('android_platform') == 'cros'\n+  tracepoint_files = files([\n+      'pipeline.perfetto',\n+      'request.perfetto',\n+  ])\n+else\n+  # enum files must go first\n+  tracepoint_files = files([\n+      'buffer_enums.tp',\n+      'request_enums.tp',\n+  ])\n \n-tracepoint_files += files([\n-    'pipeline.tp',\n-    'request.tp',\n-])\n+  tracepoint_files += files([\n+      'pipeline.tp',\n+      'request.tp',\n+  ])\n+endif\ndiff --git a/include/libcamera/internal/tracepoints/pipeline.perfetto b/include/libcamera/internal/tracepoints/pipeline.perfetto\nnew file mode 100644\nindex 00000000..5f45295e\n--- /dev/null\n+++ b/include/libcamera/internal/tracepoints/pipeline.perfetto\n@@ -0,0 +1,10 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2022, Google Inc.\n+ *\n+ * pipeline.tp - Tracepoints for pipelines\n+ */\n+\n+void LIBCAMERA_TRACE_EVENT_ipa_call_begin(const char *pipe, const char *func);\n+\n+void LIBCAMERA_TRACE_EVENT_ipa_call_end(const char *pipe, const char *func);\ndiff --git a/include/libcamera/internal/tracepoints/request.perfetto b/include/libcamera/internal/tracepoints/request.perfetto\nnew file mode 100644\nindex 00000000..fd6a42a4\n--- /dev/null\n+++ b/include/libcamera/internal/tracepoints/request.perfetto\n@@ -0,0 +1,30 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2022, Google Inc.\n+ *\n+ * request.tp - Tracepoints for the request object\n+ */\n+\n+#include <libcamera/internal/request.h>\n+\n+#include <libcamera/framebuffer.h>\n+\n+void LIBCAMERA_TRACE_EVENT_request(libcamera::Request *req);\n+\n+void LIBCAMERA_TRACE_EVENT_request_construct(libcamera::Request *req);\n+\n+void LIBCAMERA_TRACE_EVENT_request_destroy(libcamera::Request *req);\n+\n+void LIBCAMERA_TRACE_EVENT_request_reuse(libcamera::Request *req);\n+\n+void LIBCAMERA_TRACE_EVENT_request_queue(libcamera::Request *req);\n+\n+void LIBCAMERA_TRACE_EVENT_request_device_queue(libcamera::Request *req);\n+\n+void LIBCAMERA_TRACE_EVENT_request_complete(libcamera::Request::Private *req);\n+\n+void LIBCAMERA_TRACE_EVENT_request_cancel(libcamera::Request::Private *req);\n+\n+void LIBCAMERA_TRACE_EVENT_request_complete_buffer(\n+\t\tlibcamera::Request::Private *req,\n+\t\tlibcamera::FrameBuffer * buf);\ndiff --git a/meson.build b/meson.build\nindex 29d8542d..053bb831 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -176,6 +176,7 @@ py_mod.find_installation('python3', modules: py_modules)\n summary({\n             'Enabled pipelines': pipelines,\n             'Enabled IPA modules': ipa_modules,\n+            'Perfetto support': perfetto_enabled,\n             'Tracing support': tracing_enabled,\n             'Android support': android_enabled,\n             'GStreamer support': gst_enabled,\ndiff --git a/src/android/cros/camera3_hal.cpp b/src/android/cros/camera3_hal.cpp\nindex fb863b5f..2fbd7f14 100644\n--- a/src/android/cros/camera3_hal.cpp\n+++ b/src/android/cros/camera3_hal.cpp\n@@ -7,10 +7,15 @@\n \n #include <cros-camera/cros_camera_hal.h>\n \n+#include \"libcamera/internal/tracepoints.h\"\n #include \"../camera_hal_manager.h\"\n \n static void set_up([[maybe_unused]] cros::CameraMojoChannelManagerToken *token)\n {\n+\tperfetto::TracingInitArgs args;\n+\targs.backends |= perfetto::kSystemBackend;\n+\tperfetto::Tracing::Initialize(args);\n+\tperfetto::TrackEvent::Register();\n }\n \n static void tear_down()\ndiff --git a/src/android/cros/meson.build b/src/android/cros/meson.build\nindex 35995dd8..68f2bd9e 100644\n--- a/src/android/cros/meson.build\n+++ b/src/android/cros/meson.build\n@@ -9,5 +9,6 @@ android_hal_sources += files([\n ])\n \n android_deps += dependency('libcros_camera')\n+android_deps += dependency('perfetto')\n \n android_cpp_args += ['-DOS_CHROMEOS']\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 26912ca1..3332cc05 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -71,11 +71,22 @@ if libgnutls.found()\n     config_h.set('HAVE_GNUTLS', 1)\n endif\n \n-if liblttng.found()\n+if get_option('android').enabled() and get_option('android_platform') == 'cros'\n+    perfetto_enabled = true\n+    tracing_enabled = false\n+    config_h.set('HAVE_PERFETTO', 1)\n+    libcamera_sources += [\n+        'pipeline_perfetto.cpp',\n+        'request_perfetto.cpp',\n+        'tracepoints.cpp',\n+    ]\n+elif liblttng.found()\n+    perfetto_enabled = false\n     tracing_enabled = true\n     config_h.set('HAVE_TRACING', 1)\n     libcamera_sources += files(['tracepoints.cpp'])\n else\n+    perfetto_enabled = false\n     tracing_enabled = false\n endif\n \n@@ -128,6 +139,11 @@ libcamera_deps = [\n     libudev,\n ]\n \n+if perfetto_enabled\n+  perfetto = dependency('perfetto', required : true)\n+  libcamera_deps += [ perfetto ]\n+endif\n+\n # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n # The build_rpath is stripped at install time by meson, so we determine at\n # runtime if the library is running from an installed location by checking\ndiff --git a/src/libcamera/pipeline_perfetto.cpp b/src/libcamera/pipeline_perfetto.cpp\nnew file mode 100644\nindex 00000000..d0ddc17d\n--- /dev/null\n+++ b/src/libcamera/pipeline_perfetto.cpp\n@@ -0,0 +1,22 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2022, Google Inc.\n+ *\n+ * pipeline.tp - Tracepoints for pipelines\n+ */\n+\n+#include \"libcamera/internal/tracepoints.h\"\n+\n+void LIBCAMERA_TRACE_EVENT_ipa_call_begin(const char *pipe, const char *func) {\n+\t// TODO: Consider TRACE_EVENT_BEGIN\n+\tTRACE_EVENT(\"libcamera\", \"ipa_call_begin\",\n+\t\t    \"pipeline_name\", pipe,\n+\t\t    \"function_name\", func);\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_ipa_call_end(const char *pipe, const char *func) {\n+\t// TODO: Consider TRACE_EVENT_END\n+\tTRACE_EVENT(\"libcamera\", \"ipa_call_end\",\n+\t\t    \"pipeline_name\", pipe,\n+\t\t    \"function_name\", func);\n+}\ndiff --git a/src/libcamera/request_perfetto.cpp b/src/libcamera/request_perfetto.cpp\nnew file mode 100644\nindex 00000000..c82cce33\n--- /dev/null\n+++ b/src/libcamera/request_perfetto.cpp\n@@ -0,0 +1,65 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2022, Google Inc.\n+ *\n+ * request.tp - Tracepoints for the request object\n+ */\n+\n+\n+#include <libcamera/framebuffer.h>\n+\n+#include \"libcamera/internal/request.h\"\n+#include \"libcamera/internal/tracepoints.h\"\n+\n+void LIBCAMERA_TRACE_EVENT_request(libcamera::Request *req) {\n+\tTRACE_EVENT(\"libcamera\", \"request\",\n+\t\t    \"request_ptr\", reinterpret_cast<uintptr_t>(req),\n+\t\t    \"cookie\", req->cookie(),\n+\t\t    \"status\", req->status()); // TODO\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_request_construct(libcamera::Request *req) {\n+\tTRACE_EVENT(\"libcamera\", \"request_construct\",\n+\t\t    \"request_ptr\", reinterpret_cast<uintptr_t>(req));\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_request_destroy(libcamera::Request *req) {\n+\tTRACE_EVENT(\"libcamera\", \"request_destroy\",\n+\t\t    \"request_ptr\", reinterpret_cast<uintptr_t>(req));\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_request_reuse(libcamera::Request *req) {\n+\tTRACE_EVENT(\"libcamera\", \"request_reuse\",\n+\t\t    \"request_ptr\", reinterpret_cast<uintptr_t>(req));\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_request_queue(libcamera::Request *req) {\n+\tTRACE_EVENT(\"libcamera\", \"request_queue\",\n+\t\t    \"request_ptr\", reinterpret_cast<uintptr_t>(req));\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_request_device_queue(libcamera::Request *req) {\n+\tTRACE_EVENT(\"libcamera\", \"request_device_queue\",\n+\t\t    \"request_ptr\", reinterpret_cast<uintptr_t>(req));\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_request_complete(libcamera::Request::Private *req) {\n+\tTRACE_EVENT(\"libcamera\", \"request_complete\",\n+\t\t    \"request_private_ptr\", reinterpret_cast<uintptr_t>(req));\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_request_cancel(libcamera::Request::Private *req) {\n+\tTRACE_EVENT(\"libcamera\", \"request_cancel\",\n+\t\t    \"request_private_ptr\", reinterpret_cast<uintptr_t>(req));\n+}\n+\n+void LIBCAMERA_TRACE_EVENT_request_complete_buffer(\n+\t\tlibcamera::Request::Private *req,\n+\t\tlibcamera::FrameBuffer * buf) {\n+\tTRACE_EVENT(\"libcamera\", \"request_complete_buffer\",\n+\t\t    \"request_private_ptr\", reinterpret_cast<uintptr_t>(req),\n+\t\t    \"cookie\", req->_o<libcamera::Request>()->cookie(),\n+\t\t    \"status\", req->_o<libcamera::Request>()->status(), // TODO\n+\t\t    \"buffer_ptr\", reinterpret_cast<uintptr_t>(buf),\n+\t\t    \"buffer_status\", buf->metadata().status); // TODO\n+}\ndiff --git a/src/libcamera/tracepoints.cpp b/src/libcamera/tracepoints.cpp\nindex 0173b75a..a07ea531 100644\n--- a/src/libcamera/tracepoints.cpp\n+++ b/src/libcamera/tracepoints.cpp\n@@ -4,7 +4,18 @@\n  *\n  * tracepoints.cpp - Tracepoints with lttng\n  */\n+\n+#if HAVE_PERFETTO\n+\n+#include \"libcamera/internal/tracepoints.h\"\n+\n+PERFETTO_TRACK_EVENT_STATIC_STORAGE();\n+\n+#else\n+\n #define TRACEPOINT_CREATE_PROBES\n #define TRACEPOINT_DEFINE\n \n #include \"libcamera/internal/tracepoints.h\"\n+\n+#endif /* HAVE_PERFETTO */\n",
    "prefixes": [
        "libcamera-devel",
        "1/1"
    ]
}