From 7ca10817122d3b7b30fabb1cadb75e5ee14b364e Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 18 Nov 2011 06:08:56 +0000 Subject: Mega-commit with features and tweaks for 1.0: * Performance improvements * Support for splitting CPU meters into two or four columns (thanks to Wim Heirman) * Switch from PLPA, which is now deprecated, to HWLOC. * Bring back support for native Linux sched_setaffinity, so we don't have to use HWLOC where we don't need to. * Support for typing in user names and column fields in selection panels. --- Settings.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Settings.c') diff --git a/Settings.c b/Settings.c index 3daf3c11..816a7ecb 100644 --- a/Settings.c +++ b/Settings.c @@ -55,7 +55,7 @@ static void Settings_readMeterModes(Settings* this, char* line, HeaderSide side) String_freeArray(ids); } -static bool Settings_read(Settings* this, char* fileName) { +static bool Settings_read(Settings* this, char* fileName, int cpuCount) { // TODO: implement File object and make // file I/O object-oriented. FILE* fd; @@ -144,7 +144,7 @@ static bool Settings_read(Settings* this, char* fileName) { } fclose(fd); if (!readMeters) { - Header_defaultMeters(this->header); + Header_defaultMeters(this->header, cpuCount); } return true; } @@ -208,7 +208,7 @@ bool Settings_write(Settings* this) { return true; } -Settings* Settings_new(ProcessList* pl, Header* header) { +Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) { Settings* this = malloc(sizeof(Settings)); this->pl = pl; this->header = header; @@ -225,15 +225,15 @@ Settings* Settings_new(ProcessList* pl, Header* header) { this->colorScheme = 0; this->changed = false; this->delay = DEFAULT_DELAY; - bool ok = Settings_read(this, this->userSettings); + bool ok = Settings_read(this, this->userSettings, cpuCount); if (!ok) { this->changed = true; // TODO: how to get SYSCONFDIR correctly through Autoconf? char* systemSettings = String_cat(SYSCONFDIR, "/htoprc"); - ok = Settings_read(this, systemSettings); + ok = Settings_read(this, systemSettings, cpuCount); free(systemSettings); if (!ok) { - Header_defaultMeters(this->header); + Header_defaultMeters(this->header, cpuCount); pl->hideKernelThreads = true; pl->highlightMegabytes = true; pl->highlightThreads = false; -- cgit v1.2.3