Home Explore Blog CI



man-pages

35th chunk of `top.man`
fd16c87184b304cfcd1a59ab74611a89d4d0ada1910b8c7a0000000100000c0f
 Creating it is a simple process.

       1. Configure top appropriately for your installation and preserve that configuration with the ‘W’ interactive command.

       2. Add and test any desired ‘inspect’ entries.

       3. Copy that configuration file to the /etc/ directory as ‘topdefaultrc’.

   6d. SYSTEM Restrictions File
       The presence of this file will influence which version of the help screen is shown to an ordinary user.

       More importantly, it will limit what ordinary users are allowed to do when top is running.  They will not be able to issue the following commands.
           k        Kill a task
           r        Renice a task
           d or s   Change delay/sleep interval

       This configuration file is not created by top.  Rather, it is created manually and placed it in the /etc/ directory as ‘toprc’.

       It should have exactly two lines, as shown in this example:
           s        # line 1: secure mode switch
           5.0      # line 2: delay interval in seconds

7. ENVIRONMENT VARIABLE(S)
       The value set for the following is unimportant, just its presence.

       LIBPROC_HIDE_KERNEL
              This will prevent display of any kernel threads and exclude such processes from the summary area Tasks/Threads counts.

8. STUPID TRICKS Sampler
       Many of these tricks work best when you give top a scheduling boost.  So plan on starting him with a nice value of -10, assuming you’ve got the authority.

   7a. Kernel Magic
       For these stupid tricks, top needs full-screen mode.

       •  The user interface, through prompts and help, intentionally implies that the delay interval is limited to tenths of a second.  However, you’re free to set any desired delay.   If  you  want  to  see  Linux  at  his
          scheduling best, try a delay of .09 seconds or less.

          For this experiment, under x‐windows open an xterm and maximize it.  Then do the following:
            . provide a scheduling boost and tiny delay via:
                nice ‐n ‐10 top ‐d.09
            . keep sorted column highlighting Off so as to
              minimize path length
            . turn On reverse row highlighting for emphasis
            . try various sort columns (TIME/MEM work well),
              and normal or reverse sorts to bring the most
              active processes into view

          What you’ll see is a very busy Linux doing what he’s always done for you, but there was no program available to illustrate this.

       •  Under  an  xterm  using  ‘white‐on‐black’  colors, on top’s Color Mapping screen set the task color to black and be sure that task highlighting is set to bold, not reverse.  Then set the delay interval to around .3
          seconds.

          After bringing the most active processes into view, what you’ll see are the ghostly images of just the currently running tasks.

       •  Delete the existing rcfile, or create a new symlink.  Start this new version then type ‘T’ (a secret key, see topic 4c. Task Area Commands,

Title: Top Command: System Files, Environment Variables, and Stupid Tricks
Summary
This section covers creating the system configuration file ('topdefaultrc') and the system restrictions file ('toprc'). It describes the steps for creating 'topdefaultrc' and explains the purpose and format of 'toprc', which restricts certain commands for ordinary users. It then mentions the 'LIBPROC_HIDE_KERNEL' environment variable, which hides kernel threads. Finally, it presents several 'stupid tricks' to use with the 'top' command, including using a tiny delay interval for better visualization of Linux scheduling and creating ghostly images of running tasks by manipulating color settings in an xterm environment.