MSG("%ssymbol: \"%s\"", indent8, event->attr.ftrace.symbol_name);
break;
case LTTNG_EVENT_SYSCALL:
- MSG("%s (type: syscall)%s", indent6,
+ MSG("%ssyscalls (type: syscall)%s", indent6,
enabled_string(event->enabled));
break;
case LTTNG_EVENT_NOOP:
size = lttng_list_tracepoints(handle, &event_list);
if (size < 0) {
ERR("Unable to list UST events");
+ lttng_destroy_handle(handle);
return size;
}
MSG("");
free(event_list);
+ lttng_destroy_handle(handle);
return CMD_SUCCESS;
error:
+ lttng_destroy_handle(handle);
return -1;
}
size = lttng_list_tracepoints(handle, &event_list);
if (size < 0) {
ERR("Unable to list kernel events");
+ lttng_destroy_handle(handle);
return size;
}
free(event_list);
+ lttng_destroy_handle(handle);
return CMD_SUCCESS;
error:
+ lttng_destroy_handle(handle);
return -1;
}
domain.type = LTTNG_DOMAIN_UST;
}
- handle = lttng_create_handle(session_name, &domain);
- if (handle == NULL) {
- ret = CMD_FATAL;
- goto end;
+ if (opt_kernel || opt_userspace) {
+ handle = lttng_create_handle(session_name, &domain);
+ if (handle == NULL) {
+ ret = CMD_FATAL;
+ goto end;
+ }
}
if (session_name == NULL) {
}
/* Clean handle before creating a new one */
- lttng_destroy_handle(handle);
+ if (handle) {
+ lttng_destroy_handle(handle);
+ }
handle = lttng_create_handle(session_name, &domains[i]);
if (handle == NULL) {
if (domains) {
free(domains);
}
- lttng_destroy_handle(handle);
+ if (handle) {
+ lttng_destroy_handle(handle);
+ }
poptFreeContext(pc);
return ret;