From: Jonathan Rajotte Date: Tue, 7 Apr 2020 20:27:05 +0000 (-0400) Subject: Fix: load: incomplete error handling for load_session_from_file X-Git-Tag: v2.11.4~3 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=92dbeff150951f4827c209028cacd035caf15288;hp=92dbeff150951f4827c209028cacd035caf15288;p=lttng-tools.git Fix: load: incomplete error handling for load_session_from_file Observed issue ============== lttng-ivc test fails to fail. test_save_load_blocking_timeout[lttng-tools-2.12-lttng-tools-2.11-False] Here we load a xml created by lttng-tools-2.12 and try to load it using lttng-tools 2.11. We expect this to fail on the load. The command report an error on the stderr but the command return code value is zero. From lttng-ivc test runtime.log: Command #0 Return value: 0 Command: lttng load --input-path=/home/joraj/lttng/lttng-ivc/.tox/py3/tmp/test_save_load_blocking_timeou0/save_load saved_trace STDOUT: Session saved_trace has been loaded successfully STDERR: XML Error: Element 'process_attr_trackers': This element is not expected. Error: Session configuration file validation failed Cause ============== The error coming from load_session_from_file is not handled correctly. Solution ======== Rework error handling in load_session_from_path and load_session_from_file. LTTNG_ERR_LOAD_SESSION_NOENT is NOT an error when session_name is specified in load_session_from_path. In this scenario, we are actively looking for the configuration of the session. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I0fea474045b718664e70ffe169e4e4fa125791a8 ---