2016-08-03 4 views

答えて

0

/usr/bin/timex

the /usr/bin/timex man pageから:

与えられたコマンドが実行されます。経過時間、ユーザー時間、およびシステム 実行に費やされた時間が秒単位で報告されます。オプションで、コマンド のアカウンティングデータおよびそのすべての子をリストするか、または を要約し、実行間隔 の合計システムアクティビティを報告できます。

...

-pコマンドとそのすべての子プロセスの課金レコードを一覧表示します。 このオプションは、プロセス会計ソフトウェアがインストールされている場合にのみ機能します。サブオプションf、h、k、m、r、およびtは、データ項目 を変更します。オプションは次の通りです:

...

プロセス・アカウンティングが有効に得るためにacctadmのmanページでスタート。

Solarisでは、getrusage()およびwait3()はメモリ使用統計情報を返しません。 ソースコードをhttp://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/syscall/rusagesys.cに、wait3()ソースコードをhttp://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/sys/common/wait.c#158にしてください(これは実際にはOracleがサポートを停止したOpenSolarisソースであり、現在のSolaris実装ではない可能性があります)。 RSSデータはまた、Solaris getrusage() man pageから、まだ実際にはゼロ)

rusage構造の

ru_maxrssru_ixrssru_idrss、およびru_isrssメンバーは、この実装では0に設定されています。

dtraceのように、データを取得する方法は他にもあります。

編集:

dtraceが、残念ながら、多くの助けであることを見ていません。 Solaris上で

dtrace: failed to compile script memuse.d: line 8: translator does not define conversion for member: pr_pctmem 

dtraceプロセスのメモリ使用量へのアクセスを提供するために、表示されません。dtrace -s memuse.d -c bash

#!/usr/sbin/dtrace -s 

#pragma D option quiet 

profile:::profile-1001hz 
/pid == $target/
{ 
    @pct[ pid ] = max(curpsinfo->pr_pctmem); 
} 

dtrace:::END 
{ 
    printa("pct: %@u %a\n", @pct); 
} 

でこれdtraceスクリプトを実行しようとすると、次のエラーメッセージが表示されました。実際、Solaris 11。procfsデータのための2 /usr/lib/dtrace/procfs.d翻訳者はその中にこのコメントがありますIllumos.orgのソースコードをブラウズする

/* 
* Translate from the kernel's proc_t structure to a proc(4) psinfo_t struct. 
* We do not provide support for pr_size, pr_rssize, pr_pctcpu, and pr_pctmem. 
* We also do not fill in pr_lwp (the lwpsinfo_t for the representative LWP) 
* because we do not have the ability to select and stop any representative. 
* Also, for the moment, pr_wstat, pr_time, and pr_ctime are not supported, 
* but these could be supported by DTrace in the future using subroutines. 
* Note that any member added to this translator should also be added to the 
* kthread_t-to-psinfo_t translator, below. 
*/ 

を、ps_rssizeを探し、procfsデータが必要なときにのみ計算され、プロセスの実行時に継続的に更新されていないことを示します。 (http://src.illumos.org/source/search?q=pr_rssize&defs=&refs=&path=&hist=&project=illumos-gate参照)

関連する問題