*
**************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-#include "tdm.h"
#include "tdm_private.h"
-#include "tdm_helper.h"
-#include "tdm_log.h"
#define TDM_DBG_SERVER_ARGS_MAX 32
+/* LCOV_EXCL_START */
static void _tdm_monitor_server_usage(char *app_name, char *reply, int *len);
static void
}
static void
-_tdm_monitor_server_ttrace_vblank(unsigned int pid, char *cwd, int argc, char *argv[], char *reply, int *len, tdm_display *dpy)
+_tdm_monitor_server_ttrace(unsigned int pid, char *cwd, int argc, char *argv[], char *reply, int *len, tdm_display *dpy)
{
- int ttrace_vblank, output_id = 0;
- char *arg;
+ int output_id = 0;
char *end;
+ tdm_error ret;
if (argc < 3) {
_tdm_monitor_server_usage(argv[0], reply, len);
return;
}
- arg = argv[2];
- ttrace_vblank = strtol(arg, &end, 10);
-
- if (ttrace_vblank > 0) {
- tdm_output *output;
- tdm_error ret;
- tdm_output_type type;
- char *temp;
+ if (argv[3])
+ output_id = strtol(argv[3], &end, 10);
- 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);
}
static void
tdm_log_enable_color(0);
}
- if (tdm_display_enable_path((const char*)fd_name) != TDM_ERROR_NONE) {
- TDM_SNPRINTF(reply, len, "failed: '%s'\n", path);
- return;
- }
+ tdm_log_set_path((const char*)fd_name);
done:
TDM_SNPRINTF(reply, len, "log path: '%s'\n", path);
"set output dpms", "<output_idx>:<dpms>", "0:3 or 0:0"
},
{
- "ttrace_vblank", _tdm_monitor_server_ttrace_vblank,
- "enable/disable the vblank for ttrace [0:disable, 1:server, 2:clients]",
- "<enable>[@<output_idx>]", "0 or 1 or 2 or 1@0 or 2@0 or 1@1 or 2@1"
+ "ttrace", _tdm_monitor_server_ttrace,
+ "enable/disable ttrace (module: none,vsync,client_vblank,server_vblank,vblank,layer,pp,capture,all",
+ "<module>[@<output_idx>]",
+ NULL
},
{
"debug", _tdm_monitor_server_debug,
_tdm_monitor_server_command(pid, cwd, dpy, argc, argv, reply, len);
}
+/* LCOV_EXCL_STOP */