summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch')
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch
new file mode 100644
index 0000000000..efc85a42ab
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-dri-lite/xserver-boottime.patch
@@ -0,0 +1,38 @@
1diff --git a/os/log.c b/os/log.c
2index 0860847..2c46f1a 100644
3--- a/os/log.c
4+++ b/os/log.c
5@@ -255,6 +255,33 @@ LogVWrite(int verb, const char *f, va_list args)
6 static char tmpBuffer[1024];
7 int len = 0;
8
9+ struct timeval time;
10+ time_t tv_sec;
11+ suseconds_t tv_usec;
12+ static Bool first = TRUE;
13+ static time_t start_tv_sec;
14+ static suseconds_t start_usec;
15+ int diff_sec, diff_usec;
16+
17+ gettimeofday(&time, NULL);
18+ tv_sec = time.tv_sec;
19+ tv_usec = time.tv_usec;
20+ if (first == TRUE) {
21+ start_tv_sec = tv_sec;
22+ start_usec = tv_usec;
23+ first = FALSE;
24+ }
25+ diff_sec = (int)difftime(tv_sec, start_tv_sec);
26+ diff_usec = (tv_usec - start_usec);
27+ if (diff_usec < 0) {
28+ diff_sec--;
29+ diff_usec += 1000000;
30+ }
31+ sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec);
32+ len = strlen(tmpBuffer);
33+ if (logFile)
34+ fwrite(tmpBuffer, len, 1, logFile);
35+
36 /*
37 * Since a va_list can only be processed once, write the string to a
38 * buffer, and then write the buffer out to the appropriate output