aboutsummaryrefslogtreecommitdiffstats
path: root/lib/os_mon
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-09-06 15:27:17 +0200
committerFredrik Gustafsson <[email protected]>2013-09-06 15:27:17 +0200
commit61f6e220b6399ae20f72e877628896872bc522ad (patch)
treefd5562387234099c0c51a40ab7a07051c6f09315 /lib/os_mon
parent30c4078cf1a898dfbca2dc8d00655bd766c0fbb1 (diff)
parentefbd406f1b8f148569a40a090c38929a7661d2aa (diff)
downloadotp-61f6e220b6399ae20f72e877628896872bc522ad.tar.gz
otp-61f6e220b6399ae20f72e877628896872bc522ad.tar.bz2
otp-61f6e220b6399ae20f72e877628896872bc522ad.zip
Merge branch 'dotsimon/os_mon_cpu_sup_solaris64/OTP-11298' into maint
* dotsimon/os_mon_cpu_sup_solaris64/OTP-11298: Fix broken cpu_sup:nprocs and others on Solaris 64-bit Fix some compiler warnings Remove object files when cleaning
Diffstat (limited to 'lib/os_mon')
-rw-r--r--lib/os_mon/c_src/Makefile.in1
-rw-r--r--lib/os_mon/c_src/cpu_sup.c9
-rw-r--r--lib/os_mon/test/cpu_sup_SUITE.erl1
3 files changed, 9 insertions, 2 deletions
diff --git a/lib/os_mon/c_src/Makefile.in b/lib/os_mon/c_src/Makefile.in
index 51569f6ec9..f84ccf7c87 100644
--- a/lib/os_mon/c_src/Makefile.in
+++ b/lib/os_mon/c_src/Makefile.in
@@ -84,6 +84,7 @@ debug opt: $(TARGET_FILES)
clean:
rm -f $(TARGET_FILES)
+ rm -rf $(OBJDIR)
rm -f core *~
docs:
diff --git a/lib/os_mon/c_src/cpu_sup.c b/lib/os_mon/c_src/cpu_sup.c
index 7372d5b0e8..e9fd75a32c 100644
--- a/lib/os_mon/c_src/cpu_sup.c
+++ b/lib/os_mon/c_src/cpu_sup.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
#if defined(__sun__)
#include <kstat.h>
@@ -120,7 +121,9 @@ typedef struct {
static void util_measure(unsigned int **result_vec, int *result_sz);
+#if defined(__sun__)
static unsigned int misc_measure(char* name);
+#endif
static void send(unsigned int data);
static void sendv(unsigned int data[], int ints);
static void error(char* err_msg);
@@ -140,7 +143,9 @@ int main(int argc, char** argv) {
int rc;
int sz;
unsigned int *rv;
+#if defined(__linux__)
unsigned int no_of_cpus = 0;
+#endif
#if defined(__sun__)
kstat_ctl = kstat_open();
@@ -288,10 +293,10 @@ static unsigned int misc_measure(char* name) {
if(!entry)
return -1;
- if(entry->data_type != KSTAT_DATA_ULONG)
+ if(entry->data_type != KSTAT_DATA_UINT32)
return -1;
- return entry->value.ul;
+ return entry->value.ui32;
}
diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl
index d04adbb6d3..e0382cb0c7 100644
--- a/lib/os_mon/test/cpu_sup_SUITE.erl
+++ b/lib/os_mon/test/cpu_sup_SUITE.erl
@@ -88,6 +88,7 @@ load_api(Config) when is_list(Config) ->
?line N = cpu_sup:nprocs(),
?line true = is_integer(N),
?line true = N>0,
+ ?line true = N<1000000,
%% avg1()
?line Load1 = cpu_sup:avg1(),