Add some profiling aids

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Claudio Matsuoka committed 2008-08-19 13:58:19 -03:00
1 parent 367049a11c
commit 938773765c
1 file changed
+8 -2
+8 -2
View File
@@ -129,7 +129,7 @@ void chld_handler(int);
static int debug = 0; static int debug = 0;
#ifdef DEBUG_TIMESTAMP #ifdef DEBUG_TIMESTAMP /* For profiling */
#include <time.h> #include <time.h>
#include <stdarg.h> #include <stdarg.h>
@@ -161,7 +161,7 @@ void _d(char *fmt, ...)
va_end(ap); va_end(ap);
} }
#else #else
#define _d(x...) do { if (debug) printf(x); printf("\n"); } while (0) #define _d(x...) do { if (debug) { printf(x); printf("\n"); } } while (0)
#endif #endif
@@ -423,7 +423,9 @@ int main()
} }
_d("adjust clock"); _d("adjust clock");
#ifndef NO_HCTOSYS #ifndef NO_HCTOSYS
#ifndef DEBUG_TIMESTAMP
system("/sbin/hwclock --hctosys --localtime" HWCLOCK_DIRECTISA); system("/sbin/hwclock --hctosys --localtime" HWCLOCK_DIRECTISA);
#endif
#endif #endif
/* /*
@@ -526,6 +528,7 @@ int main()
system(GETTY "&"); system(GETTY "&");
_d("forking");
if (!fork()) { if (!fork()) {
/* child process */ /* child process */
@@ -571,6 +574,9 @@ int main()
while (access("/tmp/shutdown", F_OK) < 0) { while (access("/tmp/shutdown", F_OK) < 0) {
_d("start X as %s\n", username); _d("start X as %s\n", username);
#ifdef DEBUG_TIMESTAMP
sleep(10);
#endif
if (debug) { if (debug) {
snprintf(line, LINE_SIZE, snprintf(line, LINE_SIZE,
"su -c startx -l %s\n", username); "su -c startx -l %s\n", username);