bin: compile lttng-sessiond as C++ Same as commit 48a400056134 ("bin: compile lttng as C++"), but change lttng-sessiond to be a C++ program. In addition to the categories of changes already mentioned in that commit's message, here are some interesting changes: - Add an include in trigger.h, an exported header, to fix: CXX notification-thread.lo In file included from /home/simark/src/lttng-tools/src/bin/lttng-sessiond/notification-thread.cpp:9: /home/simark/src/lttng-tools/include/lttng/trigger/trigger.h:142:13: error: use of enum ‘lttng_error_code’ without previous declaration 142 | extern enum lttng_error_code lttng_register_trigger_with_name( | ^~~~~~~~~~~~~~~~ - We get this with clang: CXX lttng-conf.o In file included from /home/simark/src/lttng-tools/src/bin/lttng/conf.cpp:18: In file included from /home/simark/src/lttng-tools/src/common/common.h:14: In file included from /home/simark/src/lttng-tools/src/common/runas.h:17: In file included from /home/simark/src/lttng-tools/src/common/sessiond-comm/sessiond-comm.h:38: In file included from /home/simark/src/lttng-tools/src/common/unix.h:17: /home/simark/src/lttng-tools/src/common/payload-view.h:82:27: error: 'lttng_payload_view_from_payload' has C-linkage specified, but returns user-defined type 'struct lttng_payload_view' which is incompatible with C [-Werror,-Wreturn-type-c-linkage] struct lttng_payload_view lttng_payload_view_from_payload( ^ Turns out that because of the "const" field in lttng_payload_view, clang doesn't consider that type incompatible with C. I don't really want to remove the "const" for C code using that API, so conditionally remove it if we are compiling with clang in C++. - clang gives: CXX event.lo In file included from /home/simark/src/lttng-tools/src/bin/lttng-sessiond/event.cpp:19: /home/simark/src/lttng-tools/src/common/bytecode/bytecode.h:50:1: error: struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat] struct literal_string { ^ It looks like that type isn't even used? Remove it. - it's not possible to initialize some union members, for example with lttcomm_consumer_msg, in consumer.cpp. Initialize it in a separate statement. - It's not possible to use the transparent union trick when calling urcu function, for example in thread_application_registration, in register.cpp. We need to instantiate a cds_wfcq_head_ptr_t object, assign the appropriate field, and pass that object to the function. - the ALIGNED_CONST_PTR trick does not work in C++: CXX consumer.lo In file included from /home/simark/src/lttng-tools/src/common/error.h:19, from /home/simark/src/lttng-tools/src/common/common.h:12, from /home/simark/src/lttng-tools/src/bin/lttng-sessiond/consumer.cpp:19: /home/simark/src/lttng-tools/src/bin/lttng-sessiond/consumer.cpp: In function ‘int consumer_send_relayd_socket(consumer_socket*, lttcomm_relayd_sock*, consumer_output*, lttng_stream_type, uint64_t, const char*, const char*, const char*, int, const uint64_t*, time_t, bool)’: /home/simark/src/lttng-tools/src/common/macros.h:116:58: error: expected primary-expression before ‘]’ token 116 | #define ALIGNED_CONST_PTR(value) (((const typeof(value) []) { value })) | ^ /home/simark/src/lttng-tools/src/bin/lttng-sessiond/consumer.cpp:1192:48: note: in expansion of macro ‘ALIGNED_CONST_PTR’ 1192 | ret = consumer_send_fds(consumer_sock, ALIGNED_CONST_PTR(rsock->sock.fd), 1); | ^~~~~~~~~~~~~~~~~ Replace uses with copying the data in a local variable (which is properly aligned), and pass the address to that variable to the function. - In consumer.h, an array field in a structure is defined using the max macro. It can't be replaced with std::max, since std::max isn't constexpr in C++11. Define a max_constexpr function locally and use it. - g++ 7 doesn't support non-trivial designated initializers, leading to errors like: CXX globals.lo /home/smarchi/src/lttng-tools/src/bin/lttng-sessiond/globals.cpp:44:1: sorry, unimplemented: non-trivial designated initializers not supported }; ^ Change consumer_data to have a constructor instead. Change initializations of some structures, such as lttcomm_lttng_msg, to initialize the fields separate from the variable declaration. This requires making these variable non-const which is not ideal. But once everything is C++, these types could get a fancy constructor, and then they can be made const again. - When compiling without UST support the stub versions of functions ust_app_rotate_session & co, in ust-app.h, are used. Some of them have the return type "enum lttng_error_code", but return 0, an invalid value, causing: CXX main.o In file included from /home/smarchi/src/lttng-tools/src/bin/lttng-sessiond/lttng-sessiond.h:22:0, from /home/smarchi/src/lttng-tools/src/bin/lttng-sessiond/main.cpp:45: /home/smarchi/src/lttng-tools/src/bin/lttng-sessiond/ust-app.h: In function ‘lttng_error_code ust_app_snapshot_record(ltt_ust_session*, const consumer_output*, int, uint64_t)’: /home/smarchi/src/lttng-tools/src/bin/lttng-sessiond/ust-app.h:575:9: error: invalid conversion from ‘int’ to ‘lttng_error_code’ [-fpermissive] return 0; ^ Change these functions to return LTTNG_ERR_UNK. These functions are not supposed to be called if UST support is not included. But even if they were: all their callers check that the return value is not LTTNG_OK. The value 0 would be considered an error, so will be LTTNG_ERR_UNK. Change-Id: I2cdd34459a54b1943087b43843ef20b35b7bf7d8 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Force usage of assert() condition when NDEBUG is defined Reuse the BT2 approach to force the usage of the assertion condition even when assert() are removed by the NDEBUG define. See `BT_USE_EXPR()` macro and documentation in Babeltrace commit[0]: commit 1778c2a4134647150b199b2b57130817144446b0 Author: Philippe Proulx <eeppeliteloop@gmail.com> Date: Tue Apr 21 11:15:42 2020 -0400 lib: assign a unique ID to each pre/postcond. and report it on failure 0: https://github.com/efficios/babeltrace/commit/1778c2a4134647150b199b2b57130817144446b0 Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: I3844b6ae7e95952d90033898397ac936540b785c
Fix: action executor: deadlock on session_list_lock Observed issue ============== A dead lock is observed during the start-stop test suite for triggers. Cause ===== A start session action is executed by the action executor, the `cmd_start_trace` function is called and effectively holds the `session_list_lock.`. During `cmd_start_trace` a call to `notification_thread_command_add_channel` is performed to inform the notification thread of the new channel presence. At the same time, a tracer event notification is received by the notification thread. The actions are queued up and the sample of the session id take place and a call to `session_lock_list` is performed and blocks on the lock operation. The notification thread wait on the `session_list_lock` and the `session_list_lock` holder, the action executor, waits on the completion of a command the be run by the notification thread: deadlock. The backtrace: Thread 6 (Thread 0x7f831c8a6700 (LWP 3046458)): #0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 #1 0x000000000053b852 in futex (uaddr=0x7f831c8a45e0, op=0, val=0, timeout=0x0, uaddr2=0x0, val3=0) at /home/joraj/lttng/master/install/include/urcu/futex.h:72 #2 0x000000000053b4f9 in futex_noasync (uaddr=0x7f831c8a45e0, op=0, val=0, timeout=0x0, uaddr2=0x0, val3=0) at /home/joraj/lttng/master/install/include/urcu/futex.h:81 #3 0x000000000053af10 in lttng_waiter_wait (waiter=0x7f831c8a45d8) at waiter.c:55 #4 0x000000000046b0f2 in run_command_wait (handle=0xe60520, cmd=0x7f831c8a4588) at notification-thread-commands.c:49 #5 0x000000000046b270 in notification_thread_command_add_channel (handle=0xe60520, session_name=0x7f8300006c30 "my_triggered_session", uid=1000, gid=1000, channel_name=0x7f82dc00be04 "channel0", key=1, domain=LTTNG_DOMAIN_UST, capacity=2097152) at notification-thread-commands.c:184 #6 0x00000000004c7f65 in create_channel_per_uid (app=0x7f82d8000bf0, usess=0x7f8300000bb0, ua_sess=0x7f82dc002600, ua_chan=0x7f82dc00bde0) at ust-app.c:3360 #7 0x00000000004c6f98 in ust_app_channel_send (app=0x7f82d8000bf0, usess=0x7f8300000bb0, ua_sess=0x7f82dc002600, ua_chan=0x7f82dc00bde0) at ust-app.c:3514 #8 0x00000000004c6bde in ust_app_channel_create (usess=0x7f8300000bb0, ua_sess=0x7f82dc002600, uchan=0x7f8300005a90, app=0x7f82d8000bf0, _ua_chan=0x7f831c8a48b0) at ust-app.c:4771 #9 0x00000000004c6968 in find_or_create_ust_app_channel (usess=0x7f8300000bb0, ua_sess=0x7f82dc002600, app=0x7f82d8000bf0, uchan=0x7f8300005a90, ua_chan=0x7f831c8a48b0) at ust-app.c:5610 #10 0x00000000004c4f09 in ust_app_synchronize_all_channels (usess=0x7f8300000bb0, ua_sess=0x7f82dc002600, app=0x7f82d8000bf0) at ust-app.c:5820 #11 0x00000000004b958c in ust_app_synchronize (usess=0x7f8300000bb0, app=0x7f82d8000bf0) at ust-app.c:5886 #12 0x00000000004b8500 in ust_app_global_update (usess=0x7f8300000bb0, app=0x7f82d8000bf0) at ust-app.c:5960 #13 0x00000000004b7ec2 in ust_app_start_trace_all (usess=0x7f8300000bb0) at ust-app.c:5520 #14 0x0000000000444e86 in cmd_start_trace (session=0x7f8300006c30) at cmd.c:2707 #15 0x00000000004a5af9 in action_executor_start_session_handler (executor=0x7f8314004410, work_item=0x7f8314005100, item=0x7f83140050b0) at action-executor.c:342 #16 0x00000000004a537f in action_executor_generic_handler (executor=0x7f8314004410, work_item=0x7f8314005100, item=0x7f83140050b0) at action-executor.c:696 #17 0x00000000004a4dbc in action_work_item_execute (executor=0x7f8314004410, work_item=0x7f8314005100) at action-executor.c:715 #18 0x00000000004a37e6 in action_executor_thread (_data=0x7f8314004410) at action-executor.c:797 #19 0x0000000000486193 in launch_thread (data=0x7f83140044b0) at thread.c:66 #20 0x00007f8320b60609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #21 0x00007f8320a87293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 5 (Thread 0x7f831d0a7700 (LWP 3046457)): #0 __lll_lock_wait (futex=futex@entry=0x5e1c10 <ltt_session_list>, private=0) at lowlevellock.c:52 #1 0x00007f8320b630a3 in __GI___pthread_mutex_lock (mutex=0x5e1c10 <ltt_session_list>) at ../nptl/pthread_mutex_lock.c:80 #2 0x00000000004378c3 in session_lock_list () at session.c:156 #3 0x00000000004a871c in add_action_to_subitem_array (action=0x7f830001a730, subitems=0x7f83140051d0) at action-executor.c:1081 #4 0x00000000004a8578 in add_action_to_subitem_array (action=0x7f830001a620, subitems=0x7f83140051d0) at action-executor.c:1025 #5 0x00000000004a4922 in populate_subitem_array_from_trigger (trigger=0x7f830001a950, subitems=0x7f83140051d0) at action-executor.c:1116 #6 0x00000000004a416e in action_executor_enqueue_trigger (executor=0x7f8314004410, trigger=0x7f830001a950, evaluation=0x7f8314005190, object_creds=0x0, client_list=0x7f8314004980) at action-executor.c:924 #7 0x0000000000479481 in dispatch_one_event_notifier_notification (state=0x7f831d0a63e8, notification=0x7f8314005160) at notification-thread-events.c:4613 #8 0x0000000000472324 in handle_one_event_notifier_notification (state=0x7f831d0a63e8, pipe=65, domain=LTTNG_DOMAIN_UST) at notification-thread-events.c:4702 #9 0x0000000000472271 in handle_notification_thread_event_notification (state=0x7f831d0a63e8, pipe=65, domain=LTTNG_DOMAIN_UST) at notification-thread-events.c:4717 #10 0x00000000004695a3 in handle_event_notification_pipe (event_source_fd=65, domain=LTTNG_DOMAIN_UST, revents=1, state=0x7f831d0a63e8) at notification-thread.c:591 #11 0x000000000046849b in thread_notification (data=0xe60520) at notification-thread.c:727 #12 0x0000000000486193 in launch_thread (data=0xe60610) at thread.c:66 #13 0x00007f8320b60609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #14 0x00007f8320a87293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Solution ======== Instead of using session_find_by_name() which requires the `session_list_lock`, we introduce `sample_session_id_by_name` that uses a urcu backed data structure. This allows the sampling of the session id without holding the session list lock. We accept the small window where a session object is still accessible but concretely not valid since the actual execution context will be validated at the moment of execution. The execution side already handles the possibility that the session is removed at that point or is not the same session. The execution side acquires the session_list_lock for validation. Known drawbacks ========= None Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: I5ad2c57acc0d03d2814dda59f8ecf2d831fd961e
Clean-up: sessiond: prepend `the_` to global variable names This avoids name clashes between global variables and local variables or function parameters (notification_thread_handle, for example). This is a step towards enabling -Wshadow. This also helps readability, in my opinion, as it helps quickly spot that some code is using a global variable. Change-Id: Ib0e35ad7efcc54fa88e1900cab3388b98a06b8d9 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: missing `_mutex_lock()` before signaling a condition variable According to the PTHREAD_COND(3) man page, a condition variable signaling and broadcast should alway be protected with a mutex. This commit fixes two calls to `pthread_cond_signal()` function without holding the right lock. This commit also adds an assertion right before two calls to `pthread_cond_broadcast()` where it's less obvious from the surrounding code that the mutex is held. This documents the code and may be useful for future debugging. Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: Iebf5a8b2e4251bd1ff4cd462e548cd3486c6cb75
credentials: uid and gid now use LTTNG_OPTIONAL The triggers will only use the uid element. Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: Ia96e7def5ab560d9af1476920426635fc49f92ef
sessiond: enforce user-exclusive session access in session_access_ok The current session_access_ok logic disallows the access to a session when: uid != session->uid && gid != session->gid && uid != 0 This means that any user that is part of the same primary group as the session's owner can access the session. The primary group is not necessarily (and most likely) not the `tracing` group. Moreover, the `tracing` group is not meant to provide shared access to sessions, but to allow interactions with a root session daemon. For instance: - the session has uid = 1000, gid = 100 - the current user has uid = 1001, gid = 100 access to the session is granted. This is way too broad and unexpected from most users as the LTTng documentation never mentions this "primary group share tracing sessions" behaviour. The documentation only alludes to the fact that separate users have "their own set of sessions". On most distributions, this change will have no impact as `useradd` creates a new group for every user. Users will never share a primary group and thus can't control each others' sessions. However, it is not unusual to have users share a primary group (e.g. `users`) and set the default umask to `0700`. In that case, there is no expectation that every user will share files and there would be no reasonable expectation that they should share all sessions. For instance, it would be unexpected for one user to tear down the sessions of other users with a single `lttng destroy -a` command. If this type of session sharing is desirable to some users, then the default umask of users could be checked or sessions could be created as part of a group. However, in doubt, it is preferable to be strict. This is not marked as a fix since this was most likely deliberate and the change could, although unlikely, break existing deployment scenarios. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: I98f7ffb29d5f6dcb9d660535c1d3f5a1d1a68293
Fix: sessiond: erroneous user check logic in session_access_ok The current session_access_ok logic disallows the access to a session when: uid != session->uid && gid != session->gid && uid != 0 This means that any user that is part of the same primary group as the session's owner can access the session. The primary group is not necessarily (and most likely) not the `tracing` group. For instance: - the session has uid = 1000, gid = 100 - the current user has uid = 1001, gid = 100 access to the session is granted. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: I2e9208286e5508315dae90cb25d34133ca5edcc0
Fix: stream intersection fails on snapshot of cleared session Observed issue ============== In the following scenario: lttng create --snapshot lttng enable-event -u -a lttng start taskset -c 0 <tracepoint producing app> lttng clear taskset -c 0 <tracepoint producing app> lttng snapshot record lttng destroy When using the stream-intersection mode, babetrace complains that the time range for the intersection is invalid since the begin timestamp is after the end timestamp. This is caused by the presence of "inactive" streams for which no events are recorded between the clear action and the recording of the snapshot. These streams have a begin timestamp roughly equal to the moment when the snapshot was taken (i.e. the end timestamp). Babeltrace, in stream-intersection mode, attempts to use the latest beginning timestamp of all streams as the start of the intersection and the earliest end timestamp as the end boundary. Path │File size │Packets │Timestamp: beginning │Timestamp: end │ snapshot-1-20200622-212617-1/ust/uid/1000/64-bit/channel0_0 │ 4.000 KiB│ 1│2020-06-22 21:26:01.903685878│2020-06-22 21:26:17.630456312│ snapshot-1-20200622-212617-1/ust/uid/1000/64-bit/channel0_1 │ 4.000 KiB│ 1│2020-06-22 21:26:17.630909310│2020-06-22 21:26:17.630909310│ snapshot-1-20200622-212617-1/ust/uid/1000/64-bit/channel0_2 │ 4.000 KiB│ 1│2020-06-22 21:26:17.631295033│2020-06-22 21:26:17.631295033│ snapshot-1-20200622-212617-1/ust/uid/1000/64-bit/channel0_3 │ 4.000 KiB│ 1│2020-06-22 21:26:17.631673614│2020-06-22 21:26:17.631673614│ Cause ===== The packet beginning timestamps of the buffers are initialized on creation (on the first "start" of a tracing session). When a "clear" is performed on a session, all open packets are closed and the existing contents are purged. If a stream is inactive, it is possible for no packet to be "opened" until a snapshot of the tracing session is recorded. Solution ======== A new consumer command, "open channel packets" is added. This command performs a "flush empty" operation on all streams of a channel. This command is invoked after a clear (after the tracing is re-started) and on start. This ensures that streams are opened as soon as possible after a clear, a rotation, or a session start. Known drawbacks =============== In the case of an inactive stream, this results an extra empty packet at the beginning of the inactive streams (typically 4kB) in the snapshots. In the case of an active stream, this change will cause the first packet to be empty or contain few events. If the stream is active enough to wrap-around, that empty packet will simply be overwritten. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: I19b5c630fa8bddfb13c3c10f86c6cc9dc4990b08
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>
trace-chunk: Introduce chunk "path", relayd session "ongoing_rotation", sessiond session "rotated" This commit introduces new attributes in 3 different structures because those are used in surrounding areas of the code. Introduce a trace chunk path attribute which tracks where the chunk currently keeps its files. It allows updating the current chunk location with the "rename" API without having to rely on changing the chunk name override, which is an attribute we may want to keep using when we archive the chunk. Separating the "path" from the "name override" attribute allows easy manipulation of the chunk output without having to keep the name override around in the caller code. Introduce an "ongoing_rotation" relayd session attribute to allow live viewers to retry while a rotation is ongoing. This ongoing rotation attribute is introduced in the same commit as the path chunk attribute because they are used in a surrounding area of the code. Introduce a "rotated" sessiond session attribute in this commit because it is used in a surrounding area of the code. This rotated attribute tracks whether an explicit rotation has been performed on the session. It is a preparation step for the clear feature, which will use this to figure out whether it needs to clear the "root" output path (no rotation prior to clear") or if it needs to clear to a new path. Before introduction of the clear feature, a chunk_id of 0 was used to identify this, but because clear will increment the chunk id without changing the path, we need to track this explicitly through the "rotated" session flag. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: Ifdecc66cb4849f3e5f7476ab7db48d8f7532a6d3 Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
sessiond: add clear notifier Add a clear notifier array to reply to clients requesting a clear command. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: I422d87b0122b75be47ae5941fed15f09e87460fe Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
sessiond: cmd_rotate_session: introduce command argument Add a command type argument to cmd_rotate_session(). Change the internal session_close_trace_chunk() API to introduce the LTTNG_TRACE_CHUNK_COMMAND_TYPE_NO_OPERATION command rather than rely on a NULL pointer, which facilitates passing of command argument across cmd_rotate_session. This introduces the LTTNG_TRACE_CHUNK_COMMAND_TYPE_DELETE command, which is required for the clear feature. Its implementation will follow in a separate commit. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: Ic1d8cbab1f98b93f1f6d27a2c6624ac2780932e2 Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Send ust and kernel domain directory handle to consumer Send a directory handle to ust/ and kernel/ subdirectories of the chunk to the consumer daemon, and alter the paths sent to consumer so they do not include the domain subdir. This will facilitate implementation of the clear command when no rotation has been performed. The clear command will need to move the ust/ and kernel/ directories to a "deleted" temporary directory while the consumer is still actively using those directories. Making sure that the consumer uses a handle on those subdirectories only ensures that the consumer will not observe any transient state when those directories are moved. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: I2357ad702f810561c4d11405edc3ef204fc6c455 Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Make lttng_directory_handle reference countable Currently, the lttng_directory_handle API assumes that the caller has exclusive ownership of the lttng_directory_handle. Directory handles are passed by reference and populated by an "init" method and finalized using the "fini" method. In order to allow multiple references to a path or directory file descriptor in follow-up patches, the API is moved to a model where directory handles are dynamically allocated and released using the "put" method. No change in behaviour is intended by this change beyond adapting the API. The objective of the change is to make it easier to implement copy operations of trace chunks that are configured to use an fd-tracker and reduce the number of open file descriptors when lttng_directory_handles are copied. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: Ibc8e97ea9e949adafef44533c30b61e3a9fa1f7d
sessiond: make ltt_sessions_ht_alloc static Fixes: CC session.o /home/smarchi/src/lttng-tools/src/bin/lttng-sessiond/session.c:305:5: error: no previous declaration for ‘ltt_sessions_ht_alloc’ [-Werror=missing-declarations] int ltt_sessions_ht_alloc(void) ^~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Change-Id: Iaf4ca32c1f6ca01fa7ad4a1bfc7edd81a90e6adc Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: move set base_path of session to URI configuration The load code still uses the "old" API to create and configure network session output (lttng_create_session followed by lttng_set_consumer_url). The session base_path is only set in the cmd_create_session_from_descriptor function. This results in invalid network output paths when using a loaded session configuration (xml). While we might want to move the load code to the new API, there is a case to be made in not breaking the previous API behaviour. To restore the expected behaviour of lttng_set_consumer_url, move the assignation of the session base_path to the cmd_set_consumer_uri function (LTTNG_SET_CONSUMER_URI). Both the previous and session descriptor based creation API uses this code path when needed (network output). Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>