2015-07-12 18:47:43 +00:00
|
|
|
#ifndef HEADER_DarwinProcessList
|
|
|
|
#define HEADER_DarwinProcessList
|
|
|
|
/*
|
|
|
|
htop - DarwinProcessList.h
|
|
|
|
(C) 2014 Hisham H. Muhammad
|
|
|
|
Released under the GNU GPL, see the COPYING file
|
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
2019-07-07 21:30:37 +00:00
|
|
|
struct kern;
|
|
|
|
|
|
|
|
void GetKernelVersion(struct kern *k);
|
|
|
|
|
|
|
|
/* compare the given os version with the one installed returns:
|
|
|
|
0 if equals the installed version
|
|
|
|
positive value if less than the installed version
|
|
|
|
negative value if more than the installed version
|
|
|
|
*/
|
|
|
|
int CompareKernelVersion(short int major, short int minor, short int component);
|
|
|
|
|
2015-07-14 02:02:40 +00:00
|
|
|
#include "ProcessList.h"
|
2019-07-07 23:27:00 +00:00
|
|
|
#include "zfs/ZfsArcStats.h"
|
2015-07-13 06:17:14 +00:00
|
|
|
#include <mach/mach_host.h>
|
|
|
|
#include <sys/sysctl.h>
|
2015-07-12 18:47:43 +00:00
|
|
|
|
2015-07-13 06:17:14 +00:00
|
|
|
typedef struct DarwinProcessList_ {
|
|
|
|
ProcessList super;
|
|
|
|
|
2015-07-13 21:53:46 +00:00
|
|
|
host_basic_info_data_t host_info;
|
2016-01-13 19:57:29 +00:00
|
|
|
vm_statistics_data_t vm_stats;
|
2015-07-13 22:09:18 +00:00
|
|
|
processor_cpu_load_info_t prev_load;
|
|
|
|
processor_cpu_load_info_t curr_load;
|
2015-07-14 02:02:40 +00:00
|
|
|
uint64_t kernel_threads;
|
|
|
|
uint64_t user_threads;
|
2015-07-14 16:46:16 +00:00
|
|
|
uint64_t global_diff;
|
2019-07-07 21:30:37 +00:00
|
|
|
|
2019-07-07 23:27:00 +00:00
|
|
|
ZfsArcStats zfs;
|
2015-07-13 06:17:14 +00:00
|
|
|
} DarwinProcessList;
|
|
|
|
|
|
|
|
void ProcessList_getHostInfo(host_basic_info_data_t *p);
|
|
|
|
|
2015-07-13 22:09:18 +00:00
|
|
|
void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p);
|
|
|
|
|
|
|
|
unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p);
|
2015-07-13 06:17:14 +00:00
|
|
|
|
2016-01-13 19:57:29 +00:00
|
|
|
void ProcessList_getVMStats(vm_statistics_t p);
|
2015-07-14 02:02:40 +00:00
|
|
|
|
2015-07-13 06:17:14 +00:00
|
|
|
struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count);
|
2015-07-12 18:47:43 +00:00
|
|
|
|
|
|
|
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
|
|
|
|
|
|
|
|
void ProcessList_delete(ProcessList* this);
|
|
|
|
|
|
|
|
void ProcessList_goThroughEntries(ProcessList* super);
|
|
|
|
|
|
|
|
#endif
|