#include "param.h"
#include "super.h"
+#if ENABLE_SYSCALL_STATS
+EXTERN unsigned long calls_stats[NCALLS];
+#endif
+
FORWARD _PROTOTYPE( void fs_init, (void) );
FORWARD _PROTOTYPE( void get_work, (void) );
FORWARD _PROTOTYPE( void init_root, (void) );
"FS, bad process, who = %d, call_nr = %d, endpt1 = %d\n",
who_e, call_nr, m_in.endpt1);
} else {
+#if ENABLE_SYSCALL_STATS
+ calls_stats[call_nr]++;
+#endif
error = (*call_vec[call_nr])();
}
#define CORE_NAME "core"
#define CORE_MODE 0777 /* mode to use on core image files */
+#if ENABLE_SYSCALL_STATS
+PUBLIC unsigned long calls_stats[NCALLS];
+#endif
+
FORWARD _PROTOTYPE( void free_proc, (struct fproc *freed, int flags));
FORWARD _PROTOTYPE( int dumpcore, (int proc_e, struct mem_map *seg_ptr));
FORWARD _PROTOTYPE( int write_bytes, (struct inode *rip, off_t off,
src_addr = (vir_bytes) dmap;
len = sizeof(struct dmap) * NR_DEVICES;
break;
+#if ENABLE_SYSCALL_STATS
+ case SI_CALL_STATS:
+ src_addr = (vir_bytes) calls_stats;
+ len = sizeof(calls_stats);
+ break;
+#endif
default:
return(EINVAL);
}
#include "../../kernel/type.h"
#include "../../kernel/proc.h"
+#if ENABLE_SYSCALL_STATS
+EXTERN unsigned long calls_stats[NCALLS];
+#endif
+
FORWARD _PROTOTYPE( void get_work, (void) );
FORWARD _PROTOTYPE( void pm_init, (void) );
FORWARD _PROTOTYPE( int get_nice_value, (int queue) );
if ((unsigned) call_nr >= NCALLS) {
result = ENOSYS;
} else {
+#if ENABLE_SYSCALL_STATS
+ calls_stats[call_nr]++;
+#endif
result = (*call_vec[call_nr])();
}
break;
NULL, /* No bus */ /* No bus */
};
+#if ENABLE_SYSCALL_STATS
+PUBLIC unsigned long calls_stats[NCALLS];
+#endif
+
/*===========================================================================*
* do_allocmem *
*===========================================================================*/
src_addr = (vir_bytes) &loadinfo;
len = sizeof(struct loadinfo);
break;
+#if ENABLE_SYSCALL_STATS
+ case SI_CALL_STATS:
+ src_addr = (vir_bytes) calls_stats;
+ len = sizeof(calls_stats);
+ break;
+#endif
default:
return(EINVAL);
}