pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

btop-git: Fix the memory counters.



Module Name:	pkgsrc-wip
Committed By:	Santhosh Raju <fox%NetBSD.org@localhost>
Pushed By:	fox
Date:		Sat Feb 24 11:17:04 2024 +0100
Changeset:	c188cb5f9ed64bc7112780b18af09d99a9f43625

Modified Files:
	btop-git/distinfo
	btop-git/patches/patch-src_netbsd_btop__collect.cpp

Log Message:
btop-git: Fix the memory counters.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c188cb5f9ed64bc7112780b18af09d99a9f43625

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 btop-git/distinfo                                   |  2 +-
 btop-git/patches/patch-src_netbsd_btop__collect.cpp | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diffs:
diff --git a/btop-git/distinfo b/btop-git/distinfo
index bf4af0871e..5bd835b3dd 100644
--- a/btop-git/distinfo
+++ b/btop-git/distinfo
@@ -5,4 +5,4 @@ SHA512 (btop-1.2.13.20240218-6c667402907171f3ba7ebb637e553cc6f66f4e66.tar.gz) =
 Size (btop-1.2.13.20240218-6c667402907171f3ba7ebb637e553cc6f66f4e66.tar.gz) = 1145612 bytes
 SHA1 (patch-Makefile) = c881cc9121de99902f560728da201473b2ea9ef9
 SHA1 (patch-src_btop.cpp) = 60c805d6a5343d2e46f8f7cb0b03059426871fe9
-SHA1 (patch-src_netbsd_btop__collect.cpp) = 501431e0e58202915720cf97907af102c873de45
+SHA1 (patch-src_netbsd_btop__collect.cpp) = 1e2fbd770f13efc83d264bd7cfcc350c5df16978
diff --git a/btop-git/patches/patch-src_netbsd_btop__collect.cpp b/btop-git/patches/patch-src_netbsd_btop__collect.cpp
index 5b5ec89f5e..9a3bff7d78 100644
--- a/btop-git/patches/patch-src_netbsd_btop__collect.cpp
+++ b/btop-git/patches/patch-src_netbsd_btop__collect.cpp
@@ -2,9 +2,9 @@ $NetBSD$
 
 Add support for NetBSD.
 
---- src/netbsd/btop_collect.cpp.orig	2024-02-22 14:43:00.208906303 +0000
+--- src/netbsd/btop_collect.cpp.orig	2024-02-24 10:09:12.152243490 +0000
 +++ src/netbsd/btop_collect.cpp
-@@ -0,0 +1,1283 @@
+@@ -0,0 +1,1282 @@
 +/* Copyright 2021 Aristocratos (jakob%qvantnet.com@localhost)
 +
 +   Licensed under the Apache License, Version 2.0 (the "License");
@@ -605,7 +605,7 @@ Add support for NetBSD.
 +		auto &mem = current_mem;
 +		static bool snapped = (getenv("BTOP_SNAPPED") != nullptr);
 +
-+		uint64_t memActive, memWired, memCached, memFree, memInactive;
++		uint64_t memActive, memWired, memCached, memFree;
 +		size_t size;
 +
 +		static int uvmexp_mib[] = {CTL_VM, VM_UVMEXP2};
@@ -616,13 +616,12 @@ Add support for NetBSD.
 +			bzero(&uvmexp, sizeof(uvmexp));
 +		}
 +
-+		memActive = (uvmexp.active + uvmexp.bootpages) * Shared::pageSize;
++		memActive = uvmexp.active * Shared::pageSize;
 +		memWired = uvmexp.wired * Shared::pageSize;
-+		memInactive = uvmexp.inactive * Shared::pageSize;
 +		memFree = uvmexp.free * Shared::pageSize;
 +		memCached = (uvmexp.filepages + uvmexp.execpages + uvmexp.anonpages) * Shared::pageSize;
 +		mem.stats.at("used") = memActive + memWired;
-+		mem.stats.at("available") = memInactive + memCached;
++		mem.stats.at("available") = Shared::totalMem - (memActive + memWired);
 +		mem.stats.at("cached") = memCached;
 +		mem.stats.at("free") = memFree;
 +


Home | Main Index | Thread Index | Old Index