diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-04-06 12:41:36 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-04-06 12:41:36 -0300 |
commit | 6fe06fb7e55831ab81594bbac35c200136746830 (patch) | |
tree | dd4f71a2b02da7c92c1bd195566c2d0d71dc2095 /linux | |
parent | 657836a2ae4c250416a258534b3f383d57f61d4c (diff) |
Portability: make list of default screens per-platform
Diffstat (limited to 'linux')
-rw-r--r-- | linux/Platform.c | 30 | ||||
-rw-r--r-- | linux/Platform.h | 7 |
2 files changed, 31 insertions, 6 deletions
diff --git a/linux/Platform.c b/linux/Platform.c index dfe4dd64..7efc7e47 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -36,16 +36,13 @@ in the source distribution for its full text. #include "BatteryMeter.h" #include "LinuxProcess.h" #include "SignalsPanel.h" +#include "Settings.h" }*/ #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, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; - -//static ProcessField defaultIoFields[] = { PID, IO_PRIORITY, USER, IO_READ_RATE, IO_WRITE_RATE, IO_RATE, COMM, 0 }; - int Platform_numberOfFields = LAST_PROCESSFIELD; const SignalItem Platform_signals[] = { @@ -85,6 +82,31 @@ const SignalItem Platform_signals[] = { { .name = "31 SIGSYS", .number = 31 }, }; +ScreenDefaults Platform_defaultScreens[] = { + { + .name = "Default", + .columns = "PID USER PRIORITY NICE M_SIZE M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command", + .sortKey = "PERCENT_CPU", + }, + { + .name = "I/O", + .columns = "PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command", + .sortKey = "IO_RATE", + }, + { + .name = "Perf Counters", + .columns = "PID USER PERCENT_CPU PROCESSOR MCYCLE MINSTR IPC PERCENT_MISS PERCENT_BMISS Command", + .sortKey = "MCYCLE", + }, + { + .name = "L1 Data Cache", + .columns = "PID USER PERCENT_CPU L1DREADS L1DRMISSES L1DWRITES L1DWMISSES Command", + .sortKey = "LD1READS", + }, +}; + +const unsigned int Platform_numberOfDefaultScreens = sizeof(Platform_defaultScreens)/sizeof(ScreenDefaults); + const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem); static Htop_Reaction Platform_actionSetIOPriority(State* st) { diff --git a/linux/Platform.h b/linux/Platform.h index b0456e5b..f17e2b3e 100644 --- a/linux/Platform.h +++ b/linux/Platform.h @@ -14,17 +14,20 @@ in the source distribution for its full text. #include "BatteryMeter.h" #include "LinuxProcess.h" #include "SignalsPanel.h" +#include "Settings.h" #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif -extern ProcessField Platform_defaultFields[]; - extern int Platform_numberOfFields; extern const SignalItem Platform_signals[]; +extern ScreenDefaults Platform_defaultScreens[]; + +extern const unsigned int Platform_numberOfDefaultScreens; + extern const unsigned int Platform_numberOfSignals; void Platform_setBindings(Htop_Action* keys); |