diff options
author | Nathan Scott <nathans@redhat.com> | 2020-08-26 10:15:00 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2020-08-26 10:39:43 +1000 |
commit | 728b04bbb5667291f1e56058240fcd7e03cbfe74 (patch) | |
tree | ad199ce3a3303e723eb9332aa6cb847b9530084a /Settings.c | |
parent | d0f31ede5624ed2f35ca25043f6a28adfe3bc171 (diff) |
Merge branch 'ci-hwloc-job' of https://github.com/bertwesarg/htop into bertwesarg-ci-hwloc-job
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -62,6 +62,9 @@ typedef struct Settings_ { bool headerMargin; bool enableMouse; bool vimMode; + #ifdef HAVE_LIBHWLOC + bool topologyAffinity; + #endif bool changed; } Settings; @@ -256,6 +259,10 @@ static bool Settings_read(Settings* this, const char* fileName) { didReadMeters = true; } else if (String_eq(option[0], "vim_mode")) { this->vimMode = atoi(option[1]); + #ifdef HAVE_LIBHWLOC + } else if (String_eq(option[0], "topology_affinity")) { + this->topologyAffinity = !!atoi(option[1]); + #endif } String_freeArray(option); } @@ -336,6 +343,9 @@ bool Settings_write(Settings* this) { fprintf(fd, "right_meters="); writeMeters(this, fd, 1); fprintf(fd, "right_meter_modes="); writeMeterModes(this, fd, 1); fprintf(fd, "vim_mode=%d\n", (int) this->vimMode); + #ifdef HAVE_LIBHWLOC + fprintf(fd, "topology_affinity=%d\n", (int) this->topologyAffinity); + #endif fclose(fd); return true; } @@ -362,6 +372,9 @@ Settings* Settings_new(int cpuCount) { this->cpuCount = cpuCount; this->showProgramPath = true; this->highlightThreads = true; + #ifdef HAVE_LIBHWLOC + this->topologyAffinity = false; + #endif this->fields = xCalloc(Platform_numberOfFields+1, sizeof(ProcessField)); // TODO: turn 'fields' into a Vector, |