summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
af73f72)
Approximation in case of hostname change or in case of
contextualisation, but it does the job for 95% of use-cases.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
unsigned char uuid_s[37], clock_uuid_s[BOOT_ID_LEN];
struct lttng_channel *chan;
struct lttng_event *event;
unsigned char uuid_s[37], clock_uuid_s[BOOT_ID_LEN];
struct lttng_channel *chan;
struct lttng_event *event;
+ char hostname[__NEW_UTS_LEN + 1];
int ret = 0;
if (!ACCESS_ONCE(session->active))
int ret = 0;
if (!ACCESS_ONCE(session->active))
+ rcu_read_lock();
+ memcpy(hostname, task_nsproxy(current)->uts_ns->name.nodename,
+ sizeof(hostname));
+ rcu_read_unlock();
+
ret = lttng_metadata_printf(session,
"env {\n"
ret = lttng_metadata_printf(session,
"env {\n"
+ " hostname = \"%s\";\n"
" domain = \"kernel\";\n"
" sysname = \"%s\";\n"
" kernel_release = \"%s\";\n"
" domain = \"kernel\";\n"
" sysname = \"%s\";\n"
" kernel_release = \"%s\";\n"
" tracer_minor = %d;\n"
" tracer_patchlevel = %d;\n"
"};\n\n",
" tracer_minor = %d;\n"
" tracer_patchlevel = %d;\n"
"};\n\n",
utsname()->sysname,
utsname()->release,
utsname()->version,
utsname()->sysname,
utsname()->release,
utsname()->version,