VM: static data structure for mem allocation
[minix3.git] / servers / pm / profile.c
blob27ff0c260c3b72a6a7565832554fd7c6b6e18997
1 /* This file implements entry points for system profiling.
3 * The entry points in this file are:
4 * do_sprofile: start/stop statistical profiling
5 * do_cprofile: get/reset call profiling tables
7 * Changes:
8 * 14 Aug, 2006 Created (Rogier Meurs)
9 */
11 #include <minix/config.h>
12 #include <minix/profile.h>
13 #include "pm.h"
14 #include <sys/wait.h>
15 #include <minix/callnr.h>
16 #include <minix/com.h>
17 #include <signal.h>
18 #include "mproc.h"
19 #include "param.h"
21 /*===========================================================================*
22 * do_sprofile *
23 *===========================================================================*/
24 int do_sprofile(void)
26 #if SPROFILE
28 int r;
30 switch(m_in.PROF_ACTION) {
32 case PROF_START:
33 return sys_sprof(PROF_START, m_in.PROF_MEM_SIZE, m_in.PROF_FREQ,
34 m_in.PROF_INTR_TYPE,
35 who_e, m_in.PROF_CTL_PTR, m_in.PROF_MEM_PTR);
37 case PROF_STOP:
38 return sys_sprof(PROF_STOP,0,0,0,0,0,0);
40 default:
41 return EINVAL;
44 #else
45 return ENOSYS;
46 #endif
50 /*===========================================================================*
51 * do_cprofile *
52 *===========================================================================*/
53 int do_cprofile(void)
55 #if CPROFILE
57 int r;
59 switch(m_in.PROF_ACTION) {
61 case PROF_GET:
62 return sys_cprof(PROF_GET, m_in.PROF_MEM_SIZE, who_e,
63 m_in.PROF_CTL_PTR, m_in.PROF_MEM_PTR);
65 case PROF_RESET:
66 return sys_cprof(PROF_RESET,0,0,0,0);
68 default:
69 return EINVAL;
72 #else
73 return ENOSYS;
74 #endif