JP5024252B2 - Trace information acquisition device, trace information acquisition program, and trace information acquisition method - Google Patents
Trace information acquisition device, trace information acquisition program, and trace information acquisition method Download PDFInfo
- Publication number
- JP5024252B2 JP5024252B2 JP2008243609A JP2008243609A JP5024252B2 JP 5024252 B2 JP5024252 B2 JP 5024252B2 JP 2008243609 A JP2008243609 A JP 2008243609A JP 2008243609 A JP2008243609 A JP 2008243609A JP 5024252 B2 JP5024252 B2 JP 5024252B2
- Authority
- JP
- Japan
- Prior art keywords
- trace
- loop
- data
- buffer
- analysis
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明はトレース情報取得装置、トレース情報取得プログラム、および、トレース情報取得方法に関する。 The present invention relates to a trace information acquisition device, a trace information acquisition program, and a trace information acquisition method.
ループ実行中にトレース情報を取得すると、同じパターンのトレース情報が繰り返し出力されることがある。この場合、大きなトレース用記憶域が必要となるうえ、解析が困難になる。または、情報が上書きされて失われる。これを解決するため、以下の技術が提案されている。 When trace information is acquired during loop execution, trace information with the same pattern may be output repeatedly. In this case, a large trace storage area is required, and analysis becomes difficult. Or the information is overwritten and lost. In order to solve this, the following techniques have been proposed.
特許文献1には、マイクロ命令語の予め定めた特定パターンを検出した場合に、履歴登録を抑制する履歴登録制御回路が記載されている。特許文献2には、第1回目のループ終了によりトレースを終了し、最後のループ終了と同時にトレースを再開するトレースマスク制御回路が開示されている。
ループ実行中のトレースパターンは変化する。従って、特許文献1における特定パターンを予め決定しておくことは出来ない場合が多い。特許文献2では、第2回目以降のループで新たに出現したパターンのトレース情報は失われるという課題があった。
The trace pattern during loop execution changes. Therefore, the specific pattern in
本発明は、上述した課題を解決するための、トレース情報取得装置、トレース情報取得プログラム、および、トレース情報取得方法を提供することを目的とする。 An object of this invention is to provide the trace information acquisition apparatus, the trace information acquisition program, and the trace information acquisition method for solving the subject mentioned above.
本発明の一実施形態のトレース採取装置は、被トレース処理の実行により生成されるトレースデータを順次格納するトレースバッファと、第1のパターン表と、第1の解析バッファを格納するメモリと、前記被トレース処理内の第1のループの各回の実行により生成される各々の前記トレースデータ(第1の区間データ)を入力して、当該第1の区間データが前記第1のパターン表にすでに格納されたいずれかの第1の区間データとの一致(パターン一致)を検出しないと、入力した前記第1の区間データを前記第1のパターン表および前記第1の解析バッファに追記し、前記パターン一致を検出すると、前記第1の区間データの少なくとも一部を前記第1の解析バッファに格納せず、前記第1ループの終了を検出すると、前記第1の解析バッファの内容を前記トレースバッファに出力する解析部を備える。
本発明の一実施形態のトレース採取プログラムは、被トレース処理の実行により生成されるトレースデータを順次格納するトレースバッファと、第1のパターン表と、第1の解析バッファを格納するメモリを備えたコンピュータに、前記被トレース処理内の第1のループの各回の実行により生成される各々の前記トレースデータ(第1の区間データ)を入力して、当該第1の区間データが前記第1のパターン表にすでに格納されたいずれかの第1の区間データとの一致(パターン一致)を検出しないと、入力した前記第1の区間データを前記第1のパターン表および前記第1の解析バッファに追記し、前記パターン一致を検出すると、前記第1の区間データの少なくとも一部を前記第1の解析バッファに格納せず、前記第1ループの終了を検出すると、前記第1の解析バッファの内容を前記トレースバッファに出力する解析部を実行させる。
A trace collection device according to an embodiment of the present invention includes a trace buffer that sequentially stores trace data generated by execution of a traced process, a first pattern table, a memory that stores a first analysis buffer, Each trace data (first section data) generated by each execution of the first loop in the traced process is input, and the first section data is already stored in the first pattern table. If no coincidence (pattern coincidence) with any of the first section data that has been performed is detected, the input first section data is added to the first pattern table and the first analysis buffer, and the pattern When a match is detected, at least a part of the first interval data is not stored in the first analysis buffer, and when the end of the first loop is detected, the first analysis buffer is detected. The contents of the file comprises analyzing section for output to the trace buffer.
A trace collection program according to an embodiment of the present invention includes a trace buffer that sequentially stores trace data generated by execution of a process to be traced, a first pattern table, and a memory that stores a first analysis buffer. Each trace data (first section data) generated by each execution of the first loop in the traced process is input to the computer, and the first section data is the first pattern. If a match (pattern match) with any of the first section data already stored in the table is not detected, the input first section data is added to the first pattern table and the first analysis buffer. When the pattern match is detected, at least part of the first section data is not stored in the first analysis buffer, and the end of the first loop is detected. Then, to execute an analysis unit for outputting the contents of said first analysis buffer to the trace buffer.
本発明の一実施形態のトレース採取方法は、被トレース処理の実行により生成されるトレースデータを順次格納するトレースバッファと、第1のパターン表と、第1の解析バッファを格納するメモリを備えたコンピュータが、前記被トレース処理内の第1のループの各回の実行により生成される各々の前記トレースデータ(第1の区間データ)を入力して、当該第1の区間データが前記第1のパターン表にすでに格納されたいずれかの第1の区間データとの一致(パターン一致)を検出しないと、入力した前記第1の区間データを前記第1のパターン表および前記第1の解析バッファに追記し、前記パターン一致を検出すると、前記第1の区間データの少なくとも一部を前記第1の解析バッファに格納せず、
前記第1ループの終了を検出すると、前記第1の解析バッファの内容を前記トレースバッファに出力する解析工程を有する。
A trace collection method according to an embodiment of the present invention includes a trace buffer that sequentially stores trace data generated by execution of a traced process, a first pattern table, and a memory that stores a first analysis buffer. The computer inputs each of the trace data (first section data) generated by each execution of the first loop in the traced process, and the first section data is the first pattern. If a match (pattern match) with any of the first section data already stored in the table is not detected, the input first section data is added to the first pattern table and the first analysis buffer. When the pattern match is detected, at least a part of the first section data is not stored in the first analysis buffer,
When the end of the first loop is detected, there is an analysis step of outputting the contents of the first analysis buffer to the trace buffer.
パターンが変化するループ実行中に、同じシーケンスのトレース情報が大量に出力されるのを防止しつつ、異なるシーケンスのトレース情報は取得できる。 It is possible to acquire trace information of different sequences while preventing a large amount of trace information of the same sequence from being output in large quantities during loop execution in which the pattern changes.
図1は、本発明の第1の実施形態にかかるトレース採取装置10の構成図である。トレース採取装置10は、トレースファイル12、生成部14、解析部15、出力部16、メモリ20を備える。メモリ20は、ループ管理表21、レベル記憶域22、トレース領域23を格納する。メモリ20は、被トレース処理プログラム24、トレース採取プログラム25を格納していても良い。
FIG. 1 is a configuration diagram of a
生成部14は、トレースの対象となる処理(被トレース処理)を実行してトレースデータ30を生成して、解析部15に出力する。生成部14は機器の制御装置などであってハードウェアで実現される。また、生成部14は、コンピュータ11であるトレース採取装置10のプロセッサ13が、業務処理などを行う被トレース処理プログラム24を実行することで実現されても良い。
The
解析部15は、トレースデータ30を入力してトレース領域23に順次格納する。但し、解析部15は、被トレース処理のループ実行中に発生したパターンをループ管理表21に記録し、同一パターンのトレース情報は以降のループ実行中にトレース領域23に格納しない。
The
出力部16は、定期的またはトレース領域23の使用率が高いとき等に、トレース領域23に格納されたトレースデータ30をトレースファイル12に出力する。出力部16は無くても良い。
The
解析部15および出力部16はハードウェアで実現される。解析部15または出力部16は、コンピュータ11であるトレース採取装置10のプロセッサ13が、トレース採取プログラム25を実行することで実現されても良い。
The
レベル記憶域22は、被トレース処理の実行中ループのネストのレベル数(包含関係の階層数)を格納する。被トレース処理がループ実行中でないときこの値は、例えば0である。一番外側のループ(第1のループ)実行中、レベル記憶域22は、例えば、1を格納する。第1のループにネストして包含される内側のループ(第2のループ)実行中、レベル記憶域22は、例えば、2を格納する。 以降、実行中ループのネストが増すたびに、レベル記憶域22は、1多い値を格納する。レベル記憶域22の初期値は0である。
The
図2はトレースデータ30の構成を示す。トレースデータ30は種別31と付加データ32を包含する。種別31は当該トレースデータ30が生成された事象の種類を示す。種別31は、例えば、loop entry、loop exit、loop pattern、他事象通知などである。loop entry、loop exitはおのおのループの開始と終了を示す。
FIG. 2 shows the configuration of the
loop patternはループ先頭の実行を示す。即ち、loop patternは、ループの各回の実行の開始と終了を示す。本発明に於いて、ループの一回の実行で生成されるトレースデータ30の集合が区間データである。区間データは、ある回のループの実行開始を示すloop patternから次回の当該ループの実行開始を示すloop patternの直前までのトレースデータ30の集合である。または、区間データは、ある回のループの実行開始を示すloop patternからループ終了を示すloop exitの直前までのトレースデータ30の集合である。
The loop pattern indicates execution at the top of the loop. That is, the loop pattern indicates the start and end of each execution of the loop. In the present invention, a set of
他事象通知は、上記以外の事象の発生を通知するトレースデータ30である。他事象通知は、例えば、routine entry/routine exit(一般関数コール開始/終了)、MPI entry/MPI exit(MPI関数コール開始/終了)、send(メッセージ送信)などがある。ここで、MPIは、Message Passing Interfaceを意味する。
Other event notification is trace
付加データ32は、通知する事象に応じた詳細通知データである。loop entry、loop exit、loop patternの付加データ32は、ループの識別子などを包含する。他事象通知の付加データ32は、関数名やパラメータ値などを包含する。
The
図3は、被トレース処理プログラム24のソースコード例(1)を示す。被トレース処理プログラム24は、ループを含むプログラム(図中左側)に、例えば、トレース関数コールを挿入したもの(図中右側)である。トレース関数は、プロセッサ13で実行されると、例えば、当該関数名と同じ種別31を持つトレースデータ30を生成する。例えば、プロセッサ13がloop_entry関数を実行すると、loop entryのトレースデータ30を生成する。なお、MPI entry、MPI exit、sendの各トレースデータ30は、MPI_send関数で生成される。
FIG. 3 shows a source code example (1) of the
図から明らかなように、loop_entry関数、loop_exit関数は、おのおの、ループの開始直前と終了直後の位置に挿入される。loop_pattern関数は、ループ内の先頭実行命令の直前に挿入される。routine_entry関数、routine_exit関数は、おのおの、関数コール(本図に於いては、calc1関数やcalc2関数コール)の直前直後に挿入される。専用のツールやコンパイラが、被トレース処理プログラム24のソースプログラムの文脈を解析して、自動的にトレース関数を挿入する。プログラマが人手により挿入しても良い。
As is apparent from the figure, the loop_entry function and the loop_exit function are inserted at positions immediately before and after the start of the loop. The loop_pattern function is inserted immediately before the first execution instruction in the loop. The routine_entry function and routine_exit function are inserted immediately before and after the function call (in this figure, calc1 function and calc2 function call). A dedicated tool or compiler analyzes the context of the source program of the traced
付加データ32は、トレース関数のパラメータとして入力されても良いし、トレース関数内で生成されても良い。
The
トレースデータ30は、トレース関数によらず、被トレース処理プログラム24が直接生成しても良い。例えば、コンパイラが被トレース処理プログラム24のソースプログラム(図中左側)をコンパイルするときにトレースデータ30を生成するための命令を、オブジェクトプログラムに挿入しても良い。
The
図4は、トレース領域23の構成を示す図である。トレース領域23は、トレースバッファ40と、領域ポインタ41を包含する。トレースバッファ40はトレースデータ30を順次格納する。トレースバッファ40は、通常、循環バッファである。領域ポインタ41は、トレースバッファ40の空き領域の先頭アドレスを指す。初期値は、トレースバッファ40の先頭アドレスである。
FIG. 4 is a diagram showing the configuration of the
解析部15は、トレースデータ30をトレースバッファ40に追記するときは、先ず、領域ポインタ41が指す領域以降にトレースデータ30を格納する。格納後、同部は当該追記データの直後のアドレス(満杯時は、トレースバッファ40の先頭アドレス)を領域ポインタ41に格納する。
When adding the
図5は、ループ管理表21の構成を示す。ループ管理表21はループネストの各レベルに対応して存在する。即ち、ループ管理表21はレベル格納域22の1以上の各値に対応して存在する。各レベル対応のループ管理表21は、解析バッファ50、バッファポインタ51、パターン表52、表ポインタ53を包含する。
FIG. 5 shows the configuration of the loop management table 21. The loop management table 21 exists corresponding to each level of loop nest. That is, the loop management table 21 exists corresponding to each of one or more values in the
解析バッファ50はトレースデータ30を順次格納する。解析バッファ50の初期値は例えばゼロである。バッファポインタ51は、解析バッファ50の空き領域の先頭アドレスを指す。バッファポインタ51の初期値は、解析バッファ50の先頭アドレスである。
The
解析部15は、トレースデータ30を解析バッファ50に追記するときは、バッファポインタ51が指す領域以降にトレースデータ30を格納して、格納後、当該追記データの直後のアドレスをバッファポインタ51に格納する。
When the
パターン表52は、パターンID54とパターンデータ55を対応させて順次格納する。パターン表52の初期値は、例えば、ゼロである。パターンデータ55は区間データ、即ち、トレースデータ30の集合である。パターンデータ55はその他のデータを包含しても良い。表ポインタ53は、パターン表52の空き領域の先頭アドレスを指す。表ポインタ53の初期値は、パターン表52の先頭アドレスである。
The pattern table 52 sequentially stores the
解析部15は、パターンデータ55をパターン表52に追記するときは、表ポインタ53が指す領域以降にパターンデータ55を格納して、格納後、当該追記データの直後のアドレスを表ポインタ53に格納する。
When adding the
第1のループに対応するループ管理表21は、第1の解析バッファ61および第1のパターン表62を包含する。 第2のループに対応するループ管理表21は、第2の解析バッファ63および第2のパターン表64を包含する。ここで、第1のループは、一番外側のループを指し、ループネストのレベル(レベル格納域22の値)が1のループである。第2のループは、第1のループ内でネストしているループを指し、ループネストのレベルが2のループである。
The loop management table 21 corresponding to the first loop includes a
なお、ある時点のレベル記憶域22の値(1以上)に対応するループ管理表21、解析バッファ50、パターン表52は、その時点に於けるカレントレベルのループ管理表21、解析バッファ50、パターン表52と呼ばれる。例えば、ある時点でレベル記憶域22の値が1であれば、その時点に於けるカレントレベルの解析バッファ50は、第1の解析バッファ61である。ある時点でレベル記憶域22の値が2であれば、その時点に於けるカレントレベルの解析バッファ50は、第2の解析バッファ63である。
The loop management table 21, the
図6は、解析部15の動作フローチャートである。まず、解析部15は、生成部14から入力したトレースデータ30の種別31を判定する(S1)。
FIG. 6 is an operation flowchart of the
種別31が他事象通知である場合、同部はループネストのレベル(レベル記憶域22の値)を判定する(S5)。レベルが0であれば(S5でY)、同部は、入力したトレースデータ30をトレースバッファ40に追記して(S6)動作を終了する。レベルが0でなければ(S5でN)、同部は、入力したトレースデータ30をカレントレベルの解析バッファ50に追記して(S9)動作を終了する。即ち解析部15は、入力したトレースデータ30を、生成部14がループ実行中であればカレントレベルの解析バッファ50に、生成部14がループ実行中でなければトレースバッファ40に追記する。
If the
種別31がループ開始である場合、解析部15は、入力したトレースデータ30を、生成部14がループ実行中であればカレントレベルの解析バッファ50に、生成部14がループ実行中でなければトレースバッファ40に追記する(S5、S6、S9)。その後、同部は、レベル記憶域22の値を1加算し、カレントレベルのループ管理表21を初期化する(S8)。ループ管理表21の初期化は、バッファポインタ51、表ポインタ53、解析バッファ50およびパターン表52の初期化を包含する。
When the
種別31がループ先頭実行である場合、解析部15はカレントレベルの解析バッファ50が空(初期状態)であるかを判定する(S2)。空でない場合(S2でN)、同部は同一パターン検出処理(図7参照)を実行する(S3)。空である場合(S2でY)、同部は同一パターン検出処理をスキップする。このスキップは、ループ開始に続く最初のループ先頭実行を示すトレースデータ30が入力された場合に発生する。その後、同部は、入力したトレースデータ30をカレントレベルの解析バッファ50に追記して(S4)動作を終了する。
When the
種別31がループ終了である場合、解析部15は、同一パターン検出処理(図7参照)の実行、入力トレースデータ30のカレントレベルの解析バッファ50への追記、レベル記憶域22の値の1減算を行う(SA、SB、SC)。その後、同部はループネストのレベル(レベル記憶域22の値)を判定する(SD)。レベルが0であれば(SDでY)、同部は、第1の解析バッファ50の内容をトレースバッファ40に追記して(SE)動作を終了する。レベルが0でなければ(SDでN)、同部は、元のレベルの解析バッファ50の内容をカレントレベルの解析バッファ50に追記して(SF)動作を終了する。
When the
図7は、解析部15の同一パターン検出処理部分の動作フローチャートである。カレントレベルのパターン表52が空(初期値)であると(S11でY)、解析部15はパターン表52への登録処理を行う。カレントレベルのパターン表52が空(初期値)であるのは、ループ開始後、2回目のループ先頭実行を示すトレースデータ30が入力された場合、即ち、ループの初回実行が終了した場合に発生する。
FIG. 7 is an operation flowchart of the same pattern detection processing portion of the
同部はパターンID54を生成してパターン表52に追記する(S12)。パターンID54は、例えば、入力したループ先頭実行を示すトレースデータ30が有する付加データ32内のループの識別子(処理中ループ識別子)にトレース採取装置10に一意の通し番号を付加して生成する。
The same part generates a
その後、同部は、最新区間開始データ以降のカレントレベルの解析バッファ50のトレースデータ30をパターン表52のパターンデータ55に追記する。最新区間開始データは、処理中ループ識別子と同じループ識別子を持つ最新(前回)のループ先頭実行を示すトレースデータ30である(S13)。即ち同部は、最新の区間データをパターン表52に追記する。最新の区間データはループの最新回の実行で生成された区間データである。このとき同部は、パターンデータ55に最新の区間データの終端を示すデータを付加して追記しても良い。例えば、同部は、パターンID54の直後に最新の区間データのサイズを追記しても良い。または、同部は、区間データの最後に、区切り符号(パターンデータ55として発生し得ない値など)を付加しても良い。
Thereafter, the same part adds the
同部は、カレントレベルの解析バッファ50の最新の区間開始データにパターンID54を付加して(S14)、同一パターン検出処理を終了する。パターンID54の付加は、例えば、付加データ32内のループの識別子を書き換えることで行う。
The same part adds the
カレントレベルのパターン表52が空でないと(S11でN)、解析部15は、最新の区間データとパターン表52に登録済み区間データのおのおのと一致判定を行う(S15)。同部は、パターン表52に登録済みの区間データを順次取得し、当該区間データ内の各トレースデータ30と最新の区間データ内の各トレースデータ30を先頭から順次対比し、全てが一致するパターン表52に登録済みの区間データ(一致区間データ)を検索する。このとき、同部は、対比するトレースデータ30の種別31および付加データ32の全部を対比しても良い。同部は、種別31だけ、または、種別31および付加データ32の一部(例えば、ある特定のパラメータ値など)だけを比較しても良い。
If the pattern table 52 at the current level is not empty (N in S11), the
一致区間データを発見できた場合(S16でY)、同部は、カレントレベルの解析バッファ50の最新区間開始データに一致区間データのパターンID54を付加する(S17)。このパターンID54は、当該パターンID54のパターンのトレースデータ30が生成されたことを示す。次に、同部は、バッファポインタ51の値を当該トレースデータ30の次のアドレスを示すように戻して(S18)、同一パターン検出処理を終了する。即ち同部は、最新の区間データ中、最新区間開始データ以外を破棄(後続データで上書き)する。
If the matching section data is found (Y in S16), the same part adds the
一致区間データを発見できない場合(S16でN)、同部はパターン表52への登録処理を行う(S12、S13、S14)。 When the matching section data cannot be found (N in S16), the same part performs a registration process to the pattern table 52 (S12, S13, S14).
以下は、本実施形態の動作の具体例に則した説明である。図8は、プロセッサ13が図3に示した被トレース処理プログラム24の例(1)を実行した場合に生成するトレースデータ30の例(1)を示す。プログラム中の変数Nは2であるとする。なお、図8に示す通番33は説明のリファレンス用に記載したものであり、必ずしも実際に生成されるデータではない。以降の図に於いても同様であり、通番33は、必ずしも実際にトレースバッファ40やパターン表52に格納されているわけではない。
The following is a description according to a specific example of the operation of the present embodiment. FIG. 8 shows an example (1) of the
解析部15は、t1乃至t3のトレースデータ30をトレースバッファ40に追記する。同部は、t3でレベル1のループ管理表21を初期化して、t4乃至t9のトレースデータ30をレベル1の解析バッファ50に追記する。同部は、t10でt4乃至t9のトレースデータ30を区間データとしてパターン表52に追記する。図9は、解析部15が、図8のトレースデータ30の例(1)を入力して作成したパターン表52の例(1)である。パターンID54は、ループの識別子(L1)にP1を付加したものとしている。
The
同部は、t10乃至t15のトレースデータ30を解析バッファ50に追記する。t16において、同部は、最新の区間データ(t10乃至t15)とパターン表52に登録された区間データ(t4乃至t9)の一致を検出する。同部は、バッファポインタ51を操作してt11乃至t15のトレースデータ30を破棄する。同部は、最後にt16のトレースデータ30を解析バッファ50に追記して、解析バッファ50の内容をトレースバッファ40に追記して処理を終了する。図10は、解析部15が、図8のトレースデータ30の例(1)を入力して作成したトレースバッファ40の例(1)である。
The same section adds the
図11は、被トレース処理プログラム24のソースコード例(2)を示す。図12は、プロセッサ13が図11に示した被トレース処理プログラム24の例(2)を実行した場合に生成するトレースデータ30の例(2)を示す。プログラム中の変数Nは3であるとする。
FIG. 11 shows a source code example (2) of the traced
解析部15は、t1のトレースデータ30をトレースバッファ40に追記する。同部は、t1でレベル1のループ管理表21を初期化して、t2乃至t7のトレースデータ30をレベル1の解析バッファ50に追記する。同部は、t8でt2乃至t7のトレースデータ30を区間データとしてパターン表52に追記する。さらに、同部は、t8乃至t10を解析バッファ50に格納し、t11でt8乃至t10のトレースデータ30を区間データとしてパターン表52に追加して追記する。図13は、解析部15が、図12のトレースデータ30の例(2)を入力して作成したパターン表52の例(2)である。パターンID54は、ループの識別子(L1)にP1、P2を付加したものとしている。
The
同部は、t11乃至t13のトレースデータ30を解析バッファ50に追記する。t14において、同部は、最新の区間データ(t11乃至t13)とパターン表52に登録された区間データ(t8乃至t10)の一致を検出する。同部は、バッファポインタ51を操作してt12とt13のトレースデータ30を破棄する。同部は、最後にt14のトレースデータ30を追記して、解析バッファ50の内容をトレースバッファ40に追記して処理を終了する。図14は、解析部15が、図12のトレースデータ30の例(2)を入力して作成したトレースバッファ40の例(2)である。
The same section adds the
図15は、被トレース処理プログラム24のソースコード例(3)を示す。図16は、プロセッサ13が図15に示した被トレース処理プログラム24の例(3)を実行した場合に生成するトレースデータ30の例(3)を示す。プログラム中の変数Nは3であるとする。図17は、解析部15が、図16のトレースデータ30の例(3)を入力して作成したパターン表52の例(3)である。図18は、解析部15が、図16のトレースデータ30の例(3)を入力して作成したトレースバッファ40の例(3)である。
FIG. 15 shows a source code example (3) of the traced
図19は、被トレース処理プログラム24のソースコード例(4)を示す。このプログラムは、ネストしたループを持つ。図20は、プロセッサ13が図19に示した被トレース処理プログラム24の例(4)を実行した場合に生成するトレースデータ30の例(4)を示す。プログラム中の変数M、Nは2であるとする。
FIG. 19 shows a source code example (4) of the traced
解析部15は、t1のトレースデータ30をトレースバッファ40に追記する。同部は、t1でレベル1のループ管理表21を初期化して、t2およびt3のトレースデータ30をレベル1の解析バッファ50に追記する。同部は、t3でレベル2のループ管理表21を初期化して、t4乃至t6のトレースデータ30をレベル2の解析バッファ50に追記する。同部は、t7でt4乃至t6のトレースデータ30を区間データとしてレベル2のパターン表52に追記する。図21は、解析部15が、図20のトレースデータ30の例(4)を入力して作成したレベル2のパターン表52の例(4−1)である。パターンID54は、ループの識別子(L2)にP1を付加したものとしている。
The
同部は、t7乃至t9のトレースデータ30を解析バッファ50に追記する。t10において、同部は、最新の区間データ(t7乃至t9)とパターン表52に登録された区間データ(t4乃至t6)の一致を検出する。同部は、バッファポインタ51を操作してt8とt9のトレースデータ30を破棄する。ここで同部は、レベル2の解析バッファ50にt10のトレースデータ30を追記して、レベル(レベル記憶域22の値)を2から1に下げて、レベル2の解析バッファ50内容をレベル1の解析バッファ50に追記する。ここで追記されるデータは、t4乃至t10のトレースデータ30である。但し、t8およびt9は破棄されている。
The same section adds the
同部は、t11乃至t13をレベル1の解析バッファ50に格納して、t14でt2乃至t13のトレースデータ30を区間データとしてレベル1のパターン表52に追加して追記する。図22は、解析部15が、図20のトレースデータ30の例(4)を入力して作成したレベル1のパターン表52の例(4−2)である。パターンID54は、ループの識別子(L1)にP1を付加したものとしている。
The same unit stores t11 to t13 in the
同部は、t15乃至t25で上述のt3乃至t13と同様に処理し、t26において、最新の区間データ(t14乃至t25)とパターン表52に登録された区間データ(t2とt13)の一致を検出する。同部は、バッファポインタ51を操作してt15乃至t25のトレースデータ30を破棄する。同部は、最後にt26のトレースデータ30を付加して、解析バッファ50の内容をトレースバッファ40に格納して処理を終了する。図23は、解析部15が、図19のトレースデータ30の例(4)を入力して作成したトレースバッファ40の例(4)である。
The same processing is performed at t15 to t25 in the same manner as the above-described t3 to t13, and at t26, the latest section data (t14 to t25) and the section data (t2 and t13) registered in the pattern table 52 are detected. To do. The same unit operates the buffer pointer 51 to discard the
本実施形態のトレース採取装置10は、パターンが変化するループ実行中に、同じシーケンスのトレースデータ30が大量に出力されるのを防止しつつ、異なるシーケンスのトレースデータ30は取得できる。その理由は、解析部15が、新規のパターンをループ管理表21に登録し、登録済みパターンのトレースデータ30の少なくとも一部はトレース領域23に出力しないからである。
The
また、本実施形態のトレース採取装置10は、ループのネストが存在しても、上述の効果を奏する。その理由は、ループ管理表21をループネストのレベル対応に設け、解析部15がパターンの登録、検出をネストレベル対応に実行するからである。
Moreover, the
図24は、本発明の第2の実施形態にかかるトレース採取システム70の構成を示す。トレース採取システム70は、トレース採取装置10および当該トレース採取装置10に接続される外部生成装置71を包含する。本実施形態に於いて、トレース採取装置10は、生成部14を備えていなくても良い。トレースデータ30は、外部生成装置71から解析部15に入力される。他の点は、第1の実施形態と同じである。
FIG. 24 shows a configuration of a trace collection system 70 according to the second embodiment of the present invention. The trace collection system 70 includes a
外部生成装置71は、制御装置などであってハードウェアで実現されている。外部生成装置71は、内部の記憶装置と演算装置を備え、当該演算装置が当該記憶装置に格納された被トレース処理プログラム24を実行することで実現されても良い。
The external generation device 71 is a control device or the like and is realized by hardware. The external generation device 71 may include an internal storage device and an arithmetic device, and the arithmetic device may be realized by executing the
本実施形態のトレース採取システム70は、当該装置外の被トレース処理のトレースデータ30を採取できる。その理由は、トレースデータ30は外部生成装置71から入力するからである。
The trace collection system 70 of this embodiment can collect the
図25は、本発明の基本的構成を示す。本発明にかかるトレース採取装置10は、被トレース処理の実行により生成されるトレースデータ30を順次格納するトレースバッファ40と、第1のパターン表62と、第1の解析バッファ61を格納するメモリ20を備える。更に、同装置は、被トレース処理内の第1のループの各回の実行により生成される各々のトレースデータ30(第1の区間データ)を入力する解析部15を備える。同部は、入力データが、当該第1の区間データが第1のパターン表62にすでに格納されたいずれかの第1の区間データとの一致(パターン一致)を検出しないと、入力した第1の区間データを第1のパターン表62および第1の解析バッファ61に追記する。また、同部は、パターン一致を検出すると、第1の区間データの少なくとも一部を第1の解析バッファ61に格納せず、第1ループの終了を検出すると、第1の解析バッファ61の内容をトレースバッファ40に出力する。
FIG. 25 shows the basic configuration of the present invention. The
10 トレース採取装置
11 コンピュータ
12 トレースファイル
13 プロセッサ
14 生成部
15 解析部
16 出力部
20 メモリ
21 ループ管理表
22 レベル記憶域
23 トレース領域
24 被トレースプログラム
25 トレース採取プログラム
30 トレースデータ
31 種別
32 付加データ
33 通番
40 トレースバッファ
41 領域ポインタ
50 解析バッファ
51 バッファポインタ
52 パターン表
53 表ポインタ
54 パターンID
55 パターンデータ
61 第1の解析バッファ
62 第1のパターン表
63 第2の解析バッファ
64 第2のパターン表
70 トレース採取システム
71 外部生成装置
DESCRIPTION OF
55
Claims (8)
前記被トレース処理内の第1のループの各回の実行により生成される各々の前記トレースデータである第1の区間データを入力して、当該第1の区間データが前記第1のパターン表にすでに格納されたいずれかの第1の区間データとの一致である第1のパターン一致を検出しないと、入力した前記第1の区間データを前記第1のパターン表および前記第1の解析バッファに追記し、前記第1のパターン一致を検出すると、前記第1の区間データの少なくとも一部を前記第1の解析バッファに格納せず、前記第1ループの終了を検出すると、前記第1の解析バッファの内容を前記トレースバッファに出力する解析部を備える、トレース採取装置であって、前記メモリは、第2のパターン表と、第2の解析バッファを格納し、
前記解析部は、前記第1のループ内に包含される第2のループの各回の実行により生成される各々の前記トレースデータである第2の区間データを入力して、前記第2の区間データが前記第2のパターン表に格納されたいずれかの第2の区間のトレースデータとの一致である第2のパターン一致を検出しないと、前記第2の区間データを前記第2のパターン表および前記第2の解析バッファに追記し、前記第2のパターン一致を検出すると、前記第2の区間データの少なくとも一部を前記第2の解析バッファに格納せず、前記第2のループの終了を検出すると、前記第2の解析バッファの内容を前記第1の解析バッファに出力するトレース採取装置。 A trace buffer for sequentially storing trace data generated by execution of the traced process; a first pattern table; a memory for storing a first analysis buffer;
First section data that is each of the trace data generated by each execution of the first loop in the traced process is input, and the first section data is already stored in the first pattern table. If the first pattern match, which is a match with any of the stored first section data, is not detected, the input first section data is added to the first pattern table and the first analysis buffer. When the first pattern match is detected, at least part of the first section data is not stored in the first analysis buffer, and when the end of the first loop is detected, the first analysis buffer is detected. A trace collection device comprising an analysis unit that outputs the contents of the trace buffer to the trace buffer, wherein the memory stores a second pattern table and a second analysis buffer;
The analysis unit inputs second interval data that is each of the trace data generated by each execution of the second loop included in the first loop, and the second interval data Does not detect a second pattern match that matches the trace data of any second section stored in the second pattern table, the second section data is stored in the second pattern table and When the second analysis buffer is additionally written and the second pattern match is detected, at least part of the second section data is not stored in the second analysis buffer, and the end of the second loop is completed. A trace collection device that outputs the contents of the second analysis buffer to the first analysis buffer when detected.
前記トレースバッファの内容を前記トレースファイルに出力する出力部を備える、請求項1のトレース採取装置。 With a trace file,
The trace collection device according to claim 1, further comprising an output unit that outputs the contents of the trace buffer to the trace file.
前記生成部が生成した前記トレースデータに基づいて、前記第1のループの開始および終了、並びに、前記第1のループの各回の実行の開始及び終了を検出する前記解析部を備える、請求項1または2のトレース採取装置。 A generation unit that executes the traced process, and generates the trace data of different types before and after the start of the first loop, and at the start of each iteration of the in-loop repeat process;
The analysis unit that detects the start and end of the first loop and the start and end of each execution of the first loop based on the trace data generated by the generation unit. Or 2 trace collection devices.
前記外部生成装置が生成した前記トレースデータに基づいて、前記第1のループの開始および終了、並びに、前記第1のループの各回の実行の開始及び終了を検出する前記解析部を備える請求項1または2のトレース採取装置を包含するトレース採取システム。 The trace data connected to the trace collection device, executing the traced process, before and after the start of the first loop, and at the start of each repetition of the in-loop process. An external generation device for generating
The analysis unit that detects the start and end of the first loop and the start and end of each execution of the first loop based on the trace data generated by the external generation device. Or a trace collection system comprising two trace collection devices.
前記被トレース処理内の第1のループの各回の実行により生成される各々の前記トレースデータである第1の区間データを入力して、当該第1の区間データが前記第1のパターン表にすでに格納されたいずれかの第1の区間データとの一致である第1のパターン一致を検出しないと、入力した前記第1の区間データを前記第1のパターン表および前記第1の解析バッファに追記し、前記第1のパターン一致を検出すると、前記第1の区間データの少なくとも一部を前記第1の解析バッファに格納せず、前記第1ループの終了を検出すると、前記第1の解析バッファの内容を前記トレースバッファに出力する解析処理を実行させる、トレース採取プログラムであって、
前記コンピュータに、
前記第1のループ内に包含される第2のループの各回の実行により生成される各々の前記トレースデータである第2の区間データを入力して、前記第2の区間データが前記第2のパターン表に格納されたいずれかの第2の区間のトレースデータとの一致である第2のパターン一致を検出しないと、前記第2の区間データを前記第2のパターン表および前記第2の解析バッファに追記し、前記パターン一致を検出すると、前記第2の区間データの少なくとも一部を前記第2の解析バッファに格納せず、前記第2のループの終了を検出すると、前記第2の解析バッファの内容を前記第1の解析バッファに出力する前記解析処理を実行させる、トレース採取プログラム。 A trace buffer for sequentially storing trace data generated by execution of the traced process, a first pattern table, a first analysis buffer, a second pattern table, and a memory for storing a second analysis buffer; Computer
First section data that is each of the trace data generated by each execution of the first loop in the traced process is input, and the first section data is already stored in the first pattern table. If the first pattern match, which is a match with any of the stored first section data, is not detected, the input first section data is added to the first pattern table and the first analysis buffer. When the first pattern match is detected, at least part of the first section data is not stored in the first analysis buffer, and when the end of the first loop is detected, the first analysis buffer is detected. A trace collection program for executing an analysis process for outputting the contents of the trace buffer to the trace buffer,
In the computer,
Second interval data that is each of the trace data generated by each execution of the second loop included in the first loop is input, and the second interval data is input to the second loop If the second pattern match, which is a match with the trace data of any second section stored in the pattern table, is not detected, the second section data is converted into the second pattern table and the second analysis. When the pattern match is detected by adding to the buffer, at least a part of the second section data is not stored in the second analysis buffer, and when the end of the second loop is detected, the second analysis is performed. A trace collection program for executing the analysis processing for outputting the contents of the buffer to the first analysis buffer.
前記トレースバッファの内容を前記トレースファイルに出力する出力処理を実行させる、請求項5のトレース採取プログラム。 On the computer with the trace file,
The trace collection program according to claim 5, wherein an output process for outputting the contents of the trace buffer to the trace file is executed.
前記生成部が生成した前記トレースデータに基づいて、前記第1のループの開始および終了、並びに、前記第1のループの各回の実行の開始及び終了を検出する前記解析処理を実行させる、請求項5または6のトレース採取プログラム。 Generation processing for executing the traced processing in the computer and generating the trace data of different types before and after the start of the first loop and at the start of each iteration of the intra-loop iteration processing. When,
The analysis processing for detecting the start and end of the first loop and the start and end of each execution of the first loop is executed based on the trace data generated by the generation unit. 5 or 6 trace collection programs.
前記被トレース処理内の第1のループの各回の実行により生成される各々の前記トレースデータである第1の区間データを入力して、当該第1の区間データが前記第1のパターン表にすでに格納されたいずれかの第1の区間データとの一致である第1のパターン一致を検出しないと、入力した前記第1の区間データを前記第1のパターン表および前記第1の解析バッファに追記し、前記第1のパターン一致を検出すると、前記第1の区間データの少なくとも一部を前記第1の解析バッファに格納せず、前記第1ループの終了を検出すると、前記第1の解析バッファの内容を前記トレースバッファに出力する解析工程を有する、トレース採取方法であって、
前記コンピュータが、
前記第1のループ内に包含される第2のループの各回の実行により生成される各々の前記トレースデータである第2の区間データを入力して、前記第2の区間データが前記第2のパターン表に格納されたいずれかの第2の区間のトレースデータとの一致である第2のパターン一致を検出しないと、前記第2の区間データを前記第2のパターン表および前記第2の解析バッファに追記し、前記第2のパターン一致を検出すると、前記第2の区間データの少なくとも一部を前記第2の解析バッファに格納せず、前記第2のループの終了を検出すると、前記第2の解析バッファの内容を前記第1の解析バッファに出力する前記解析工程を有する、トレース採取方法。 A trace buffer for sequentially storing trace data generated by execution of the traced process, a first pattern table, a first analysis buffer, a second pattern table, and a memory for storing a second analysis buffer; Computer with
First section data that is each of the trace data generated by each execution of the first loop in the traced process is input, and the first section data is already stored in the first pattern table. If the first pattern match, which is a match with any of the stored first section data, is not detected, the input first section data is added to the first pattern table and the first analysis buffer. When the first pattern match is detected, at least part of the first section data is not stored in the first analysis buffer, and when the end of the first loop is detected, the first analysis buffer is detected. A trace collection method comprising an analysis step of outputting the contents of
The computer is
Second interval data that is each of the trace data generated by each execution of the second loop included in the first loop is input, and the second interval data is input to the second loop If the second pattern match, which is a match with the trace data of any second section stored in the pattern table, is not detected, the second section data is converted into the second pattern table and the second analysis. When adding to the buffer and detecting the second pattern match, at least a part of the second section data is not stored in the second analysis buffer, and when the end of the second loop is detected, A trace collection method comprising the analysis step of outputting the contents of two analysis buffers to the first analysis buffer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008243609A JP5024252B2 (en) | 2008-09-24 | 2008-09-24 | Trace information acquisition device, trace information acquisition program, and trace information acquisition method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008243609A JP5024252B2 (en) | 2008-09-24 | 2008-09-24 | Trace information acquisition device, trace information acquisition program, and trace information acquisition method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010079343A JP2010079343A (en) | 2010-04-08 |
JP5024252B2 true JP5024252B2 (en) | 2012-09-12 |
Family
ID=42209757
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008243609A Expired - Fee Related JP5024252B2 (en) | 2008-09-24 | 2008-09-24 | Trace information acquisition device, trace information acquisition program, and trace information acquisition method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5024252B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5569343B2 (en) * | 2010-11-04 | 2014-08-13 | 富士通セミコンダクター株式会社 | Trace compression device, trace compression program |
GB2532285A (en) | 2014-11-17 | 2016-05-18 | Ibm | Request monitoring |
JP6353816B2 (en) * | 2015-08-03 | 2018-07-04 | 日本電信電話株式会社 | Structured log generation device, structured log generation method, and program |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3100013B2 (en) * | 1992-12-04 | 2000-10-16 | 株式会社東芝 | Program debug device |
JP2878264B1 (en) * | 1998-03-11 | 1999-04-05 | 甲府日本電気株式会社 | Tracer device, trace data compression method, and compressed trace data reading method |
JP3498702B2 (en) * | 2000-12-06 | 2004-02-16 | 日本電気株式会社 | Computer system and trace information control method used therefor |
JP2004102594A (en) * | 2002-09-09 | 2004-04-02 | Fujitsu Ltd | Method for analyzing number of times of execution of parallel execution program and its program |
-
2008
- 2008-09-24 JP JP2008243609A patent/JP5024252B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2010079343A (en) | 2010-04-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7788535B2 (en) | Means and method for debugging | |
US10019240B2 (en) | Method and apparatus for detecting code change | |
US8671397B2 (en) | Selective data flow analysis of bounded regions of computer software applications | |
US9626170B2 (en) | Method and computer program product for disassembling a mixed machine code | |
US9459989B2 (en) | Method and apparatus for reverse debugging source code using causal analysis | |
JP2010238228A (en) | Method and device for dynamically analyzing program | |
JP2015043198A (en) | Analysis system, analysis method and analysis program | |
EP2778629A1 (en) | Method and device for code change detection | |
US20210405980A1 (en) | Long method autofix engine | |
JP5024252B2 (en) | Trace information acquisition device, trace information acquisition program, and trace information acquisition method | |
JP5440287B2 (en) | Symbolic execution support program, method and apparatus | |
JP2010122959A (en) | Test support system, method, and program | |
JP6107455B2 (en) | Test schedule determination device and program | |
GB2551574B (en) | An apparatus and method for generating and processing a trace stream indicative of instruction execution by processing circuitry | |
CN112631925A (en) | Method for detecting single variable atom violation defect | |
JP2009193335A (en) | Automatic annotation insertion method of static verification tool | |
JP4888790B2 (en) | Contract definition function verification apparatus, method and program thereof | |
CN110688320A (en) | Global variable detection method and device and terminal equipment | |
CN113190235B (en) | Code analysis method and device, electronic terminal and storage medium | |
JP2016128941A (en) | Output determination device, output determination method, output determination program, and static analysis device | |
JP6369177B2 (en) | Development support program, development support method, and development support apparatus | |
US20140372982A1 (en) | Standardization of variable names in an integrated development environment | |
JP2009217617A (en) | Method and device for identifying memory leak place | |
CN110244954A (en) | A kind of Compilation Method and equipment of application program | |
US20090235223A1 (en) | Program generation apparatus and program generation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110221 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20110705 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110913 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20111109 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120306 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120319 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20120522 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120604 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150629 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |