+ break;
+ case PUT_SUBBUFFER:
+ result = put_subbuffer(trace_name, buf_inf->channel,
+ buf_inf->ch_cpu,
+ buf_inf->consumed_old);
+ reply_header->result = result;
+
+ break;
+ }
+
+ if (ustcomm_send(sock, reply_header, (char *)reply_msg) < 0) {
+ ERR("ustcomm_send failed");
+ }
+
+}
+
+static void process_marker_cmd(int sock, int command,
+ struct ustcomm_marker_info *marker_inf)
+{
+ struct ustcomm_header _reply_header;
+ struct ustcomm_header *reply_header = &_reply_header;
+ int result;
+
+ memset(reply_header, 0, sizeof(*reply_header));
+
+ switch(command) {
+ case ENABLE_MARKER:
+
+ result = ltt_marker_connect(marker_inf->channel,
+ marker_inf->marker,
+ "default");
+ if (result < 0) {
+ WARN("could not enable marker; channel=%s,"
+ " name=%s",
+ marker_inf->channel,
+ marker_inf->marker);
+
+ }
+ break;
+ case DISABLE_MARKER:
+ result = ltt_marker_disconnect(marker_inf->channel,
+ marker_inf->marker,
+ "default");
+ if (result < 0) {
+ WARN("could not disable marker; channel=%s,"
+ " name=%s",
+ marker_inf->channel,
+ marker_inf->marker);
+ }
+ break;
+ }
+
+ reply_header->result = result;
+
+ if (ustcomm_send(sock, reply_header, NULL) < 0) {
+ ERR("ustcomm_send failed");
+ }
+
+}
+static void process_client_cmd(struct ustcomm_header *recv_header,
+ char *recv_buf, int sock)
+{
+ int result;
+ struct ustcomm_header _reply_header;
+ struct ustcomm_header *reply_header = &_reply_header;
+ char *send_buf = send_buffer;
+
+ memset(reply_header, 0, sizeof(*reply_header));
+ memset(send_buf, 0, sizeof(send_buffer));
+
+ switch(recv_header->command) {
+ case GET_SUBBUF_NUM_SIZE:
+ case SET_SUBBUF_NUM:
+ case SET_SUBBUF_SIZE:
+ {
+ struct ustcomm_channel_info *ch_inf;
+ ch_inf = (struct ustcomm_channel_info *)recv_buf;
+ result = ustcomm_unpack_channel_info(ch_inf);
+ if (result < 0) {
+ ERR("couldn't unpack channel info");
+ reply_header->result = -EINVAL;
+ goto send_response;