Re: [PATCH] Toggle display of the kernel idle process (per-CPU idle threads) in top

From: John Baldwin <jhb_at_freebsd.org>
Date: Fri, 27 May 2011 11:59:28 -0400
On Friday, May 27, 2011 11:17:58 am Sergey Kandaurov wrote:
> On 27 May 2011 18:46, John Baldwin <jhb_at_freebsd.org> wrote:
> > Some times in top, I don't want to see all the per-CPU idle threads but
> > instead focus on the non-idle threads that are running.  Especially on a
> > system with a lot of CPUs, the idle threads can push all the interesting
> > threads off of the list.  This patch adds a new 'z' flag (gratuitously chosen
> > letter) and interactive command to toggle the display of the system idle
> > process.  Patch is tested against 8, but should work fine on HEAD too:
> 
> Works on HEAD as well. I like this idea.
> Perhaps it could be combined with i key?

I couldn't think of a sane way.  There are a few times when I want to see the
idle processes, but mostly I don't want to see them and want all the other
settings (idle, system, threads, etc.) to be orthogonal.

I'd even be up for defaulting kdile to No so we don't show the idle threads
by default.  That would match the behavior of 4.x where there were no idle
threads.

> > _at__at_ -1075,7 +1081,13 _at__at_
> >                                reset_display();
> >                                putchar('\r');
> >                                break;
> > -
> > +                           case CMD_kidletog:
> > +                               ps.kidle = !ps.kidle;
> > +                               new_message(MT_standout | MT_delayed,
> > +                                   " %sisplaying kernel idle process.",
> 
> > +                                   ps.idle ? "D" : "Not d");
> ^^
> typo: s/idle/kidle/

Oops, thanks!

-- 
John Baldwin
Received on Fri May 27 2011 - 14:02:06 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:14 UTC