<listitem><para><parameter moreinfo="none">syslog</parameter></para></listitem>
<listitem><para><parameter moreinfo="none">file</parameter></para></listitem>
<listitem><para><parameter moreinfo="none">systemd</parameter></para></listitem>
+ <listitem><para><parameter moreinfo="none">lttng</parameter></para></listitem>
</itemizedlist>
</description>
}
#endif
+#ifdef HAVE_LTTNG_TRACEF
+#include <lttng/tracef.h>
+static void debug_lttng_log(int msg_level,
+ const char *msg, const char *msg_no_nl)
+{
+ tracef(msg_no_nl);
+}
+#endif /* WITH_LTTNG_TRACEF */
+
static struct debug_backend {
const char *name;
int log_level;
.log = debug_systemd_log,
},
#endif
+
+#ifdef HAVE_LTTNG_TRACEF
+ {
+ .name = "lttng",
+ .log = debug_lttng_log,
+ },
+#endif
+
};
static struct debug_backend *debug_find_backend(const char *name)
opt.add_option('--without-systemd',
help=("Disable systemd integration"),
action='store_false', dest='enable_systemd')
+
+ opt.add_option('--with-lttng',
+ help=("Enable lttng integration"),
+ action='store_true', dest='enable_lttng')
+
+ opt.add_option('--without-lttng',
+ help=("Disable lttng integration"),
+ action='store_false', dest='enable_lttng')
bld.SAMBA_LIBRARY('samba-debug',
source='debug.c',
deps='replace time-basic close-low-fd talloc socket-blocking',
- public_deps='systemd-journal',
+ public_deps='systemd-journal lttng-ust',
local_include=False,
private_library=True)
else:
conf.SET_TARGET_TYPE('systemd-journal', 'EMPTY')
conf.undefine('HAVE_SYSTEMD_JOURNAL')
+
+if Options.options.enable_lttng != False:
+ conf.check_cfg(package='lttng-ust', args='--cflags --libs',
+ msg='Checking for lttng-ust', uselib_store="LTTNG-UST")
+ conf.CHECK_HEADERS('lttng/tracef.h', lib='lttng-st')
+ conf.CHECK_LIB('lttng-ust', shlib=True)
+
+if (conf.CONFIG_SET('HAVE_LTTNG_TRACEF_H') and
+ conf.CONFIG_SET('HAVE_LTTNG_UST')):
+ conf.DEFINE('HAVE_LTTNG_TRACEF', '1')
+ conf.env['HAVE_LTTNG_TRACEF'] = True
+else:
+ conf.SET_TARGET_TYPE('lttng-ust', 'EMPTY')
+ conf.undefine('HAVE_LTTNG_TRACEF')