nobody0
11-03-2005, 22:09
Zum Debuggen verwende ich im User-Space ein C-Makro, das auch Datum und Zeit ausgibt:
#define mc_DEBUGT(fmt, args...) { struct tm *tm; time_t t1= time (NULL); tm = localtime (&t1); (void)fprintf(stderr, \
"mc_DEBUGT: %d.%d.%d, %d:%d:%d, \"%s\", \"%s\", line %d: ", \
tm->tm_year +1900, tm->tm_mon +1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, __FILE__, __FUNCTION__, __LINE__); \
(void)fprintf(stderr, fmt, ## args); }
Nun hätte ich sowas auch gerne im Kernel-Space, aber da gibt's weder time noch localtime.
Irgendwelche Vorschläge wie man es trotzdem hinbekommen kann? :confused:
#define mc_DEBUGT(fmt, args...) { struct tm *tm; time_t t1= time (NULL); tm = localtime (&t1); (void)fprintf(stderr, \
"mc_DEBUGT: %d.%d.%d, %d:%d:%d, \"%s\", \"%s\", line %d: ", \
tm->tm_year +1900, tm->tm_mon +1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, __FILE__, __FUNCTION__, __LINE__); \
(void)fprintf(stderr, fmt, ## args); }
Nun hätte ich sowas auch gerne im Kernel-Space, aber da gibt's weder time noch localtime.
Irgendwelche Vorschläge wie man es trotzdem hinbekommen kann? :confused: