From 938773765ce159505bcd0f54befc39b8b4fa1791 Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Tue, 19 Aug 2008 13:58:19 -0300 Subject: [PATCH] Add some profiling aids Signed-off-by: Claudio Matsuoka --- finit-alt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/finit-alt.c b/finit-alt.c index 36d96c32..aa7ad898 100644 --- a/finit-alt.c +++ b/finit-alt.c @@ -129,7 +129,7 @@ void chld_handler(int); static int debug = 0; -#ifdef DEBUG_TIMESTAMP +#ifdef DEBUG_TIMESTAMP /* For profiling */ #include #include @@ -161,7 +161,7 @@ void _d(char *fmt, ...) va_end(ap); } #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 @@ -423,7 +423,9 @@ int main() } _d("adjust clock"); #ifndef NO_HCTOSYS +#ifndef DEBUG_TIMESTAMP system("/sbin/hwclock --hctosys --localtime" HWCLOCK_DIRECTISA); +#endif #endif /* @@ -526,6 +528,7 @@ int main() system(GETTY "&"); + _d("forking"); if (!fork()) { /* child process */ @@ -571,6 +574,9 @@ int main() while (access("/tmp/shutdown", F_OK) < 0) { _d("start X as %s\n", username); +#ifdef DEBUG_TIMESTAMP + sleep(10); +#endif if (debug) { snprintf(line, LINE_SIZE, "su -c startx -l %s\n", username);