summaryrefslogtreecommitdiffstats
path: root/linux/LinuxProcessList.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-08-08 16:04:26 +0200
committercgzones <cgzones@googlemail.com>2021-08-14 17:05:00 +0200
commitce27f8379d143d64ab6a7787fdf38cb864e18edd (patch)
treea06dfcadc31925ba04ef918d8aebf5f5df621f78 /linux/LinuxProcessList.c
parent2d1b6f47836119b6318d4fa3abae5b312bf380d7 (diff)
Respect "Show custom thread names" setting update
Update merged command-line when started with "Show custom thread names" disabled and enabling at runtime. Also only consider showThreadNames when working on userland threads.
Diffstat (limited to 'linux/LinuxProcessList.c')
-rw-r--r--linux/LinuxProcessList.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 3ad4e2f0..cd218ceb 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -1223,7 +1223,7 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc
if ((amtRead = xReadfileat(procFd, "comm", command, sizeof(command))) > 0) {
command[amtRead - 1] = '\0';
Process_updateComm(process, command);
- } else if (process->procComm) {
+ } else {
Process_updateComm(process, NULL);
}
@@ -1543,18 +1543,15 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_
LinuxProcessList_readAutogroup(lp, procFd);
}
- if (proc->state == 'Z' && !proc->cmdline && statCommand[0]) {
+ if (!proc->cmdline && statCommand[0] &&
+ (proc->state == 'Z' || Process_isKernelThread(proc) || settings->showThreadNames)) {
Process_updateCmdline(proc, statCommand, 0, strlen(statCommand));
- } else if (Process_isThread(proc)) {
- if ((settings->showThreadNames || Process_isKernelThread(proc)) && statCommand[0]) {
- Process_updateCmdline(proc, statCommand, 0, strlen(statCommand));
- }
+ }
- if (Process_isKernelThread(proc)) {
- pl->kernelThreads++;
- } else {
- pl->userlandThreads++;
- }
+ if (Process_isKernelThread(proc)) {
+ pl->kernelThreads++;
+ } else if (Process_isUserlandThread(proc)) {
+ pl->userlandThreads++;
}
/* Set at the end when we know if a new entry is a thread */

© 2014-2024 Faster IT GmbH | imprint | privacy policy