System statistical and call profiling

support by Rogier Meurs <rogier@meurs.org>.
This commit is contained in:
Ben Gras
2006-10-30 15:53:38 +00:00
parent fa0ba56bc9
commit 7195fe3325
76 changed files with 2650 additions and 77 deletions

View File

@@ -26,6 +26,7 @@ libsys_FILES=" \
pci_slot_name.c \
safecopies.c \
sys_abort.c \
sys_cprof.c \
sys_endsig.c \
sys_eniop.c \
sys_exec.c \
@@ -45,6 +46,7 @@ libsys_FILES=" \
sys_readbios.c \
sys_safecopy.c \
sys_vsafecopy.c \
sys_profbuf.c \
sys_sdevio.c \
sys_segctl.c \
sys_setalarm.c \
@@ -52,6 +54,7 @@ libsys_FILES=" \
sys_sigsend.c \
sys_privctl.c \
sys_setgrant.c \
sys_sprof.c \
sys_times.c \
sys_trace.c \
sys_umap.c \

27
lib/syslib/sys_cprof.c Normal file
View File

@@ -0,0 +1,27 @@
#include "syslib.h"
#if CPROFILE
/*===========================================================================*
* sys_cprof *
*===========================================================================*/
PUBLIC int sys_cprof(action, size, endpt, ctl_ptr, mem_ptr)
int action; /* get/reset profiling tables */
int size; /* size of allocated memory */
int endpt; /* caller endpoint */
void *ctl_ptr; /* location of info struct */
void *mem_ptr; /* location of allocated memory */
{
message m;
m.PROF_ACTION = action;
m.PROF_MEM_SIZE = size;
m.PROF_ENDPT = endpt;
m.PROF_CTL_PTR = ctl_ptr;
m.PROF_MEM_PTR = mem_ptr;
return(_taskcall(SYSTASK, SYS_CPROF, &m));
}
#endif

23
lib/syslib/sys_profbuf.c Normal file
View File

@@ -0,0 +1,23 @@
#include "syslib.h"
#include <minix/config.h>
#if CPROFILE
/*===========================================================================*
* sys_profbuf *
*===========================================================================*/
PUBLIC int sys_profbuf(ctl_ptr, mem_ptr)
void *ctl_ptr; /* pointer to control structure */
void *mem_ptr; /* pointer to profiling table */
{
message m;
m.PROF_CTL_PTR = ctl_ptr;
m.PROF_MEM_PTR = mem_ptr;
return(_taskcall(SYSTASK, SYS_PROFBUF, &m));
}
#endif

29
lib/syslib/sys_sprof.c Normal file
View File

@@ -0,0 +1,29 @@
#include "syslib.h"
#if SPROFILE
/*===========================================================================*
* sys_sprof *
*===========================================================================*/
PUBLIC int sys_sprof(action, size, freq, endpt, ctl_ptr, mem_ptr)
int action; /* start/stop profiling */
int size; /* available profiling memory */
int freq; /* sample frequency */
int endpt; /* caller endpoint */
void *ctl_ptr; /* location of info struct */
void *mem_ptr; /* location of profiling memory */
{
message m;
m.PROF_ACTION = action;
m.PROF_MEM_SIZE = size;
m.PROF_FREQ = freq;
m.PROF_ENDPT = endpt;
m.PROF_CTL_PTR = ctl_ptr;
m.PROF_MEM_PTR = mem_ptr;
return(_taskcall(SYSTASK, SYS_SPROF, &m));
}
#endif