すべてのコアをすぐに表示するには、top コマンドを開始します。

すべてのコアをすぐに表示するには、top コマンドを開始します。

top一度実行して押すと、1各プロセッサの負荷を見ることができ(マルチスレッドの問題は忘れてください)、クリックするとs更新時間を設定できることがわかります。

このオプションを起動コマンドにどのように配置できますか?

出力を記録しようとしています。

$ top -b -p $(pidof myprocess) > top.log

しかし、私は4つのプロセッサとより高いリフレッシュレートの製品を見たいです。

答え1

Linuxは、実行中の構成でも作成できる構成topファイル()をサポートしています。~/.toprc

  • スタートtop
  • 必要なオプションを有効にします(色、更新頻度、ソート順、表示される統計など)。
  • クリックW(例:Shift+W)

次回実行したら、設定をtop読み、デフォルト値を要求どおりに変更します。

答え2

図は、で構成できるtop manpage項目を示しています。モニターはそのうちの1つではありません。Startup DefaultscommandlineCpu

   Startup Defaults
   The following startup defaults assume no configuration file, thus no user customizations.  Even so, items shown with an asterisk (’*’) could be overridden  through  the  command-
   line.

       Global_defaults
          ’A’ - Alt display      Off (full-screen)
        * ’d’ - Delay time       3.0 seconds
          ’I’ - Irix mode        On  (no, ’solaris’ smp)
        * ’p’ - PID monitoring   Off
        * ’s’ - Secure mode      Off (unsecured)
          ’B’ - Bold disable     Off
       Summary_Area_defaults
          ’l’ - Load Avg/Uptime  On  (thus program name)
          ’t’ - Task/Cpu states  On  (1+1 lines, see ’1’)
          ’m’ - Mem/Swap usage   On  (2 lines worth)
          ’1’ - Single Cpu       On  (thus 1 line if smp)
       Task_Area_defaults
          ’b’ - Bold hilite      On  (not ’reverse’)
        * ’c’ - Command line     Off (name, not cmdline)
        * ’H’ - Threads          Off (show all threads)
        * ’i’ - Idle tasks       On  (show all tasks)
          ’R’ - Reverse sort     On  (pids high-to-low)
        * ’S’ - Cumulative time  Off (no, dead children)
          ’x’ - Column hilite    Off (no, sort field)
          ’y’ - Row hilite       On  (yes, running tasks)
          ’z’ - color/mono       Off (no, colors)

これはtop設定ファイルを使用して行うことができます。からtop manpage

   5b. PERSONAL Configuration File
   This file is written as ’$HOME/.your-name-4-top’ + ’rc’.  Use the ’W’ interactive command to create it or update it.

topすべてのプロセッサーの表示を開始する構成ファイルを生成するには、次のようにします。

1. Start `top`.
2. Toggle display of all CPUs (press 1).
3. Press `d` or `s` and set new delay (default=3.0 seconds).  (This can be set on the `commandline`.  See the `Startup Defaults` above.
4. Press Shift+W.  Notice message 'Wrote configuration to '/home/youruser/.toprc'.
5. Quit `top`.
6. Start `top`.  Until you rewrite the `top` configuration file with a different option (Step #3), it will start with all CPUs showing.

関連情報