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 PDF

Info

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
Application number
JP2008243609A
Other languages
Japanese (ja)
Other versions
JP2010079343A (en
Inventor
直記 片岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2008243609A priority Critical patent/JP5024252B2/en
Publication of JP2010079343A publication Critical patent/JP2010079343A/en
Application granted granted Critical
Publication of JP5024252B2 publication Critical patent/JP5024252B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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回目のループ終了によりトレースを終了し、最後のループ終了と同時にトレースを再開するトレースマスク制御回路が開示されている。   Patent Document 1 describes a history registration control circuit that suppresses history registration when a predetermined specific pattern of microinstruction words is detected. Patent Document 2 discloses a trace mask control circuit that ends a trace at the end of the first loop and restarts the trace at the end of the last loop.

特開昭57−19854JP-A-57-19854 特開平11−73344JP-A-11-73344

ループ実行中のトレースパターンは変化する。従って、特許文献1における特定パターンを予め決定しておくことは出来ない場合が多い。特許文献2では、第2回目以降のループで新たに出現したパターンのトレース情報は失われるという課題があった。   The trace pattern during loop execution changes. Therefore, the specific pattern in Patent Document 1 cannot be determined in advance in many cases. In Patent Document 2, there is a problem that trace information of a pattern that newly appears in the second and subsequent loops is lost.

本発明は、上述した課題を解決するための、トレース情報取得装置、トレース情報取得プログラム、および、トレース情報取得方法を提供することを目的とする。   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 trace collection apparatus 10 according to the first embodiment of the present invention. The trace collection apparatus 10 includes a trace file 12, a generation unit 14, an analysis unit 15, an output unit 16, and a memory 20. The memory 20 stores a loop management table 21, a level storage area 22, and a trace area 23. The memory 20 may store a trace processing program 24 and a trace collection program 25.

生成部14は、トレースの対象となる処理(被トレース処理)を実行してトレースデータ30を生成して、解析部15に出力する。生成部14は機器の制御装置などであってハードウェアで実現される。また、生成部14は、コンピュータ11であるトレース採取装置10のプロセッサ13が、業務処理などを行う被トレース処理プログラム24を実行することで実現されても良い。   The generation unit 14 generates a trace data 30 by executing a process to be traced (process to be traced) and outputs the trace data 30 to the analysis unit 15. The generation unit 14 is a device control device or the like, and is realized by hardware. The generation unit 14 may also be realized by the processor 13 of the trace collection device 10 that is the computer 11 executing the trace processing program 24 that performs business processing and the like.

解析部15は、トレースデータ30を入力してトレース領域23に順次格納する。但し、解析部15は、被トレース処理のループ実行中に発生したパターンをループ管理表21に記録し、同一パターンのトレース情報は以降のループ実行中にトレース領域23に格納しない。   The analysis unit 15 inputs the trace data 30 and sequentially stores it in the trace area 23. However, the analysis unit 15 records the pattern generated during the loop execution of the traced process in the loop management table 21 and does not store the trace information of the same pattern in the trace area 23 during the subsequent loop execution.

出力部16は、定期的またはトレース領域23の使用率が高いとき等に、トレース領域23に格納されたトレースデータ30をトレースファイル12に出力する。出力部16は無くても良い。   The output unit 16 outputs the trace data 30 stored in the trace area 23 to the trace file 12 periodically or when the usage rate of the trace area 23 is high. The output unit 16 may not be provided.

解析部15および出力部16はハードウェアで実現される。解析部15または出力部16は、コンピュータ11であるトレース採取装置10のプロセッサ13が、トレース採取プログラム25を実行することで実現されても良い。   The analysis unit 15 and the output unit 16 are realized by hardware. The analysis unit 15 or the output unit 16 may be realized by the processor 13 of the trace collection device 10 that is the computer 11 executing the trace collection program 25.

レベル記憶域22は、被トレース処理の実行中ループのネストのレベル数(包含関係の階層数)を格納する。被トレース処理がループ実行中でないときこの値は、例えば0である。一番外側のループ(第1のループ)実行中、レベル記憶域22は、例えば、1を格納する。第1のループにネストして包含される内側のループ(第2のループ)実行中、レベル記憶域22は、例えば、2を格納する。 以降、実行中ループのネストが増すたびに、レベル記憶域22は、1多い値を格納する。レベル記憶域22の初期値は0である。   The level storage area 22 stores the number of nesting levels of loops during execution of the traced process (the number of layers in the inclusion relationship). When the traced process is not being executed in a loop, this value is 0, for example. During execution of the outermost loop (first loop), the level storage area 22 stores, for example, 1. During execution of the inner loop (second loop) that is nested in the first loop, the level storage area 22 stores, for example, 2. Thereafter, each time the number of executing loops increases, the level storage area 22 stores a value one more. The initial value of the level storage area 22 is zero.

図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 trace data 30. The trace data 30 includes a type 31 and additional data 32. The type 31 indicates the type of event for which the trace data 30 is generated. The type 31 is, for example, loop entry, loop exit, loop pattern, other event notification, or the like. The loop entry and loop exit indicate the start and end of each loop.

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 trace data 30 generated by one execution of a loop is interval data. The section data is a set of trace data 30 from a loop pattern indicating the start of execution of a certain loop to immediately before the loop pattern indicating the start of execution of the next loop. Alternatively, the section data is a set of trace data 30 from a loop pattern indicating the start of execution of a certain loop to immediately before a loop exit indicating the end of the loop.

他事象通知は、上記以外の事象の発生を通知するトレースデータ30である。他事象通知は、例えば、routine entry/routine exit(一般関数コール開始/終了)、MPI entry/MPI exit(MPI関数コール開始/終了)、send(メッセージ送信)などがある。ここで、MPIは、Message Passing Interfaceを意味する。   Other event notification is trace data 30 for notifying the occurrence of an event other than the above. Other event notifications include, for example, routine entry / routine exit (general function call start / end), MPI entry / MPI exit (MPI function call start / end), send (message transmission), and the like. Here, MPI means Message Passing Interface.

付加データ32は、通知する事象に応じた詳細通知データである。loop entry、loop exit、loop patternの付加データ32は、ループの識別子などを包含する。他事象通知の付加データ32は、関数名やパラメータ値などを包含する。   The additional data 32 is detailed notification data corresponding to the event to be notified. The additional data 32 of loop entry, loop exit, and loop pattern includes a loop identifier and the like. The additional data 32 of other event notification includes a function name, a parameter value, and the like.

図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 trace processing program 24. The trace processing program 24 is a program (a right side in the figure) in which, for example, a trace function call is inserted into a program including a loop (a left side in the figure). When the trace function is executed by the processor 13, for example, the trace data 30 having the same type 31 as the function name is generated. For example, when the processor 13 executes the loop_entry function, the trace data 30 of the loop entry is generated. Note that the MPI entry, MPI exit, and send trace data 30 are generated by the MPI_send function.

図から明らかなように、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 program 24 and automatically inserts a trace function. The programmer may insert it manually.

付加データ32は、トレース関数のパラメータとして入力されても良いし、トレース関数内で生成されても良い。   The additional data 32 may be input as a parameter of the trace function, or may be generated in the trace function.

トレースデータ30は、トレース関数によらず、被トレース処理プログラム24が直接生成しても良い。例えば、コンパイラが被トレース処理プログラム24のソースプログラム(図中左側)をコンパイルするときにトレースデータ30を生成するための命令を、オブジェクトプログラムに挿入しても良い。   The trace data 30 may be directly generated by the trace processing program 24 regardless of the trace function. For example, an instruction for generating the trace data 30 may be inserted into the object program when the compiler compiles the source program (the left side in the figure) of the trace processing program 24.

図4は、トレース領域23の構成を示す図である。トレース領域23は、トレースバッファ40と、領域ポインタ41を包含する。トレースバッファ40はトレースデータ30を順次格納する。トレースバッファ40は、通常、循環バッファである。領域ポインタ41は、トレースバッファ40の空き領域の先頭アドレスを指す。初期値は、トレースバッファ40の先頭アドレスである。   FIG. 4 is a diagram showing the configuration of the trace area 23. The trace area 23 includes a trace buffer 40 and an area pointer 41. The trace buffer 40 stores the trace data 30 sequentially. The trace buffer 40 is usually a circular buffer. The area pointer 41 points to the start address of the empty area of the trace buffer 40. The initial value is the top address of the trace buffer 40.

解析部15は、トレースデータ30をトレースバッファ40に追記するときは、先ず、領域ポインタ41が指す領域以降にトレースデータ30を格納する。格納後、同部は当該追記データの直後のアドレス(満杯時は、トレースバッファ40の先頭アドレス)を領域ポインタ41に格納する。   When adding the trace data 30 to the trace buffer 40, the analysis unit 15 first stores the trace data 30 after the area indicated by the area pointer 41. After the storage, the same part stores the address immediately after the additional data (when it is full, the head address of the trace buffer 40) in the area pointer 41.

図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 level storage area 22. The loop management table 21 corresponding to each level includes an analysis buffer 50, a buffer pointer 51, a pattern table 52, and a table pointer 53.

解析バッファ50はトレースデータ30を順次格納する。解析バッファ50の初期値は例えばゼロである。バッファポインタ51は、解析バッファ50の空き領域の先頭アドレスを指す。バッファポインタ51の初期値は、解析バッファ50の先頭アドレスである。   The analysis buffer 50 stores the trace data 30 sequentially. The initial value of the analysis buffer 50 is, for example, zero. The buffer pointer 51 points to the start address of the free area of the analysis buffer 50. The initial value of the buffer pointer 51 is the start address of the analysis buffer 50.

解析部15は、トレースデータ30を解析バッファ50に追記するときは、バッファポインタ51が指す領域以降にトレースデータ30を格納して、格納後、当該追記データの直後のアドレスをバッファポインタ51に格納する。   When the analysis unit 15 adds the trace data 30 to the analysis buffer 50, the analysis unit 15 stores the trace data 30 after the area indicated by the buffer pointer 51, and stores the address immediately after the additional data in the buffer pointer 51 after the storage. To do.

パターン表52は、パターンID54とパターンデータ55を対応させて順次格納する。パターン表52の初期値は、例えば、ゼロである。パターンデータ55は区間データ、即ち、トレースデータ30の集合である。パターンデータ55はその他のデータを包含しても良い。表ポインタ53は、パターン表52の空き領域の先頭アドレスを指す。表ポインタ53の初期値は、パターン表52の先頭アドレスである。   The pattern table 52 sequentially stores the pattern ID 54 and the pattern data 55 in association with each other. The initial value of the pattern table 52 is, for example, zero. The pattern data 55 is section data, that is, a set of trace data 30. The pattern data 55 may include other data. The table pointer 53 points to the start address of the empty area of the pattern table 52. The initial value of the table pointer 53 is the start address of the pattern table 52.

解析部15は、パターンデータ55をパターン表52に追記するときは、表ポインタ53が指す領域以降にパターンデータ55を格納して、格納後、当該追記データの直後のアドレスを表ポインタ53に格納する。   When adding the pattern data 55 to the pattern table 52, the analysis unit 15 stores the pattern data 55 after the area indicated by the table pointer 53, and stores the address immediately after the additional data in the table pointer 53 after the storage. To do.

第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 first analysis buffer 61 and a first pattern table 62. The loop management table 21 corresponding to the second loop includes a second analysis buffer 63 and a second pattern table 64. Here, the first loop refers to the outermost loop, and is a loop whose loop nest level (value of the level storage area 22) is 1. The second loop refers to a loop nested within the first loop, and is a loop having a loop nesting level of 2.

なお、ある時点のレベル記憶域22の値(1以上)に対応するループ管理表21、解析バッファ50、パターン表52は、その時点に於けるカレントレベルのループ管理表21、解析バッファ50、パターン表52と呼ばれる。例えば、ある時点でレベル記憶域22の値が1であれば、その時点に於けるカレントレベルの解析バッファ50は、第1の解析バッファ61である。ある時点でレベル記憶域22の値が2であれば、その時点に於けるカレントレベルの解析バッファ50は、第2の解析バッファ63である。   The loop management table 21, the analysis buffer 50, and the pattern table 52 corresponding to the value (1 or more) of the level storage area 22 at a certain point in time are the loop management table 21, the analysis buffer 50, and the pattern at the current level. Called Table 52. For example, if the value of the level storage area 22 is 1 at a certain time, the analysis buffer 50 at the current level at that time is the first analysis buffer 61. If the value of the level storage area 22 is 2 at a certain time, the analysis buffer 50 at the current level at that time is the second analysis buffer 63.

図6は、解析部15の動作フローチャートである。まず、解析部15は、生成部14から入力したトレースデータ30の種別31を判定する(S1)。   FIG. 6 is an operation flowchart of the analysis unit 15. First, the analysis unit 15 determines the type 31 of the trace data 30 input from the generation unit 14 (S1).

種別31が他事象通知である場合、同部はループネストのレベル(レベル記憶域22の値)を判定する(S5)。レベルが0であれば(S5でY)、同部は、入力したトレースデータ30をトレースバッファ40に追記して(S6)動作を終了する。レベルが0でなければ(S5でN)、同部は、入力したトレースデータ30をカレントレベルの解析バッファ50に追記して(S9)動作を終了する。即ち解析部15は、入力したトレースデータ30を、生成部14がループ実行中であればカレントレベルの解析バッファ50に、生成部14がループ実行中でなければトレースバッファ40に追記する。   If the type 31 is other event notification, the same part determines the loop nest level (value of the level storage area 22) (S5). If the level is 0 (Y in S5), the same section adds the input trace data 30 to the trace buffer 40 (S6) and ends the operation. If the level is not 0 (N in S5), the same section adds the input trace data 30 to the analysis buffer 50 at the current level (S9) and ends the operation. That is, the analysis unit 15 appends the input trace data 30 to the analysis buffer 50 at the current level if the generation unit 14 is executing a loop, and to the trace buffer 40 if the generation unit 14 is not executing the loop.

種別31がループ開始である場合、解析部15は、入力したトレースデータ30を、生成部14がループ実行中であればカレントレベルの解析バッファ50に、生成部14がループ実行中でなければトレースバッファ40に追記する(S5、S6、S9)。その後、同部は、レベル記憶域22の値を1加算し、カレントレベルのループ管理表21を初期化する(S8)。ループ管理表21の初期化は、バッファポインタ51、表ポインタ53、解析バッファ50およびパターン表52の初期化を包含する。   When the type 31 is loop start, the analysis unit 15 traces the input trace data 30 to the analysis buffer 50 at the current level if the generation unit 14 is executing a loop, and traces the input trace data 30 if the generation unit 14 is not executing the loop. The information is added to the buffer 40 (S5, S6, S9). Thereafter, the same unit adds 1 to the value in the level storage area 22, and initializes the loop management table 21 at the current level (S8). The initialization of the loop management table 21 includes initialization of the buffer pointer 51, the table pointer 53, the analysis buffer 50, and the pattern table 52.

種別31がループ先頭実行である場合、解析部15はカレントレベルの解析バッファ50が空(初期状態)であるかを判定する(S2)。空でない場合(S2でN)、同部は同一パターン検出処理(図7参照)を実行する(S3)。空である場合(S2でY)、同部は同一パターン検出処理をスキップする。このスキップは、ループ開始に続く最初のループ先頭実行を示すトレースデータ30が入力された場合に発生する。その後、同部は、入力したトレースデータ30をカレントレベルの解析バッファ50に追記して(S4)動作を終了する。   When the type 31 is loop head execution, the analysis unit 15 determines whether or not the analysis buffer 50 at the current level is empty (initial state) (S2). If it is not empty (N in S2), the same part executes the same pattern detection process (see FIG. 7) (S3). If it is empty (Y in S2), the same part skips the same pattern detection process. This skip occurs when the trace data 30 indicating the first loop head execution following the start of the loop is input. Thereafter, the same section adds the input trace data 30 to the analysis buffer 50 at the current level (S4), and ends the operation.

種別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 type 31 is loop end, the analysis unit 15 executes the same pattern detection process (see FIG. 7), adds the input trace data 30 to the analysis buffer 50 at the current level, and subtracts 1 from the value in the level storage area 22. (SA, SB, SC). Thereafter, the same part determines the level of the loop nest (level storage area 22 value) (SD). If the level is 0 (Y in SD), the same part adds the contents of the first analysis buffer 50 to the trace buffer 40 (SE) and ends the operation. If the level is not 0 (N in SD), the same part adds the contents of the analysis buffer 50 of the original level to the analysis buffer 50 of the current level (SF) and ends the operation.

図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 analysis unit 15. If the pattern table 52 at the current level is empty (initial value) (Y in S11), the analysis unit 15 performs registration processing in the pattern table 52. The pattern table 52 at the current level is empty (initial value) when the trace data 30 indicating the second loop head execution is input after the start of the loop, that is, when the initial execution of the loop is completed. To do.

同部はパターンID54を生成してパターン表52に追記する(S12)。パターンID54は、例えば、入力したループ先頭実行を示すトレースデータ30が有する付加データ32内のループの識別子(処理中ループ識別子)にトレース採取装置10に一意の通し番号を付加して生成する。   The same part generates a pattern ID 54 and adds it to the pattern table 52 (S12). The pattern ID 54 is generated, for example, by adding a unique serial number to the trace collection device 10 to the loop identifier (processing loop identifier) in the additional data 32 included in the trace data 30 indicating the input loop head execution.

その後、同部は、最新区間開始データ以降のカレントレベルの解析バッファ50のトレースデータ30をパターン表52のパターンデータ55に追記する。最新区間開始データは、処理中ループ識別子と同じループ識別子を持つ最新(前回)のループ先頭実行を示すトレースデータ30である(S13)。即ち同部は、最新の区間データをパターン表52に追記する。最新の区間データはループの最新回の実行で生成された区間データである。このとき同部は、パターンデータ55に最新の区間データの終端を示すデータを付加して追記しても良い。例えば、同部は、パターンID54の直後に最新の区間データのサイズを追記しても良い。または、同部は、区間データの最後に、区切り符号(パターンデータ55として発生し得ない値など)を付加しても良い。   Thereafter, the same part adds the trace data 30 of the analysis buffer 50 at the current level after the latest section start data to the pattern data 55 of the pattern table 52. The latest section start data is trace data 30 indicating the latest (previous) loop head execution having the same loop identifier as the loop identifier being processed (S13). That is, the same part adds the latest section data to the pattern table 52. The latest section data is section data generated by the latest execution of the loop. At this time, the same part may additionally write data indicating the end of the latest section data to the pattern data 55. For example, the same part may add the size of the latest section data immediately after the pattern ID 54. Alternatively, the same part may add a delimiter (such as a value that cannot be generated as the pattern data 55) to the end of the section data.

同部は、カレントレベルの解析バッファ50の最新の区間開始データにパターンID54を付加して(S14)、同一パターン検出処理を終了する。パターンID54の付加は、例えば、付加データ32内のループの識別子を書き換えることで行う。   The same part adds the pattern ID 54 to the latest section start data of the analysis buffer 50 at the current level (S14), and ends the same pattern detection process. The addition of the pattern ID 54 is performed, for example, by rewriting the loop identifier in the additional data 32.

カレントレベルのパターン表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 analysis unit 15 determines whether the latest section data and the section data registered in the pattern table 52 match each other (S15). The same section sequentially acquires the section data registered in the pattern table 52, and sequentially compares each trace data 30 in the section data with each trace data 30 in the latest section data from the head, and the patterns all match. The section data registered in the table 52 (matching section data) is searched. At this time, the same part may compare all of the type 31 and the additional data 32 of the trace data 30 to be compared. The same unit may compare only type 31 or only part of type 31 and additional data 32 (for example, a specific parameter value).

一致区間データを発見できた場合(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 pattern ID 54 of the matching section data to the latest section start data of the analysis buffer 50 at the current level (S17). The pattern ID 54 indicates that the trace data 30 of the pattern with the pattern ID 54 has been generated. Next, the same part returns the value of the buffer pointer 51 to indicate the next address of the trace data 30 (S18), and ends the same pattern detection process. That is, the same unit discards (overwrites with subsequent data) data other than the latest section start data in the latest section data.

一致区間データを発見できない場合(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 trace data 30 generated when the processor 13 executes the example (1) of the trace processing program 24 shown in FIG. Assume that the variable N in the program is 2. Note that the serial number 33 shown in FIG. 8 is described for reference, and is not necessarily actually generated data. The same applies to the subsequent drawings, and the serial number 33 is not necessarily stored in the trace buffer 40 or the pattern table 52 in practice.

解析部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 analysis unit 15 adds the trace data 30 from t1 to t3 to the trace buffer 40. The same part initializes the loop management table 21 of level 1 at t3 and additionally writes the trace data 30 from t4 to t9 to the analysis buffer 50 of level 1. The same part adds the trace data 30 from t4 to t9 to the pattern table 52 as section data at t10. FIG. 9 is an example (1) of the pattern table 52 created by the analysis unit 15 by inputting the example (1) of the trace data 30 of FIG. The pattern ID 54 is obtained by adding P1 to the loop identifier (L1).

同部は、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 trace data 30 from t10 to t15 to the analysis buffer 50. At t16, the same part detects the coincidence between the latest section data (t10 to t15) and the section data (t4 to t9) registered in the pattern table 52. The same unit operates the buffer pointer 51 to discard the trace data 30 from t11 to t15. Finally, the same part adds the trace data 30 at t16 to the analysis buffer 50, adds the contents of the analysis buffer 50 to the trace buffer 40, and ends the process. FIG. 10 shows an example (1) of the trace buffer 40 created by the analysis unit 15 by inputting the example (1) of the trace data 30 of FIG.

図11は、被トレース処理プログラム24のソースコード例(2)を示す。図12は、プロセッサ13が図11に示した被トレース処理プログラム24の例(2)を実行した場合に生成するトレースデータ30の例(2)を示す。プログラム中の変数Nは3であるとする。   FIG. 11 shows a source code example (2) of the traced processing program 24. FIG. 12 shows an example (2) of the trace data 30 generated when the processor 13 executes the example (2) of the trace processing program 24 shown in FIG. Assume that the variable N in the program is 3.

解析部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 analysis unit 15 adds the trace data 30 of t1 to the trace buffer 40. The same unit initializes the loop management table 21 of level 1 at t1, and additionally writes the trace data 30 from t2 to t7 to the analysis buffer 50 of level 1. The same section adds the trace data 30 from t2 to t7 to the pattern table 52 as section data at t8. Further, the same unit stores t8 to t10 in the analysis buffer 50, and adds the trace data 30 from t8 to t10 to the pattern table 52 as section data at t11 and additionally writes it. FIG. 13 is an example (2) of the pattern table 52 created by the analysis unit 15 by inputting the example (2) of the trace data 30 of FIG. The pattern ID 54 is obtained by adding P1 and P2 to the loop identifier (L1).

同部は、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 trace data 30 from t11 to t13 to the analysis buffer 50. At t14, the same unit detects a match between the latest section data (t11 to t13) and the section data (t8 to t10) registered in the pattern table 52. The same unit operates the buffer pointer 51 to discard the trace data 30 at t12 and t13. Finally, the same part additionally writes the trace data 30 at t14, adds the contents of the analysis buffer 50 to the trace buffer 40, and ends the process. FIG. 14 shows an example (2) of the trace buffer 40 created by the analysis unit 15 by inputting the example (2) of the trace data 30 of FIG.

図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 program 24. FIG. 16 shows an example (3) of the trace data 30 generated when the processor 13 executes the example (3) of the trace processing program 24 shown in FIG. Assume that the variable N in the program is 3. FIG. 17 is an example (3) of the pattern table 52 created by the analysis unit 15 by inputting the example (3) of the trace data 30 of FIG. FIG. 18 shows an example (3) of the trace buffer 40 created by the analysis unit 15 by inputting the example (3) of the trace data 30 of FIG.

図19は、被トレース処理プログラム24のソースコード例(4)を示す。このプログラムは、ネストしたループを持つ。図20は、プロセッサ13が図19に示した被トレース処理プログラム24の例(4)を実行した場合に生成するトレースデータ30の例(4)を示す。プログラム中の変数M、Nは2であるとする。   FIG. 19 shows a source code example (4) of the traced program 24. This program has a nested loop. FIG. 20 shows an example (4) of the trace data 30 generated when the processor 13 executes the example (4) of the trace processing program 24 shown in FIG. It is assumed that variables M and N in the program are 2.

解析部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 analysis unit 15 adds the trace data 30 of t1 to the trace buffer 40. The same unit initializes the loop management table 21 of level 1 at t1, and additionally writes the trace data 30 of t2 and t3 to the analysis buffer 50 of level 1. The same part initializes the loop management table 21 of level 2 at t3 and adds the trace data 30 of t4 to t6 to the analysis buffer 50 of level 2. The same part adds the trace data 30 from t4 to t6 to the pattern table 52 of level 2 as section data at t7. FIG. 21 is an example (4-1) of the level 2 pattern table 52 created by the analysis unit 15 by inputting the example (4) of the trace data 30 of FIG. The pattern ID 54 is obtained by adding P1 to the loop identifier (L2).

同部は、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 trace data 30 from t7 to t9 to the analysis buffer 50. At t10, the same unit detects a match between the latest section data (t7 to t9) and the section data (t4 to t6) registered in the pattern table 52. The same unit operates the buffer pointer 51 to discard the trace data 30 at t8 and t9. Here, the same part adds the trace data 30 at t10 to the analysis buffer 50 of level 2, lowers the level (value of the level storage area 22) from 2 to 1, and changes the contents of the analysis buffer 50 of level 2 to level 1. To the analysis buffer 50. The data added here is the trace data 30 from t4 to t10. However, t8 and t9 are discarded.

同部は、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 level 1 analysis buffer 50 and adds the trace data 30 from t2 to t13 to the level 1 pattern table 52 as section data at t14. FIG. 22 is an example (4-2) of the level 1 pattern table 52 created by the analysis unit 15 by inputting the example (4) of the trace data 30 of FIG. The pattern ID 54 is obtained by adding P1 to the loop identifier (L1).

同部は、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 trace data 30 from t15 to t25. The same part finally adds the trace data 30 at t26, stores the contents of the analysis buffer 50 in the trace buffer 40, and ends the process. FIG. 23 shows an example (4) of the trace buffer 40 created by the analysis unit 15 by inputting the example (4) of the trace data 30 of FIG.

本実施形態のトレース採取装置10は、パターンが変化するループ実行中に、同じシーケンスのトレースデータ30が大量に出力されるのを防止しつつ、異なるシーケンスのトレースデータ30は取得できる。その理由は、解析部15が、新規のパターンをループ管理表21に登録し、登録済みパターンのトレースデータ30の少なくとも一部はトレース領域23に出力しないからである。   The trace collection apparatus 10 according to the present embodiment can acquire the trace data 30 of different sequences while preventing a large amount of the trace data 30 of the same sequence from being output in large quantities during execution of the loop in which the pattern changes. The reason is that the analysis unit 15 registers a new pattern in the loop management table 21, and at least a part of the trace data 30 of the registered pattern is not output to the trace area 23.

また、本実施形態のトレース採取装置10は、ループのネストが存在しても、上述の効果を奏する。その理由は、ループ管理表21をループネストのレベル対応に設け、解析部15がパターンの登録、検出をネストレベル対応に実行するからである。   Moreover, the trace collection device 10 of the present embodiment has the above-described effects even when there is a loop nest. The reason is that the loop management table 21 is provided corresponding to the level of the loop nest, and the analysis unit 15 executes pattern registration and detection corresponding to the nest level.

図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 trace collection device 10 and an external generation device 71 connected to the trace collection device 10. In the present embodiment, the trace collection device 10 may not include the generation unit 14. The trace data 30 is input from the external generation device 71 to the analysis unit 15. Other points are the same as in the first embodiment.

外部生成装置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 trace processing program 24 stored in the storage device.

本実施形態のトレース採取システム70は、当該装置外の被トレース処理のトレースデータ30を採取できる。その理由は、トレースデータ30は外部生成装置71から入力するからである。   The trace collection system 70 of this embodiment can collect the trace data 30 of the traced process outside the apparatus. This is because the trace data 30 is input from the external generation device 71.

図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 trace collection apparatus 10 according to the present invention includes a trace buffer 40 that sequentially stores trace data 30 generated by execution of a traced process, a first pattern table 62, and a memory 20 that stores a first analysis buffer 61. Is provided. The apparatus further includes an analysis unit 15 that inputs each trace data 30 (first interval data) generated by each execution of the first loop in the traced process. If the input data does not detect coincidence (pattern coincidence) with any of the first section data already stored in the first pattern table 62, the input section inputs the first Are added to the first pattern table 62 and the first analysis buffer 61. Further, when detecting the pattern match, the same unit does not store at least a part of the first section data in the first analysis buffer 61, and when detecting the end of the first loop, the contents of the first analysis buffer 61 are detected. Is output to the trace buffer 40.

図1は、本発明の第1の実施形態にかかるトレース採取装置10の構成図である。FIG. 1 is a configuration diagram of a trace collection apparatus 10 according to the first embodiment of the present invention. 図2はトレースデータ30の構成を示す。FIG. 2 shows the configuration of the trace data 30. 図3は、被トレース処理プログラム24のソースコード例(1)を示す。FIG. 3 shows a source code example (1) of the trace processing program 24. 図4は、トレース領域23の構成を示す図である。FIG. 4 is a diagram showing the configuration of the trace area 23. 図5は、ループ管理表21の構成を示す。FIG. 5 shows the configuration of the loop management table 21. 図6は、解析部15の動作フローチャートである。FIG. 6 is an operation flowchart of the analysis unit 15. 図7は、解析部15の同一パターン検出処理部分の動作フローチャートである。FIG. 7 is an operation flowchart of the same pattern detection processing portion of the analysis unit 15. 図8は、プロセッサ13が図3に示した被トレース処理プログラム24の例(1)を実行した場合に生成するトレースデータ30の例(1)を示す。FIG. 8 shows an example (1) of the trace data 30 generated when the processor 13 executes the example (1) of the trace processing program 24 shown in FIG. 図9は、解析部15が、図8のトレースデータ30の例(1)を入力して作成したパターン表52の例(1)である。FIG. 9 is an example (1) of the pattern table 52 created by the analysis unit 15 by inputting the example (1) of the trace data 30 of FIG. 図10は、解析部15が、図8のトレースデータ30の例(1)を入力して作成したトレースバッファ40の例(1)である。FIG. 10 shows an example (1) of the trace buffer 40 created by the analysis unit 15 by inputting the example (1) of the trace data 30 of FIG. 図11は、被トレース処理プログラム24のソースコード例(2)を示す。FIG. 11 shows a source code example (2) of the traced processing program 24. 図12は、プロセッサ13が図11に示した被トレース処理プログラム24の例(2)を実行した場合に生成するトレースデータ30の例(2)を示す。FIG. 12 shows an example (2) of the trace data 30 generated when the processor 13 executes the example (2) of the trace processing program 24 shown in FIG. 図13は、解析部15が、図12のトレースデータ30の例(2)を入力して作成したパターン表52の例(2)である。FIG. 13 is an example (2) of the pattern table 52 created by the analysis unit 15 by inputting the example (2) of the trace data 30 of FIG. 図14は、解析部15が、図12のトレースデータ30の例(2)を入力して作成したトレースバッファ40の例(2)である。FIG. 14 shows an example (2) of the trace buffer 40 created by the analysis unit 15 by inputting the example (2) of the trace data 30 of FIG. 図15は、被トレース処理プログラム24のソースコード例(3)を示す。FIG. 15 shows a source code example (3) of the traced program 24. 図16は、プロセッサ13が図15に示した被トレース処理プログラム24の例(3)を実行した場合に生成するトレースデータ30の例(3)を示す。FIG. 16 shows an example (3) of the trace data 30 generated when the processor 13 executes the example (3) of the trace processing program 24 shown in FIG. 図17は、解析部15が、図16のトレースデータ30の例(3)を入力して作成したパターン表52の例(3)である。FIG. 17 is an example (3) of the pattern table 52 created by the analysis unit 15 by inputting the example (3) of the trace data 30 of FIG. 図18は、解析部15が、図16のトレースデータ30の例(3)を入力して作成したトレースバッファ40の例(3)である。FIG. 18 shows an example (3) of the trace buffer 40 created by the analysis unit 15 by inputting the example (3) of the trace data 30 of FIG. 図19は、被トレース処理プログラム24のソースコード例(4)を示す。FIG. 19 shows a source code example (4) of the traced program 24. 図20は、プロセッサ13が図19に示した被トレース処理プログラム24の例(4)を実行した場合に生成するトレースデータ30の例(4)を示す。FIG. 20 shows an example (4) of the trace data 30 generated when the processor 13 executes the example (4) of the trace processing program 24 shown in FIG. 図21は、解析部15が、図20のトレースデータ30の例(4)を入力して作成したレベル2のパターン表52の例(4−1)である。FIG. 21 is an example (4-1) of the level 2 pattern table 52 created by the analysis unit 15 by inputting the example (4) of the trace data 30 of FIG. 図22は、解析部15が、図20のトレースデータ30の例(4)を入力して作成したレベル1のパターン表52の例(4−2)である。FIG. 22 is an example (4-2) of the level 1 pattern table 52 created by the analysis unit 15 by inputting the example (4) of the trace data 30 of FIG. 図23は、解析部15が、図19のトレースデータ30の例(4)を入力して作成したトレースバッファ40の例(4)である。FIG. 23 shows an example (4) of the trace buffer 40 created by the analysis unit 15 by inputting the example (4) of the trace data 30 of FIG. 図24は、本発明の第2の実施形態にかかるトレース採取システム70の構成を示す。FIG. 24 shows a configuration of a trace collection system 70 according to the second embodiment of the present invention. 図25は、本発明の基本的構成を示す。FIG. 25 shows the basic configuration of the present invention.

符号の説明Explanation of symbols

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 SYMBOLS 10 Trace collection device 11 Computer 12 Trace file 13 Processor 14 Generation part 15 Analysis part 16 Output part 20 Memory 21 Loop management table 22 Level storage area 23 Trace area 24 Trace program 25 Trace collection program 30 Trace data 31 Type 32 Additional data 33 Serial number 40 Trace buffer 41 Area pointer 50 Analysis buffer 51 Buffer pointer 52 Pattern table 53 Table pointer 54 Pattern ID
55 Pattern Data 61 First Analysis Buffer 62 First Pattern Table 63 Second Analysis Buffer 64 Second Pattern Table 70 Trace Collection System 71 External Generation Device

Claims (8)

被トレース処理の実行により生成されるトレースデータを順次格納するトレースバッファと、第1のパターン表と、第1の解析バッファを格納するメモリと、
前記被トレース処理内の第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のループの各回の実行の開始及び終了を検出する前記解析部を備える、請求項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のループの各回の実行の開始及び終了を検出する前記解析部を備える請求項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の解析バッファと、第2のパターン表と、第2の解析バッファを格納するメモリを備えたコンピュータに、
前記被トレース処理内の第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のループの開始および終了、並びに、前記第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の解析バッファと、第2のパターン表と、第2の解析バッファを格納するメモリを備えたコンピュータが、
前記被トレース処理内の第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.
JP2008243609A 2008-09-24 2008-09-24 Trace information acquisition device, trace information acquisition program, and trace information acquisition method Expired - Fee Related JP5024252B2 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

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