#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
+#include <linux/utsname.h>
#include "wrapper/uuid.h"
#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "wrapper/random.h"
ACCESS_ONCE(session->active) = 1;
ACCESS_ONCE(session->been_active) = 1;
ret = _lttng_session_metadata_statedump(session);
+ if (ret) {
+ ACCESS_ONCE(session->active) = 0;
+ goto end;
+ }
+ ret = lttng_statedump_start(session);
if (ret)
ACCESS_ONCE(session->active) = 0;
end:
lttng_alignof(uint16_t) * CHAR_BIT,
lttng_alignof(uint32_t) * CHAR_BIT,
lttng_alignof(uint64_t) * CHAR_BIT,
- CTF_VERSION_MAJOR,
- CTF_VERSION_MINOR,
+ CTF_SPEC_MAJOR,
+ CTF_SPEC_MINOR,
uuid_s,
#ifdef __BIG_ENDIAN
"be"
if (ret)
goto end;
+ ret = lttng_metadata_printf(session,
+ "env {\n"
+ " domain = \"kernel\";\n"
+ " sysname = \"%s\";\n"
+ " kernel_release = \"%s\";\n"
+ " kernel_version = \"%s\";\n"
+ " tracer_name = \"lttng-modules\";\n"
+ " tracer_major = %d;\n"
+ " tracer_minor = %d;\n"
+ " tracer_patchlevel = %d;\n"
+ "};\n\n",
+ utsname()->sysname,
+ utsname()->release,
+ utsname()->version,
+ LTTNG_MODULES_MAJOR_VERSION,
+ LTTNG_MODULES_MINOR_VERSION,
+ LTTNG_MODULES_PATCHLEVEL_VERSION
+ );
+ if (ret)
+ goto end;
+
ret = lttng_metadata_printf(session,
"clock {\n"
" name = %s;\n",
if (!trace_clock_uuid(clock_uuid_s)) {
ret = lttng_metadata_printf(session,
- " uuid = %s;\n",
+ " uuid = \"%s\";\n",
clock_uuid_s
);
if (ret)