2015-07-12 13:47:43 -05:00
|
|
|
#ifndef HEADER_DarwinProcess
|
|
|
|
#define HEADER_DarwinProcess
|
|
|
|
/*
|
|
|
|
htop - DarwinProcess.h
|
|
|
|
(C) 2015 Hisham H. Muhammad
|
2020-10-05 09:51:32 +02:00
|
|
|
Released under the GNU GPLv2, see the COPYING file
|
2015-07-12 13:47:43 -05:00
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
2020-11-17 19:41:22 +01:00
|
|
|
#include <sys/sysctl.h>
|
|
|
|
|
2015-07-13 21:02:40 -05:00
|
|
|
#include "DarwinProcessList.h"
|
2020-11-17 19:41:22 +01:00
|
|
|
#include "Settings.h"
|
2015-07-13 21:02:40 -05:00
|
|
|
|
2015-07-12 13:47:43 -05:00
|
|
|
|
2015-07-14 11:46:16 -05:00
|
|
|
typedef struct DarwinProcess_ {
|
|
|
|
Process super;
|
2015-07-12 13:47:43 -05:00
|
|
|
|
2015-07-14 11:46:16 -05:00
|
|
|
uint64_t utime;
|
|
|
|
uint64_t stime;
|
2016-03-31 11:01:23 -03:00
|
|
|
bool taskAccess;
|
2020-12-13 15:54:13 +01:00
|
|
|
bool translated;
|
2015-07-14 11:46:16 -05:00
|
|
|
} DarwinProcess;
|
|
|
|
|
2020-10-13 14:35:30 +02:00
|
|
|
extern const ProcessClass DarwinProcess_class;
|
2015-07-14 11:46:16 -05:00
|
|
|
|
2020-12-15 19:44:52 +01:00
|
|
|
extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD];
|
2020-12-13 15:52:58 +01:00
|
|
|
|
2020-10-21 21:26:05 +02:00
|
|
|
Process* DarwinProcess_new(const Settings* settings);
|
2015-07-12 13:47:43 -05:00
|
|
|
|
2015-07-13 01:17:14 -05:00
|
|
|
void Process_delete(Object* cast);
|
|
|
|
|
2020-10-07 19:02:15 +02:00
|
|
|
bool Process_isThread(const Process* this);
|
2015-07-13 01:17:14 -05:00
|
|
|
|
2020-11-17 19:41:22 +01:00
|
|
|
void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps, bool exists);
|
2015-07-13 01:17:14 -05:00
|
|
|
|
2020-12-08 23:12:44 -05:00
|
|
|
void DarwinProcess_setFromLibprocPidinfo(DarwinProcess* proc, DarwinProcessList* dpl, double time_interval);
|
2015-07-12 13:47:43 -05:00
|
|
|
|
2016-02-18 23:45:17 -02:00
|
|
|
/*
|
|
|
|
* Scan threads for process state information.
|
|
|
|
* Based on: http://stackoverflow.com/questions/6788274/ios-mac-cpu-usage-for-thread
|
|
|
|
* and https://github.com/max-horvath/htop-osx/blob/e86692e869e30b0bc7264b3675d2a4014866ef46/ProcessList.c
|
|
|
|
*/
|
2020-10-31 23:28:02 +01:00
|
|
|
void DarwinProcess_scanThreads(DarwinProcess* dp);
|
2016-02-18 14:57:09 -02:00
|
|
|
|
2015-07-12 13:47:43 -05:00
|
|
|
#endif
|