+ /* 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");
+ goto error;
+ } else if (opt_stop_trace && opt_session_name == NULL) {
+ ERR("Please specify a session to stop tracing");
+ goto error;
+ }
+
+ /* If start trace, auto start tracing */
+ if (opt_start_trace || opt_event_list != NULL) {
+ DBG("Requesting auto tracing");
+ auto_trace = 1;