+ switch (opts.cmd) {
+ case START_TRACE:
+ result = ustcmd_start_trace(*pidit);
+ if (result) {
+ ERR("error while trying to for trace with PID %u\n", (unsigned int) *pidit);
+ break;
+ }
+ //printf("sucessfully started trace for PID %u\n", (unsigned int) *pidit);
+ break;
+
+ case STOP_TRACE:
+ result = ustcmd_stop_trace(*pidit);
+ if (result) {
+ ERR("error while trying to stop trace for PID %u\n", (unsigned int) *pidit);
+ break;
+ }
+ //printf("sucessfully stopped trace for PID %u\n", (unsigned int) *pidit);
+ break;
+
+ case START:
+ result = ustcmd_setup_and_start(*pidit);
+ if (result) {
+ ERR("error while trying to setup/start trace for PID %u\n", (unsigned int) *pidit);
+ break;
+ }
+ //printf("sucessfully setup/started trace for PID %u\n", (unsigned int) *pidit);
+ break;
+
+ case DESTROY:
+ result = ustcmd_destroy_trace(*pidit);
+ if (result) {
+ ERR("error while trying to destroy trace with PID %u\n", (unsigned int) *pidit);
+ break;
+ }
+ //printf("sucessfully destroyed trace for PID %u\n", (unsigned int) *pidit);
+ break;
+
+ case LIST_MARKERS:
+ cmsf = NULL;
+ if (ustcmd_get_cmsf(&cmsf, *pidit)) {
+ fprintf(stderr,
+ "error while trying to list markers for"
+ " PID %u\n", (unsigned int) *pidit);
+ break;
+ }
+ unsigned int i = 0;
+ while (cmsf[i].channel != NULL) {
+ printf("{PID: %u, channel/marker: %s/%s, "
+ "state: %u, fmt: %s}\n",
+ (unsigned int) *pidit,
+ cmsf[i].channel,
+ cmsf[i].marker,
+ cmsf[i].state,
+ cmsf[i].fs);
+ ++i;
+ }
+ ustcmd_free_cmsf(cmsf);
+ break;
+
+ case ENABLE_MARKER:
+ case DISABLE_MARKER:
+ regex_change_m_state(&opts, *pidit);
+ break;
+
+ default:
+ ERR("unknown command\n");
+ break;