lttng-context-interruptible.o \
lttng-context-need-reschedule.o \
lttng-context-callstack.o lttng-calibrate.o \
- lttng-context-hostname.o wrapper/random.o \
+ lttng-context-hostname.o \
probes/lttng.o wrapper/trace-clock.o \
lttng-tracker-id.o \
lttng-filter.o lttng-filter-interpreter.o \
#include <linux/vmalloc.h>
#include <linux/limits.h>
-#include <wrapper/random.h>
+#include <linux/random.h>
#include <lttng-kernel-version.h>
#include <lttng-events.h>
#include <lttng-tracer.h>
int _lttng_session_metadata_statedump(struct lttng_session *session)
{
unsigned char *uuid_c = session->uuid.b;
- unsigned char uuid_s[37], clock_uuid_s[BOOT_ID_LEN];
+ unsigned char uuid_s[LTTNG_MODULES_UUID_STR_LEN], clock_uuid_s[LTTNG_MODULES_UUID_STR_LEN];
const char *product_uuid;
struct lttng_channel *chan;
struct lttng_event *event;
+++ /dev/null
-/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
- *
- * wrapper/random.c
- *
- * wrapper around bootid read. Read the boot id through the /proc filesystem.
- *
- * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#include <linux/errno.h>
-
-/* boot_id depends on sysctl */
-#if defined(CONFIG_SYSCTL)
-
-#include <linux/fs.h>
-#include <linux/file.h>
-#include <linux/sched.h>
-#include <linux/uaccess.h>
-#include <wrapper/random.h>
-
-/*
- * Returns string boot id.
- */
-int wrapper_get_bootid(char *bootid)
-{
- struct file *file;
- int ret;
- ssize_t len;
- mm_segment_t old_fs;
-
- file = filp_open("/proc/sys/kernel/random/boot_id", O_RDONLY, 0);
- if (IS_ERR(file))
- return PTR_ERR(file);
-
- old_fs = get_fs();
- set_fs(KERNEL_DS);
-
- if (!file->f_op || !file->f_op->read) {
- ret = -EINVAL;
- goto end;
- }
-
- len = file->f_op->read(file, bootid, BOOT_ID_LEN - 1, &file->f_pos);
- if (len != BOOT_ID_LEN - 1) {
- ret = -EINVAL;
- goto end;
- }
-
- bootid[BOOT_ID_LEN - 1] = '\0';
- ret = 0;
-end:
- set_fs(old_fs);
- filp_close(file, current->files);
- return ret;
-}
-
-#else
-
-int wrapper_get_bootid(char *bootid)
-{
- return -ENOSYS;
-}
-
-#endif
+++ /dev/null
-/* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
- *
- * wrapper/random.h
- *
- * wrapper around bootid read. Read the boot id through the /proc filesystem.
- *
- * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_RANDOM_H
-#define _LTTNG_WRAPPER_RANDOM_H
-
-#include <lttng-clock.h>
-
-#define BOOT_ID_LEN LTTNG_MODULES_UUID_STR_LEN
-
-int wrapper_get_bootid(char *bootid);
-
-#endif /* _LTTNG_WRAPPER_RANDOM_H */
#include <asm/local.h>
#include <lttng-kernel-version.h>
#include <lttng-clock.h>
-#include <wrapper/random.h>
+#include <linux/random.h>
extern struct lttng_trace_clock *lttng_trace_clock;
static inline int trace_clock_uuid_monotonic(char *uuid)
{
- return wrapper_get_bootid(uuid);
+ unsigned char *boot_id;
+
+ boot_id = get_kernel_boot_id();
+ sprintf(uuid, "%pU", boot_id);
+ return 0;
}
static inline const char *trace_clock_name_monotonic(void)