*/
#define _LGPL_SOURCE
-#define _GNU_SOURCE
+#include <stddef.h>
+#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/mman.h>
#include <urcu/futex.h>
#include <urcu/compiler.h>
+#include <lttng/align.h>
#include <lttng/ust-events.h>
#include <lttng/ust-abi.h>
#include <lttng/ust.h>
#include "clock.h"
#include "../libringbuffer/getcpu.h"
#include "getenv.h"
+#include "ust-events-internal.h"
/* Concatenate lttng ust shared library name with its major version number. */
#define LTTNG_UST_LIB_SO_NAME "liblttng-ust.so." __ust_stringify(CONFIG_LTTNG_UST_LIBRARY_VERSION_MAJOR)
/* Keep track of lazy state dump not performed yet. */
int statedump_pending;
int initial_statedump_done;
+ /* Keep procname for statedump */
+ char procname[LTTNG_UST_ABI_PROCNAME_LEN];
};
/* Socket from app (connect) to session daemon (listen) for communication */
.statedump_pending = 0,
.initial_statedump_done = 0,
+ .procname[0] = '\0'
};
/* TODO: allow global_apps_sock_path override */
.statedump_pending = 0,
.initial_statedump_done = 0,
+ .procname[0] = '\0'
};
static int wait_poll_fallback;
lttng_fixup_cgroup_ns_tls();
lttng_fixup_ipc_ns_tls();
lttng_fixup_net_ns_tls();
+ lttng_fixup_time_ns_tls();
lttng_fixup_uts_ns_tls();
}
return info->notify_socket;
}
+
+LTTNG_HIDDEN
+char* lttng_ust_sockinfo_get_procname(void *owner)
+{
+ struct sock_info *info = owner;
+
+ return info->procname;
+}
+
static
void print_cmd(int cmd, int handle)
{
}
global_apps.allowed = 1;
+ lttng_pthread_getname_np(global_apps.procname, LTTNG_UST_ABI_PROCNAME_LEN);
error:
return ret;
}
ret = -EIO;
goto end;
}
+
+ lttng_pthread_getname_np(local_apps.procname, LTTNG_UST_ABI_PROCNAME_LEN);
end:
return ret;
}
if (sock_info->wait_shm_mmap) {
long page_size;
- page_size = sysconf(_SC_PAGE_SIZE);
+ page_size = LTTNG_UST_PAGE_SIZE;
if (page_size <= 0) {
if (!page_size) {
errno = EINVAL;
lttng_context_mnt_ns_reset();
lttng_context_net_ns_reset();
lttng_context_user_ns_reset();
+ lttng_context_time_ns_reset();
lttng_context_uts_ns_reset();
}