about summary refs log tree commit diff
path: root/users/multi/pkgs/htop/zfs-arc-cache
diff options
context:
space:
mode:
authormulti <depot@in-addr.xyz>2020-11-17T23·56+0000
committermulti <depot@in-addr.xyz>2020-11-18T00·29+0000
commit4331bc8da76ae67a43d64ff5355598a2699a647f (patch)
tree2db05805958d2be1992bd6b827de8801f9097e71 /users/multi/pkgs/htop/zfs-arc-cache
parent73c862279aad7aa4c87bfe5ae2c69a0f56bb59df (diff)
chore(users/multi): Update htop derivation for new upstream. r/1883
- htop has moved upstreams, which has been producing new releases, so
  update the derivation to pull from the new repository on GitHub.

- All of the patches I have locally have been merged upstream, so drop
  them from the depot.

- Pull from a reasonably recent git commit instead of from a numbered
  release, as the ZFS ARC stats and CPU meter columnation patches
  haven't made it into a release yet.

Change-Id: I66ad4c035df07709abf4f75a9d4e1486920091d0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2105
Reviewed-by: multi <depot@in-addr.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/multi/pkgs/htop/zfs-arc-cache')
-rw-r--r--users/multi/pkgs/htop/zfs-arc-cache/0001-Linux-consider-ZFS-ARC-to-be-cache.patch119
1 files changed, 0 insertions, 119 deletions
diff --git a/users/multi/pkgs/htop/zfs-arc-cache/0001-Linux-consider-ZFS-ARC-to-be-cache.patch b/users/multi/pkgs/htop/zfs-arc-cache/0001-Linux-consider-ZFS-ARC-to-be-cache.patch
deleted file mode 100644
index 50b2abd2b803..000000000000
--- a/users/multi/pkgs/htop/zfs-arc-cache/0001-Linux-consider-ZFS-ARC-to-be-cache.patch
+++ /dev/null
@@ -1,119 +0,0 @@
-From d1dadae5674222a0134092b3313383e088deda89 Mon Sep 17 00:00:00 2001
-From: multiplexd <multi@in-addr.xyz>
-Date: Sat, 9 May 2020 20:13:09 +0100
-Subject: [PATCH] Linux: consider ZFS ARC to be cache
-
----
- ProcessList.c            |  1 +
- ProcessList.h            |  1 +
- linux/LinuxProcessList.c | 27 +++++++++++++++++++++++++++
- linux/LinuxProcessList.h |  4 ++++
- linux/Platform.c         |  5 +++--
- 5 files changed, 36 insertions(+), 2 deletions(-)
-
-diff --git a/ProcessList.c b/ProcessList.c
-index 7482b03..7083957 100644
---- a/ProcessList.c
-+++ b/ProcessList.c
-@@ -67,6 +67,7 @@ typedef struct ProcessList_ {
-    unsigned long long int totalSwap;
-    unsigned long long int usedSwap;
-    unsigned long long int freeSwap;
-+   unsigned long long int arcSize;
- 
-    int cpuCount;
- 
-diff --git a/ProcessList.h b/ProcessList.h
-index 572d484..65029f1 100644
---- a/ProcessList.h
-+++ b/ProcessList.h
-@@ -61,6 +61,7 @@ typedef struct ProcessList_ {
-    unsigned long long int totalSwap;
-    unsigned long long int usedSwap;
-    unsigned long long int freeSwap;
-+   unsigned long long int arcSize;
- 
-    int cpuCount;
- 
-diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
-index 5f38540..507ebd2 100644
---- a/linux/LinuxProcessList.c
-+++ b/linux/LinuxProcessList.c
-@@ -104,6 +104,10 @@ typedef struct LinuxProcessList_ {
- #define PROCSTATFILE PROCDIR "/stat"
- #endif
- 
-+#ifndef ARCSTATFILE
-+#define ARCSTATFILE PROCDIR "/spl/kstat/zfs/arcstats"
-+#endif
-+
- #ifndef PROCMEMINFOFILE
- #define PROCMEMINFOFILE PROCDIR "/meminfo"
- #endif
-@@ -962,6 +966,29 @@ static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) {
-    this->cachedMem = this->cachedMem + sreclaimable - shmem;
-    this->usedSwap = this->totalSwap - swapFree;
-    fclose(file);
-+
-+   file = fopen(ARCSTATFILE, "r");
-+   if (file == NULL && errno != ENOENT) {
-+      CRT_fatalError("Cannot open " ARCSTATFILE);
-+   }
-+
-+   if (file != NULL) {
-+      // skip the first two lines
-+      fgets(buffer, sizeof buffer, file);
-+      fgets(buffer, sizeof buffer, file);
-+
-+      unsigned long long int arcsize = 0;
-+      while (fgets(buffer, sizeof buffer, file)) {
-+         #define tryRead(label, variable) do { if (String_startsWith(buffer, label) && sscanf(buffer + strlen(label), " %*d %llu", variable)) { break; } } while(0)
-+         if (buffer[0] == 's') tryRead("size", &arcsize);
-+      }
-+
-+      this->arcSize = arcsize / 1024;
-+
-+      fclose(file);
-+   } else {
-+      this->arcSize = 0;
-+   }
- }
- 
- static inline double LinuxProcessList_scanCPUTime(LinuxProcessList* this) {
-diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h
-index f30b487..8f2edbb 100644
---- a/linux/LinuxProcessList.h
-+++ b/linux/LinuxProcessList.h
-@@ -77,6 +77,10 @@ typedef struct LinuxProcessList_ {
- #define PROCSTATFILE PROCDIR "/stat"
- #endif
- 
-+#ifndef ARCSTATFILE
-+#define ARCSTATFILE PROCDIR "/spl/kstat/zfs/arcstats"
-+#endif
-+
- #ifndef PROCMEMINFOFILE
- #define PROCMEMINFOFILE PROCDIR "/meminfo"
- #endif
-diff --git a/linux/Platform.c b/linux/Platform.c
-index ab90ca7..fb78c4c 100644
---- a/linux/Platform.c
-+++ b/linux/Platform.c
-@@ -200,11 +200,12 @@ void Platform_setMemoryValues(Meter* this) {
-    long int usedMem = pl->usedMem;
-    long int buffersMem = pl->buffersMem;
-    long int cachedMem = pl->cachedMem;
--   usedMem -= buffersMem + cachedMem;
-+   long int arcSize = pl->arcSize;
-+   usedMem -= buffersMem + cachedMem + arcSize;
-    this->total = pl->totalMem;
-    this->values[0] = usedMem;
-    this->values[1] = buffersMem;
--   this->values[2] = cachedMem;
-+   this->values[2] = cachedMem + arcSize;
- }
- 
- void Platform_setSwapValues(Meter* this) {
--- 
-2.20.1
-