mirror of https://github.com/xzeldon/htop.git
Option to update process names on every refresh
(thanks to Rob Hoelz)
This commit is contained in:
parent
1b21827f1f
commit
f44a8f2009
|
@ -5,6 +5,8 @@ What's new in version 1.0.2
|
||||||
* Avoid deleting .htoprc if it is a symlink
|
* Avoid deleting .htoprc if it is a symlink
|
||||||
* Fail gracefully when /proc is not mounted
|
* Fail gracefully when /proc is not mounted
|
||||||
(thanks to Philipp Hagemeister)
|
(thanks to Philipp Hagemeister)
|
||||||
|
* Option to update process names on every refresh
|
||||||
|
(thanks to Rob Hoelz)
|
||||||
* BUGFIX: Fix crashes when process list is empty
|
* BUGFIX: Fix crashes when process list is empty
|
||||||
|
|
||||||
What's new in version 1.0.1
|
What's new in version 1.0.1
|
||||||
|
|
|
@ -83,5 +83,6 @@ DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager*
|
||||||
Panel_add(super, (Object*) CheckItem_new(strdup("Leave a margin around header"), &(settings->header->margin), false));
|
Panel_add(super, (Object*) CheckItem_new(strdup("Leave a margin around header"), &(settings->header->margin), false));
|
||||||
Panel_add(super, (Object*) CheckItem_new(strdup("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest)"), &(settings->pl->detailedCPUTime), false));
|
Panel_add(super, (Object*) CheckItem_new(strdup("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest)"), &(settings->pl->detailedCPUTime), false));
|
||||||
Panel_add(super, (Object*) CheckItem_new(strdup("Count CPUs from 0 instead of 1"), &(settings->pl->countCPUsFromZero), false));
|
Panel_add(super, (Object*) CheckItem_new(strdup("Count CPUs from 0 instead of 1"), &(settings->pl->countCPUsFromZero), false));
|
||||||
|
Panel_add(super, (Object*) CheckItem_new(strdup("Update process names on every refresh"), &(settings->pl->updateProcessNames), false));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,7 @@ typedef struct ProcessList_ {
|
||||||
bool highlightThreads;
|
bool highlightThreads;
|
||||||
bool detailedCPUTime;
|
bool detailedCPUTime;
|
||||||
bool countCPUsFromZero;
|
bool countCPUsFromZero;
|
||||||
|
bool updateProcessNames;
|
||||||
const char **treeStr;
|
const char **treeStr;
|
||||||
|
|
||||||
} ProcessList;
|
} ProcessList;
|
||||||
|
@ -239,6 +240,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
|
||||||
this->highlightMegabytes = false;
|
this->highlightMegabytes = false;
|
||||||
this->detailedCPUTime = false;
|
this->detailedCPUTime = false;
|
||||||
this->countCPUsFromZero = false;
|
this->countCPUsFromZero = false;
|
||||||
|
this->updateProcessNames = false;
|
||||||
this->treeStr = NULL;
|
this->treeStr = NULL;
|
||||||
this->following = -1;
|
this->following = -1;
|
||||||
|
|
||||||
|
@ -712,6 +714,11 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
|
||||||
goto errorReadingProcess;
|
goto errorReadingProcess;
|
||||||
|
|
||||||
ProcessList_add(this, process);
|
ProcessList_add(this, process);
|
||||||
|
} else {
|
||||||
|
if (this->updateProcessNames) {
|
||||||
|
if (! ProcessList_readCmdlineFile(process, dirname, name))
|
||||||
|
goto errorReadingProcess;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process->state == 'Z') {
|
if (process->state == 'Z') {
|
||||||
|
|
|
@ -136,6 +136,7 @@ typedef struct ProcessList_ {
|
||||||
bool highlightThreads;
|
bool highlightThreads;
|
||||||
bool detailedCPUTime;
|
bool detailedCPUTime;
|
||||||
bool countCPUsFromZero;
|
bool countCPUsFromZero;
|
||||||
|
bool updateProcessNames;
|
||||||
const char **treeStr;
|
const char **treeStr;
|
||||||
|
|
||||||
} ProcessList;
|
} ProcessList;
|
||||||
|
|
|
@ -124,6 +124,8 @@ static bool Settings_read(Settings* this, char* fileName, int cpuCount) {
|
||||||
this->pl->detailedCPUTime = atoi(option[1]);
|
this->pl->detailedCPUTime = atoi(option[1]);
|
||||||
} else if (String_eq(option[0], "cpu_count_from_zero")) {
|
} else if (String_eq(option[0], "cpu_count_from_zero")) {
|
||||||
this->pl->countCPUsFromZero = atoi(option[1]);
|
this->pl->countCPUsFromZero = atoi(option[1]);
|
||||||
|
} else if (String_eq(option[0], "update_process_names")) {
|
||||||
|
this->pl->updateProcessNames = atoi(option[1]);
|
||||||
} else if (String_eq(option[0], "delay")) {
|
} else if (String_eq(option[0], "delay")) {
|
||||||
this->delay = atoi(option[1]);
|
this->delay = atoi(option[1]);
|
||||||
} else if (String_eq(option[0], "color_scheme")) {
|
} else if (String_eq(option[0], "color_scheme")) {
|
||||||
|
@ -183,6 +185,7 @@ bool Settings_write(Settings* this) {
|
||||||
fprintf(fd, "header_margin=%d\n", (int) this->header->margin);
|
fprintf(fd, "header_margin=%d\n", (int) this->header->margin);
|
||||||
fprintf(fd, "detailed_cpu_time=%d\n", (int) this->pl->detailedCPUTime);
|
fprintf(fd, "detailed_cpu_time=%d\n", (int) this->pl->detailedCPUTime);
|
||||||
fprintf(fd, "cpu_count_from_zero=%d\n", (int) this->pl->countCPUsFromZero);
|
fprintf(fd, "cpu_count_from_zero=%d\n", (int) this->pl->countCPUsFromZero);
|
||||||
|
fprintf(fd, "update_process_names=%d\n", (int) this->pl->updateProcessNames);
|
||||||
fprintf(fd, "color_scheme=%d\n", (int) this->colorScheme);
|
fprintf(fd, "color_scheme=%d\n", (int) this->colorScheme);
|
||||||
fprintf(fd, "delay=%d\n", (int) this->delay);
|
fprintf(fd, "delay=%d\n", (int) this->delay);
|
||||||
fprintf(fd, "left_meters=");
|
fprintf(fd, "left_meters=");
|
||||||
|
|
Loading…
Reference in New Issue