Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
fork() でプロセスを作成し、get_pid() でプロセスの pid を出力する C プログラムがあります。このプログラムの実行中に、「top」コマンドを使用して同じプロセスを表示しますが、そこには表示されません。なんで?「top」コマンドでプロセスを確認するにはどうすればよいですか?
トップはフィールドに従って並べ替えます。デフォルトではこれは CPU 時間です
あなたの C プログラムはおそらくリストに表示するには小さすぎて効率的です
top と同様のメトリクスを表示するには、特定の pid に対して ps を使用します。たとえば、
ps -lp 12188