+ if (opts.regex) {
+ char *channel, *marker;
+
+ if (scan_ch_marker(opts.regex,
+ &channel, &marker)) {
+ retval = EXIT_FAILURE;
+ break;
+ }
+ if (ustcmd_set_marker_state(trace, channel, marker, 0, *pidit)) {
+ ERR("error while trying to disable marker %s with PID %u\n",
+ opts.regex, (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ }
+ }
+ break;
+
+ case SET_SUBBUF_SIZE:
+ if (opts.regex) {
+ char *channel;
+ unsigned int size;
+ if (scan_ch_and_num(opts.regex, &channel, &size)) {
+ retval = EXIT_FAILURE;
+ break;
+ }
+
+ if (ustcmd_set_subbuf_size(trace, channel, size, *pidit)) {
+ ERR("error while trying to set the size of subbuffers with PID %u\n",
+ (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ }
+ }
+ break;
+
+ case SET_SUBBUF_NUM:
+ if (opts.regex) {
+ char *channel;
+ unsigned int num;
+ if (scan_ch_and_num(opts.regex, &channel, &num)) {
+ retval = EXIT_FAILURE;
+ break;
+ }
+
+ if (num < 2) {
+ ERR("Subbuffer count should be greater or equal to 2");
+ retval = EXIT_FAILURE;
+ break;
+ }
+ if (ustcmd_set_subbuf_num(trace, channel, num, *pidit)) {
+ ERR("error while trying to set the number of subbuffers with PID %u\n",
+ (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ }
+ }
+ break;
+
+ case GET_SUBBUF_SIZE:
+ result = ustcmd_get_subbuf_size(trace, opts.regex, *pidit);
+ if (result == -1) {
+ ERR("error while trying to get_subuf_size with PID %u\n", (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ break;
+ }
+
+ printf("the size of subbufers is %d\n", result);
+ break;
+
+ case GET_SUBBUF_NUM:
+ result = ustcmd_get_subbuf_num(trace, opts.regex, *pidit);
+ if (result == -1) {
+ ERR("error while trying to get_subuf_num with PID %u\n", (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ break;
+ }
+
+ printf("the number of subbufers is %d\n", result);
+ break;
+
+ case ALLOC_TRACE:
+ result = ustcmd_alloc_trace(trace, *pidit);
+ if (result) {
+ ERR("error while trying to alloc trace with PID %u\n", (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ }
+ break;
+
+ case GET_SOCK_PATH:
+ result = ustcmd_get_sock_path(&tmp, *pidit);
+ if (result) {
+ ERR("error while trying to get sock path for PID %u\n", (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ break;
+ }
+ printf("the socket path is %s\n", tmp);
+ free(tmp);
+ break;
+
+ case SET_SOCK_PATH:
+ result = ustcmd_set_sock_path(opts.regex, *pidit);
+ if (result) {
+ ERR("error while trying to set sock path for PID %u\n", (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ }
+ break;
+
+ case FORCE_SWITCH:
+ result = ustcmd_force_switch(*pidit);
+ if (result) {
+ ERR("error while trying to force switch for PID %u\n", (unsigned int) *pidit);
+ retval = EXIT_FAILURE;
+ }