From owner-svn-ports-all@freebsd.org Sun Dec 22 18:54:48 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC8CD1D9E82; Sun, 22 Dec 2019 18:54:48 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47gs9N52v7z3CfP; Sun, 22 Dec 2019 18:54:48 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A88E43ED6; Sun, 22 Dec 2019 18:54:48 +0000 (UTC) (envelope-from adamw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBMIsmxF017114; Sun, 22 Dec 2019 18:54:48 GMT (envelope-from adamw@FreeBSD.org) Received: (from adamw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBMIsmIx017113; Sun, 22 Dec 2019 18:54:48 GMT (envelope-from adamw@FreeBSD.org) Message-Id: <201912221854.xBMIsmIx017113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adamw set sender to adamw@FreeBSD.org using -f From: Adam Weinberger Date: Sun, 22 Dec 2019 18:54:48 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r520651 - in head/sysutils/tmux-mem-cpu-load: . files X-SVN-Group: ports-head X-SVN-Commit-Author: adamw X-SVN-Commit-Paths: in head/sysutils/tmux-mem-cpu-load: . files X-SVN-Commit-Revision: 520651 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2019 18:54:48 -0000 Author: adamw Date: Sun Dec 22 18:54:47 2019 New Revision: 520651 URL: https://svnweb.freebsd.org/changeset/ports/520651 Log: tmux-mem-cpu-load: Fix memory calculation, and remove tmux dependency This adds a patch from fluffy that fixes the memory usage calculation, which was previously wildly incorrect (on my box: before 484, after 16889). See https://github.com/thewtex/tmux-mem-cpu-load/pull/61 Also, I'm removing the run-time dependency on tmux. Although this program is designed to be used in the tmux status bar, there's no reason it can't be used in any other status bar, and it doesn't actually use tmux in any way. Added: head/sysutils/tmux-mem-cpu-load/files/ head/sysutils/tmux-mem-cpu-load/files/patch-freebsd_memory.cc (contents, props changed) Modified: head/sysutils/tmux-mem-cpu-load/Makefile Modified: head/sysutils/tmux-mem-cpu-load/Makefile ============================================================================== --- head/sysutils/tmux-mem-cpu-load/Makefile Sun Dec 22 18:44:56 2019 (r520650) +++ head/sysutils/tmux-mem-cpu-load/Makefile Sun Dec 22 18:54:47 2019 (r520651) @@ -3,7 +3,7 @@ PORTNAME= tmux-mem-cpu-load PORTVERSION= 3.4.0 -PORTREVISION= 3 +PORTREVISION= 4 DISTVERSIONPREFIX= v CATEGORIES= sysutils @@ -11,8 +11,6 @@ MAINTAINER= adamw@FreeBSD.org COMMENT= CPU, RAM, and load monitor for use with tmux LICENSE= APACHE20 - -RUN_DEPENDS= tmux:sysutils/tmux USES= cmake compiler:c++11-lang USE_GITHUB= yes Added: head/sysutils/tmux-mem-cpu-load/files/patch-freebsd_memory.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/tmux-mem-cpu-load/files/patch-freebsd_memory.cc Sun Dec 22 18:54:47 2019 (r520651) @@ -0,0 +1,24 @@ +From e24890652e3674fe4677722aab8644e62da37348 Mon Sep 17 00:00:00 2001 +From: Dima Panov +Date: Fri, 20 Dec 2019 02:47:32 +1000 +Subject: [PATCH] Fix calculate memory usage on FreeBSD + +--- + freebsd/memory.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/freebsd/memory.cc b/freebsd/memory.cc +index 5500032..687a0a8 100644 +--- freebsd/memory.cc ++++ freebsd/memory.cc +@@ -63,8 +63,8 @@ void mem_status( MemoryStatus & status ) + //u_int unused = ( cache + inactive + free ) * page_size; + + // Used memory on FreeBSD is active + wired. +- u_int used = ( active + wired ) * page_size; ++ u_int used = ( active + wired ); + +- status.used_mem = convert_unit( static_cast< float >( used ), MEGABYTES ); ++ status.used_mem = convert_unit( static_cast< float >( used * (page_size >> 10) ), MEGABYTES, KILOBYTES ); + status.total_mem = convert_unit( static_cast< float >( page_count * (page_size >> 10) ), MEGABYTES, KILOBYTES); + }