update to tmux-mem-cpu-load-3.3.0
This commit is contained in:
parent
17b25f1dbf
commit
3057e31df6
@ -1,11 +1,10 @@
|
||||
# $OpenBSD: Makefile,v 1.9 2016/04/28 13:32:22 jasper Exp $
|
||||
# $OpenBSD: Makefile,v 1.10 2016/04/29 09:33:10 jasper Exp $
|
||||
|
||||
COMMENT = CPU, RAM memory, and load monitor for use with tmux(1)
|
||||
|
||||
GH_ACCOUNT = thewtex
|
||||
GH_PROJECT = tmux-mem-cpu-load
|
||||
GH_TAGNAME = v3.2.3
|
||||
REVISION = 1
|
||||
GH_TAGNAME = v3.3.0
|
||||
|
||||
CATEGORIES = sysutils
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (tmux-mem-cpu-load-3.2.3.tar.gz) = jsAN8JjE4n5dZrjFBbCqrLp4AcelFm1RSeVqntdy+3U=
|
||||
SIZE (tmux-mem-cpu-load-3.2.3.tar.gz) = 17068
|
||||
SHA256 (tmux-mem-cpu-load-3.3.0.tar.gz) = Ujxpqr0wQQW219t/lfp7UHFXlK9uAAoPcFzlMwJq+Xc=
|
||||
SIZE (tmux-mem-cpu-load-3.3.0.tar.gz) = 17835
|
||||
|
@ -1,11 +1,11 @@
|
||||
$OpenBSD: patch-openbsd_memory_cc,v 1.1 2016/04/28 13:32:22 jasper Exp $
|
||||
$OpenBSD: patch-openbsd_memory_cc,v 1.2 2016/04/29 09:33:10 jasper Exp $
|
||||
|
||||
Simplify memory calculations by using uvmexp.pageshift
|
||||
|
||||
--- openbsd/memory.cc.orig Thu Apr 28 15:07:56 2016
|
||||
+++ openbsd/memory.cc Thu Apr 28 15:25:30 2016
|
||||
@@ -40,13 +40,6 @@
|
||||
#include "luts.h"
|
||||
--- openbsd/memory.cc.orig Mon Mar 7 02:33:34 2016
|
||||
+++ openbsd/memory.cc Fri Apr 29 11:31:48 2016
|
||||
@@ -39,13 +39,6 @@
|
||||
#include "memory.h"
|
||||
#include "conversions.h"
|
||||
|
||||
-static int pageshift;
|
||||
@ -15,10 +15,10 @@ Simplify memory calculations by using uvmexp.pageshift
|
||||
-#endif
|
||||
-#define pagesh(size) ((size) << pageshift)
|
||||
-
|
||||
std::string mem_string( bool use_colors = false )
|
||||
void mem_status( MemoryStatus & status )
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@@ -66,16 +59,6 @@ std::string mem_string( bool use_colors = false )
|
||||
// These values are in bytes
|
||||
@@ -63,16 +56,6 @@ void mem_status( MemoryStatus & status )
|
||||
error( "memory: error getting page size" );
|
||||
}
|
||||
|
||||
@ -35,25 +35,25 @@ Simplify memory calculations by using uvmexp.pageshift
|
||||
// get vm memory stats
|
||||
static int uvmexp_mib[] = { CTL_VM, VM_UVMEXP };
|
||||
struct uvmexp uvmexp;
|
||||
@@ -95,16 +78,15 @@ std::string mem_string( bool use_colors = false )
|
||||
@@ -92,16 +75,15 @@ void mem_status( MemoryStatus & status )
|
||||
}
|
||||
|
||||
// calculations based on libgtop
|
||||
- used_mem = (uint64_t) pagesh (uvmexp.npages - uvmexp.free) << LOG1024;
|
||||
+ used_mem = ((uint64_t) uvmexp.npages - uvmexp.free) << uvmexp.pageshift;
|
||||
+ free_mem = ((uint64_t) uvmexp.free) << uvmexp.pageshift;
|
||||
+ used_mem = ( (uint64_t) uvmexp.npages - uvmexp.free ) << uvmexp.pageshift;
|
||||
+ free_mem = ( (uint64_t) uvmexp.free ) << uvmexp.pageshift;
|
||||
|
||||
- free_mem = (uint64_t) pagesh( uvmexp.free ) << LOG1024;
|
||||
-
|
||||
// from nagios-memory plugin
|
||||
- used_mem -= pagesh( bcstats.numbufpages );
|
||||
- free_mem += pagesh( bcstats.numbufpages );
|
||||
+ used_mem -= ((uint64_t) bcstats.numbufpages) << uvmexp.pageshift;
|
||||
+ free_mem += ((uint64_t) bcstats.numbufpages) << uvmexp.pageshift;
|
||||
+ used_mem -= ( (uint64_t) bcstats.numbufpages ) << uvmexp.pageshift;
|
||||
+ free_mem += ( (uint64_t) bcstats.numbufpages ) << uvmexp.pageshift;
|
||||
|
||||
// calculate total memory
|
||||
- total_mem = (uint64_t) pagesh( uvmexp.npages ) << LOG1024;
|
||||
+ total_mem = ((uint64_t) uvmexp.npages) << uvmexp.pageshift;
|
||||
+ total_mem = ( (uint64_t) uvmexp.npages ) << uvmexp.pageshift;
|
||||
|
||||
if( use_colors )
|
||||
{
|
||||
status.used_mem = convert_unit(static_cast< float >( used_mem ), MEGABYTES );
|
||||
status.total_mem = convert_unit(static_cast< float >( total_mem ), MEGABYTES );
|
||||
|
Loading…
x
Reference in New Issue
Block a user