ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. MEL 例.

概要

profiler [-addCategory string] [-allCategories] [-bufferSize int] [-categoryIndex int] [-categoryIndexToName int] [-categoryName string] [-categoryNameToIndex string] [-categoryRecording boolean] [-clearAllMelInstrumentation] [-colorIndex int] [-eventCPUId] [-eventCategory] [-eventColor] [-eventCount] [-eventDescription] [-eventDuration] [-eventIndex int] [-eventName] [-eventStartTime] [-eventThreadId] [-instrumentMel boolean] [-load string] [-output string] [-procedureDescription string] [-procedureName string] [-removeCategory string] [-reset] [-sampling boolean] [-signalEvent] [-signalMelEvent boolean]

profiler は、取り消し不可能、照会可能、および編集不可能です。

プロファイラは、シーン、スクリプト、およびプラグインのパフォーマンスを調整するための補助として、Maya のキー イベントからタイミング情報を記録するために使用されます。ユーザ記述のプラグインと Python スクリプトにより、API の MProfilingScope および MProfiler クラスを使用して、ユーザ独自のコードのためのプロファイリング情報を生成することもできます。

このコマンドには、プロファイリング データのコレクションをコントロールしたり、記録されたイベントに関する情報を照会したりするための機能があります。また、記録された情報は、[プロファイラ]ウィンドウでグラフィカルに表示することができます。

サンプリングがアクティブな場合はバッファ サイズを変更することはできず、エラーが返されます。サンプリングがアクティブな場合はリセット フラグをコールすることはできず、エラーが返されます。バッファ サイズに対するすべての変更は、次の記録の開始時に適用されます。同一のコマンドで保存とロードを行うことはできません。保存が優先されるため、ロードは無視されます。

戻り値

なし

照会モードでは、戻り値のタイプは照会されたフラグに基づきます。

キーワード

timing, performance, profiling, optimize

関連

dgtimer

フラグ

addCategory, allCategories, bufferSize, categoryIndex, categoryIndexToName, categoryName, categoryNameToIndex, categoryRecording, clearAllMelInstrumentation, colorIndex, eventCPUId, eventCategory, eventColor, eventCount, eventDescription, eventDuration, eventIndex, eventName, eventStartTime, eventThreadId, instrumentMel, load, output, procedureDescription, procedureName, removeCategory, reset, sampling, signalEvent, signalMelEvent
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
-sampling(-s) boolean createquery
切り替え: イベント記録の有効/無効を切り替えます。照会: イベントの記録がオンになっている場合に返されます。
-output(-o) string createquery
記録したイベントを指定のファイルに出力します。
-load(-l) string createquery
指定のファイルから記録されたイベントを読み込みます。
-reset(-r) createquery
プロファイラのデータをリセットします(サンプリングがオフになっていることが必要)。
-bufferSize(-b) int createquery
切り替え: 指定したイベントの数に適合するようにバッファ サイズを変更します(サンプリングがオフになっていることが必要)。照会: 現在のバッファ サイズを返します。新しいバッファ サイズは次のサンプリングが開始されたときに有効になります。バッファが一杯になると、記録が停止します。
-addCategory(-a) string create
プロファイラに新しいカテゴリを追加します。新しいカテゴリのインデックスを返します。
-removeCategory(-rc) string create
プロファイラの既存のカテゴリを削除します。除去されたカテゴリのインデックスを返します。
-allCategories(-ac) query
すべてのカテゴリの名前を照会します。
-categoryNameToIndex(-cni) string createquery
カテゴリのインデックスを指定した名前で返します。

照会モードでは、このフラグに値が必要になります。

-categoryIndexToName(-cin) int createquery
カテゴリの名前を指定したインデックスで返します。

照会モードでは、このフラグに値が必要になります。

-categoryIndex(-ci) int createquery
その他のフラグと一緒に使用し、カテゴリのインデックスを示します。

照会モードでは、このフラグに値が必要になります。

-categoryName(-cn) string query
その他のフラグと一緒に使用し、カテゴリの名前を示します。

照会モードでは、このフラグに値が必要になります。

-categoryRecording(-cr) boolean createquery
切り替え: カテゴリ記録の有効/無効を切り替えます。照会: カテゴリの記録がオンになっている場合に返されます。照会するカテゴリを指定するには、-categoryIndex または -categoryName フラグが必要です。
-eventCount(-ec) query
バッファ内のイベントの数を照会します。
-eventIndex(-ei) int query
通常はその他のフラグと一緒に使用され、イベントのインデックスを示します。

照会モードでは、このフラグに値が必要になります。

-eventStartTime(-et) query
指定したインデックスにあるイベントの時間を照会します。時間の単位は「秒」です。照会するイベントを指定するには、-eventIndex フラグが必要です。
-eventDuration(-edu) query
指定したインデックスにあるイベントの継続期間を照会します。時間の単位は「マイクロ秒」です。シグナル イベントの継続期間は 0 になります。照会するイベントを指定するには、-eventIndex フラグが必要です。
-eventName(-en) query
指定したインデックスにあるイベントの名前を照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
-eventDescription(-ed) query
指定したインデックスにあるイベントの説明を照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
-eventCategory(-eca) query
指定したインデックスに属するイベントのカテゴリ インデックスを照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
-eventColor(-eco) query
指定したインデックスにあるイベントのカラーを照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
-eventThreadId(-eti) query
指定したインデックスにあるイベントのスレッド ID を照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
-eventCPUId(-eci) query
指定したインデックスにあるイベントの CPU ID を照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
-signalEvent(-sig) query
指定したインデックスにあるイベントがシグナル イベントかどうかを照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。シグナル イベントは開始モーメントのみを記憶し、継続期間については記憶しません。このため、このイベントが発生するのが重要で、継続期間は重要ではない場合にのみ使用できます。
-instrumentMel(-in) boolean create
MEL コマンドまたはプロシージャの計測の有効/無効を切り替えます。計測が有効になっている場合、実行された MEL コマンドまたはプロシージャが[プロファイラ]ウィンドウにプロファイルされて表示されます。計測を有効にするには、-procedureName、-colorIndex、および -categoryIndex フラグが必要です。計測を無効にするには、-procedureName フラグが必要です。
-colorIndex(-coi) int create
"-instrumentMel true" と共に使用して、プロファイリング結果に表示するカラー インデックスを指定します。
-procedureName(-pn) string create
-instrumentMel と共に使用して、計測を有効化/無効化するプロシージャの名前を指定します。
-procedureDescription(-pd) string create
"-instrumentMel true" と共に使用して、計測される MEL コマンドまたはプロシージャの説明を提供します。この説明は、[プロファイラ ツール]ウィンドウに表示されます。
-signalMelEvent(-sim) boolean create
"-instrumentMel true" と共に使用して、計測された MEL コマンドまたはプロシージャがプロファイリング中にシグナル イベントとして使われることをプロファイラに伝えます。シグナル イベントは開始モーメントのみを記憶し、継続期間については記憶しません。このため、このイベントが発生するのが重要で、継続期間は重要ではない場合にのみ使用できます。
-clearAllMelInstrumentation(-cam) create
MEL コマンドまたはプロシージャの計測をすべてクリアします。

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます コマンド内でフラグを複数回使用できます。

MEL 例

//Start profiling
profiler -sampling true;
//Wait for events to be profiled
//Stop profiling
profiler -sampling false;
//Output the result to a file
profiler -output "test.txt";
//Load a recording from a file to the buffer
profiler -load "test.txt";
//Reset the tool
profiler -reset;
//Set the profiler's buffer size to fit 5 megaBytes
profiler -bufferSize 5;
//Query the profiler's buffer size
profiler -query -bufferSize;
//Add a new category
profiler -addCategory "Test Category";
//Remove an existing category
profiler -removeCategory "Test Category";
//Query the index of the category with the given name
profiler -query -categoryNameToIndex "Maya Qt" ;
//Query the name of the category at the given index
profiler -query -categoryIndexToName 5 ;
//Query if it is enabled for the recording of the category at the given index
profiler -query -categoryRecording -categoryIndex 5;
//Query if it is enabled for the recording of the category with the given name
profiler -query -categoryRecording -categoryName "Maya Qt";
//Enable/Disable the recording of the category at the given index
profiler -categoryIndex 5 -categoryRecording false;
profiler -categoryIndex 5 -categoryRecording true;
//Query the number of the events in the buffer
profiler -query -eventCount;
//Query the time at which the event at the given index start
profiler -query -eventStartTime -eventIndex 100;
//Query the duration of the event at the given index
profiler -query -eventDuration -eventIndex 100;
//Query the name of the event at the given index
profiler -query -eventName -eventIndex 100;
//Query the description of the event at the given index
profiler -query -eventDescription -eventIndex 100;
//Query the category the the event at the given index belongs to
profiler -query -eventCategory -eventIndex 100;
//Query the color of the event at the given index
profiler -query -eventColor -eventIndex 100;
//Query the thread ID of the event at the given index
profiler -query -eventThreadId -eventIndex 100;
//Query the CPU ID of the event at the given index
profiler -query -eventCPUId -eventIndex 100;
//Query if the event at the given index is a signal event
profiler -query -signalEvent -eventIndex 100;
//Instrument a MEL command or procedure
//Given a MEL procedure which calculate factorial, it will be instrumented
//and profiled
proc int Factorial(int $limit)
{
    int $result = 1;
    for( $i=1; $i<=$limit; ++$i)
    {
        $result = $result * $i;
    }
    return $result;
}
// Add a new category for MEL Scripts
int $melCategoryIndex = `profiler -addCategory "MEL Scripts"`;
//Instrument a MEL command
profiler -instrumentMel true -procedureName "deviceManager" -categoryIndex $melCategoryIndex -colorIndex 2 -procedureDescription "deviceManagerDesc";
//Instrument a MEL procedure as a signal event
profiler -instrumentMel true -procedureName "Factorial" -categoryIndex $melCategoryIndex -colorIndex 8 -procedureDescription "FactorialDesc" -signalMelEvent true;
//Profiler the MEL procedure and command.
profiler -s true;
Factorial(5);
deviceManager -query -numDevices;
profiler -s false;
// Remove the instrumentation of the MEL command and procedure
profiler -instrumentMel false -procedureName "deviceManager";
profiler -instrumentMel false -procedureName "Factorial";