Repository navigation
Expand file tree
/
Copy pathprofile.c
More file actions
75 lines (58 loc) · 1.55 KB
/
Copy pathprofile.c
File metadata and controls
75 lines (58 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* This file implements entry points for system profiling.
*
* The entry points in this file are:
* do_sprofile: start/stop statistical profiling
* do_cprofile: get/reset call profiling tables
*
* Changes:
* 14 Aug, 2006 Created (Rogier Meurs)
*/
#include <minix/config.h>
#include <minix/profile.h>
#include "pm.h"
#include <sys/wait.h>
#include <minix/callnr.h>
#include <minix/com.h>
#include <signal.h>
#include "mproc.h"
/*===========================================================================*
* do_sprofile *
*===========================================================================*/
int do_sprofile(void)
{
#if SPROFILE
int r;
switch(m_in.m_lc_pm_sprof.action) {
case PROF_START:
return sys_sprof(PROF_START, m_in.m_lc_pm_sprof.mem_size,
m_in.m_lc_pm_sprof.freq, m_in.m_lc_pm_sprof.intr_type, who_e,
m_in.m_lc_pm_sprof.ctl_ptr, m_in.m_lc_pm_sprof.mem_ptr);
case PROF_STOP:
return sys_sprof(PROF_STOP,0,0,0,0,0,0);
default:
return EINVAL;
}
#else
return ENOSYS;
#endif
}
/*===========================================================================*
* do_cprofile *
*===========================================================================*/
int do_cprofile(void)
{
#if CPROFILE
int r;
switch(m_in.m_lc_pm_cprof.action) {
case PROF_GET:
return sys_cprof(PROF_GET, m_in.m_lc_pm_cprof.mem_size, who_e,
m_in.m_lc_pm_cprof.ctl_ptr, m_in.m_lc_pm_cprof.mem_ptr);
case PROF_RESET:
return sys_cprof(PROF_RESET,0,0,0,0);
default:
return EINVAL;
}
#else
return ENOSYS;
#endif
}