#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <stdbool.h>
#include <common/defaults.h>
#include <common/error.h>
memset(&event, 0, sizeof(event));
+ /* Initialize default log level which varies by domain */
+ switch (handle->domain.type)
+ {
+ case LTTNG_DOMAIN_JUL:
+ event.loglevel = LTTNG_LOGLEVEL_JUL_ALL;
+ break;
+ case LTTNG_DOMAIN_LOG4J:
+ event.loglevel = LTTNG_LOGLEVEL_LOG4J_ALL;
+ break;
+ case LTTNG_DOMAIN_PYTHON:
+ event.loglevel = LTTNG_LOGLEVEL_PYTHON_DEBUG;
+ break;
+ case LTTNG_DOMAIN_UST:
+ case LTTNG_DOMAIN_KERNEL:
+ event.loglevel = LTTNG_LOGLEVEL_DEBUG;
+ break;
+ default:
+ assert(0);
+ }
+
for (node = xmlFirstElementChild(event_node); node;
node = xmlNextElementSibling(node)) {
if (!strcmp((const char *) node->name, config_element_name)) {
}
}
- if (!session_found) {
- ret = -LTTNG_ERR_LOAD_SESSION_NOENT;
+ if (session_found) {
+ ret = 0;
}
return ret;
int override, unsigned int autoload)
{
int ret;
+ bool session_loaded = false;
const char *path_ptr = NULL;
struct session_config_validation_ctx validation_ctx = { 0 };
* Continue even if the session was found since we have to try
* the system wide sessions.
*/
+ session_loaded = true;
}
}
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);
*/
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;
}