root / lab4 / .minix-src / include / minix / profile.h @ 14
History | View | Annotate | Download (866 Bytes)
1 | 13 | up20180614 | #ifndef _PROFILE_H
|
---|---|---|---|
2 | #define _PROFILE_H
|
||
3 | |||
4 | #include <minix/type.h> |
||
5 | #include <sys/types.h> |
||
6 | |||
7 | /*
|
||
8 | * Types relating to system profiling.
|
||
9 | */
|
||
10 | |||
11 | # define PROF_START 0 /* start statistical profiling */ |
||
12 | # define PROF_STOP 1 /* stop statistical profiling */ |
||
13 | |||
14 | #define PROF_RTC 0 /* RTC based profiling */ |
||
15 | #define PROF_NMI 1 /* NMI based profiling, profiles kernel too */ |
||
16 | |||
17 | /* Info struct to be copied to from kernel to user program. */
|
||
18 | struct sprof_info_s {
|
||
19 | int mem_used;
|
||
20 | int total_samples;
|
||
21 | int idle_samples;
|
||
22 | int system_samples;
|
||
23 | int user_samples;
|
||
24 | }; |
||
25 | |||
26 | /* What a profiling sample looks like (used for sizeof()). */
|
||
27 | struct sprof_sample {
|
||
28 | endpoint_t proc; |
||
29 | void * pc;
|
||
30 | }; |
||
31 | |||
32 | struct sprof_proc {
|
||
33 | endpoint_t proc; |
||
34 | char name[PROC_NAME_LEN];
|
||
35 | }; |
||
36 | |||
37 | int sprofile(int action, int size, int freq, int type, void *ctl_ptr, |
||
38 | void *mem_ptr);
|
||
39 | |||
40 | #endif /* PROFILE_H */ |