Skip to content

Disable basename matching for kernel threads#1392

Merged
BenBE merged 1 commit intohtop-dev:mainfrom
cgzones:kernel_cmdline
Jan 27, 2024
Merged

Disable basename matching for kernel threads#1392
BenBE merged 1 commit intohtop-dev:mainfrom
cgzones:kernel_cmdline

Conversation

@cgzones
Copy link
Copy Markdown
Member

@cgzones cgzones commented Jan 27, 2024

Kernel threads are commonly not based on an executable and their cmdline therefore just a human readable string.
On Linux this string might contain slashes, e.g. kworker/7:5H-ttm, which cause Process_writeCommand() to print only the trailing parts if the option Show Program Path is disabled.

Reported-and-Suggested-By: mmrmaximuzz
Fixes: #1391

/cc @mmrmaximuzz

Kernel threads are commonly not based on an executable and their cmdline
therefore just a human readable string.
On Linux this string might contain slashes, e.g. kworker/7:5H-ttm, which
cause Process_writeCommand() to print only the trailing parts if the
option *Show Program Path* is disabled.

Reported-and-Suggested-By: mmrmaximuzz
Fixes: htop-dev#1391
@cgzones cgzones added bug 🐛 Something isn't working Linux 🐧 Linux related issues labels Jan 27, 2024
@cgzones cgzones added this to the 3.4.0 milestone Jan 27, 2024
Copy link
Copy Markdown
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

An alternative would be highlighting the first part for kernel threads instead. Fine either way.

@BenBE BenBE merged commit 32cb302 into htop-dev:main Jan 27, 2024
@mmrmaximuzz
Copy link
Copy Markdown

@BenBE

An alternative would be highlighting the first part for kernel threads instead.

I suppose that highlighting any part of a kernel thread name could be misleading. And it seems to be broken already, look how it could be rendered for some threads:

image

Not only /, but additionally a number and a colon : are highlighted as well. I don't think this kind of "partitioning" is expected. :)

With @cgzones patch all the highlighting for kernel threads is gone as well, I worked with kernel for some time and at least for me it looks more natural.

@BenBE
Copy link
Copy Markdown
Member

BenBE commented Jan 28, 2024

Okay. Noticed the partial highlighting there too. My suggestion was to just highlight kworker, but without highlighting is fine too. Note that this also disables the path shortening for kernel threads and always shows them as-is.

@cgzones cgzones deleted the kernel_cmdline branch February 2, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 Something isn't working Linux 🐧 Linux related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong kernel thread names are rendered when "Show program path" option is disabled

3 participants