GNOME Bugzilla – Bug 667830
[RFE] Please collapse kthreadd part of the process tree
Last modified: 2012-02-20 23:55:07 UTC
If g-s-m shows the process tree in "Dependencies" mode it would be useful to collapse the kthreadd branch of it by default. kernel threads are little more than an implementation detail of the kernel. It's OK to make them explorable, but in order to focus on what matters I'd strongly suggest taking them out of view by default and making them visible only after expanding the kthreadd branch.
Agreed. I'll get to it soon.
*** Bug 590372 has been marked as a duplicate of this bug. ***
Created attachment 205919 [details] [review] Proposed patch This patch stops kthreadd from expanding by default in process three mode.
Review of attachment 205919 [details] [review]: Works fine on my system but what about the case when we're not running on a Linux kernel?
I have missed that case. So we should only do this if we are running a Linux kernel? I could find that info from the SysInfo instance.
Yes, as far as I know kthreadd is Linux specific. If we don't do a check we'll be collapsing any process tree that happens to be assigned to pid 2.
just add an "#ifdef __linux__" around that check. http://predef.sourceforge.net/ is your friend. Or more specifically http://sourceforge.net/apps/mediawiki/predef/index.php?title=Operating_Systems#Linux is.
(The point I am making here is that you should make whether you are running on Linux a compile time check for this, not a runtime check)
Created attachment 206348 [details] [review] Proposed patch for linuxes only I've added the ifdef, so process with pid 2 (kthreadd) should only be collapsed on linuxes. Tried it this way and also tried with undef __linux__ to make sure it works if not on Linux, and seems to work as expected.
Sorry, I forgot about this. It's applied now. Thanks.