. use library function to parse memory string
[minix3.git] / kernel / debug.h
blob2cfb905d0ad85dd7595fd98bba37088ad6da78f5
1 #ifndef DEBUG_H
2 #define DEBUG_H
4 /* This header file defines all debugging constants and macros, and declares
5 * some variables. Certain debugging features redefine standard constants
6 * and macros. Therefore, this header file should be included after the
7 * other kernel headers.
8 */
10 #include <ansi.h>
11 #include "config.h"
13 /* Enable prints such as
14 * . send/receive failed due to deadlock or dead source or dead destination
15 * . trap not allowed
16 * . bogus message pointer
17 * . kernel call number not allowed by this process
19 * Of course the call still fails, but nothing is printed if these warnings
20 * are disabled.
22 #define DEBUG_ENABLE_IPC_WARNINGS 0
23 #define DEBUG_STACKTRACE 1
25 /* It's interesting to measure the time spent withing locked regions, because
26 * this is the time that the system is deaf to interrupts.
28 #if DEBUG_TIME_LOCKS
30 #define TIMING_POINTS 20 /* timing resolution */
31 #define TIMING_CATEGORIES 20
32 #define TIMING_NAME 10
34 /* Definition of the data structure to store lock() timing data. */
35 struct lock_timingdata {
36 char names[TIMING_NAME];
37 unsigned long lock_timings[TIMING_POINTS];
38 unsigned long lock_timings_range[2];
39 unsigned long binsize, resets, misses, measurements;
42 /* The data is declared here, but allocated in debug.c. */
43 extern struct lock_timingdata timingdata[TIMING_CATEGORIES];
45 /* Prototypes for the timing functionality. */
46 _PROTOTYPE( void timer_start, (int cat, char *name) );
47 _PROTOTYPE( void timer_end, (int cat) );
49 #define locktimestart(c, v) timer_start(c, v)
50 #define locktimeend(c) timer_end(c)
51 #else
52 #define locktimestart(c, v)
53 #define locktimeend(c)
54 #endif /* DEBUG_TIME_LOCKS */
56 #endif /* DEBUG_H */