+ /* If listing options, jump validation */
+ if (opt_list_apps || opt_list_session) {
+ goto end;
+ }
+ /* Conflicting command */
+ if (opt_start_trace && opt_stop_trace) {
+ ERR("Can't use --start and --stop together.");
+ goto error;
+ /* If no PID specified and trace_kernel is off */
+ } else if ((opt_trace_pid == 0 && !opt_trace_kernel) &&
+ (opt_create_trace || opt_start_trace || opt_stop_trace || opt_destroy_trace)) {
+ ERR("Please specify for which tracer (-k or -p PID).");
+ goto error;
+ /* List traces, we need a session name */
+ } else if (opt_list_traces && opt_session_name == NULL) {
+ ERR("Can't use -t without -s, --session option.");
+ goto error;
+ /* Can't set event for both kernel and userspace at the same time */
+ } else if (opt_event_list != NULL && (opt_trace_kernel && opt_trace_pid)) {
+ ERR("Please don't use --event for both kernel and userspace.\nOne at a time to enable events.");
+ goto error;
+ /* Don't need a trace name for kernel tracig */
+ } else if (opt_trace_name != NULL && opt_trace_kernel) {
+ ERR("For action on a kernel trace, please don't specify a trace name.");
+ goto error;
+ } else if (opt_destroy_trace && opt_session_name == NULL) {
+ ERR("Please specify a session in order to destroy a trace");
+ goto error;
+ } else if (opt_create_trace || opt_destroy_trace) {
+ /* Both kernel and user-space are denied for these options */
+ if (opt_trace_pid != 0 && opt_trace_kernel) {
+ ERR("Kernel and user-space trace creation and destruction can't be used together.");
+ goto error;
+ /* Need a trace name for user-space tracing */
+ } else if (opt_trace_name == NULL && opt_trace_pid != 0) {
+ ERR("Please specify a trace name for user-space tracing");
+ goto error;
+ }
+ } else if (opt_stop_trace && opt_trace_pid != 0 && opt_trace_name == NULL) {
+ ERR("Please specify a trace name for user-space tracing");