Go to main content

マニュアルページ セクション 1: ユーザーコマンド

印刷ビューの終了

更新: 2022年7月27日
 
 

gcore(1)

名前

gcore - 実行中のプロセスのコアイメージを取得する

形式

gcore [-pgFR] [-o filename] [-c content] process-id...

説明

gcore ユーティリティーは、指定した各プロセスのコアイメージを作成します。デフォルトでは、プロセス ID が process-id のプロセスのコアイメージファイルは、core.process-id という名前になります。

オプション

サポートしているオプションは、次のとおりです。

–c content

指定したコンテンツを使用してコアイメージファイルを生成します。コンテンツの記述では、coreadm(8) にあるものと同じトークンを使用します。–c オプションは、–p または –g フラグによって生成されるコアには適用されません。

–F

強制。別のプロセスが制御していても、ターゲットプロセスを捕捉します。

–g

Produces core image files in the global core file repository with the global content as configured by coreadm(8).ユーザーが大域コアファイルリポジトリへのアクセス権を持っていない場合、コマンドは失敗します。

–o filename

Substitutes filename in place of core as the first part of the name of the core image files. filename can contain the same tokens to be expanded as the paths in coreadm(8).

–p

Produces a core image file in the process-specific location with the process-specific content for each process as configured by coreadm(8).ユーザーがプロセスごとのコアファイルリポジトリへのアクセス権を持っていない場合、このコマンドは失敗します。

–P

デフォルトで、gcorememcntl(2) を使用して行われたプルーニング要求を考慮し、現在プロセスのアドレス空間でアクティブになっています。そのようなプロセスで gcore の使用中にこのフラグを指定すると、プロセスのコアのダンプ中にアクティブなプルーニング要求が無視されることがあります。

–R

Bring in the content of the process to memory before dumping its core.This is a best effort and pages read are not locked.For large processes, this option is expected to shorten the time they remain stopped, at the cost of increasing the total time of execution of the command.

オペランド

次のオペランドを指定できます。

process-id

process ID

使用法

–F フラグを使用するときは注意してください。2 つの制御プロセスを 1 つの犠牲プロセスに課すと混乱することがあります。プライマリ制御プロセス (通常はデバッガ) が犠牲プロセスを停止しており、プライマリ制御プロセスが当該の proc ツールの適用時に何も実行していない場合のみ、安全性が確保されます。

終了ステータス

次の終了ステータスが返されます。

0

成功の場合。

0 以外

失敗した場合 (存在しないプロセス ID など)。

ファイル

core.process-id

コアイメージ

属性

属性についての詳細は、マニュアルページの attributes(7) を参照してください。

属性タイプ
属性値
使用条件
system/core-os
インタフェースの安定性
下記を参照。

コマンドの構文は「確実」です。出力形式は「不確実」です。

関連項目

kill(1), setrlimit(2), core(5), proc(5), attributes(7), memcntl(2), coreadm(8)

gcore は、RLIMIT_CORE 値を使用した setrlimit(2) システムコールによる影響を受けません。