summaryrefslogtreecommitdiffstats
path: root/darwin/DarwinProcessList.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2016-02-18 14:57:09 -0200
committerHisham Muhammad <hisham@gobolinux.org>2016-02-18 14:57:09 -0200
commit5ee6715843902da1aa40782a9d00f41ca855a2ee (patch)
tree82175584a26771bdb0e084a684450cb8c4f2c2e7 /darwin/DarwinProcessList.c
parentc18309466d0974fd839c5b8c61edc590447092d4 (diff)
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 This should be a fix for #361.
Diffstat (limited to 'darwin/DarwinProcessList.c')
-rw-r--r--darwin/DarwinProcessList.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c
index 7ea89d9f..7492f822 100644
--- a/darwin/DarwinProcessList.c
+++ b/darwin/DarwinProcessList.c
@@ -168,8 +168,10 @@ void ProcessList_goThroughEntries(ProcessList* super) {
for(size_t i = 0; i < count; ++i) {
proc = (DarwinProcess *)ProcessList_getProcess(super, ps[i].kp_proc.p_pid, &preExisting, (Process_New)DarwinProcess_new);
- DarwinProcess_setFromKInfoProc(&proc->super, ps + i, tv.tv_sec, preExisting);
+ DarwinProcess_setFromKInfoProc(&proc->super, &ps[i], tv.tv_sec, preExisting);
DarwinProcess_setFromLibprocPidinfo(proc, dpl);
+
+ DarwinProcess_scanThreads(proc);
super->totalTasks += 1;

© 2014-2024 Faster IT GmbH | imprint | privacy policy