int idle_samples;
int system_samples;
int user_samples;
-} sprof_info_inst;
+};
/* What a profiling sample looks like (used for sizeof()). */
struct sprof_sample {
struct cprof_info_s {
int mem_used;
int err;
-} cprof_info_inst;
+};
/* Data structures for control structure and profiling data table in the
* in the profiled processes.
int reset; /* kernel sets to have table reset */
int slots_used; /* proc writes nr slots used in table */
int err; /* proc writes errors that occurred */
-} cprof_ctl_inst;
+};
struct cprof_tbl_s {
struct cprof_tbl_s *next; /* next in chain */
char cpath[CPROF_CPATH_MAX_LEN]; /* string with call path */
int calls; /* nr of executions of path */
u64_t cycles; /* execution time of path, in cycles */
-} cprof_tbl_inst;
+};
int sprofile(int action, int size, int freq, int type, void *ctl_ptr,
void *mem_ptr);
#include "mproc.h"
#include "param.h"
-#if SPROFILE || CPROFILE
-static int check_addrs(int info_size);
-#endif
-
/*===========================================================================*
* do_sprofile *
*===========================================================================*/
switch(m_in.PROF_ACTION) {
case PROF_START:
- if ((r = check_addrs(sizeof(sprof_info_inst)))) /* check pointers */
- return r;
-
return sys_sprof(PROF_START, m_in.PROF_MEM_SIZE, m_in.PROF_FREQ,
m_in.PROF_INTR_TYPE,
who_e, m_in.PROF_CTL_PTR, m_in.PROF_MEM_PTR);
switch(m_in.PROF_ACTION) {
case PROF_GET:
- if (r = check_addrs(sizeof(cprof_info_inst))) /* check user pointers */
- return r;
-
return sys_cprof(PROF_GET, m_in.PROF_MEM_SIZE, who_e,
m_in.PROF_CTL_PTR, m_in.PROF_MEM_PTR);
#endif
}
-
-#if SPROFILE || CPROFILE
-
-/*===========================================================================*
- * check_addrs *
- *===========================================================================*/
-static int check_addrs(info_size)
-int info_size;
-{
- int r;
- phys_bytes p;
-
- /* Check if supplied pointers point into user process. */
- if ((r = sys_umap_remote(who_e, SELF, VM_D, (vir_bytes) m_in.PROF_CTL_PTR,
- 1, &p)) != OK) {
- printf("PM: PROFILE: umap failed for process %d\n", who_e);
- return r;
- }
-
- if ((r =sys_umap_remote(who_e, SELF, VM_D, (vir_bytes) m_in.PROF_MEM_PTR,
- 1, &p)) != OK) {
- printf("PM: PROFILE: umap failed for process %d\n", who_e);
- return r;
- }
- return 0;
-}
-
-#endif
-