+ case GET_PIDUNIQUE:
+ {
+ struct ustcomm_pidunique *pid_msg;
+ pid_msg = (struct ustcomm_pidunique *)send_buf;
+
+ pid_msg->pidunique = pidunique;
+ reply_header->size = sizeof(pid_msg);
+
+ goto send_response;
+
+ }
+ case GET_SOCK_PATH:
+ {
+ struct ustcomm_single_field *sock_msg;
+ char *sock_path_env;
+
+ sock_msg = (struct ustcomm_single_field *)send_buf;
+
+ sock_path_env = getenv("UST_DAEMON_SOCKET");
+
+ if (!sock_path_env) {
+ result = ustcomm_pack_single_field(reply_header,
+ sock_msg,
+ SOCK_DIR "/ustconsumer");
+
+ } else {
+ result = ustcomm_pack_single_field(reply_header,
+ sock_msg,
+ sock_path_env);
+ }
+ reply_header->result = result;
+
+ goto send_response;
+ }
+ case SET_SOCK_PATH:
+ {
+ struct ustcomm_single_field *sock_msg;
+ sock_msg = (struct ustcomm_single_field *)recv_buf;
+ result = ustcomm_unpack_single_field(sock_msg);
+ if (result < 0) {
+ reply_header->result = -EINVAL;
+ goto send_response;
+ }
+
+ reply_header->result = setenv("UST_DAEMON_SOCKET",
+ sock_msg->field, 1);
+
+ goto send_response;
+ }
+ case START:
+ case SETUP_TRACE:
+ case ALLOC_TRACE:
+ case CREATE_TRACE:
+ case START_TRACE:
+ case STOP_TRACE:
+ case DESTROY_TRACE:
+ case FORCE_SUBBUF_SWITCH:
+ {
+ struct ustcomm_single_field *trace_inf =
+ (struct ustcomm_single_field *)recv_buf;
+
+ result = ustcomm_unpack_single_field(trace_inf);
+ if (result < 0) {
+ ERR("couldn't unpack trace info");
+ reply_header->result = -EINVAL;
+ goto send_response;
+ }
+
+ reply_header->result =
+ process_trace_cmd(recv_header->command,
+ trace_inf->field);
+ goto send_response;
+