void mono_process_get_times (gpointer pid, gint64 *start_time, gint64 *user_time, gint64 *kernel_time) { if (user_time) *user_time = mono_process_get_data (pid, MONO_PROCESS_USER_TIME); if (kernel_time) *kernel_time = mono_process_get_data (pid, MONO_PROCESS_SYSTEM_TIME); if (start_time) { *start_time = 0; #if USE_SYSCTL && defined(kinfo_starttime_member) { KINFO_PROC processi; if (sysctl_kinfo_proc (pid, &processi)) *start_time = mono_100ns_datetime_from_timeval (processi.kinfo_starttime_member); } #endif if (*start_time == 0) { static guint64 boot_time = 0; if (!boot_time) boot_time = mono_100ns_datetime () - ((guint64)mono_msec_ticks ()) * 10000; *start_time = boot_time + mono_process_get_data (pid, MONO_PROCESS_ELAPSED); } } }
static gint64 virtual_bytes (void) { return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_VIRTUAL_BYTES); }
static gint64 page_faults (void) { return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_FAULTS); }
static gint64 private_bytes (void) { return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_PRIVATE_BYTES); }
static gint64 working_set (void) { return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_WORKING_SET); }
static gint64 total_time (void) { return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_TOTAL_TIME); }
static gint64 system_time (void) { return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_SYSTEM_TIME); }
static gint64 user_time (void) { return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_USER_TIME); }