Debug stuff.

SVN revision: 19666
This commit is contained in:
Kim Woelders 2006-01-08 23:51:07 +00:00
parent 8feadccca6
commit 26f55b545d
3 changed files with 34 additions and 1 deletions

View File

@ -2588,6 +2588,8 @@ BackgroundsIpc(const char *params, Client * c __UNUSED__)
bg = DeskBackgroundGet(DeskGet(i));
if (bg)
IpcPrintf("%i %s\n", i, BackgroundGetName(bg));
else
IpcPrintf("%i %s\n", i, "-NONE-");
}
}
else if (!strncmp(cmd, "apply", 2))

View File

@ -511,7 +511,7 @@ EventsProcess(XEvent ** evq_p, int *evq_n, int *evq_f)
continue;
if (EventDebug(EDBUG_TYPE_EVENTS) > 1)
Eprintf("EventsProcess %d type=%d\n", i, evq[i].type);
EventShow(evq + i);
count++;
HandleEvent(evq + i);

View File

@ -185,6 +185,9 @@ ETimedLoopNext(void)
/*
* Debug/error message printing.
*/
#if 1 /* Set to 0 for differential time */
void
Eprintf(const char *fmt, ...)
{
@ -201,3 +204,31 @@ Eprintf(const char *fmt, ...)
vfprintf(stdout, fmt, args);
va_end(args);
}
#else
void
Eprintf(const char *fmt, ...)
{
static struct timeval t0;
va_list args;
struct timeval tv;
long ts, tus;
gettimeofday(&tv, NULL);
ts = tv.tv_sec - t0.tv_sec;
tus = tv.tv_usec - t0.tv_usec;
if (tus < 0)
{
tus += 1000000;
ts -= 1;
}
fprintf(stdout, "[%d] %#lx %4ld.%06ld: ", getpid(), NextRequest(disp), ts,
tus);
va_start(args, fmt);
vfprintf(stdout, fmt, args);
va_end(args);
gettimeofday(&t0, NULL);
}
#endif