Add time checking debugging code 09/271409/1
authorJunkyeong, Kim <jk0430.kim@samsung.com>
Mon, 21 Feb 2022 03:01:20 +0000 (12:01 +0900)
committerJunkyeong, Kim <jk0430.kim@samsung.com>
Mon, 21 Feb 2022 03:01:29 +0000 (12:01 +0900)
Change define to 1 if you want get time info.

Change-Id: Ie7c9b118dd1f99b490237a3c23f8f9346f388bea
Signed-off-by: Junkyeong, Kim <jk0430.kim@samsung.com>
src/e_mod_rdp.c

index c0f3fc2..81ae7b9 100644 (file)
@@ -35,6 +35,8 @@
 #include "e_mod_main.h"
 #include "e_mod_rdp.h"
 
+#define RDP_DEBUG 0
+
 #define E_RDP_WIDTH 1280
 #define E_RDP_HEIGHT 720
 #define E_RDP_DEVICE_NAME "rdp_input"
@@ -254,8 +256,15 @@ e_rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp
 
    cmd.bmp.bitmapDataLength = Stream_GetPosition(context->encode_stream);
    cmd.bmp.bitmapData = Stream_Buffer(context->encode_stream);
-
+#if RDP_DEBUG
+   struct timeval start_tv, end_tv;
+   gettimeofday(&start_tv, NULL);
+#endif
    update->SurfaceBits(update->context, &cmd);
+#if RDP_DEBUG
+   gettimeofday(&end_tv, NULL);
+   INF("pixman refresh time rfx: %ld ms", ((end_tv.tv_sec * 1000 + end_tv.tv_usec / 1000) - (start_tv.tv_sec * 1000 + start_tv.tv_usec / 1000)));
+#endif
 }
 
 
@@ -291,8 +300,15 @@ e_rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp
 
    cmd.bmp.bitmapDataLength = Stream_GetPosition(context->encode_stream);
    cmd.bmp.bitmapData = Stream_Buffer(context->encode_stream);
-
+#if RDP_DEBUG
+   struct timeval start_tv, end_tv;
+   gettimeofday(&start_tv, NULL);
+#endif
    update->SurfaceBits(update->context, &cmd);
+#if RDP_DEBUG
+   gettimeofday(&end_tv, NULL);
+   INF("pixman refresh time nsc: %ld ms", ((end_tv.tv_sec * 1000 + end_tv.tv_usec / 1000) - (start_tv.tv_sec * 1000 + start_tv.tv_usec / 1000)));
+#endif
 }
 
 static void
@@ -349,6 +365,11 @@ e_rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp
         subrect.x1 = rect->x1;
         subrect.x2 = rect->x2;
 
+#if RDP_DEBUG
+        struct timeval start_tv, end_tv;
+        gettimeofday(&start_tv, NULL);
+#endif
+
         while (remainingHeight)
           {
              cmd.bmp.height = (remainingHeight > heightIncrement) ? heightIncrement : remainingHeight;
@@ -367,6 +388,10 @@ e_rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp
              remainingHeight -= cmd.bmp.height;
              top += cmd.bmp.height;
           }
+#if RDP_DEBUG
+        gettimeofday(&end_tv, NULL);
+        INF("pixman refresh time raw: %ld ms", ((end_tv.tv_sec * 1000 + end_tv.tv_usec / 1000) - (start_tv.tv_sec * 1000 + start_tv.tv_usec / 1000)));
+#endif
      }
 
    free(cmd.bmp.bitmapData);
@@ -868,6 +893,11 @@ _e_rdp_frame_timer(void *data)
         return ECORE_CALLBACK_CANCEL;
      }
 
+#if RDP_DEBUG
+   struct timeval start_tv, end_capture_tv, end_refresh_tv;
+   gettimeofday(&start_tv, NULL);
+#endif
+
    tbm_surface = _e_rdp_tbm_image_create(output, output->w, output->h, 0x00000000);
    if (tbm_surface == NULL)
      {
@@ -883,6 +913,11 @@ _e_rdp_frame_timer(void *data)
         return ECORE_CALLBACK_RENEW;
      }
 
+#if RDP_DEBUG
+   gettimeofday(&end_capture_tv, NULL);
+   iNF("pixman capture time: %ld ms", ((end_capture_tv.tv_sec * 1000 + end_capture_tv.tv_usec / 1000) - (start_tv.tv_sec * 1000 + start_tv.tv_usec / 1000)));
+#endif
+
    /* sends a full refresh */
    box.x1 = 0;
    box.y1 = 0;
@@ -900,6 +935,11 @@ _e_rdp_frame_timer(void *data)
      }
    pixman_region32_fini(&damage);
 
+#if RDP_DEBUG
+   gettimeofday(&end_refresh_tv, NULL);
+   INF("pixman refresh time: %ld ms", ((end_refresh_tv.tv_sec * 1000 + end_refresh_tv.tv_usec / 1000) - (end_capture_tv.tv_sec * 1000 + end_capture_tv.tv_usec / 1000)));
+#endif
+
    return ECORE_CALLBACK_RENEW;
 }