unsigned int started;
unsigned int stamp;
+ double req_time;
double last_time;
struct list_head link;
TDM_DBG("vblank(%p) req_id(%u) sequence(%u) time(%.6f)",
private_vblank, req_id, sequence, TDM_TIME(tv_sec, tv_usec));
- TDM_TRACE_COUNT(ClientDoneVBlank, req_id);
-
LIST_FOR_EACH_ENTRY_SAFE(w, ww, &private_vblank->wait_list, link) {
if (w->req_id != req_id)
continue;
+ TDM_TRACE_ASYNC_END((int)w->req_time, "TDM_Client_Vblank:%u", private_vblank->stamp);
+
if (w->req_time >= private_vblank->last_time)
TDM_WRN("'req(%.6f) < last(%.6f)' failed", w->req_time, private_vblank->last_time);
wl_tdm_vblank_wait_vblank(private_vblank->vblank, interval, w->req_id, req_sec, req_usec);
- TDM_TRACE_COUNT(ClientWaitVBlank, w->req_id);
+ TDM_TRACE_ASYNC_BEGIN((int)w->req_time, "TDM_Client_Vblank:%u", private_vblank->stamp);
TDM_DBG("vblank(%p) interval(%u) req_id(%d) req(%.6f)",
- vblank, interval, w->req_id, TDM_TIME(req_sec, req_usec));
+ vblank, interval, w->req_id, w->req_time);
+
+ private_vblank->req_time = w->req_time;
if (private_vblank->last_time >= w->req_time)
TDM_ERR("'last(%.6f) < req(%.6f)' failed", private_vblank->last_time, w->req_time);
wl_tdm_vblank_wait_vblank_seq(private_vblank->vblank, sequence, w->req_id, req_sec, req_usec);
- TDM_TRACE_COUNT(ClientWaitVBlank, w->req_id);
+ TDM_TRACE_ASYNC_BEGIN((int)w->req_time, "TDM_Client_Vblank:%u", private_vblank->stamp);
TDM_DBG("vblank(%p) sequence(%u) req_id(%d) req(%.6f)",
- vblank, sequence, w->req_id, TDM_TIME(req_sec, req_usec));
+ vblank, sequence, w->req_id, w->req_time);
+
+ private_vblank->req_time = w->req_time;
if (private_vblank->last_time >= w->req_time)
TDM_ERR("'last(%.6f) < req(%.6f)' failed", private_vblank->last_time, w->req_time);
};
stamp = tdm_helper_get_time();
- TDM_TRACE_BEGIN(Load_Backend);
+ TDM_TRACE_BEGIN("TDM_Load_Backend");
module = dlopen(path, RTLD_LAZY);
if (!module) {
TDM_ERR("failed to load module: %s(%s)", dlerror(), file);
TDM_TRACE_END();
goto failed_load;
}
+ TDM_TRACE_END();
TDM_DBG("dlopen, dlsym time: %.3f ms", (tdm_helper_get_time() - stamp) * 1000.0);
if (ret != TDM_ERROR_NONE)
goto failed_load;
- TDM_TRACE_END();
-
/* We don't care if backend_data is NULL or not. It's up to backend. */
- TDM_TRACE_BEGIN(Init_Backend);
+ TDM_TRACE_BEGIN("TDM_Init_Backend");
stamp = tdm_helper_get_time();
private_display->bdata = module_data->init((tdm_display *)private_display, &ret);
TDM_DBG("backend init() time: %.3f ms", (tdm_helper_get_time() - stamp) * 1000.0);
}
#endif
- TDM_TRACE_BEGIN(Update_Display);
+ TDM_TRACE_BEGIN("TDM_Update_Display");
ret = _tdm_display_update_internal(private_display, 0);
TDM_TRACE_END();
if (ret != TDM_ERROR_NONE)
{
tdm_error ret = TDM_ERROR_NONE;
- TDM_TRACE_MARK(VBlank);
+ TDM_TRACE_MARK("TDM_DISPLAY_TTRACE_VBlank");
ret = tdm_vblank_wait(vblank, 0, 0, 1, _tdm_display_ttrace_vblank_cb, NULL);
TDM_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);
#ifdef HAVE_TTRACE
#include <ttrace.h>
-#define TDM_TRACE_BEGIN(NAME) traceBegin(TTRACE_TAG_GRAPHICS, "TDM:"#NAME)
+#define TDM_TRACE_BEGIN(fmt, ...) traceBegin(TTRACE_TAG_GRAPHICS, fmt, ##__VA_ARGS__)
#define TDM_TRACE_END() traceEnd(TTRACE_TAG_GRAPHICS)
-#define TDM_TRACE_COUNT(NAME, COUNT) traceCounter(TTRACE_TAG_GRAPHICS, COUNT, "TDM:"#NAME)
-#define TDM_TRACE_MARK(NAME) traceMark(TTRACE_TAG_GRAPHICS, "TDM:"#NAME)
+#define TDM_TRACE_ASYNC_BEGIN(key, name,...) traceAsyncBegin(TTRACE_TAG_GRAPHICS, key, name, ##__VA_ARGS__)
+#define TDM_TRACE_ASYNC_END(key, name,...) traceAsyncEnd(TTRACE_TAG_GRAPHICS, key, name, ##__VA_ARGS__)
+#define TDM_TRACE_COUNT(count, fmt, ...) traceCounter(TTRACE_TAG_GRAPHICS, count, fmt, ##__VA_ARGS__)
+#define TDM_TRACE_MARK(fmt, ...) traceMark(TTRACE_TAG_GRAPHICS, fmt, ##__VA_ARGS__)
#else
-#define TDM_TRACE_BEGIN(NAME)
+#define TDM_TRACE_BEGIN(fmt, ...)
#define TDM_TRACE_END()
-#define TDM_TRACE_COUNT(NAME, COUNT)
-#define TDM_TRACE_MARK(NAME)
+#define TDM_TRACE_ASYNC_BEGIN(key, name,...)
+#define TDM_TRACE_ASYNC_END(key, name,...)
+#define TDM_TRACE_COUNT(count, fmt, ...)
+#define TDM_TRACE_MARK(fmt, ...)
#endif
typedef enum {
tdm_server_vblank_info *vblank_info;
unsigned int req_id;
+ double req_time;
} tdm_server_wait_info;
typedef struct _tdm_server_client_info {
if (tdm_debug_module & TDM_DEBUG_VBLANK)
TDM_DBG("req_id(%d) done", wait_info->req_id);
- TDM_TRACE_COUNT(ServerDoneVBlank, wait_info->req_id);
-
vblank_info = wait_info->vblank_info;
wl_tdm_vblank_send_done(vblank_info->resource, wait_info->req_id,
sequence, tv_sec, tv_usec, error);
+
+ TDM_TRACE_ASYNC_END((int)wait_info->req_time, "TDM_Server_Vblank:%u", vblank_info->stamp);
+
destroy_wait(wait_info);
}
unsigned int enable_fake = 0;
tdm_error ret;
- TDM_TRACE_COUNT(ServerWaitVBlank, req_id);
-
wait_info = calloc(1, sizeof * wait_info);
if (!wait_info) {
TDM_ERR("alloc failed");
LIST_ADDTAIL(&wait_info->link, &private_server->wait_list);
wait_info->vblank_info = vblank_info;
wait_info->req_id = req_id;
+ wait_info->req_time = TDM_TIME(req_sec, req_usec);
if (tdm_debug_module & TDM_DEBUG_VBLANK)
TDM_DBG("req_id(%d) wait", req_id);
+ TDM_TRACE_ASYNC_BEGIN((int)wait_info->req_time, "TDM_Server_Vblank:%u", vblank_info->stamp);
+
ret = tdm_vblank_wait(vblank_info->vblank, req_sec, req_usec, interval, _tdm_server_cb_vblank, wait_info);
tdm_vblank_get_enable_fake(vblank_info->vblank, &enable_fake);
unsigned int enable_fake = 0;
tdm_error ret;
- TDM_TRACE_COUNT(ServerWaitVBlank, req_id);
-
wait_info = calloc(1, sizeof * wait_info);
if (!wait_info) {
TDM_ERR("alloc failed");
LIST_ADDTAIL(&wait_info->link, &private_server->wait_list);
wait_info->vblank_info = vblank_info;
wait_info->req_id = req_id;
+ wait_info->req_time = TDM_TIME(req_sec, req_usec);
if (tdm_debug_module & TDM_DEBUG_VBLANK)
TDM_DBG("req_id(%d) wait", req_id);
+ TDM_TRACE_ASYNC_BEGIN((int)wait_info->req_time, "TDM_Server_Vblank:%u", vblank_info->stamp);
+
ret = tdm_vblank_wait_seq(vblank_info->vblank, req_sec, req_usec, sequence, _tdm_server_cb_vblank, wait_info);
tdm_vblank_get_enable_fake(vblank_info->vblank, &enable_fake);
return;
}
+ TDM_TRACE_ASYNC_END((int)wait_info->req_time, "TDM_HW_Vblank:%u", (unsigned int)private_vblank->stamp);
+
if (wait_info->type == VBLANK_TYPE_HW_SW) {
tdm_error ret;
skip, hw_interval, wait_info->target_seq);
}
+ TDM_TRACE_ASYNC_BEGIN((int)wait_info->req_time, "TDM_HW_Vblank:%u", (unsigned int)private_vblank->stamp);
+
if (private_vblank->add_front)
ret = tdm_output_wait_vblank_add_front(private_vblank->output, hw_interval, 0,
_tdm_vblank_cb_vblank_HW, wait_info);
if (w->target_time != first_wait_info->target_time)
break;
+ TDM_TRACE_ASYNC_END((int)w->req_time, "TDM_SW_Vblank:%u", (unsigned int)private_vblank->stamp);
+
LIST_DEL(&w->link);
_tdm_vblank_valid_list_del(&w->valid_link);
_tdm_vblank_insert_wait(wait_info, &private_vblank->SW_wait_list);
+ TDM_TRACE_ASYNC_BEGIN((int)wait_info->req_time, "TDM_SW_Vblank:%u", (unsigned int)private_vblank->stamp);
+
ret = _tdm_vblank_sw_timer_update(private_vblank);
if (ret != TDM_ERROR_NONE) {
LIST_DEL(&wait_info->link);