diff options
Diffstat (limited to 'firmware/export/profile.h')
-rw-r--r-- | firmware/export/profile.h | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/firmware/export/profile.h b/firmware/export/profile.h index 3736ac7924..4a7649e803 100644 --- a/firmware/export/profile.h +++ b/firmware/export/profile.h | |||
@@ -19,40 +19,7 @@ | |||
19 | ****************************************************************************/ | 19 | ****************************************************************************/ |
20 | 20 | ||
21 | #ifndef _SYS_PROFILE_H | 21 | #ifndef _SYS_PROFILE_H |
22 | #define _SYS_PROFILE_H 1 | 22 | #define _SYS_PROFILE_H |
23 | |||
24 | #include <sys/types.h> | ||
25 | |||
26 | /* PFD is Profiled Function Data */ | ||
27 | |||
28 | /* Indices are shorts which means that we use 4k of RAM */ | ||
29 | #define INDEX_BITS 11 /* What is a reasonable size for this? */ | ||
30 | #define INDEX_SIZE 2048 /* 2 ^ INDEX_BITS */ | ||
31 | #define INDEX_MASK 0x7FF /* lower INDEX_BITS 1 */ | ||
32 | |||
33 | /* | ||
34 | * In the current setup (pfd has 4 longs and 2 shorts) this uses 20k of RAM | ||
35 | * for profiling, and allows for profiling sections of code with up-to | ||
36 | * 1024 function caller->callee pairs | ||
37 | */ | ||
38 | #define NUMPFDS 1024 | ||
39 | |||
40 | struct pfd_struct { | ||
41 | void *self_pc; | ||
42 | unsigned long count; | ||
43 | unsigned long time; | ||
44 | unsigned short link; | ||
45 | struct pfd_struct *caller; | ||
46 | }; | ||
47 | |||
48 | /* Possible states of profiling */ | ||
49 | #define PROF_ON 0x00 | ||
50 | #define PROF_BUSY 0x01 | ||
51 | #define PROF_ERROR 0x02 | ||
52 | #define PROF_OFF 0x03 | ||
53 | /* Masks for thread switches */ | ||
54 | #define PROF_OFF_THREAD 0x10 | ||
55 | #define PROF_ON_THREAD 0x0F | ||
56 | 23 | ||
57 | /* Initialize and start profiling */ | 24 | /* Initialize and start profiling */ |
58 | void profstart(int current_thread) | 25 | void profstart(int current_thread) |