summaryrefslogtreecommitdiff
path: root/include/libcamera/internal/tracepoints
diff options
context:
space:
mode:
Diffstat (limited to 'include/libcamera/internal/tracepoints')
-rw-r--r--include/libcamera/internal/tracepoints/buffer_enums.tp16
-rw-r--r--include/libcamera/internal/tracepoints/meson.build12
-rw-r--r--include/libcamera/internal/tracepoints/pipeline.tp32
-rw-r--r--include/libcamera/internal/tracepoints/request.tp104
-rw-r--r--include/libcamera/internal/tracepoints/request_enums.tp16
5 files changed, 180 insertions, 0 deletions
diff --git a/include/libcamera/internal/tracepoints/buffer_enums.tp b/include/libcamera/internal/tracepoints/buffer_enums.tp
new file mode 100644
index 00000000..c5a93252
--- /dev/null
+++ b/include/libcamera/internal/tracepoints/buffer_enums.tp
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * buffer_enums.tp - Tracepoint definition for enums in the buffer class
+ */
+
+TRACEPOINT_ENUM(
+ libcamera,
+ buffer_status,
+ TP_ENUM_VALUES(
+ ctf_enum_value("FrameSuccess", 0)
+ ctf_enum_value("FrameError", 1)
+ ctf_enum_value("FrameCancelled", 2)
+ )
+)
diff --git a/include/libcamera/internal/tracepoints/meson.build b/include/libcamera/internal/tracepoints/meson.build
new file mode 100644
index 00000000..d9b2fca5
--- /dev/null
+++ b/include/libcamera/internal/tracepoints/meson.build
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: CC0-1.0
+
+# enum files must go first
+tracepoint_files = files([
+ 'buffer_enums.tp',
+ 'request_enums.tp',
+])
+
+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..950aa918
--- /dev/null
+++ b/include/libcamera/internal/tracepoints/pipeline.tp
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * pipeline.tp - Tracepoints for pipelines
+ */
+
+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)
+ )
+)
diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp
new file mode 100644
index 00000000..42c59685
--- /dev/null
+++ b/include/libcamera/internal/tracepoints/request.tp
@@ -0,0 +1,104 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * request.tp - Tracepoints for the request object
+ */
+
+#include <stdint.h>
+
+#include <libcamera/framebuffer.h>
+
+#include "libcamera/internal/request.h"
+
+TRACEPOINT_EVENT_CLASS(
+ libcamera,
+ request,
+ TP_ARGS(
+ libcamera::Request *, req
+ ),
+ TP_FIELDS(
+ ctf_integer_hex(uintptr_t, request, reinterpret_cast<uintptr_t>(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_queue,
+ TP_ARGS(
+ libcamera::Request *, req
+ )
+)
+
+TRACEPOINT_EVENT_INSTANCE(
+ libcamera,
+ request,
+ request_device_queue,
+ TP_ARGS(
+ libcamera::Request *, req
+ )
+)
+
+TRACEPOINT_EVENT_INSTANCE(
+ libcamera,
+ request,
+ request_complete,
+ TP_ARGS(
+ libcamera::Request::Private *, req
+ )
+)
+
+TRACEPOINT_EVENT_INSTANCE(
+ libcamera,
+ request,
+ request_cancel,
+ TP_ARGS(
+ libcamera::Request::Private *, req
+ )
+)
+
+TRACEPOINT_EVENT(
+ libcamera,
+ request_complete_buffer,
+ TP_ARGS(
+ libcamera::Request::Private *, req,
+ libcamera::FrameBuffer *, buf
+ ),
+ TP_FIELDS(
+ ctf_integer_hex(uintptr_t, request, reinterpret_cast<uintptr_t>(req))
+ ctf_integer(uint64_t, cookie, req->_o<libcamera::Request>()->cookie())
+ ctf_integer(int, status, req->_o<libcamera::Request>()->status())
+ ctf_integer_hex(uintptr_t, buffer, reinterpret_cast<uintptr_t>(buf))
+ ctf_enum(libcamera, buffer_status, uint32_t, buf_status, buf->metadata().status)
+ )
+)
diff --git a/include/libcamera/internal/tracepoints/request_enums.tp b/include/libcamera/internal/tracepoints/request_enums.tp
new file mode 100644
index 00000000..bcbd1aaa
--- /dev/null
+++ b/include/libcamera/internal/tracepoints/request_enums.tp
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * request_enums.tp - Tracepoint definition for enums in the request class
+ */
+
+TRACEPOINT_ENUM(
+ libcamera,
+ request_status,
+ TP_ENUM_VALUES(
+ ctf_enum_value("RequestPending", 0)
+ ctf_enum_value("RequestComplete", 1)
+ ctf_enum_value("RequestCancelled", 2)
+ )
+)