Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
195f5edb
Commit
195f5edb
authored
Jan 13, 2016
by
Hisham Muhammad
Browse files
Merge pull request #347 from mklein-de/darwin32+64
Darwin: replace vm_statistics64_* with vm_statistics_*
parents
9c39422c
d3125102
Changes
3
Show whitespace changes
Inline
Side-by-side
darwin/DarwinProcessList.c
View file @
195f5edb
...
@@ -28,7 +28,7 @@ typedef struct DarwinProcessList_ {
...
@@ -28,7 +28,7 @@ typedef struct DarwinProcessList_ {
ProcessList super;
ProcessList super;
host_basic_info_data_t host_info;
host_basic_info_data_t host_info;
vm_statistics
64
_data_t vm_stats;
vm_statistics_data_t vm_stats;
processor_cpu_load_info_t prev_load;
processor_cpu_load_info_t prev_load;
processor_cpu_load_info_t curr_load;
processor_cpu_load_info_t curr_load;
uint64_t kernel_threads;
uint64_t kernel_threads;
...
@@ -68,10 +68,10 @@ unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p) {
...
@@ -68,10 +68,10 @@ unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p) {
return
cpu_count
;
return
cpu_count
;
}
}
void
ProcessList_getVMStats
(
vm_statistics
64
_t
p
)
{
void
ProcessList_getVMStats
(
vm_statistics_t
p
)
{
mach_msg_type_number_t
info_size
=
HOST_VM_INFO
64
_COUNT
;
mach_msg_type_number_t
info_size
=
HOST_VM_INFO_COUNT
;
if
(
host_statistics
64
(
mach_host_self
(),
HOST_VM_INFO
64
,
(
host_info_t
)
p
,
&
info_size
)
!=
0
)
if
(
host_statistics
(
mach_host_self
(),
HOST_VM_INFO
,
(
host_info_t
)
p
,
&
info_size
)
!=
0
)
CRT_fatalError
(
"Unable to retrieve VM statistics
\n
"
);
CRT_fatalError
(
"Unable to retrieve VM statistics
\n
"
);
}
}
...
...
darwin/DarwinProcessList.h
View file @
195f5edb
...
@@ -17,7 +17,7 @@ typedef struct DarwinProcessList_ {
...
@@ -17,7 +17,7 @@ typedef struct DarwinProcessList_ {
ProcessList
super
;
ProcessList
super
;
host_basic_info_data_t
host_info
;
host_basic_info_data_t
host_info
;
vm_statistics
64
_data_t
vm_stats
;
vm_statistics_data_t
vm_stats
;
processor_cpu_load_info_t
prev_load
;
processor_cpu_load_info_t
prev_load
;
processor_cpu_load_info_t
curr_load
;
processor_cpu_load_info_t
curr_load
;
uint64_t
kernel_threads
;
uint64_t
kernel_threads
;
...
@@ -32,7 +32,7 @@ void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p);
...
@@ -32,7 +32,7 @@ void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p);
unsigned
ProcessList_allocateCPULoadInfo
(
processor_cpu_load_info_t
*
p
);
unsigned
ProcessList_allocateCPULoadInfo
(
processor_cpu_load_info_t
*
p
);
void
ProcessList_getVMStats
(
vm_statistics
64
_t
p
);
void
ProcessList_getVMStats
(
vm_statistics_t
p
);
struct
kinfo_proc
*
ProcessList_getKInfoProcs
(
size_t
*
count
);
struct
kinfo_proc
*
ProcessList_getKInfoProcs
(
size_t
*
count
);
...
...
darwin/Platform.c
View file @
195f5edb
...
@@ -218,7 +218,7 @@ double Platform_setCPUValues(Meter* mtr, int cpu) {
...
@@ -218,7 +218,7 @@ double Platform_setCPUValues(Meter* mtr, int cpu) {
void
Platform_setMemoryValues
(
Meter
*
mtr
)
{
void
Platform_setMemoryValues
(
Meter
*
mtr
)
{
DarwinProcessList
*
dpl
=
(
DarwinProcessList
*
)
mtr
->
pl
;
DarwinProcessList
*
dpl
=
(
DarwinProcessList
*
)
mtr
->
pl
;
vm_statistics
64
_t
vm
=
&
dpl
->
vm_stats
;
vm_statistics_t
vm
=
&
dpl
->
vm_stats
;
double
page_K
=
(
double
)
vm_page_size
/
(
double
)
1024
;
double
page_K
=
(
double
)
vm_page_size
/
(
double
)
1024
;
mtr
->
total
=
dpl
->
host_info
.
max_mem
/
1024
;
mtr
->
total
=
dpl
->
host_info
.
max_mem
/
1024
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment