After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667830 - [RFE] Please collapse kthreadd part of the process tree
[RFE] Please collapse kthreadd part of the process tree
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: process list
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Robert Roth
: 590372 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-01-12 22:41 UTC by Lennart Poettering
Modified: 2012-02-20 23:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1.21 KB, patch)
2012-01-23 20:16 UTC, Robert Roth
reviewed Details | Review
Proposed patch for linuxes only (1.28 KB, patch)
2012-01-29 08:42 UTC, Robert Roth
none Details | Review

Description Lennart Poettering 2012-01-12 22:41:55 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.
Comment 1 Chris Kühl 2012-01-14 02:29:33 UTC
Agreed. I'll get to it soon.
Comment 2 Robert Roth 2012-01-16 19:57:24 UTC
*** Bug 590372 has been marked as a duplicate of this bug. ***
Comment 3 Robert Roth 2012-01-23 20:16:09 UTC
Created attachment 205919 [details] [review]
Proposed patch

This patch stops kthreadd from expanding by default in process three mode.
Comment 4 Chris Kühl 2012-01-28 01:18:44 UTC
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?
Comment 5 Robert Roth 2012-01-28 05:04:22 UTC
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.
Comment 6 Chris Kühl 2012-01-28 12:56:24 UTC
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.
Comment 7 Lennart Poettering 2012-01-28 17:18:57 UTC
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.
Comment 8 Lennart Poettering 2012-01-28 17:19:40 UTC
(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)
Comment 9 Robert Roth 2012-01-29 08:42:23 UTC
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.
Comment 10 Chris Kühl 2012-02-20 23:55:07 UTC
Sorry, I forgot about this. It's applied now. Thanks.