X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fsession-config.c;h=9df815bff4129ea8e799d25f65f0891b63c45b81;hp=743b5143893a4364cf5bf4f314e408102f77824d;hb=02d8ac3daf181dc8b07bf206e8cd855e74e3fcd8;hpb=d7b645e2c77977a8a83362f27094bf6d126f6fb8 diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c index 743b51438..9df815bff 100644 --- a/src/common/config/session-config.c +++ b/src/common/config/session-config.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -177,6 +178,9 @@ LTTNG_HIDDEN const char * const config_event_context_preemptible = "PREEMPTIBLE" LTTNG_HIDDEN const char * const config_event_context_need_reschedule = "NEED_RESCHEDULE"; LTTNG_HIDDEN const char * const config_event_context_migratable = "MIGRATABLE"; +/* Deprecated symbols */ +const char * const config_element_perf; + enum process_event_node_phase { CREATION = 0, ENABLE = 1, @@ -1607,6 +1611,7 @@ int process_event_node(xmlNodePtr event_node, struct lttng_handle *handle, goto end; } + free(filter_expression); filter_expression = strdup((char *) content); free(content); if (!filter_expression) { @@ -2837,8 +2842,8 @@ end: } } - if (!session_found) { - ret = -LTTNG_ERR_LOAD_SESSION_NOENT; + if (session_found) { + ret = 0; } return ret; @@ -2883,6 +2888,7 @@ int config_load_session(const char *path, const char *session_name, int override, unsigned int autoload) { int ret; + bool session_loaded = false; const char *path_ptr = NULL; struct session_config_validation_ctx validation_ctx = { 0 }; @@ -2941,6 +2947,7 @@ int config_load_session(const char *path, const char *session_name, * Continue even if the session was found since we have to try * the system wide sessions. */ + session_loaded = true; } } @@ -2963,6 +2970,9 @@ int config_load_session(const char *path, const char *session_name, if (path_ptr) { ret = load_session_from_path(path_ptr, session_name, &validation_ctx, override); + if (!ret) { + session_loaded = true; + } } } else { ret = access(path, F_OK); @@ -2995,5 +3005,10 @@ end: */ ret = 0; } + + if (session_loaded && ret == -LTTNG_ERR_LOAD_SESSION_NOENT) { + /* A matching session was found in one of the search paths. */ + ret = 0; + } return ret; }