splat コマンド

目的

Simple Performance Lock Analysis Tool (splat)。 カーネル および pthread ロック使用率レポートを提供します。

構文

スプラット I ファイル [ N ファイル ] [ - ファイル ] [ -d 年 [ BFTA ] ] [ - アドレス ] [ 「-c」 クラス] [ -s [ acelmsS ] ] [ -C CPU ] [ -S (S) カウント ] [ T 開始] [ -T (T) 停止] [ P- ]

splat -h [トピック]

スプラット -j

説明

splat(Simple Performance Lock Analysis Tool) はAIX®トレースファイルを後処理して、 カーネルの単純ロックと複雑ロックの使用レポートを作成するソフトウェアツールです。 pthread mutex 読み取り/書き込みロック、および条件変数使用率レポートも生成します。

フラグ

項目 説明
-i 入力ファイル AIX トレース・ファイル (REQUIRED)。
-n 名前ファイル gensyms コマンドの出力が入っているファイル。
-o 出力ファイル レポートを書き込むファイル (デフォルト: stdout)。
-d 詳細 Detail には、次の項目を使用できます。[b]asic: 要約とロックの詳細 (デフォルト) [f]unction: 基本 + 関数の詳細 [t]hread: 基本 + スレッドの詳細 [a]ll: 基本 + 関数 + スレッドの詳細
-c クラス ユーザーが 10 進数のロック・クラス・インデックスを提供する と、splat は、そのクラスのロックに関するアクテ ィビティーだけを報告します。
-l アドレス ユーザーが 16 進数ロック・アドレスを提供する と、splat はそのアドレスのロックに関するアクテ ィビティーだけを報告します。 splat は、そのロック・アドレス が入っているロック・フックを検索するためにトレース・ファイルをフィルターに掛け、 そのロックについてのみレポートを生成します。
-s 基準 次の基準を使用して、ロック、関数、およびスレッドに関するレポートをソートします。
a
収集
c
プロセッサー保持時間パーセント
e
経過保持時間パーセント
l
ロック・アドレス、関数アドレス、またはスレッド ID
m
ミス率
s
スピン・カウント
S
プロセッサー・スピン保持時間パーセント (デフォルト)
w
実待ち時間パーセント
W
平均 waitq 深さ
-C CPU このトレースに存在するプロセッサーの台数を指定します。
-S カウント 各レポートのエントリー最大数 (デフォルト: 10)。
-t 開始時刻 トレース開始からの時間オフセット (秒数)。
-T 停止時間 トレース開始からトレース・データ解析停止までの時間オフセット (秒数)。 (デフォルト: トレース終了時)
-h [トピック] 使用方法または特定のトピックに関するヘルプ。 次のトピックが有効です。
  • すべて
  • overview
  • 入力
  • 名前
  • reports
  • ソート
-j splat が使用するトレース・フックのリストを出力します。
-p プロセッサー時間の計算のために PURR レジスターの使用を指定します。

ヘルプ

以下は、使用可能なヘルプ・トピックとそれぞれの内容の要約です。

項目 説明
OVERVIEW このテキスト
INPUT splatから有用な出力を得るために必要な AIX トレース・フック。
NAMES splat の原因となり、 人間が解読可能なシンボルにアドレスをマップするネーム・ユーティリティー。
REPORTS splat が生成するレポートの説明、および報告する値の計算に使用する数式。
SORTING 使用可能なすべてのソート・オプション、およびそのオプション を splat の出力に適用する方法。

Splat のトレース

Splat は、 AIX トレース・コマンドで収集された AIX トレース・ファイルを 1 次入力として受け取ります。 splat を使用して トレースを分析する前に、トレースの収集に次の内容も含めて、十分なフックが 使用されていることを確認する必要があります。
106 DISPATCH
10C DISPATCH IDLE PROCESS
10E RELOCK
112 LOCK
113 UNLOCK
134 HKWD_SYSC_EXECVE
139 HKWD_SYSC_FORK
419 CPU PREEMPT
465 HKWD_SYSC_CRTHREAD
46D WAIT LOCK
46E WAKEUP LOCK
606 HKWD_PTHREAD_COND
607 HKWD_PTHREAD_MUTEX
608 HKWD_PTHREAD_RWLOCK
609 HKWD_PTHREAD_GENERAL
このようなロックおよびアンロックのトレース・イベントを取り込むと、 マルチプロセッサー環境でロックが使用される頻度のために、重大なパフォーマンスの低 下が起こります。 そこで、通常は、ロック・トレース・イベントの報告を使用不可に しておきます。 ロック・トレース・イベントの報告を使用可能にするには、splat に 必要なロック・トレース・イベントを含むトレースの収集を開始する前に、 次のステップを実行する必要があります (KornShell 構文)。
  1. bosboot -ad /dev/hdisk0 -L

  2. shutdown -Fr

  3. (reboot the machine)

  4. locktrace -S

  5. mkdir temp.lib; cd temp.lib

  6. ln -s /usr/ccs/lib/perf/libpthreads.a

  7. export LIBPATH=$PWD:$LIBPATH
ステップ 1 から 3 はオプショナルです。 これらのステップにより、 アドレスの代わりにカーネル・ロック・クラス名を表示することができます。 bosboot およびそのフラグの詳細については、bosboot(1) を参照してください。 ステップ 5 から 7 は、 ユーザーの pthread ロック・インスツルメンテーションをアクティブにするのに必要なステップです。 temp.lib サブディレクトリーは、任意の場所に設定できます。 ステップ 1 から 7 は、レポートの完了に必要なステップです。

Splat の名前

splat は、gensyms コマンドの出力をオプションの入力として使用し、ロック・アドレスおよび関数アドレスを人間が理解できるシンボルにマップすることができます。

Lock classes および offsets を使用して、 ロックをおおよそ識別することはできますが、実際のシンボルとして特定することは できません。

Splat のレポート

splat が生成するレポートには、レポートの要約、 ロックのサマリー・レポート・セクション、およびロック詳細レポート・リストが含まれます。 それぞれに関連関数の詳細またはスレッド詳細レポート (またはその両方) が付きます。
Report Summary
^^^^^^^^^^^^^^
 The report summary consists of the following elements:

 - The trace command used to collect the trace.
 - The host that the trace was taken on.
 - The date that the trace was taken on.
 - The duration of the trace in seconds.
 - The estimated number of CPUs
 - The combined elapsed duration of the trace in seconds;
   ( the duration of the trace multiplied by the number of
     CPUs identified during the trace ).
 - Start time, which is the offset in seconds from the beginning of the
   trace that trace statistics begin to be gathered.
 - Stop time, which is the offset in seconds from the beginning of the
   trace that trace statistics stop being gathered.
 - Total number of acquisitions during the trace.
 - Acquisitions per second, which is computed by dividing
   the total number of lock acquisitions by the real-time
   duration of the trace.
 - % of Total Spin Time, this is the summation of all lock spin hold
   times, divided by the combined trace duration in seconds, divided by 100.
   The current goal is to have this value be less than 10% of the total
   trace duration.


 Lock Summary
 ^^^^^^^^^^^^

 The lock summary report has the following fields:

Lock		         The name, lockclass or address of the lock.


Type              The type of the lock, identified by one of the following letters: 
                      Q    A RunQ lock 
                      S    A simple kernel lock 
                      D    A disabled simple kernel lock
                      C    A complex kernel lock 
                      M    A PThread mutex 
                      V    A PThread condition-variable 
                      L    A PThread read/write lock
Acquisitions     The number of successful lock attempts for this lock, minus
                  the number of times a thread was preempted while holding
                  this lock.

Spins            The number of unsuccessful lock attempts for this lock,
                  minus the number of times a thread was undispatched while
                  spinning.

Wait             The number of unsuccessful lock attempts that
 or               resulted in the attempting thread going to
Transform         sleep to wait for the lock to become available,
                  or allocating a krlock.

%Miss            Spins divided by Acquisitions plus Spins, multiplied by 100.

%Total           Acquisitions divided by the total number of all
                  lock acquisitions, multiplied by 100.

Locks/CSec       Acquisitions divided by the combined elapsed
 	               duration in seconds.

Percent HoldTime 
Real CPU          The percent of combined elapsed trace time that
                  threads held the lock in question while dispatched.
                  DISPATCHED_HOLDTIME_IN_SECONDS divided by combined
                  trace duration, multiplied by 100.

Real Elaps(ed)    The percent of combined elapsed trace time that
                  threads held the lock while dispatched or sleeping.
                  UNDISPATCHED_AND_DISPATCHED_HOLDTIME_IN_SECONDS divided
                  by combined trace duration, multiplied by 100.

Comb Spin         The percent of combined elapsed trace time that
                  threads spun while waiting to acquire this lock.
                  SPIN_HOLDTIME_IN_SECONDS divided by combined trace
                  duration, multiplied by 100.

ロック・サマリー・レポートは、デフォルトでは 10 のロック項目が表示されます。 この内容は、percent spin hold time (10 番目のフィールド) 別に降順で保存されています。 サマリー・レポートの長さは、-S スイッチを使用すると 調整できます。 サマリー・レポート (およびその他のレポート) の保管順序を設定 するには -s スイッチを使用します。 このスイッチのオプションについては、splat -h ソート の SORTING ヘルプ・セクションに説明があります。
Lock Detail
^^^^^^^^^^^

 The lock detail report consists of the following fields:

 LOCK             The address (in hexadecimal) of the lock.

 NAME             The symbol mapping for that address (if available)

 CLASS            The lockclass name (if available) and hexadecimal offset,
                  used to allocate this lock ( lock_alloc() kernel service ).

Parent Thread    Thread id of the parent thread. This field only exists for Mutex, 
                  Read/Write lock and Conditional Variable report. 

 creation time    Elapsed time in seconds after the first event recorded in trace, 
                  if available. This field only exists for Mutex, Read/Write lock
                  and Conditional Variable report.
 deletion time    Elapsed time in seconds after the first event recorded in trace, 
                  if available. Tthis field only exists for Mutex, Read/Write lock
                  and Conditional Variable report. 

 Pid              Pid number associated to the lock (this field only exists for Mutex, 
                  Read/Write lock and Conditional Variable report). 

 Process Name    Process name associated to the lock (this field only exists for Mutex, 
                 Read/Write lock and Conditional Variable report). 

 Call-Chain      Stack of called methods (if possible to have them, this field only 
                 exists for Mutex, Read/Write lock and Conditional Variable report). 


 Acquisitions     The number of successful lock attempts for this lock.
                  This field is named Passes for the conditional variable lock report.

 Miss Rate        The number of unsuccessful lock attempts divided by
                  Acquisitions plus unsuccessful lock attempts, multiplied
                  by 100.

 Spin Count       The number of unsuccessful lock attempts.

 Wait Count       The number of unsuccessful lock attempts that resulted in
                  the attempting thread going to sleep to wait for the lock
                  to become available.

 Transform Count  The number of krlock allocated and deallocated by the simple lock. 

 Busy Count	      The number of simple_lock_try() calls that returned busy.

 Seconds Held
 CPU              The total time in seconds that this lock was held by
                  dispatched threads.

 Elapsed	         The total time in seconds that this lock was held by
                  both dispatched and undispatched threads.

NOTE: neither of these two values should exceed the
      total real elapsed duration of the trace.

 Percent Held
 Real CPU         The percent of combined elapsed trace time that
                  threads held the lock in question while dispatched.
                  DISPATCHED_HOLDTIME_IN_SECONDS divided by trace
                  duration, multiplied by 100.

 Real Elaps(ed)   The percent of combined elapsed trace time that
                  threads held the lock while dispatched or sleeping.
                  UNDISPATCHED_AND_DISPATCHED_HOLDTIME_IN_SECONDS divided
                  by trace duration, multiplied by 100.

 Comb Spin        The percent of combined elapsed trace time that
                  threads spun while waiting to acquire this lock.
                  SPIN_HOLDTIME_IN_SECONDS divided by trace duration,
                  multiplied by 100. 

 Wait             The percentage of combined elapsed trace time that 
                  threads unsuccessfully tried to acquire this lock.

 SpinQ            Splat keeps track of the minimum, maximum and average
                  depth of the spin queue (the threads spinning, waiting
                  for a lock to become available).

 WaitQ            As with the spin queue, splat also tracks the minimum,
                  maximum and average depth of the queue of threads waited
                  waiting for a lock to become available).

PROD              The associated krlocks prod calls count.

CONFER SELF       The confer to self calls count for the simple lock and the 
                  associated krlocks.

CONFER TARGET     The confer to target calls count for the simple lock and the 
                  associated krlocks. w/ preemption reports the successfull calls 
                  count, resulting in a preemption.

CONFER ALL        The confer to all calls count for the simple lock and the 
                  associated krlocks. w/ preemption reports the successfull calls 
                  count, resulting in a preemption.

HANDOFF           The associated krlocks handoff calls count.

Lock Activity w/Interrupts Enabled (mSecs)

ロック明細報告のこのセクションは、splat が各ロックについて収集したロー・データのダンプであり、時間はミリ秒で表されます。 LOCK、SPIN、WAIT、UNDISP(atched)、および PREEMPT の 5 つの状態は、splat の使用可能な simple_lock 有限状態マシンの基本的な 5 つの状態です。 それぞれの状態に対するカウント は、スレッドのアクションにより状態が変化した回数を示します。 ミリ秒による 時間は、ロック要求がその状態になっていた時間について、最低時間、最大時間、 平均時間、および合計時間を表示します。
   LOCK:    this state represents a thread successfully acquiring a lock.

   SPIN:    this state represents a thread unsuccessfully trying to acquire
            a lock.

   WAIT:    this state represents a spinning thread (in SPIN) going to sleep
            (voluntarily) after exceeding the thread's spin threshold.

   UNDISP:  this state represents a spinning thread (in SPIN) becoming
            undispatched (involuntarily) before exceeding the thread's
            spin threshold.

   PREEMPT: this state represents when a thread holding a lock is
            undispatched.


Lock Activity w/Interrupts Disabled (mSecs)
ロック明細報告のこのセクションは、splat が各ロックについて収集したロー・データのダンプであり、時間はミリ秒で表されます。 LOCK、SPIN、LOCK with KRLOCK、KRLOCK LOCK、KRLOCK SPIN、および TRANSFORM の 6 つの状態は、splat の使用不可な simple_lock 有限状態マシンの基本的な 6 つの状態です。 それぞれの状態に対するカウント は、スレッドのアクションにより状態が変化した回数を示します。 ミリ秒による 時間は、ロック要求がその状態になっていた時間について、最低時間、最大時間、 平均時間、および合計時間を表示します。
LOCK:        This state represents a thread successfully acquiring a lock.

SPIN:        This state represents a thread unsuccessfully trying to acquire
             a lock.

LOCK with    The thread has successfully acquired the lock, while holding 
 KRLOCK:     the associated krlock, and is currently executing.

KRLOCK LOCK: The thread has successfully acquired the associated krlock, 
             and is currently executing.

KRLOCK SPIN: The thread is executing and unsuccessfully attempting to acquire
             the associated krlock. 

TRANSFORM:   The thread has successfully allocated a krlock it associates to, 
             and is executing.


Function Detail
^^^^^^^^^^^^^^^

 The function detail report consists of the following fields:

 Function Name   The name or return address of the function which
                 used the lock.

 Acquisitions	   The number of successful lock attempts for this lock.
                 For complex lock and read/write lock there is a 
                 distinction between acquisition for writing 
                 (Acquisition Write) and for reading 
                 (Acquisition Read).


 Miss Rate      The number of unsuccessful lock attempts divided by
                Acquisitions, multiplied by 100.

 Spin Count     The number of unsuccessful lock attempts.
                For complex lock and read/write lock there is a 
                distinction between spin count for writing 
                (Spin Count Write) and for reading 
                (Spin Count Read).

 Wait Count     The number of unsuccessful lock attempts that resulted in
                the attempting thread going to sleep to wait for the lock
                to become available.
                For complex lock and read/write lock there is a 
                distinction between wait count for writing 
                (Wait Count Write) and for reading 
                (Wait Count Read).

Transform Count The number of times that a simple lock has allocated a krlock,
                while the thread was trying to acquire the simple lock.

 Busy Count	     The number of simple_lock_try() calls that returned busy.

 Percent Held of Total Time 
 CPU              The percent of combined elapsed trace time that
                  threads held the lock in question while dispatched.
                  DISPATCHED_HOLDTIME_IN_SECONDS divided by trace
                  duration, multiplied by 100.

 Elaps(ed)	      The percent of combined elapsed trace time that
                  threads held the lock while dispatched or sleeping.
                  UNDISPATCHED_AND_DISPATCHED_HOLDTIME_IN_SECONDS divided
                  by trace duration, multiplied by 100.

 Spin             The percent of combined elapsed trace time that
                  threads spun while waiting to acquire this lock.
                  SPIN_HOLDTIME_IN_SECONDS divided by combined trace
                  duration, multiplied by 100.

 Wait             The percentage of combined elapsed trace time that 
                  threads unsuccessfully tried to acquire this lock. 

 Return Address   The calling function's return address in hexadecimal.

 Start Address	   The start address of the calling function in hexadecimal.

 Offset           The offset from the function start address in hexadecimal.


Thread Detail
^^^^^^^^^^^^^

The thread detail report consists of the following fields:

 ThreadID        Thread identifier.

 Acquisitions    The number of successful lock attempts for this lock.

 Miss Rate       The number of unsuccessful lock attempts divided by
                 Acquisitions, multiplied by 100.

 Spin Count      The number of unsuccessful lock attempts.

 Wait Count      The number of unsuccessful lock attempts that resulted in
                 the attempting thread going to sleep to wait for the lock
                 to become available.

Transform Count The number of times that a simple lock has allocated a krlock,
                while the thread was trying to acquire the simple lock.

Busy Count      The number of simple_lock_try() calls that returned busy.

 Percent Held of Total Time 
 CPU              The percent of combined elapsed trace time that
                  threads held the lock in question while dispatched.
                  DISPATCHED_HOLDTIME_IN_SECONDS divided by trace
                  duration, multiplied by 100.

 Elaps(ed)        The percent of combined elapsed trace time that
                  threads held the lock while dispatched or sleeping.
                  UNDISPATCHED_AND_DISPATCHED_HOLDTIME_IN_SECONDS divided
                  by trace duration, multiplied by 100.

 Spin             The percent of combined elapsed trace time that
                  threads spun while waiting to acquire this lock.
                  SPIN_HOLDTIME_IN_SECONDS divided by combined trace
                  duration, multiplied by 100. 

 Wait             The percent of combined elapsed trace time that 
                  threads unsuccessfully tried to acquire this lock. 

 ProcessID        Process identifier (only for SIMPLE and COMPLEX Lock report). 

 Process Name     Name of the process (only for SIMPLE and COMPLEX Lock report).

Splat のソート

splat では、-s オプションを使用して、 サマリーとロック明細報告書のソートに使用する基準をユーザーが指定できます。 デフォルトのソート基準では、トレース合計時間に対してスレッドがロックのスピンに使 用した時間の割合を示す percent spin hold time (スピン保持時間の比率) 別にソートを行います。 -s を使用すると、ソート基準を次のように変更できます。
項目 説明
a Acquisitions: スレッドがロックを正常に獲得した回数。
C Percent processor hold time: トレース合計時間に対するプロセッサー保持時間の比率。
e Percent Elapsed hold time: トレース合計時間に対する経過保持時間の比率。
l location: ロックまたは関数のアドレス、またはスレッドの ID。
m Miss rate: 獲得回数によるロック失敗率。
s Spin count: ロックの待機でスレッドがスピンしたロック失敗回数。
S プロセッサー・スピン保持時間パーセント (デフォルト)。
w Percent elapsed wait time: ゼロ以外のスレッドがロック上で待機した合計時間のパーセント割合。
W Average waitq depth: ロック上で待機したスレッドの平均数。 待機中の各スレッドがこの状態を維持した平均時間と同じ。

splat は、指定された基準を使用して、 ロック・レポートを降順にソートします。

制約事項

VMM、XMAP、および特定の Java 指定ロックなど、その他のタイプのロックは 分析されません。

ファイル

項目 説明
/etc/bin/splat Simple Performance Lock Analysis Tool ( splat)。 カーネルおよび pthread ロック使用率レポートを提供します。