Move to kernel style SPDX license identifiers The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. See https://spdx.org/ids-how for details. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Change-Id: I62e7038e191a061286abcef5550b58f5ee67149d Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Refactoring: introduce lttng_tracker_ids data structure This data structure is opaque to allow for back-end implementation change in the future. For now, only the following functions concerning lttng_tracker_ids are public: lttng_list_tracker_ids lttng_tracker_ids_get_count lttng_tracker_ids_get_at_index lttng_tracker_ids_destroy Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Change-Id: Iae1c10d0b578b402ab91378dd49f69f605b316b2 Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Refactoring: use an opaque lttng_tracker_id type Move the tracker and tracker id related API to tracker.h and tracker-internal.h. The use of an opaque object mimics the new API for rotation and trigger etc. Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Change-Id: I00b876c618d7dcb0dd940189e5250c3f3d64c7e0 Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Add UST uid/gid contexts Add the following userspace tracer context fields: - vuid Virtual real user ID: real user ID as seen from the point of view of the current user namespace - veuid Virtual effective user ID: effective user ID as seen from the point of view of the current user namespace - vsuid Virtual saved set-user ID: saved set-user ID as seen from the point of view of the current user namespace - vgid Virtual real group ID: real group ID as seen from the point of view of the current user namespace - vegid Virtual effective group ID: effective group ID as seen from the point of view of the current user namespace - vsgid Virtual saved set-group ID: saved set-group ID as seen from the point of view of the current user namespace Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Add UST namespace contexts Add the following userspace namespace contexts: - cgroup_ns Cgroup root directory namespace: inode number of the current cgroup namespace in the proc filesystem. - ipc_ns System V IPC, POSIX message queues namespace: inode number of the current IPC namespace in the proc filesystem. - mnt_ns Mount points namespace: inode number of the current mount namespace in the proc filesystem. - net_ns Network devices, stacks, ports namespace: inode number of the current network namespace in the proc filesystem. - pid_ns Process IDs namespace: inode number of the current pid namespace in the proc filesystem. - user_ns User and group IDs namespace: inode number of the current user namespace in the proc filesystem. - uts_ns Hostname and NIS domain name namespace: inode number of the current uts namespace in the proc filesystem. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
sessiond: fix: possible unaligned access in packed structure A number of (potentially) unaligned pointers are used in client command handlers to pass command parameters to other internal functions. Fixing those forces a number of const-correctness changes where contexts are passed as arguments. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: keep ust/kernel session items around for destroy notifier Split the destruction and release operations for ust and kernel inner-sessions as they may be accessed by session destruction notifiers registered against their parent ltt_session. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Create an initial trace chunk on first start of an ltt_session Add a current trace chunk to an ltt_session on session start. The session base output directory is created at that moment and an handle to it is provided to the session daemon's trace chunk when it is set in 'owner' mode. Setting the trace chunk in "owner" mode results in the creation of the chunk's output directory. In the case, of the first chunk, the chunk output directory matches the session output directory. Hence, this has no visible effect. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: only synchronize application configuration on tracing start The UST configuration of applications is currently replicated as it is changed from the ltt_ust_{session, channel, event} data structures to their ust_app_* equivalent as they are modified. While this worked correctly for the most part, it caused a problem in per-PID mode since the buffers would get allocated (and files created, in applicable tracing modes) even though tracing was never started during some applications' lifetime. A previous fix attempt, 0498a00cb, adressed this problem but introduced a regression that caused configurations to become mismatched between the sessiond and applications in cases where a tracing session was started, stopped, modified, and started again within the lifetime of a given application. This change introduces an explicit "synchronize" set of operations that ensures that a session's channels and events configurations, as known by the application(s), match those of the session daemon whenever a session is started. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
trace_ust_create_event() now returns an error code To be consistent with similar changes made to the trace_kernel_create_event function. Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Introduce "--blocking-timeout" channel parameter Introduce the blocking timeout channel parameter to control blocking behavior for lttng-ust buffers. It only affects applications launched with the LTTNG_UST_ALLOW_BLOCKING environment variable. The blocking timeout parameter expects: - 0 (default) which does not block, - a timeout value in usec, - -1 (block forever). Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Ignore exclusion names order when matching events In other words: lttng enable-event -u -a --exclude a,b,c,d -> passes lttng enable-event -u -a --exclude a,c,d,b -> fails (same event) Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>