aboutsummaryrefslogtreecommitdiffstats
path: root/lib/os_mon
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2011-04-08 17:37:17 +0200
committerHenrik Nord <[email protected]>2011-04-08 17:37:22 +0200
commit5043e4839afd79bfcd8044dea874441763f49e89 (patch)
treecd2e4fe04686a38b77c414a69cf7d69bf87205c4 /lib/os_mon
parentd80b35fae2b7aca58f8b9c00304591e5f8dfdcb9 (diff)
parent6d1cfbcd7a782cc96f58b86372d108b50c14cc05 (diff)
downloadotp-5043e4839afd79bfcd8044dea874441763f49e89.tar.gz
otp-5043e4839afd79bfcd8044dea874441763f49e89.tar.bz2
otp-5043e4839afd79bfcd8044dea874441763f49e89.zip
Merge branch 'at/os_mon_dragonfly_support' into dev
* at/os_mon_dragonfly_support: Add support for DragonFlyBSD to memsup OTP-9217
Diffstat (limited to 'lib/os_mon')
-rw-r--r--lib/os_mon/src/memsup.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/os_mon/src/memsup.erl b/lib/os_mon/src/memsup.erl
index 8ed5e2d595..cc4941ee7d 100644
--- a/lib/os_mon/src/memsup.erl
+++ b/lib/os_mon/src/memsup.erl
@@ -176,6 +176,7 @@ init([]) ->
PortMode = case OS of
{unix, darwin} -> false;
{unix, freebsd} -> false;
+ {unix, dragonfly} -> false;
% Linux supports this.
{unix, linux} -> true;
{unix, openbsd} -> true;
@@ -611,6 +612,7 @@ code_change(Vsn, PrevState, "1.8") ->
PortMode = case OS of
{unix, darwin} -> false;
{unix, freebsd} -> false;
+ {unix, dragonfly} -> false;
{unix, linux} -> false;
{unix, openbsd} -> true;
{unix, netbsd} -> true;
@@ -689,6 +691,7 @@ get_os_wordsize({unix, linux}) -> get_os_wordsize_with_uname();
get_os_wordsize({unix, darwin}) -> get_os_wordsize_with_uname();
get_os_wordsize({unix, netbsd}) -> get_os_wordsize_with_uname();
get_os_wordsize({unix, freebsd}) -> get_os_wordsize_with_uname();
+get_os_wordsize({unix, dragonfly}) -> get_os_wordsize_with_uname();
get_os_wordsize({unix, openbsd}) -> get_os_wordsize_with_uname();
get_os_wordsize(_) -> unsupported_os.
@@ -738,7 +741,7 @@ get_memory_usage({unix,darwin}) ->
%% FreeBSD: Look in /usr/include/sys/vmmeter.h for the format of struct
%% vmmeter
-get_memory_usage({unix,freebsd}) ->
+get_memory_usage({unix,OSname}) when OSname == freebsd; OSname == dragonfly ->
PageSize = freebsd_sysctl("vm.stats.vm.v_page_size"),
PageCount = freebsd_sysctl("vm.stats.vm.v_page_count"),
FreeCount = freebsd_sysctl("vm.stats.vm.v_free_count"),
@@ -781,6 +784,9 @@ get_ext_memory_usage(OS, {Alloc, Total}) ->
{unix, freebsd} ->
[{total_memory, Total}, {free_memory, Total-Alloc},
{system_total_memory, Total}];
+ {unix, dragonfly} ->
+ [{total_memory, Total}, {free_memory, Total-Alloc},
+ {system_total_memory, Total}];
{unix, darwin} ->
[{total_memory, Total}, {free_memory, Total-Alloc},
{system_total_memory, Total}];