summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-10-19 19:18:17 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-11-03 11:07:21 +0900
commitfcc6d4bd76874585336cb0bbbd369702b59515d2 (patch)
tree7d35d18c516ef49e39cc8bf9e5c9aabfc7bb7dc2 /src
parent4757ff4ab7b4dac560cad26db12e28ef741c96ff (diff)
libcamera: tracing: Implement tracing infrastructure
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 <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/meson.build7
-rw-r--r--src/libcamera/tracepoints.cpp10
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 07711b5f..99b27e66 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -55,6 +55,7 @@ libcamera_sources = files([
])
libcamera_sources += libcamera_public_headers
+libcamera_sources += libcamera_tracepoint_header
includes = [
libcamera_includes,
@@ -72,6 +73,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([
@@ -114,6 +120,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"