aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2021-12-31 21:32:18 +0000
committerStefan Eßer <se@FreeBSD.org>2021-12-31 21:34:49 +0000
commit6cc600ed7040ae0270d22f580c4778266d9bdbe4 (patch)
tree965b2cdd005815fec6dda478e936093bb7179e17 /sysutils
parent26d588b4cb77f41160c36721627154067da1fae7 (diff)
downloadports-6cc600ed7040ae0270d22f580c4778266d9bdbe4.tar.gz
ports-6cc600ed7040ae0270d22f580c4778266d9bdbe4.zip
sysutils/turbostat: use CPU_* macros defined in -CURRENT
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/turbostat/files/patch-turbostat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sysutils/turbostat/files/patch-turbostat.c b/sysutils/turbostat/files/patch-turbostat.c
index bfe11b2212b4..cbfdcb22ddda 100644
--- a/sysutils/turbostat/files/patch-turbostat.c
+++ b/sysutils/turbostat/files/patch-turbostat.c
@@ -1,6 +1,6 @@
--- turbostat.c.orig 2020-11-13 21:55:04 UTC
+++ turbostat.c
-@@ -41,7 +41,31 @@
+@@ -41,7 +41,34 @@
#include <sched.h>
#include <time.h>
#include <cpuid.h>
@@ -16,6 +16,8 @@
+#include <libutil.h>
+#include <limits.h>
+
++#ifndef CPU_ALLOC
++#define CPUSET_2ADDR
+#define cpu_set_t cpuset_t
+
+#define CPU_ALLOC(_ign) ({(cpuset_t*)malloc(sizeof(cpuset_t));})
@@ -25,6 +27,7 @@
+#define CPU_SET_S(cpu, _ign, set) CPU_SET(cpu, set)
+#define CPU_ZERO_S(_ign, set) CPU_ZERO(set)
+#define sched_setaffinity(_x, _y, set) cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), set)
++#endif /* !CPU_ALLOC */
+
+#else
#include <linux/capability.h>
@@ -99,7 +102,7 @@
/*
* Each string in this array is compared in --show and --hide cmdline.
-@@ -2239,6 +2288,177 @@ int parse_int_file(const char *fmt, ...)
+@@ -2239,6 +2288,181 @@ int parse_int_file(const char *fmt, ...)
return value;
}
@@ -189,7 +192,11 @@
+ CPU_ZERO(packages.sets);
+
+ for (int i = 0; i < cores.len; i++)
++#ifdef CPUSET_2ADDR
+ CPU_OR(packages.sets, cores.sets + i);
++#else
++ CPU_OR(packages.sets, packages.sets, cores.sets + i);
++#endif
+ packages.len++;
+ }
+