From f80394a20254938142011855f2954b3f63fe5909 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Tue, 15 Sep 2020 08:00:00 +0200 Subject: New upstream version 3.0.2 --- freebsd/Battery.h | 2 -- freebsd/FreeBSDCRT.h | 3 --- freebsd/FreeBSDProcess.c | 27 ----------------------- freebsd/FreeBSDProcess.h | 12 +--------- freebsd/FreeBSDProcessList.c | 52 +++----------------------------------------- freebsd/FreeBSDProcessList.h | 11 ++-------- freebsd/Platform.c | 12 ---------- freebsd/Platform.h | 7 ------ 8 files changed, 6 insertions(+), 120 deletions(-) (limited to 'freebsd') diff --git a/freebsd/Battery.h b/freebsd/Battery.h index cc5b1fe..6987d78 100644 --- a/freebsd/Battery.h +++ b/freebsd/Battery.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_Battery #define HEADER_Battery /* diff --git a/freebsd/FreeBSDCRT.h b/freebsd/FreeBSDCRT.h index eb1091a..eb88fcc 100644 --- a/freebsd/FreeBSDCRT.h +++ b/freebsd/FreeBSDCRT.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_FreeBSDCRT #define HEADER_FreeBSDCRT /* @@ -11,5 +9,4 @@ in the source distribution for its full text. void CRT_handleSIGSEGV(int sgn); - #endif diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c index c8d30f6..33dc751 100644 --- a/freebsd/FreeBSDProcess.c +++ b/freebsd/FreeBSDProcess.c @@ -16,33 +16,6 @@ in the source distribution for its full text. #include #include -/*{ - -typedef enum FreeBSDProcessFields { - // Add platform-specific fields here, with ids >= 100 - JID = 100, - JAIL = 101, - LAST_PROCESSFIELD = 102, -} FreeBSDProcessField; - - -typedef struct FreeBSDProcess_ { - Process super; - int kernel; - int jid; - char* jname; -} FreeBSDProcess; - - -#ifndef Process_isKernelThread -#define Process_isKernelThread(_process) (_process->kernel == 1) -#endif - -#ifndef Process_isUserlandThread -#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#endif - -}*/ ProcessClass FreeBSDProcess_class = { .super = { diff --git a/freebsd/FreeBSDProcess.h b/freebsd/FreeBSDProcess.h index 23d298a..897c532 100644 --- a/freebsd/FreeBSDProcess.h +++ b/freebsd/FreeBSDProcess.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_FreeBSDProcess #define HEADER_FreeBSDProcess /* @@ -9,15 +7,13 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - -typedef enum FreeBSDProcessFields { +typedef enum FreeBSDProcessFields_ { // Add platform-specific fields here, with ids >= 100 JID = 100, JAIL = 101, LAST_PROCESSFIELD = 102, } FreeBSDProcessField; - typedef struct FreeBSDProcess_ { Process super; int kernel; @@ -25,15 +21,9 @@ typedef struct FreeBSDProcess_ { char* jname; } FreeBSDProcess; - -#ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) -#endif -#ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#endif - extern ProcessClass FreeBSDProcess_class; diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c index 8c892a0..6318d42 100644 --- a/freebsd/FreeBSDProcessList.c +++ b/freebsd/FreeBSDProcessList.c @@ -22,54 +22,8 @@ in the source distribution for its full text. #include #include -/*{ - -#include "zfs/ZfsArcStats.h" - -#include -#include -#include -#include -#include - -#define JAIL_ERRMSGLEN 1024 char jail_errmsg[JAIL_ERRMSGLEN]; -typedef struct CPUData_ { - - double userPercent; - double nicePercent; - double systemPercent; - double irqPercent; - double idlePercent; - double systemAllPercent; - -} CPUData; - -typedef struct FreeBSDProcessList_ { - ProcessList super; - kvm_t* kd; - - unsigned long long int memWire; - unsigned long long int memActive; - unsigned long long int memInactive; - unsigned long long int memFree; - - ZfsArcStats zfs; - - CPUData* cpus; - - unsigned long *cp_time_o; - unsigned long *cp_time_n; - - unsigned long *cp_times_o; - unsigned long *cp_times_n; - -} FreeBSDProcessList; - -}*/ - - static int MIB_hw_physmem[2]; static int MIB_vm_stats_vm_v_page_count[4]; static int pageSize; @@ -87,12 +41,12 @@ static int MIB_kern_cp_time[2]; static int MIB_kern_cp_times[2]; static int kernelFScale; -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { +ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) { size_t len; char errbuf[_POSIX2_LINE_MAX]; FreeBSDProcessList* fpl = xCalloc(1, sizeof(FreeBSDProcessList)); ProcessList* pl = (ProcessList*) fpl; - ProcessList_init(pl, Class(FreeBSDProcess), usersTable, pidWhiteList, userId); + ProcessList_init(pl, Class(FreeBSDProcess), usersTable, pidMatchList, userId); // physical memory in system: hw.physmem // physical page size: hw.pagesize @@ -157,7 +111,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui sysctl(MIB_kern_cp_times, 2, fpl->cp_times_o, &len, NULL, 0); } - pl->cpuCount = MAX(cpus, 1); + pl->cpuCount = MAXIMUM(cpus, 1); if (cpus == 1 ) { fpl->cpus = xRealloc(fpl->cpus, sizeof(CPUData)); diff --git a/freebsd/FreeBSDProcessList.h b/freebsd/FreeBSDProcessList.h index 7c1b7ad..281bf3e 100644 --- a/freebsd/FreeBSDProcessList.h +++ b/freebsd/FreeBSDProcessList.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_FreeBSDProcessList #define HEADER_FreeBSDProcessList /* @@ -9,7 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include "zfs/ZfsArcStats.h" #include @@ -19,17 +16,15 @@ in the source distribution for its full text. #include #define JAIL_ERRMSGLEN 1024 -char jail_errmsg[JAIL_ERRMSGLEN]; +extern char jail_errmsg[JAIL_ERRMSGLEN]; typedef struct CPUData_ { - double userPercent; double nicePercent; double systemPercent; double irqPercent; double idlePercent; double systemAllPercent; - } CPUData; typedef struct FreeBSDProcessList_ { @@ -53,9 +48,7 @@ typedef struct FreeBSDProcessList_ { } FreeBSDProcessList; - - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); +ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId); void ProcessList_delete(ProcessList* this); diff --git a/freebsd/Platform.c b/freebsd/Platform.c index e6acebd..c51b37c 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -28,18 +28,6 @@ in the source distribution for its full text. #include #include -/*{ -#include "Action.h" -#include "BatteryMeter.h" -#include "SignalsPanel.h" - -extern ProcessFieldData Process_fields[]; - -}*/ - -#ifndef CLAMP -#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) -#endif ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; diff --git a/freebsd/Platform.h b/freebsd/Platform.h index 0268f2c..1a18055 100644 --- a/freebsd/Platform.h +++ b/freebsd/Platform.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_Platform #define HEADER_Platform /* @@ -15,11 +13,6 @@ in the source distribution for its full text. extern ProcessFieldData Process_fields[]; - -#ifndef CLAMP -#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) -#endif - extern ProcessField Platform_defaultFields[]; extern int Platform_numberOfFields; -- cgit v1.2.3