[ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_STREAM_FAIL) ] = "Kernel create stream failed",
[ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_DIR_FAIL) ] = "Kernel trace directory creation failed",
[ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_DIR_EXIST) ] = "Kernel trace directory already exist",
+ [ LTTCOMM_ERR_INDEX(LTTCOMM_KERN_NO_SESSION) ] = "No kernel session found",
[ LTTCOMM_ERR_INDEX(KCONSUMERD_COMMAND_SOCK_READY) ] = "Kconsumerd command socket ready",
[ LTTCOMM_ERR_INDEX(KCONSUMERD_SUCCESS_RECV_FD) ] = "Kconsumerd success on receiving fds",
[ LTTCOMM_ERR_INDEX(KCONSUMERD_ERROR_RECV_FD) ] = "Kconsumerd error on receiving fds",
LTTCOMM_KERN_CONSUMER_FAIL, /* Kernel consumer start failed */
LTTCOMM_KERN_STREAM_FAIL, /* Kernel create stream failed */
LTTCOMM_KERN_DIR_FAIL, /* Kernel trace directory creation failed */
- LTTCOMM_KERN_DIR_EXIST, /* Kernel traec directory exist */
+ LTTCOMM_KERN_DIR_EXIST, /* Kernel trace directory exist */
+ LTTCOMM_KERN_NO_SESSION, /* No kernel session found */
KCONSUMERD_COMMAND_SOCK_READY, /* when kconsumerd command socket ready */
KCONSUMERD_SUCCESS_RECV_FD, /* success on receiving fds */
KCONSUMERD_ERROR_RECV_FD, /* error on receiving fds */
goto setup_error;
}
+ if (cmd_ctx->session->kernel_session == NULL) {
+ ret = LTTCOMM_KERN_NO_SESSION;
+ goto error;
+ }
+
DBG("Stop kernel tracing");
ret = kernel_stop_session(cmd_ctx->session->kernel_session);