- if (*end == '@') {
- arg = end + 1;
- output_id = strtol(arg, &end, 10);
- }
-
- output = tdm_display_get_output(dpy, output_id, NULL);
- if (!output) {
- TDM_SNPRINTF(reply, len, "can't find the output_id(%d)\n", output_id);
- return;
- }
-
- ret = tdm_output_get_output_type(output, &type);
- if (ret != TDM_ERROR_NONE) {
- TDM_SNPRINTF(reply, len, "can't find the type of output_id(%d)\n", output_id);
- return;
- }
-
- temp = "server";
- tdm_display_enable_ttrace_vblank(dpy, output, 1);
-
- if (ttrace_vblank > 1) {
- temp = "clients";
- tdm_server_enable_ttrace_vblank(dpy, output, 1);
- }
-
- TDM_SNPRINTF(reply, len, "enable ttrace vblank for '%s': %s \n", tdm_conn_str(type), temp);
- } else {
- tdm_display_enable_ttrace_vblank(dpy, NULL, 0);
- tdm_server_enable_ttrace_vblank(dpy, NULL, 0);
- TDM_SNPRINTF(reply, len, "disable ttrace vblank\n");
- }
+ ret = tdm_display_enable_ttrace(dpy, argv[2], output_id, reply, len);
+ TDM_DBG_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);