const char * const config_event_type_all = "ALL";
const char * const config_event_type_tracepoint = "TRACEPOINT";
const char * const config_event_type_probe = "PROBE";
-const char * const config_event_type_userspace_probe = "USERSPACE_PROBE";
+LTTNG_HIDDEN const char * const config_event_type_userspace_probe = "USERSPACE_PROBE";
const char * const config_event_type_function = "FUNCTION";
const char * const config_event_type_function_entry = "FUNCTION_ENTRY";
const char * const config_event_type_noop = "NOOP";
config_entry_handler_cb handler, void *user_data)
{
int ret = 0;
- char *path;
+ const char *path;
FILE *config_file = NULL;
struct handler_filter_args filter = { section, handler, user_data };
} else if (!strcmp((const char *) str, config_xml_false)) {
*val = 0;
} else {
- WARN("Invalid boolean value encoutered (%s).",
+ WARN("Invalid boolean value encountered (%s).",
(const char *) str);
ret = -1;
}
lttng_userspace_probe_location_tracepoint_create(
binary_path, provider_name,
probe_name, lookup_method);
+ lookup_method = NULL;
goto error;
}
}
free(exclusions[i]);
}
+ lttng_event_destroy(event);
free(exclusions);
free(filter_expression);
return ret;
xmlNextElementSibling(session_node)) {
ret = process_session_node(session_node,
session_name, overwrite, overrides);
- if (session_name && ret == 0) {
- /* Target session found and loaded */
- session_found = 1;
- break;
+ if (!session_name && ret) {
+ /* Loading error occurred. */
+ goto end;
+ } else if (session_name) {
+ if (ret == 0) {
+ /* Target session found and loaded */
+ session_found = 1;
+ break;
+ } else if (ret == -LTTNG_ERR_NO_SESSION) {
+ /*
+ * Ignore this error, we are looking for the
+ * session.
+ */
+ ret = 0;
+ } else {
+ /* Loading error occurred. */
+ goto end;
+ }
}
}
end:
ret = load_session_from_file(file_path.data, session_name,
validation_ctx, overwrite, overrides);
- if (session_name && !ret) {
- session_found = 1;
- break;
+ if (!session_name && ret) {
+ /* Loading error occured. */
+ goto end;
+ } else if (session_name) {
+ if (ret == 0) {
+ /* Target session found and loaded */
+ session_found = 1;
+ break;
+ } else if (ret ==
+ -LTTNG_ERR_LOAD_SESSION_NOENT) {
+ /*
+ * Ignore this error, we are looking for
+ * the session.
+ */
+ ret = 0;
+ } else {
+ /* Loading error occured. */
+ goto end;
+ }
}
+
/*
* Reset the buffer's size to the location of the
* path's trailing '/'.
}
if (!path) {
- char *home_path;
+ const char *home_path;
const char *sys_path;
/* Try home path */