mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-06-09 03:03:34 -04:00
WAYLAND_DEBUG: produce comparable timestamp values
Instead of just not bothering with overflow, keep the last 4 digits of unix time. This makes the numbers comparable with other logs that produce timestamp, in particular the syslog. Signed-off-by: Benjamin Otte <otte@redhat.com>
This commit is contained in:
parent
c072ae6f5f
commit
c560d0e2de
2 changed files with 6 additions and 6 deletions
|
|
@ -1547,7 +1547,7 @@ wl_closure_print(struct wl_closure *closure, struct wl_object *target,
|
|||
struct argument_details arg;
|
||||
const char *signature = closure->message->signature;
|
||||
struct timespec tp;
|
||||
unsigned int time;
|
||||
uint64_t time;
|
||||
uint32_t nval;
|
||||
FILE *f;
|
||||
char *buffer;
|
||||
|
|
@ -1558,10 +1558,10 @@ wl_closure_print(struct wl_closure *closure, struct wl_object *target,
|
|||
return;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &tp);
|
||||
time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
|
||||
time = ((tp.tv_sec % 10000L) * 1000000L) + (tp.tv_nsec / 1000);
|
||||
fprintf(f, "%s[%7u.%03u] ",
|
||||
color ? WL_DEBUG_COLOR_GREEN : "",
|
||||
time / 1000, time % 1000);
|
||||
(unsigned) (time / 1000), (unsigned) (time % 1000));
|
||||
|
||||
#if defined(HAVE_GETTID)
|
||||
if (include_tid < 0) {
|
||||
|
|
|
|||
|
|
@ -1577,7 +1577,7 @@ queue_event(struct wl_display *display, int len)
|
|||
const struct wl_message *message;
|
||||
struct wl_event_queue *queue;
|
||||
struct timespec tp;
|
||||
unsigned int time;
|
||||
uint64_t time;
|
||||
int num_zombie_fds;
|
||||
|
||||
wl_connection_copy(display->connection, p, sizeof p);
|
||||
|
|
@ -1619,11 +1619,11 @@ queue_event(struct wl_display *display, int len)
|
|||
|
||||
if (debug_client) {
|
||||
clock_gettime(CLOCK_REALTIME, &tp);
|
||||
time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
|
||||
time = ((tp.tv_sec % 10000L) * 1000000L) + (tp.tv_nsec / 1000);
|
||||
fprintf(stderr, "%s[%7u.%03u] %sdiscarded %s[%s]%s#%u%s.[event %d]%s"
|
||||
"(%d fd, %d byte)\n",
|
||||
debug_color ? WL_DEBUG_COLOR_GREEN : "",
|
||||
time / 1000, time % 1000,
|
||||
(unsigned) (time / 1000), (unsigned) (time % 1000),
|
||||
debug_color ? WL_DEBUG_COLOR_RED : "",
|
||||
debug_color ? WL_DEBUG_COLOR_BLUE : "",
|
||||
zombie ? "zombie" : "unknown",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue