xref: /minix3/minix/servers/pm/profile.c (revision 1dcfbcd17383a5c335ef7172dc751771716b632d)
1 /* This file implements entry points for system profiling.
2  *
3  * The entry points in this file are:
4  *   do_sprofile:   start/stop statistical profiling
5  *
6  * Changes:
7  *   14 Aug, 2006  Created (Rogier Meurs)
8  */
9 
10 #include <minix/config.h>
11 #include <minix/profile.h>
12 #include "pm.h"
13 #include <sys/wait.h>
14 #include <minix/callnr.h>
15 #include <minix/com.h>
16 #include <signal.h>
17 #include "mproc.h"
18 
19 /*===========================================================================*
20  *				do_sprofile				     *
21  *===========================================================================*/
do_sprofile(void)22 int do_sprofile(void)
23 {
24 #if SPROFILE
25 
26   int r;
27 
28   switch(m_in.m_lc_pm_sprof.action) {
29 
30   case PROF_START:
31 	return sys_sprof(PROF_START, m_in.m_lc_pm_sprof.mem_size,
32 		m_in.m_lc_pm_sprof.freq, m_in.m_lc_pm_sprof.intr_type, who_e,
33 		m_in.m_lc_pm_sprof.ctl_ptr, m_in.m_lc_pm_sprof.mem_ptr);
34 
35   case PROF_STOP:
36 	return sys_sprof(PROF_STOP,0,0,0,0,0,0);
37 
38   default:
39 	return EINVAL;
40   }
41 
42 #else
43 	return ENOSYS;
44 #endif
45 }
46