[PATCH] meson: Add -finstrument-functions to debug builds

Paul Elder paul.elder at ideasonboard.com
Thu Sep 12 18:49:09 CEST 2024


Add -finstrument-functions to debug (and debugoptimized) build types.
This will mainly be used for tracing functions with lttng by
LD_PRELOADing liblttng-ust-cyg-profile.so (or
liblttng-ust-cyg-profile-fast.so).

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 meson.build | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meson.build b/meson.build
index 432ae1337..e8014e77f 100644
--- a/meson.build
+++ b/meson.build
@@ -109,6 +109,12 @@ common_arguments = [
     '-include', meson.current_build_dir() / 'config.h',
 ]
 
+if get_option('buildtype').startswith('debug')
+    common_arguments += [
+        '-finstrument-functions',
+    ]
+endif
+
 c_arguments = []
 cpp_arguments = []
 
-- 
2.39.2



More information about the libcamera-devel mailing list