JP2003241998A - Control structure extraction method, log shaping method and program therefor - Google Patents
Control structure extraction method, log shaping method and program thereforInfo
- Publication number
- JP2003241998A JP2003241998A JP2002037407A JP2002037407A JP2003241998A JP 2003241998 A JP2003241998 A JP 2003241998A JP 2002037407 A JP2002037407 A JP 2002037407A JP 2002037407 A JP2002037407 A JP 2002037407A JP 2003241998 A JP2003241998 A JP 2003241998A
- Authority
- JP
- Japan
- Prior art keywords
- log
- shaping
- control structure
- loop
- extracting
- 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.)
- Pending
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
(57)【要約】
【課題】 ソースプログラム等の外部情報を利用せず
に、整形しようとするログ自身から制御構造を抽出し、
その情報を用いてログを整形可能な制御構造抽出方法を
提供し、そのような制御構造抽出方法を含む有用なログ
整形方法を提供する。
【解決手段】 実行トレース等のログ10に対して、そ
のログ10中に含まれる各要素間の繋がりを表現する有
向グラフを作成し(S201)、この有向グラフを強連
結成分に分解してループ構造21を抽出し(S20
2)、抽出された各ループ構造21からそのループ内部
に含まれる分岐構造22を抽出する(S203)。得ら
れたループ構造21や分岐構造22を利用してログを整
形し(S204)、「制御構造を反映した根付き木構
造」の整形ログ30を得る。整形ログ30中に、ループ
や再帰の実行パターンが同じ複数の部分がある場合に
は、それらを1つにまとめて根付き木構造を簡約化す
る。
(57) [Summary] [Problem] To extract a control structure from a log to be formatted itself without using external information such as a source program,
A control structure extraction method capable of shaping a log using the information is provided, and a useful log shaping method including such a control structure extraction method is provided. SOLUTION: For a log 10 such as an execution trace, a directed graph expressing connections between elements included in the log 10 is created (S201), and the directed graph is decomposed into strongly connected components to form a loop structure 21. Is extracted (S20
2) The branch structure 22 included in the extracted loop structure 21 is extracted from each extracted loop structure 21 (S203). The log is shaped using the obtained loop structure 21 and branch structure 22 (S204), and the shaped log 30 of "rooted tree structure reflecting the control structure" is obtained. When the shaping log 30 includes a plurality of portions having the same execution pattern of the loop and the recursion, the portions are combined into one to simplify the rooted tree structure.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、プログラムの実行
トレースなどのログを、そのログ中に含まれるループや
分岐等の制御構造を反映した根付き木構造に整形する方
法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method of shaping a log such as an execution trace of a program into a rooted tree structure that reflects a control structure such as a loop or a branch included in the log.
【0002】[0002]
【従来の技術】プログラムの実行の際、そのプログラム
がソースコード中のどの行を実行したかについての情報
を時系列的に記録したものは、「プログラムの実行トレ
ース」と呼ばれている。「プログラムの実行トレース」
は、システムログ等と同様に、監視された事象を時系列
的に記録したものであるという点で、「ログ」の一種と
考えることができる。2. Description of the Related Art When a program is executed, a time-series record of information about which line in the source code the program executed is called a "program execution trace". "Program Execution Trace"
Can be considered as a type of “log” in that the monitored events are recorded in time series, like the system log.
【0003】ここで、次の表1に示すソースプログラム
Pを、それぞれ最適化なし、最適化あり、の条件でコン
パイルして得られた実行プログラムから得られる実行ト
レースを考えた場合、例えば、表2、表3に示すような
実行トレースT1、T2が得られる。Considering the execution traces obtained from the execution programs obtained by compiling the source program P shown in the following Table 1 under the conditions without optimization and with optimization, for example, 2. The execution traces T1 and T2 as shown in Table 3 are obtained.
【表1】 [Table 1]
【表2】 [Table 2]
【表3】 [Table 3]
【0004】これらの実行トレースは、ソースプログラ
ム中の各所にプローブ(プログラム実行中の行番号をロ
グファイルに出力する機能を持つ付加プログラム)を挿
入する等の従来手法によって得ることができる。これら
の例からも分かるように、実行トレースは、そのままで
は内容を直観的に理解することが難しく、また、解析を
容易に行うこともできない。These execution traces can be obtained by a conventional method such as inserting probes (additional programs having a function of outputting the line numbers during program execution to a log file) at various places in the source program. As can be seen from these examples, it is difficult to intuitively understand the content of the execution trace as it is, and the analysis cannot be easily performed.
【0005】そこで、従来、プログラムの実行トレース
の内容を理解しやすく表現するための方法として、例え
ば、与えられた複数の実行トレースに対してトレースの
数だけ根を用意し、各トレースをそれぞれに対応する根
の子にすることによって、深さ1の根付き木構造をトレ
ースの数だけ生成する方法が存在している。Therefore, conventionally, as a method for expressing the contents of the execution trace of a program in an easy-to-understand manner, for example, roots are prepared for a plurality of given execution traces by the number of traces, and each trace is provided individually. There is a method of generating a rooted tree structure of depth 1 by the number of traces by making it the corresponding root child.
【0006】しかしながら、各トレースを深さ1の根付
き木構造で単純に表現しただけでは、各トレースの内容
が理解しにくい。そのため、実行プログラムを作る元と
なるソースプログラムを静的解析して、ループ構造や分
岐構造に含まれる行を抽出し、これらの情報を用いて、
実行トレースを、制御構造を反映した形に整形する方法
が存在している。図19は、この方法の概要をデータの
流れに沿って示すフローチャートである。However, it is difficult to understand the contents of each trace by simply expressing each trace with a rooted tree structure of depth 1. Therefore, the source program, which is the source of the execution program, is statically analyzed, the lines included in the loop structure and the branch structure are extracted, and using this information,
There is a method of shaping the execution trace into a form that reflects the control structure. FIG. 19 is a flowchart showing the outline of this method along the data flow.
【0007】この方法では、ログ110である実行トレ
ースに対して、実行プログラムを作る元となるソースプ
ログラムのソースコード120から、制御構造を抽出す
る(S1901)。そして、得られた制御構造情報13
0とログである実行トレースとを照らし合わせて、実行
トレース中のどの部分がループ構造、分岐構造などの制
御構造に相当するかを判断し、その判断結果に基づいて
トレースを「制御構造を反映した根付き木構造」に整形
し(S1902)、整形ログ140を得る。ここで、
「制御構造を反映した根付き木構造」とは、ログの先頭
を根とし、ログ中に含まれるループ構造、分岐構造など
の制御構造を分節節点とする根付き木構造の形をとった
ログを意味する。In this method, a control structure is extracted from the source code 120 of the source program that is the source of the execution program for the execution trace which is the log 110 (S1901). Then, the obtained control structure information 13
By comparing 0 and the execution trace that is a log, it is determined which part in the execution trace corresponds to the control structure such as loop structure, branch structure, etc. To the "rooted tree structure" (S1902), and the shaping log 140 is obtained. here,
"Rooted tree structure that reflects the control structure" means a log with the root of the log and the rooted tree structure with the control structure such as loop structure and branch structure included in the log as the node nodes. To do.
【0008】例えば、表1に示すソースプログラムPを
静的解析すれば、3行目から7行目、および、8行目か
ら13行目がforループに対応し、また、12行目、
13行目はif文に対応することがわかる。このソース
プログラムPからはまた、forループの初期化部、条
件判定部、繰り返し部、および、ループ本体に対応する
行、等も知ることができる。For example, when the source program P shown in Table 1 is statically analyzed, the 3rd to 7th lines and the 8th to 13th lines correspond to the for loop, and the 12th line,
It can be seen that the 13th line corresponds to the if sentence. From the source program P, the initialization part of the for loop, the condition determination part, the repeat part, the line corresponding to the loop body, and the like can be known.
【0009】そこで、これらの情報を用いて、表2に示
す実行トレースT1を整形すると、図20に示すような
根付き木構造が得られる。このように整形された実行ト
レースは、可読性が高く、また、機械的な解析も容易に
行うことができる。Then, by shaping the execution trace T1 shown in Table 2 using these pieces of information, a rooted tree structure as shown in FIG. 20 is obtained. The execution trace shaped in this way has high readability, and mechanical analysis can be easily performed.
【0010】[0010]
【発明が解決しようとする課題】しかしながら、上記の
ように、ソースプログラムの静的解析により制御構造を
抽出してトレースを整形する従来方法には、次のような
問題点がある。However, as described above, the conventional method of extracting the control structure by the static analysis of the source program and shaping the trace has the following problems.
【0011】まず、表3に示す実行トレースT2のよう
に、最適化された実行プログラムから出力されたトレー
スにおいては、ソースプログラムから得られる情報と、
トレースが示す流れとの対応が一意に定まらない場合が
ある。このような場合に、上記の従来方法では、整形に
利用する制御構造を抽出することができない。また、ソ
ースプログラム自体が入手できない場合にも、制御構造
を抽出することができない。First, in the trace output from the optimized execution program like the execution trace T2 shown in Table 3, information obtained from the source program,
The correspondence with the flow indicated by the trace may not be uniquely determined. In such a case, the above conventional method cannot extract the control structure used for shaping. Moreover, even if the source program itself is not available, the control structure cannot be extracted.
【0012】さらに、割込みや例外処理等、ソースプロ
グラムからは前もって流れの予想がつかないプログラム
の実行トレースや、実行中の変数値等の動的情報を含む
トレースなどについても、制御構造を抽出することがで
きない。一方、システムログや通信ログ等の、プログラ
ムの実行トレース以外のログについても、制御構造を抽
出することができない。Further, the control structure is extracted for the execution trace of the program whose flow cannot be predicted in advance from the source program such as interrupt and exception processing, and the trace including dynamic information such as variable values being executed. I can't. On the other hand, the control structure cannot be extracted from logs other than the program execution trace, such as the system log and the communication log.
【0013】このように、整形しようとするトレースや
その他のログに対して制御構造を抽出することができな
いと、上記の従来方法では、そのログを「制御構造を反
映した根付き木構造」に整形することができない。As described above, if the control structure cannot be extracted from the trace or other log to be shaped, the above-mentioned conventional method shapes the log into a "rooted tree structure reflecting the control structure". Can not do it.
【0014】また、上記の従来方法では、再帰関数を含
むプログラムの実行トレースの場合に、再帰構造を抽出
し、再帰構造を反映した理解しやすい根付き木構造に整
形するようにした例はない。さらに、ログの構造が複雑
な場合には、たとえ制御構造を反映して整形したとして
も、整形されたログの内容が理解しにくくなりがちであ
る。Further, in the above-mentioned conventional method, in the case of execution trace of a program including a recursive function, there is no example in which the recursive structure is extracted and shaped into an easy-to-understand rooted tree structure reflecting the recursive structure. Furthermore, when the log structure is complicated, even if the log is shaped by reflecting the control structure, the contents of the shaped log tend to be difficult to understand.
【0015】本発明は、上記した従来の問題点を解消す
るためになされたものであり、その目的は、ソースプロ
グラム等の外部情報を利用せずに、整形しようとするロ
グ自身から制御構造を抽出し、その情報を用いてログを
整形可能な制御構造抽出方法を提供すると共に、そのよ
うな制御構造抽出方法を含む有用なログ整形方法を提供
することである。The present invention has been made in order to solve the above-mentioned conventional problems, and an object thereof is to control a control structure from the log itself to be shaped without using external information such as a source program. An object of the present invention is to provide a control structure extraction method capable of extracting and shaping a log using the information, and to provide a useful log shaping method including such a control structure extraction method.
【0016】また、本発明の別の目的は、ログの再帰構
造を抽出し、再帰構造を反映した根付き木構造にログを
整形可能なログ整形方法を提供することである。そして
また、本発明の別の目的は、複雑な構造を有するログを
簡約化して、ログの内容を理解しやすくし、ログのサイ
ズを小さくすることが可能なログ整形方法を提供するこ
とである。Another object of the present invention is to provide a log shaping method capable of extracting a recursive structure of a log and shaping the log into a rooted tree structure reflecting the recursive structure. Further, another object of the present invention is to provide a log shaping method capable of simplifying a log having a complicated structure, making the contents of the log easy to understand, and reducing the size of the log. .
【0017】[0017]
【課題を解決するための手段】上記目的を達成するため
に、本発明は、ログに含まれる各要素間の繋がりをグラ
フ化して制御構造を抽出することにより、ソースプログ
ラム等の外部情報を利用せずに、整形しようとするログ
自身から制御構造を抽出し、その情報を用いてログを整
形できるようにしたものである。In order to achieve the above object, the present invention utilizes external information such as a source program by extracting a control structure by graphing the connection between each element included in a log. Instead, the control structure is extracted from the log itself to be shaped, and the information can be used to shape the log.
【0018】なお、本発明において重要な用語の定義は
次の通りである。「ログ」は、監視された事象を時系列
的に記録したものであり、システムログや通信ログ、プ
ログラムの実行トレース等を含む広い概念である。「制
御構造を反映した根付き木構造」は、前述した通り、ロ
グの先頭を根とし、ログ中に含まれるループ構造、分岐
構造などの制御構造を分節節点とする根付き木構造の形
をとったログを意味する。Definitions of important terms in the present invention are as follows. The “log” is a record of monitored events in time series, and is a broad concept including a system log, a communication log, a program execution trace, and the like. As described above, the "rooted tree structure that reflects the control structure" has the form of a rooted tree structure in which the root of the log is the root and control structures such as loop structures and branch structures included in the log are the node nodes. Means log.
【0019】請求項1の発明は、ログ中に含まれる制御
構造を、コンピュータを利用して抽出する制御構造抽出
方法において、格納部に格納されたログ中に含まれる各
要素間の繋がりを表現する有向グラフを作成するグラフ
作成ステップと、作成された有向グラフから制御構造を
抽出する制御構造抽出ステップと、を含むことを特徴と
している。請求項2の発明は、請求項1の制御構造抽出
方法において、制御構造抽出ステップが、作成された有
向グラフを強連結成分に分解してループ構造を抽出する
ループ構造抽出ステップと、抽出された各ループ構造か
らそのループ内部に含まれる分岐構造を抽出する分岐構
造抽出ステップとを含む、ことを特徴としている。According to a first aspect of the present invention, in a control structure extracting method for extracting a control structure contained in a log by using a computer, a connection between respective elements contained in the log stored in the storage unit is expressed. And a control structure extracting step of extracting a control structure from the created directed graph. According to the invention of claim 2, in the control structure extracting method according to claim 1, the control structure extracting step comprises: a loop structure extracting step of decomposing the created directed graph into strongly connected components to extract a loop structure; A branch structure extracting step of extracting a branch structure included in the loop structure from the loop structure.
【0020】請求項3の発明は、ログを、コンピュータ
を利用してそのログ中に含まれる制御構造を反映した根
付き木構造に整形するログ整形方法において、請求項1
の発明におけるグラフ作成ステップと制御構造抽出ステ
ップに加えて、抽出された制御構造を利用してログを整
形する整形ステップを含むことを特徴としている。請求
項4の発明は、請求項3のログ整形方法において、制御
構造抽出ステップが、請求項2の発明におけるループ構
造抽出ステップと分岐構造抽出ステップを含むことを特
徴としている。A third aspect of the present invention is a log shaping method for shaping a log into a rooted tree structure that reflects a control structure included in the log by using a computer.
In addition to the graph creating step and the control structure extracting step in the invention described in (1), it is characterized by including a shaping step for shaping the log using the extracted control structure. The invention of claim 4 is characterized in that, in the log shaping method of claim 3, the control structure extracting step includes the loop structure extracting step and the branch structure extracting step in the invention of claim 2.
【0021】請求項9の発明は、請求項3の発明をプロ
グラムの観点から把握したものであり、ログを、コンピ
ュータを利用してそのログ中に含まれる制御構造を反映
した根付き木構造に整形するためのプログラムにおい
て、請求項3の発明における各ステップに対応するグラ
フ作成機能、制御構造抽出機能、および整形機能、をコ
ンピュータに実現させることを特徴としている。A ninth aspect of the present invention is to grasp the third aspect of the invention from the viewpoint of a program, and shapes a log into a rooted tree structure that reflects a control structure included in the log using a computer. In the program for doing so, the computer is made to realize the graph creating function, the control structure extracting function, and the shaping function corresponding to each step in the invention of claim 3.
【0022】以上のような特徴によれば、プログラムの
実行トレース等のログに対し、そのログに含まれる各要
素間の繋がりを表現する有向グラフを作成し、この有向
グラフから強連結成分分解等によってループ構造や分岐
構造等の制御構造を容易に抽出することができる。した
がって、ソースプログラム等の外部情報を利用せずに、
整形しようとするログ自身から制御構造を抽出し、その
情報を用いてログを整形することができる。そのため、
ソースプログラムから得られる情報との対応が一意に定
まらない実行トレース、ソースプログラムが入手できな
い実行トレース、流れの予想がつかないかあるいは動的
情報を含む実行トレース、さらには実行トレース以外の
システムログや通信ログ等についても、制御構造を抽出
してログを整形することができる。According to the above-mentioned features, a directed graph is created for the log such as the execution trace of the program, which expresses the connections between the elements included in the log, and a loop is formed from this directed graph by decomposition of strongly connected components. A control structure such as a structure or a branch structure can be easily extracted. Therefore, without using external information such as source programs,
The control structure can be extracted from the log itself to be shaped, and the information can be used to shape the log. for that reason,
Execution traces that do not have a unique correspondence with the information obtained from the source program, execution traces that cannot be obtained by the source program, execution traces whose flow cannot be predicted or contain dynamic information, and system logs other than execution traces. Also for the communication log and the like, the control structure can be extracted to shape the log.
【0023】請求項5の発明は、請求項3または請求項
4のログ整形方法において、整形されたログを、そのロ
グのソースプログラムの情報を利用して再整形する再整
形ステップ、を含むことを特徴としている。この特徴に
よれば、ログのみを用いて得られた情報によりログを整
形した後、ソースプログラムから得られる付加情報が入
手できる場合に、ソースプログラムの情報を利用してロ
グを再整形することができる。The invention according to claim 5 is the log shaping method according to claim 3 or 4, further comprising a re-shaping step of re-shaping the shaped log by using information of a source program of the log. Is characterized by. According to this feature, the log can be reformatted by using the information of the source program when the additional information obtained from the source program can be obtained after the log is formatted by the information obtained by using only the log. it can.
【0024】請求項6の発明は、制御構造を反映した根
付き木構造に整形されたログを、コンピュータを利用し
て再整形するログ整形方法において、格納部に格納され
たログ中に含まれる関数間の呼び出し関係を表現する有
向グラフを作成するグラフ作成ステップと、作成された
有向グラフから再帰構造を抽出する再帰構造抽出ステッ
プと、抽出された再帰構造を利用してログを整形する整
形ステップと、を含むことを特徴としている。この特徴
によれば、ログが再帰構造を含む場合には、その再帰構
造を抽出し、その情報を用いてログを整形することがで
きるため、再帰構造を反映した理解しやすい根付き木構
造に整形することができる。また、請求項3〜5に記載
のログ整形方法によりループ構造や分岐構造などの制御
構造を利用してログを整形した後に、再帰構造を利用し
て再整形することもできる。According to a sixth aspect of the present invention, in a log shaping method for reforming a log shaped into a rooted tree structure that reflects a control structure using a computer, a function included in the log stored in the storage unit. A graph creating step for creating a directed graph that expresses a calling relationship between the two, a recursive structure extracting step for extracting a recursive structure from the created directed graph, and a shaping step for shaping a log using the extracted recursive structure. It is characterized by including. According to this feature, when a log contains a recursive structure, the recursive structure can be extracted and the information can be used to shape the log, so that the rooted tree structure that reflects the recursive structure is easy to understand. can do. In addition, after the log is shaped by using the control structure such as the loop structure or the branch structure by the log shaping method according to the third to fifth aspects, the log can be reformed by using the recursive structure.
【0025】請求項7の発明は、制御構造を反映した根
付き木構造に整形されたログを、コンピュータを利用し
て再整形するログ整形方法において、格納部に格納され
たログのソースプログラムの情報を利用して再帰構造を
抽出する再帰構造抽出ステップと、抽出された再帰構造
を利用してログを整形する整形ステップと、を含むこと
を特徴としている。この特徴によれば、ログが再帰構造
を含む際に、そのソースプログラムの情報が得られる場
合には、そのソースプログラムから再帰構造を抽出し、
その情報を用いてログを整形することができるため、再
帰構造を反映した理解しやすい根付き木構造に整形する
ことができる。また、請求項3〜5に記載のログ整形方
法によりループ構造や分岐構造などの制御構造を利用し
てログを整形した後に、再帰構造を利用して再整形する
こともできる。According to a seventh aspect of the present invention, in a log shaping method for reshaping a log shaped into a rooted tree structure that reflects a control structure using a computer, information on the source program of the log stored in the storage unit is used. It is characterized by including a recursive structure extraction step for extracting a recursive structure by using and a shaping step for shaping a log by using the extracted recursive structure. According to this feature, when the log includes a recursive structure, if the information of the source program is obtained, the recursive structure is extracted from the source program,
Since the log can be shaped using that information, it can be shaped into an easily understood rooted tree structure that reflects the recursive structure. In addition, after the log is shaped by using the control structure such as the loop structure or the branch structure by the log shaping method according to the third to fifth aspects, the log can be reformed by using the recursive structure.
【0026】請求項8の発明は、制御構造を反映した根
付き木構造に整形されたログを、コンピュータを利用し
て再整形するログ整形方法において、格納部に格納され
たログ中に含まれるループ構造または再帰構造の実行パ
ターンを抽出して実行パターンが同じ複数の部分がある
か否かを判定するパターン判定ステップと、実行パター
ンが同じ複数の部分がある場合にそれらの複数の部分を
1つにまとめることにより根付き木構造を簡約化する簡
約化ステップと、を含むことを特徴としている。この特
徴によれば、整形されたログ中に、ループや再帰の実行
パターンが同じ複数の部分がある場合に、それらを抽出
して1つにまとめることにより、根付き木構造を簡約化
できるため、ログの内容を理解しやすくし、ログのサイ
ズを小さくすることができる。According to an eighth aspect of the present invention, in a log shaping method for reforming a log shaped into a rooted tree structure that reflects a control structure using a computer, a loop included in the log stored in the storage unit. A pattern determining step for extracting an execution pattern of a structure or a recursive structure to determine whether or not there are a plurality of parts having the same execution pattern, and if there are a plurality of parts having the same execution pattern, one of those parts It is characterized by including a reduction step for reducing the rooted tree structure by merging into. According to this feature, when there are multiple parts with the same loop or recursion execution pattern in the formatted log, it is possible to simplify the rooted tree structure by extracting them and combining them into one. You can make the contents of the log easier to understand and reduce the size of the log.
【0027】[0027]
【発明の実施の形態】以下には、本発明の実施形態を図
面に沿って具体的に説明する。ただし、ここで記載する
実施形態は、本発明を何ら限定するものではなく、本発
明の一態様を例示するものにすぎない。BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be specifically described below with reference to the drawings. However, the embodiments described here do not limit the present invention at all, but merely exemplify one aspect of the present invention.
【0028】本発明は、典型的には、コンピュータをソ
フトウェアで制御することにより実現される。この場合
のソフトウェアは、コンピュータのハードウェアを物理
的に活用することで本発明の作用効果を実現するもので
あり、また、従来技術を適用可能な部分には好適な従来
技術が適用される。さらに、本発明を実現するハードウ
ェアやソフトウェアの具体的な種類や構成、ソフトウェ
アで処理する範囲などは自由に変更可能であり、例え
ば、本発明を実現するプログラムは本発明の一態様であ
る。The present invention is typically implemented by controlling a computer with software. The software in this case realizes the operation and effect of the present invention by physically utilizing the hardware of the computer, and suitable conventional techniques are applied to the portions to which the conventional techniques can be applied. Furthermore, the specific types and configurations of hardware and software that implement the present invention, the range of processing by software, and the like can be freely changed. For example, a program that implements the present invention is one aspect of the present invention.
【0029】[1.ログ整形方法の概要]図1は、本発
明を適用したログ整形方法の概要をデータの流れに沿っ
て示すフローチャートである。この図1に示すように、
本実施形態に係る方法では、実行トレース等のログ10
のみを使用して、そのログ10中に含まれるループ構
造、分岐構造等の制御構造を抽出する(S101)。そ
して、得られた制御構造情報20を用いてログ10を
「制御構造を反映した根付き木構造」に整形し(S10
2)、整形ログ30を得る。さらに、整形ログ30中
に、ループや再帰の実行パターンが同じ複数の部分があ
る場合には、それらを1つにまとめて根付き木構造を簡
約化し(S103)、簡約ログ40を得る。なお、ログ
10、制御構造情報20、整形ログ30、簡約ログ40
等のデータは、コンピュータを構成するメモリ等の格納
部に格納され、使用時に格納部から抽出される。[1. Outline of Log Shaping Method] FIG. 1 is a flowchart showing an outline of a log shaping method to which the present invention is applied along a data flow. As shown in this FIG.
In the method according to the present embodiment, the log 10 such as execution trace
The control structure such as the loop structure and the branch structure included in the log 10 is extracted by using only this (S101). Then, using the obtained control structure information 20, the log 10 is shaped into a "rooted tree structure reflecting the control structure" (S10
2) Obtain the shaping log 30. Furthermore, when there are a plurality of portions having the same loop or recursion execution pattern in the shaping log 30, these are combined into one to reduce the rooted tree structure (S103), and the reduction log 40 is obtained. Note that the log 10, the control structure information 20, the shaping log 30, the reduction log 40
Data such as is stored in a storage unit such as a memory that constitutes a computer, and is extracted from the storage unit when used.
【0030】図2は、制御構造を抽出し、ログを「制御
構造を反映した根付き木構造」に整形するための制御構
造抽出・ログ整形処理の流れをデータの流れと共に示す
フローチャートである。この図2に示すように、実行ト
レース等のログ10に対して、そのログ10中に含まれ
る各要素間の繋がりを表現する有向グラフを作成し(S
201)、この有向グラフを強連結成分に分解してルー
プ構造21を抽出し(S202)、抽出された各ループ
構造21からそのループ内部に含まれる分岐構造22を
抽出する(S203)。そして、得られたループ構造2
1や分岐構造22を利用してログを整形し(S20
4)、「制御構造を反映した根付き木構造」の整形ログ
30を得る。FIG. 2 is a flowchart showing the flow of control structure extraction / log shaping processing for extracting a control structure and shaping the log into a "rooted tree structure reflecting the control structure" together with the data flow. As shown in FIG. 2, for the log 10 such as the execution trace, a directed graph expressing the connection between the elements included in the log 10 is created (S
201), the directed graph is decomposed into strongly connected components to extract the loop structure 21 (S202), and the branch structure 22 included in the loop is extracted from each extracted loop structure 21 (S203). And the obtained loop structure 2
Format the log using 1 or the branch structure 22 (S20
4), The shaping log 30 of "a rooted tree structure reflecting the control structure" is obtained.
【0031】[2.制御構造抽出・ログ整形処理]以下
には、プログラムを一回以上実行して得られる単一また
は複数の実行トレースを対象として図2の制御構造抽出
・ログ整形処理を行う場合について具体的に説明する。[2. Control Structure Extraction / Log Shaping Processing] The following specifically describes a case where the control structure extraction / log shaping processing of FIG. 2 is performed for a single or a plurality of execution traces obtained by executing the program once or more. To do.
【0032】まず、整形しようとする実行トレースに含
まれる各要素間の繋がりを表現する有向グラフを作成す
る(S201)。この有向グラフは、トレース中に現れ
る各要素に対応する節点を持ち、トレース中の要素Aに
続いて、要素Bが現れるならば、A→Bというエッジを
持つように構成される。例えば、前記表3のトレースT
2に対応する有向グラフは、図3のようになる。First, a directed graph is created which represents the connections between the elements included in the execution trace to be shaped (S201). This directed graph has nodes corresponding to the respective elements appearing in the trace, and if an element B appears after the element A in the trace, it has an edge of A → B. For example, the trace T in Table 3 above
The directed graph corresponding to 2 is as shown in FIG.
【0033】次に、作成された有向グラフに対して、強
連結成分分解を適用する。そして、要素として含まれる
節点数が2以上の強連結成分、または要素数は1である
がその要素となる節点が自分自身に向かうエッジを持つ
ような強連結成分をループ構造であるとみなすことによ
り、ループ構造を抽出する(S202)。例えば、図3
に示す有向グラフを強連結成分分解すると、図4に示す
ように、5つの強連結成分a,b,c,d,e、が得ら
れる。このうち、成分dのみが2つ以上の接点要素とし
て持つので、この成分に含まれる5つの節点4,5,
7,12,13、がループを構成することがわかる。Next, the strongly connected component decomposition is applied to the created directed graph. Then, consider a strongly connected component with two or more nodes included as an element, or a strongly connected component with one element but the node that is an element has an edge toward itself as a loop structure. Thus, the loop structure is extracted (S202). For example, in FIG.
When the strongly connected component is decomposed into the directed graph shown in FIG. 5, five strongly connected components a, b, c, d and e are obtained as shown in FIG. Of these, only the component d has two or more contact elements, so the five nodes 4, 5 included in this component are included.
It can be seen that 7, 12, 13 form a loop.
【0034】また、多重ループを抽出するためには、次
のような処理を行えばよい。すなわち、上記のループ構
造抽出処理で得られたループに対応する強連結成分p内
の節点xに対して、p外の節点yから向かうエッジが存
在すれば、その節点xをループの入口とみなし、節点x
に向かうエッジを全て切断する。続いて、ループp内の
有向グラフに対して、再度、強連結成分分解を行う。そ
して、上記のループ構造抽出処理と同様に、節点数が2
以上の強連結成分、または、要素数は1であるがその要
素となる節点が自分自身に向かうエッジを持つ強連結成
分を、ループpの内部に含まれるループであるとみなす
ことにより、ループ構造を抽出する。以上の操作を繰り
返すことにより、多重ループを抽出することができる。In order to extract multiple loops, the following processing may be performed. That is, if there is an edge from the node y outside the p to the node x in the strongly connected component p corresponding to the loop obtained by the loop structure extraction processing, the node x is regarded as the entrance of the loop. , Node x
Cut all edges towards. Then, the strongly connected component decomposition is performed again on the directed graph in the loop p. Then, as in the above loop structure extraction processing, the number of nodes is 2
The above strongly connected component, or the strongly connected component in which the number of elements is 1 but the node that becomes an element has an edge toward itself, is regarded as a loop included in the loop p, and thus the loop structure is obtained. To extract. By repeating the above operation, multiple loops can be extracted.
【0035】図4の例では、ループdの節点4には、強
連結成分cの節点3からのエッジが存在するため、節点
4がループdの入口であることがわかる。そこで、節点
4に向かうエッジを全て切断した後、ループdを強連結
成分分解すれば、ループdの全ての節点が単独でそれぞ
れ強連結成分を構成する形となる。したがって、ループ
dの内部にはループは含まれないことがわかる。In the example of FIG. 4, since the edge from the node 3 of the strongly connected component c exists at the node 4 of the loop d, it can be seen that the node 4 is the entrance of the loop d. Therefore, if all the edges toward the node 4 are cut, and then the loop d is decomposed into the strongly connected components, all the nodes of the loop d independently form the strongly connected components. Therefore, it can be seen that the loop is not included inside the loop d.
【0036】続いて、抽出された各ループ構造に対し
て、ループ内部に含まれる分岐構造を抽出する(S20
3)。具体的には、例えば、次のような処理を行う。ま
ず、ループ内部の節点からループ外の節点に向かうエッ
ジを全て切断する。また、ループ先頭の節点(複数ある
場合には1つを選択する)に向かうエッジも全て切断す
る。次に、ループ先頭の節点から順に、エッジの向かう
先の節点を調べ、2本以上のエッジが存在する節点を分
岐の開始点と解釈すると共に、分岐したエッジ全てが合
流する節点を検出し、分岐の開始節点と合流節点の間に
挟まれる節点を分岐構造として抽出する。なお、抽出さ
れた分岐構造に対して、再び同様にしてその内部に含ま
れる分岐構造を抽出することも可能である。Then, for each extracted loop structure, a branch structure included in the loop is extracted (S20).
3). Specifically, for example, the following processing is performed. First, all the edges from the nodes inside the loop to the nodes outside the loop are cut. Also, all edges toward the node at the beginning of the loop (select one if there are multiple) are cut off. Next, in order from the node at the beginning of the loop, the nodes to which the edges are directed are examined, the node at which two or more edges exist is interpreted as the start point of the branch, and the node at which all the branched edges join is detected. The node sandwiched between the start node and the junction node of the branch is extracted as a branch structure. It is also possible to extract the branch structure contained in the extracted branch structure in the same manner.
【0037】図5は、図4のループdの例で分岐構造を
抽出するためにエッジを切断した後のグラフを示してい
る。この図5において、ループdの入口4から順に節点
を辿っていくと、節点12が分岐開始点であることがわ
かる。ここで分岐したエッジは最終的に節点5で合流し
ている。したがって、節点12と節点5の間に挟まれる
節点13が単独で分岐構造を構成していることになる。
ただし、この例の場合には、分岐開始点12から合流点
5に直接向かうエッジがあるので、「分岐後何もしな
い」という節点nullを分岐構造に追加してもよい。FIG. 5 shows a graph after the edges are cut to extract the branch structure in the example of the loop d in FIG. In FIG. 5, when the nodes are sequentially traced from the entrance 4 of the loop d, it can be seen that the node 12 is the branch start point. The edges branched here finally merge at node 5. Therefore, the node 13 sandwiched between the node 12 and the node 5 independently constitutes a branched structure.
However, in the case of this example, since there is an edge that directly goes from the branch start point 12 to the confluence point 5, a node null "do nothing after branch" may be added to the branch structure.
【0038】最後に、以上のようにして得られたループ
構造や分岐構造の情報を用いて、与えられた単一または
複数のトレースを整形することにより、制御構造を反映
した根付き木構造を持つトレースを得る(S204)。
具体的には、与えられたトレースを先頭から順に調べ、
ループ構造または分岐構造に相当する要素が現れた場合
にその構造に対応する分節節点をトレース中に挿入し、
現れた要素に続く要素を分節節点の子に割り当てる、と
いう処理を行う。なお、この整形手法は、ソースプログ
ラムから制御構造の情報を抽出して整形を行う従来技術
の整形手法と同様である。Finally, by using the information of the loop structure and the branch structure obtained as described above, a given single or a plurality of traces are shaped to have a rooted tree structure reflecting the control structure. A trace is obtained (S204).
Specifically, check the given trace in order from the beginning,
When an element corresponding to a loop structure or a branch structure appears, insert the segment node corresponding to that structure in the trace,
Performs the process of assigning the element that follows the appearing element to the child of the segment node. Note that this shaping method is the same as the shaping method of the related art in which control structure information is extracted from the source program and shaped.
【0039】表3のトレースT2については、図4に示
すように、節点4,5,7,12,13がループ構造を
持ち、図5に示すように、節点13,nullがそのル
ープ内に含まれる分岐構造を持つ、という情報を使用し
て整形を行うことになる。図6は、そのようにして行っ
たトレースT2の整形結果を示している。また、図7
は、表2のトレースT1について、同様の制御構造抽出
・ログ整形処理を行った場合の整形結果を示している。Regarding the trace T2 in Table 3, as shown in FIG. 4, the nodes 4, 5, 7, 12, 13 have a loop structure, and as shown in FIG. 5, the nodes 13, null are in the loop. Formatting will be performed using the information that the branch structure is included. FIG. 6 shows the result of shaping the trace T2 thus performed. Also, FIG.
Shows the shaping result when the same control structure extraction / log shaping processing is performed on the trace T1 in Table 2.
【0040】このように、図2に示すような制御構造抽
出・ログ整形処理を行うことにより、ソースプログラム
から得られる情報を利用せずに、トレース自身の情報の
みを利用してループ構造や分岐構造などの制御構造を抽
出し、トレースを整形することができる。そのため、表
3のトレースT2のようにソースプログラムから得られ
る情報とトレースが示す流れとの対応が一意に定まらな
い実行トレースについても、トレース自身の情報のみを
利用して制御構造を抽出し、制御構造を反映した根付き
木構造に整形することができる。同様に、ソースプログ
ラムが入手できない実行トレース、流れの予想がつかな
いかあるいは動的情報を含む実行トレース、さらには実
行トレース以外のシステムログや通信ログ等について
も、ログ自身の情報のみを利用して制御構造を抽出し、
制御構造を反映した根付き木構造に整形することができ
る。As described above, by performing the control structure extraction / log shaping process as shown in FIG. 2, the loop structure and the branch are obtained by using only the information of the trace itself without using the information obtained from the source program. You can extract control structures, such as structures, and shape the trace. Therefore, even for the execution trace whose correspondence between the information obtained from the source program and the flow shown by the trace is not uniquely determined like the trace T2 in Table 3, the control structure is extracted and controlled by using only the information of the trace itself. It can be shaped into a rooted tree structure that reflects the structure. Similarly, only the information of the log itself is used for the execution trace where the source program is not available, the execution trace that the flow cannot be predicted or contains dynamic information, and the system log and communication log other than the execution trace. To extract the control structure,
It can be shaped into a rooted tree structure that reflects the control structure.
【0041】一方、ソースプログラムから得られる付加
情報が入手できる場合には、ソースプログラムの情報を
利用してトレースを再整形することもできる。例えば、
図6に示すように整形されたトレースに対し、表1のソ
ースプログラムPから得られる情報、例えば、行3,
4,5は、それぞれ、forループの初期化部、条件
部、繰り返し部に相当する、という条件を用いれば、図
8に示すように再整形されたトレースを得ることも可能
である。On the other hand, when the additional information obtained from the source program is available, the trace of the trace can be reshaped by using the information of the source program. For example,
Information obtained from the source program P of Table 1, for example, line 3, for the trace shaped as shown in FIG.
It is also possible to obtain a reshaped trace as shown in FIG. 8 by using the conditions that 4 and 5 respectively correspond to the initialization part, the condition part, and the repeat part of the for loop.
【0042】ただし、本発明のログ整形方法において
は、本質的に、ソースコードからは理解できないループ
構造、例えば、goto文を用いたループ構造等も抽出
することができる。したがって、このようなソースコー
ドから理解できない部分の構造については、図6や図7
に示すようなログのみを用いた整形にとどめておけばよ
い。However, in the log shaping method of the present invention, a loop structure which cannot be understood from the source code, for example, a loop structure using a goto statement can be extracted. Therefore, regarding the structure of the part that cannot be understood from such source code, FIG.
It is only necessary to format the log using the log shown in.
【0043】[3.再帰構造抽出・ログ再整形処理]以
下には、表4に示すような再帰関数を含むプログラムを
実行して得られた実行トレースを、制御構造を反映した
根付き木構造に一旦整形した後に、再帰構造を抽出して
再整形を行う場合について具体的に説明する。[3. Recursive Structure Extraction / Log Reshaping Process] In the following, an execution trace obtained by executing a program including a recursive function as shown in Table 4 is once reformed into a rooted tree structure that reflects the control structure, and then recursion is performed. A case where a structure is extracted and reformatted will be specifically described.
【表4】 [Table 4]
【0044】図9は、表4に示す再帰関数を含むプログ
ラムの実行トレースを、図2に示す制御構造抽出・ログ
整形処理と関数についての付加情報とによって、制御構
造を反映した根付き木構造に整形した結果を示す根付き
木構造図である。この図9に示すように、一般に再帰関
数が含まれるプログラムの実行トレースは、木の深さが
深くなり、見通しが悪くなってしまう。そのような見通
しの悪い実行トレースを理解しやすくするために、再帰
構造を抽出して、再帰構造を反映したトレースを再整形
することが望ましい。図10は、そのための再帰構造抽
出・ログ再整形処理の流れをデータの流れと共に示すフ
ローチャートである。FIG. 9 shows an execution trace of a program including the recursive function shown in Table 4 as a rooted tree structure reflecting the control structure by the control structure extraction / log shaping process and the additional information about the function shown in FIG. It is a rooted tree structure diagram which shows the result of shaping. As shown in FIG. 9, in the execution trace of a program that generally includes a recursive function, the depth of the tree becomes deep and the visibility becomes poor. In order to make it easy to understand such a poor execution trace, it is desirable to extract the recursive structure and reshape the trace reflecting the recursive structure. FIG. 10 is a flowchart showing the flow of the recursive structure extraction / log reshaping process for that purpose together with the data flow.
【0045】この図10に示すように、まず、前述した
制御構造抽出・ログ整形処理において、実行トレースに
含まれる各要素間の繋がりを表現する有向グラフを作成
したのと同様に、整形されたトレース(再帰関数を含む
整形ログ)50から、関数間の呼び出し関係を表現する
有向グラフを作成する(S1001)。この有向グラフ
は、各関数に対応する節点を持ち、関数A内部で関数B
を呼び出すことがあれば、A→Bというエッジを持つよ
うに構成される。例えば、図9のトレースに現れる関数
の呼び出し関係を表現する有向グラフは、図11のよう
になる。As shown in FIG. 10, first, in the control structure extraction / log shaping process described above, similarly to the case where a directed graph representing the connection between the elements included in the execution trace is created, the shaped trace is formed. From the (formatted log including the recursive function) 50, a digraph expressing the call relationship between the functions is created (S1001). This directed graph has nodes corresponding to each function, and the function B inside the function A
Is called, it is configured to have an edge of A → B. For example, a directed graph expressing the calling relationship of the functions appearing in the trace of FIG. 9 is as shown in FIG.
【0046】そして、このように作成された有向グラフ
を強連結成分分解して、要素数が2以上の強連結成分、
または要素数は1であるがその要素となる節点が自分自
身に向かうエッジを持つ強連結成分を、再帰関数群に対
応するとみなすことにより、再帰構造を抽出する(S1
002)。再帰関数群の中の入口に対応する関数、再帰
関数群の内部に含まれる再帰関数群等の検出方法も、前
述した制御構造抽出・ログ整形処理における多重ループ
の抽出におけるループ構造の入口や内部ループの検出方
法と同様である。Then, the directed graph created in this way is decomposed into strongly connected components, and strongly connected components having two or more elements,
Alternatively, a recursive structure is extracted by regarding a strongly connected component having the number of elements of 1 but having an edge whose node points toward itself as corresponding to the recursive function group (S1).
002). The method for detecting the function corresponding to the entrance in the recursive function group, the recursive function group included in the recursive function group, etc. is also described in the control structure extraction and the loop structure entrance in the extraction of multiple loops in the log shaping process. This is similar to the loop detection method.
【0047】図11の例では、2つの強連結成分{main
()}、{fact()}が存在する。このうち、強連結成
分{fact()}は、要素となる節点が自分自身に向かう
エッジを持っているので、単独で再帰関数群を構成する
ことになる。In the example of FIG. 11, two strongly connected components {main
()} And {fact ()} exist. Among them, the strongly connected component {fact ()} has an edge whose node points toward itself, and thus independently constitutes a recursive function group.
【0048】次に、得られた再帰構造60を用いてログ
の整形を行い(S1003)、再帰構造を反映したログ
70を得る。このログの整形においては、再帰構造をト
レースに反映させるために、根付き木構造を持つトレー
スを根から順に調べ、再帰関数群の入口となる関数が現
れた場合にはそこに新たな分節節点「再帰」を挿入し、
同じ再帰関数群の入口に相当する関数が現れれば、それ
を分節節点「再帰」の下に移動するという作業を繰り返
す。Next, the log is shaped by using the obtained recursive structure 60 (S1003), and the log 70 reflecting the recursive structure is obtained. In this log shaping, in order to reflect the recursive structure in the trace, the trace with the rooted tree structure is examined in order from the root, and when a function that becomes the entrance of the recursive function group appears, a new segment node " Insert "recursive",
When a function corresponding to the entrance of the same recursive function group appears, the work of moving it below the segment node "recursive" is repeated.
【0049】図9のトレースでは、根「main()」から
葉に向かって節点を辿っていくと、最初に再帰関数群の
入口「fact()」が現れる。そこで、この節点「fac
t()」があった部分に分節節点「再帰」と、子節点
「0回目」を挿入し、節点「fact()」を子孫ごと節点
「0回目」の子節点に移動する。次に、節点「fac
t()」から葉まで節点を辿る処理を再開すると、再
び、「分岐」の下の節点「fact()」が現れる。これ
は、現在処理中の再帰関数群の入口である。In the trace of FIG. 9, when the node is traced from the root "main ()" toward the leaf, the entrance "fact ()" of the recursive function group first appears. Therefore, this node "fac
The segment node “recursive” and the child node “0th time” are inserted in the part where “t ()” was present, and the node “fact ()” is moved to the child node of the node “0th time” for each descendant. Next, the node "fac
When the process of tracing the node from “t ()” to the leaf is restarted, the node “fact ()” below the “branch” appears again. This is the entrance to the group of recursive functions currently being processed.
【0050】そこで、この節点「fact()」を、新たに
作った葉「<fact()>」で置き換える。一方、先に作
った分節節点「再帰」の下には節点「1回目」を追加
し、元の節点「fact()」を子孫ごと節点「1回目」の
下に移動する。これらの処理をさらに繰り返して続ける
ことにより、最終的に、図12のように再帰構造を反映
した根付き木構造を持つトレースが得られる。Therefore, the node "fact ()" is replaced with the newly created leaf "<fact ()>". On the other hand, the node “first time” is added below the previously created segment node “recursive”, and the original node “fact ()” is moved to the descendants under the node “first time”. By further repeating these processes, a trace having a rooted tree structure that reflects the recursive structure as shown in FIG. 12 is finally obtained.
【0051】このように、ループ構造や分岐構造などの
制御構造を利用して実行トレースなどのログを整形した
後、そのログが再帰構造を含む場合には、再帰構造抽出
・ログ再整形処理を行うことにより、図12に示すよう
な、再帰構造を反映した理解しやすい根付き木構造に再
整形することができる。なお、変形例として、再帰構造
の抽出を、ログのソースプログラムの情報を利用して行
うことも可能である。As described above, after the log such as the execution trace is shaped by using the control structure such as the loop structure or the branch structure, if the log includes the recursive structure, the recursive structure extraction / log reshaping process is performed. By doing so, it is possible to reform the rooted tree structure that reflects the recursive structure and is easy to understand, as shown in FIG. As a modified example, it is also possible to extract the recursive structure using the information of the log source program.
【0052】[4.実行パターン判定・ログ簡約化処
理]以下には、ループ構造や再帰構造の実行パターンを
繰り返すトレースを整形した後に、実行パターンが同じ
部分をまとめて簡約化する場合について具体的に説明す
る。図13は、この場合の実行パターン判定・ログ簡約
化処理の流れをデータの流れと共に示すフローチャート
である。[4. Execution Pattern Judgment / Log Reduction Processing] Hereinafter, a case will be specifically described in which, after shaping a trace that repeats an execution pattern of a loop structure or a recursive structure, portions having the same execution pattern are collectively reduced. FIG. 13 is a flowchart showing the flow of the execution pattern determination / log reduction process in this case together with the data flow.
【0053】[4−1.基本的な処理]この図13に示
すように、まず、整形されたトレース(実行パターンの
繰り返しを含む整形ログ)80中におけるループ構造ま
たは再帰構造の実行パターンを抽出して、実行パターン
が同じ複数の部分があるか否かを判定する(S130
1)。そして、ループ構造や再帰構造の実行パターンが
同じ複数の部分90がある場合には、それらを1つにま
とめて、分節節点「パターンn」の子節点にすることに
より、根付き木構造を次のように簡約化して(S130
2)、簡約ログ40を得る。[4-1. Basic Processing] As shown in FIG. 13, first, an execution pattern of a loop structure or a recursive structure in a shaped trace (a shaping log including repetition of an execution pattern) 80 is extracted, and a plurality of execution patterns having the same execution pattern are extracted. Is determined (S130).
1). Then, when there are a plurality of portions 90 having the same execution pattern of the loop structure or the recursive structure, they are combined into one and made a child node of the segment node “pattern n”, so that the rooted tree structure is (S130
2) Obtain the reduced log 40.
【0054】例えば、前述した制御構造抽出・ログ整形
処理の整形結果である図6のトレースにおけるループ構
造の0回目から2回目までの実行パターンは同じであ
り、3回目の実行パターンのみが異なる。そのため、0
回目から2回目までの実行パターンが同じ部分を、節点
「ループ」の子節点である分節節点「パターン0」の子
節点としてまとめ、3回目の部分を分節節点「パターン
1」の子節点とすることができる。そして、ループ構造
中の分岐構造についても、同様に、実行パターンが同じ
部分をまとめることができる。このような処理により、
図6のトレースを図14に示すようなトレースに簡約化
することができる。For example, the execution pattern from the 0th time to the 2nd time of the loop structure in the trace of FIG. 6 which is the shaping result of the control structure extraction / log shaping process described above is the same, and only the execution pattern of the 3rd time is different. Therefore, 0
The parts with the same execution pattern from the second time to the second time are grouped as child nodes of the segment node "pattern 0" which is a child node of the node "loop", and the third portion is made a child node of the segment node "pattern 1". be able to. Also, with respect to the branch structure in the loop structure, similarly, portions having the same execution pattern can be put together. By such processing,
The trace of FIG. 6 can be reduced to the trace as shown in FIG.
【0055】また、前述した再帰構造抽出・ログ再整形
処理の整形結果である図12のトレースにおける再帰構
造の0回目と1回目の実行パターンは同じであり、2回
目の実行パターンのみが異なる。そのため、0回目と1
回目の実行パターンが同じ部分を節点「再帰」の子節点
である分析節点「パターン0」の子節点としてまとめ、
2回目の部分を分節節点「パターン1」の子節点とする
ことができる。そして、再帰構造中の分岐構造について
も、同様に、実行パターンが同じ部分をまとめることが
できる。このような処理により、図12のトレースを図
15に示すようなトレースに簡約化することができる。The 0th execution pattern and the 1st execution pattern of the recursive structure in the trace of FIG. 12, which is the shaping result of the above-mentioned recursive structure extraction / log reshaping process, are the same, and only the second execution pattern is different. Therefore, 0th and 1
The parts with the same execution pattern of the second time are summarized as child nodes of the analysis node “pattern 0” which is a child node of the node “recursive”,
The second part can be a child node of the segment node “Pattern 1”. Similarly, with respect to the branch structure in the recursive structure, portions having the same execution pattern can be put together. By such processing, the trace shown in FIG. 12 can be reduced to the trace shown in FIG.
【0056】ところで、図14や図15に示すように、
簡約化されたトレースでは、ループ構造や再帰構造内に
含まれる一連の処理が、何回目の繰り返しの際に行われ
たかという情報は失われるが、その反面、ループ構造や
再帰構造がどのようなパターンで実行されているかとい
う情報や、どのパターンが頻繁に行われ、どのパターン
の頻度が低いかという情報については、一目で容易に把
握できるようになる。また、一般に、プログラムの実行
トレースには、同じ実行パターンが数百回、数千回と現
れることが多いため、それらを1つのパターンとして簡
約化するというこの処理を行うことにより、通常の場
合、実行トレースのサイズを非常に小さくすることがで
きる。By the way, as shown in FIG. 14 and FIG.
In the simplified trace, the information about the number of iterations of the series of processing included in the loop structure or the recursive structure is lost, but on the other hand, what kind of loop structure or recursive structure is It is possible to easily grasp at a glance information about whether the pattern is executed, information about which pattern is frequently performed, and information about which pattern is infrequent. In general, the same execution pattern often appears hundreds or thousands of times in the execution trace of a program. Therefore, by performing this process of simplifying them as one pattern, The execution trace size can be very small.
【0057】[4−2.多重ループや再帰構造の内部に
ループを含む場合の処理]また、整形されたトレース中
に多重ループを含む場合、あるいは再帰構造の内部にル
ープを含む場合には、次のような処理を行って、パター
ン分節節点を順次挿入することにより、根付き木構造を
簡約化する。[4-2. Processing when multiple loops or loops are included inside the recursive structure] In addition, when multiple loops are included in the shaped trace, or when loops are included inside the recursive structure, perform the following processing. , Root tree structure is reduced by inserting pattern segment nodes in sequence.
【0058】まず、根付き木構造を根から葉に向けて調
べ、最初に「ループまたは再帰」Aが現れれば、それ以
下の分節節点(新たなループや再帰以外)の下には、そ
れぞれ、1つのA用のパターン分節節点を挿入する。新
たに、「ループまたは再帰」Bが現れれば、それ以下の
分節節点にはA用とB用のパターン分節節点を2つ並べ
て挿入していく。このように、新たな「ループまたは再
帰」が現れる度に、並べて挿入するパターン分節節点の
数を増やしていくことにより、多重ループを含む場合、
あるいは再帰構造の内部にループを含む場合について
も、根付き木構造を機械的に簡約化することができる。First, the rooted tree structure is examined from the root toward the leaves, and if a "loop or recursion" A appears at the beginning, there is 1 below each of the node nodes (other than a new loop or recursion). Insert pattern segment nodes for one A. When a new "loop or recursion" B appears, two pattern segment nodes for A and B are inserted side by side at the segment nodes below that. In this way, when multiple loops are included by increasing the number of pattern segment nodes inserted side by side each time a new "loop or recursion" appears,
Alternatively, the rooted tree structure can be mechanically reduced even when a loop is included inside the recursive structure.
【0059】例えば、図16に示すような二重ループを
含むトレースには、次のような特徴がある。すなわち、
外側のループAの実行パターンは、A0:「3−ループ
B−4」、A1:「3−ループB」、A2:「3」、の
3種類である。一方、内側のループBの実行パターン
は、B0:「5−6」、B1:「5」、の2種類であ
る。ただし、ループAの実行パターンがA0の場合に
は、ループBはB0、B1の両方のパターンを実行する
のに対し、ループAの実行パターンがA1の場合には、
ループBはB1のパターンのみを実行する。For example, a trace including a double loop as shown in FIG. 16 has the following characteristics. That is,
The execution pattern of the outer loop A has three types of A0: “3-loop B-4”, A1: “3-loop B”, and A2: “3”. On the other hand, there are two types of execution patterns of the inner loop B, B0: “5-6” and B1: “5”. However, when the execution pattern of the loop A is A0, the loop B executes both patterns of B0 and B1, whereas when the execution pattern of the loop A is A1,
Loop B executes only the pattern of B1.
【0060】このような特徴を持つ図16のトレースに
対して、前述した処理により、内側のループBの下に、
ループAに関するパターン分節節点「パターンABn」
とループB自身に関するパターン分節節点「パターンB
n」の2つを並べて挿入することにより、図17に示す
ように、図16のトレースの特徴を残しながら簡約化さ
れたトレースが得られる。なお、この図17において、
「パターンAB0」、「パターンAB1」は、AB0:
「B0−B1」、AB1:「B1」、という、パターンの列
よりなるパターンを表現している。With respect to the trace of FIG. 16 having such a characteristic, by the above-described processing, below the inner loop B,
Pattern segment node “Pattern ABn” related to Loop A
And the pattern segment node “Pattern B
By inserting two "n" side-by-side, a reduced trace is obtained, as shown in FIG. 17, while preserving the features of the trace of FIG. In addition, in FIG.
“Pattern AB0” and “Pattern AB1” are AB0:
A pattern consisting of a sequence of patterns "B0-B1" and AB1: "B1" is expressed.
【0061】ただし、このような簡約化処理では、深い
ループの下の部分で、パターン分節節点が非常に多く並
び、逆に、理解しにくくなってしまうことがある。この
問題は、1つのパターン分節節点しか子に持たないパタ
ーン分節節点を省略することによって緩和することがで
きる。例えば、図17に示す簡約化処理されたトレース
にこのような処理を適用した場合には、図18に示すよ
うに、1つのパターン分節節点「パターンB1」しか子
に持たないパターン分節節点「パターンAB1」を省略
することにより、トレースをさらに簡約化することがで
きる。However, in such a simplification process, a large number of pattern segment nodes are arranged in the lower portion of the deep loop, and conversely, it may be difficult to understand. This problem can be mitigated by omitting pattern segment nodes that have only one pattern segment node in their children. For example, when such processing is applied to the simplified trace shown in FIG. 17, as shown in FIG. 18, only one pattern segment node “pattern B1” has a pattern segment node “pattern”. By omitting "AB1", the trace can be further simplified.
【0062】[5.実施形態の効果]以上のような本実
施形態のログ整形方法によれば、次のような効果が得ら
れる。[5. Effect of Embodiment] According to the log shaping method of the present embodiment as described above, the following effects can be obtained.
【0063】まず、表3の実行トレースT2のように、
最適化された実行プログラムから出力されたトレース等
の、ソースプログラムから得られる情報とトレースが示
す流れとの対応が一意に定まらない場合、あるいは、ソ
ースプログラム自体が入手できない場合であっても、従
来のようにソースプログラム等の外部情報を利用せずに
トレース自身からループ構造や分岐構造等の制御構造を
抽出することができる。そのため、トレース自身の持つ
制御構造を反映した根付き木構造、すなわち、理解しや
すくかつ機械的に処理しやすい根付き木構造に整形する
ことができる。First, as shown in the execution trace T2 in Table 3,
Even if the correspondence between the information obtained from the source program and the flow indicated by the trace, such as the trace output from the optimized execution program, cannot be uniquely determined, or even if the source program itself cannot be obtained, As described above, the control structure such as the loop structure or the branch structure can be extracted from the trace itself without using the external information such as the source program. Therefore, it is possible to shape the rooted tree structure that reflects the control structure of the trace itself, that is, the rooted tree structure that is easy to understand and mechanically process.
【0064】また、割込みや例外処理等、ソースプログ
ラムからは前もって流れの予想がつかないプログラムの
実行トレースや、実行中の変数値等の動的情報を含むト
レースなどについても、トレース自身からループ構造や
分岐構造等の制御構造を抽出し、抽出した制御構造を反
映した根付き木構造に整形することができる。一方、シ
ステムログや通信ログ等の、プログラムの実行トレース
以外のログについても、ログ自身からループ構造や分岐
構造等の制御構造を抽出し、抽出した制御構造を反映し
た根付き木構造に整形することができる。Also, for the execution trace of a program whose flow cannot be predicted in advance from the source program such as interrupts and exception handling, and the trace including dynamic information such as the variable value being executed, the loop structure from the trace itself. It is possible to extract a control structure such as a branch structure or a branch structure and shape it into a rooted tree structure that reflects the extracted control structure. On the other hand, for logs other than program execution traces, such as system logs and communication logs, extract control structures such as loop structures and branch structures from the logs themselves, and shape them into a rooted tree structure that reflects the extracted control structures. You can
【0065】また、ログのみを用いて得られた情報によ
りログを整形した後、ソースプログラムから得られる付
加情報が入手できる場合には、ソースプログラムの情報
を利用してログを再整形することも可能である。この場
合には、ソースプログラムから制御構造を抽出してログ
を整形していた従来技術と同様の整形結果を得ることが
できる。If the additional information obtained from the source program is available after the log is shaped by the information obtained using only the log, the log of the source program may be used to re-format the log. It is possible. In this case, it is possible to obtain the same shaping result as in the conventional technique in which the control structure is extracted from the source program and the log is shaped.
【0066】さらに、ループ構造や分岐構造などの制御
構造を利用してログを整形した後、そのログが再帰構造
を含む場合には、その再帰構造を反映した理解しやすい
根付き木構造に再整形することができる。また、整形さ
れたログ中に、ループや再帰の実行パターンが同じ複数
の部分がある場合には、それらを1つにまとめて根付き
木構造を簡約化することにより、ログの内容を理解しや
すくかつ機械的に処理しやすくするだけでなく、一般的
に、簡約化前に比べてログのサイズを非常に小さくする
ことができる。Further, after the log is shaped by using a control structure such as a loop structure or a branch structure, if the log includes a recursive structure, it is reformed into an easy-to-understand rooted tree structure that reflects the recursive structure. can do. Also, if there are multiple parts with the same loop or recursion execution pattern in the formatted log, by combining them into one and simplifying the rooted tree structure, the contents of the log can be easily understood. In addition to making it easier to process mechanically, generally, the size of the log can be made much smaller than that before the reduction.
【0067】[6.他の実施形態]なお、本発明は、前
述した実施形態に限定されるものではなく、本発明の範
囲内で他にも多種多様な形態が実施可能である。例え
ば、前記実施形態においては、ログ自身から制御構造を
抽出し、抽出した制御構造を反映した根付き木構造に整
形する方法について説明したが、本発明は、ログ自身か
ら制御構造を抽出する方法自体に特徴を有するため、そ
のような制御構造抽出処理を行うだけでも、本発明の効
果は得られるものである。[6. Other Embodiments] The present invention is not limited to the above-described embodiments, and various other forms can be implemented within the scope of the present invention. For example, in the above-described embodiment, the method of extracting the control structure from the log itself and shaping it into a rooted tree structure that reflects the extracted control structure has been described, but the present invention is a method of extracting the control structure from the log itself. Therefore, the effect of the present invention can be obtained only by performing such control structure extraction processing.
【0068】また、前述した再帰構造抽出・ログ再整形
処理や実行パターン判定・ログ簡約化処理は、図2に示
す制御構造抽出・ログ整形処理等の本発明に係るログ整
形方法によって整形されたログに限らず、従来技術によ
って整形されたログに対しても同様に適用可能である。The above-described recursive structure extraction / log reshaping process and execution pattern determination / log reduction process are shaped by the log shaping method according to the present invention such as the control structure extraction / log shaping process shown in FIG. The present invention is not limited to logs and can be similarly applied to logs shaped by conventional techniques.
【0069】[0069]
【発明の効果】以上説明したように、本発明によれば、
ログに含まれる各要素間の繋がりをグラフ化して制御構
造を抽出することにより、ソースプログラム等の外部情
報を利用せずに、整形しようとするログ自身から制御構
造を抽出し、その情報を用いてログを整形可能な制御構
造抽出方法を提供すると共に、そのような制御構造抽出
方法を含む有用なログ整形方法を提供することができ
る。As described above, according to the present invention,
By extracting the control structure by graphing the connection between each element included in the log, the control structure is extracted from the log itself to be shaped without using external information such as the source program, and that information is used. It is possible to provide a control structure extraction method capable of shaping a log by means of a log and a useful log shaping method including such a control structure extraction method.
【0070】また、ログに含まれる関数間の呼び出し関
係をグラフ化して再帰構造を抽出することにより、再帰
構造を反映した根付き木構造にログを整形可能なログ整
形方法を提供することができる。そしてまた、ログから
ループや再帰の実行パターンが同じ複数の部分を抽出し
てそれらを1つにまとめることにより、複雑な構造を有
するログを簡約化して、ログの内容を理解しやすくし、
ログのサイズを小さくすることが可能なログ整形方法を
提供することができる。Further, it is possible to provide a log shaping method capable of shaping the log into a rooted tree structure reflecting the recursive structure by graphing the call relationship between the functions included in the log and extracting the recursive structure. Also, by extracting multiple parts with the same loop or recursion execution pattern from the log and combining them into one, the log having a complicated structure is simplified, and the contents of the log can be easily understood.
It is possible to provide a log shaping method capable of reducing the log size.
【図1】本発明を適用したログ整形方法の概要をデータ
の流れに沿って示すフローチャート。FIG. 1 is a flowchart showing an outline of a log shaping method to which the present invention is applied along a data flow.
【図2】図1に示すログ整形方法における制御構造抽出
・ログ整形処理の流れをデータの流れと共に示すフロー
チャート。2 is a flowchart showing the flow of control structure extraction / log shaping processing in the log shaping method shown in FIG. 1 together with the flow of data.
【図3】図2に示す処理により、表3に示すトレースに
含まれる各要素間の繋がりを表現するために作成された
有向グラフ。FIG. 3 is a directed graph created by the process shown in FIG. 2 to express the connection between the elements included in the trace shown in Table 3.
【図4】図2に示す処理により、図3に示す有向グラフ
に対して強連結成分分解を適用した結果を示すグラフ。4 is a graph showing the result of applying strongly connected component decomposition to the digraph shown in FIG. 3 by the processing shown in FIG.
【図5】図2に示す処理により、図3に示すグラフのル
ープ中の分岐構造を抽出するためにエッジを切断した後
のグラフ。5 is a graph after the edge is cut to extract the branch structure in the loop of the graph shown in FIG. 3 by the process shown in FIG. 2;
【図6】表3に示すトレースに対して、図2に示す処理
により、トレース自身から制御構造を抽出して整形を行
った結果を示す根付き木構造図。FIG. 6 is a rooted tree structure diagram showing a result obtained by extracting a control structure from the trace itself and performing shaping on the trace shown in Table 3 by the processing shown in FIG. 2.
【図7】表2に示すトレースに対して、図2に示す処理
により、トレース自身から制御構造を抽出して整形を行
った結果を示す根付き木構造図。FIG. 7 is a rooted tree structure diagram showing a result of extracting a control structure from the trace itself and performing shaping on the trace shown in Table 2 by the process shown in FIG. 2.
【図8】図6に示すように整形されたトレースに対し
て、表1のソースプログラムから得られる情報を利用し
て再整形を行った結果を示す根付き木構造図。8 is a rooted tree structure diagram showing the result of reshaping the trace shaped as shown in FIG. 6 using the information obtained from the source program of Table 1. FIG.
【図9】表4に示す再帰関数を含むプログラムの実行ト
レースを、図2に示す処理によって、制御構造を反映し
た根付き木構造に整形した結果を示す根付き木構造図。9 is a rooted tree structure diagram showing a result of shaping the execution trace of the program including the recursive function shown in Table 4 into a rooted tree structure reflecting the control structure by the processing shown in FIG.
【図10】本発明を適用したログ整形方法において、再
帰関数を含む整形ログに対して行う再帰構造抽出・ログ
再整形処理の流れをデータの流れと共に示すフローチャ
ート。FIG. 10 is a flowchart showing a flow of recursive structure extraction / log reshaping processing performed on a shaping log including a recursive function together with a data flow in the log shaping method to which the present invention is applied.
【図11】図9に示すトレースに現れる関数の呼び出し
関係を表現するために作成された有向グラフ。FIG. 11 is a directed graph created to express the calling relationship of the functions appearing in the trace shown in FIG.
【図12】図9に示すトレースに対して、再帰構造を利
用して再整形を行った結果を示す根付き木構造図。12 is a rooted tree structure diagram showing a result of reshaping the trace shown in FIG. 9 using a recursive structure.
【図13】本発明を適用したログ整形方法において、ル
ープや再帰の実行パターンの繰り返しを含む整形ログに
対して行う実行パターン判定・ログ簡約化処理の流れを
データの流れと共に示すフローチャート。FIG. 13 is a flowchart showing a flow of an execution pattern determination / log reduction process to be performed on a shaping log including repetition of a loop or a recursive execution pattern in a log shaping method to which the present invention is applied together with a data flow.
【図14】図6に示すトレースに対して簡約化処理を行
った結果を示す根付き木構造図。FIG. 14 is a rooted tree structure diagram showing a result of performing reduction processing on the trace shown in FIG. 6;
【図15】図12に示すトレースに対して簡約化処理を
行った結果を示す根付き木構造図。FIG. 15 is a rooted tree structure diagram showing a result of performing reduction processing on the trace shown in FIG. 12;
【図16】図2に示す処理によって整形された二重ルー
プを含むトレースの一例を示す根付き木構造図。16 is a rooted tree structure diagram showing an example of a trace including a double loop shaped by the processing shown in FIG. 2. FIG.
【図17】図16に示すトレースに対して簡約化処理を
行った結果を示す根付き木構造図。FIG. 17 is a rooted tree structure diagram showing a result of performing reduction processing on the trace shown in FIG. 16;
【図18】図17に示すトレースに対してさらに簡約化
処理を行う場合の処理内容とその結果を示す根付き木構
造図。FIG. 18 is a rooted tree structure diagram showing the processing contents and the result when further reduction processing is performed on the trace shown in FIG. 17;
【図19】従来の実行トレースの整形方法の概要をデー
タの流れに沿って示すフローチャート。FIG. 19 is a flowchart showing an outline of a conventional execution trace shaping method along a data flow.
【図20】表2に示すトレースに対して、図19に示す
方法により、ソースプログラムから制御構造を抽出して
整形を行った結果を示す根付き木構造図。FIG. 20 is a rooted tree structure diagram showing the result of extracting the control structure from the source program and shaping the trace shown in Table 2 by the method shown in FIG.
10…ログ 20…制御構造情報 21…ループ構造 22…分岐構造 30…整形ログ 40…簡約ログ 50…再帰関数を含む整形ログ 60…再帰構造 70…再帰構造を反映した整形ログ 80…実行パターンの繰り返しを含む整形ログ 90…実行パターンが同じ複数の部分 a,b,c,d,e…強連結成分 10 ... Log 20 ... Control structure information 21 ... Loop structure 22 ... Branched structure 30 ... Formatting log 40 ... Simplified log 50 ... Formatting log including recursive function 60 ... Recursive structure 70 ... Formatting log reflecting recursive structure 80 ... Formatting log including repetition of execution pattern 90 ... Multiple parts with the same execution pattern a, b, c, d, e ... strongly connected component
フロントページの続き (72)発明者 岡本 渉 神奈川県川崎市幸区小向東芝町1番地 株 式会社東芝研究開発センター内 (72)発明者 平山 雅之 神奈川県川崎市幸区小向東芝町1番地 株 式会社東芝研究開発センター内 Fターム(参考) 5B042 GA02 HH30 MA08 MA14 MC13Continued front page (72) Inventor Wataru Okamoto 1st Komukai Toshiba-cho, Sachi-ku, Kawasaki-shi, Kanagawa Inside the Toshiba Research and Development Center (72) Inventor Masayuki Hirayama 1st Komukai Toshiba-cho, Sachi-ku, Kawasaki-shi, Kanagawa Inside the Toshiba Research and Development Center F term (reference) 5B042 GA02 HH30 MA08 MA14 MC13
Claims (9)
ータを利用して抽出する制御構造抽出方法において、 格納部に格納されたログ中に含まれる各要素間の繋がり
を表現する有向グラフを作成するグラフ作成ステップ
と、 作成された有向グラフから制御構造を抽出する制御構造
抽出ステップと、を含むことを特徴とする制御構造抽出
方法。1. A control structure extracting method for extracting a control structure contained in a log by using a computer, wherein a directed graph representing a connection between respective elements contained in the log stored in a storage unit is created. A control structure extracting method comprising: a graph creating step; and a control structure extracting step of extracting a control structure from the created directed graph.
造を抽出するループ構造抽出ステップと、 抽出された各ループ構造からそのループ内部に含まれる
分岐構造を抽出する分岐構造抽出ステップとを含む、こ
とを特徴とする請求項1に記載の制御構造抽出方法。2. The control structure extracting step includes: a loop structure extracting step of decomposing the created directed graph into strongly connected components to extract a loop structure; and a branch structure included in the loop from each extracted loop structure. The control structure extraction method according to claim 1, further comprising: a branch structure extraction step of extracting the control structure.
グ中に含まれる制御構造を反映した根付き木構造に整形
するログ整形方法において、 格納部に格納されたログ中に含まれる各要素間の繋がり
を表現する有向グラフを作成するグラフ作成ステップ
と、 作成された有向グラフから制御構造を抽出する制御構造
抽出ステップと、 抽出された制御構造を利用してログを整形する整形ステ
ップと、を含むことを特徴とするログ整形方法。3. A log shaping method for shaping a log into a rooted tree structure that reflects a control structure contained in the log by using a computer, and between the elements contained in the log stored in the storage unit. A graph creating step for creating a directed graph expressing the connection, a control structure extracting step for extracting a control structure from the created directed graph, and a shaping step for shaping a log using the extracted control structure. A characteristic log shaping method.
造を抽出するループ構造抽出ステップと、 抽出された各ループ構造からそのループ内部に含まれる
分岐構造を抽出する分岐構造抽出ステップとを含む、こ
とを特徴とする請求項3に記載のログ整形方法。4. The control structure extracting step includes: a loop structure extracting step of decomposing the created directed graph into strongly connected components to extract a loop structure; and a branch structure included in the loop from each extracted loop structure. 4. The log shaping method according to claim 3, further comprising a branch structure extraction step of extracting
ログラムの情報を利用して再整形する再整形ステップ、
を含むことを特徴とする請求項3または請求項4に記載
のログ整形方法。5. A reformatting step of reformatting a reformatted log using information of the source program of the log,
The log shaping method according to claim 3 or 4, further comprising:
されたログを、コンピュータを利用して再整形するログ
整形方法において、 格納部に格納されたログ中に含まれる関数間の呼び出し
関係を表現する有向グラフを作成するグラフ作成ステッ
プと、 作成された有向グラフから再帰構造を抽出する再帰構造
抽出ステップと、 抽出された再帰構造を利用してログを整形する整形ステ
ップと、を含むことを特徴とするログ整形方法。6. A log shaping method for reshaping a log shaped into a rooted tree structure reflecting a control structure using a computer, wherein a call relationship between functions included in a log stored in a storage unit is defined. It is characterized by including a graph creating step for creating a directed graph to be expressed, a recursive structure extracting step for extracting a recursive structure from the created directed graph, and a shaping step for shaping a log using the extracted recursive structure. How to format the log.
されたログを、コンピュータを利用して再整形するログ
整形方法において、 格納部に格納されたログのソースプログラムの情報を利
用して再帰構造を抽出する再帰構造抽出ステップと、 抽出された再帰構造を利用してログを整形する整形ステ
ップと、を含むことを特徴とするログ整形方法。7. A log reshaping method for reshaping a log shaped into a rooted tree structure that reflects a control structure by using a computer, using a source program information of the log stored in the storage unit to recurse. A log shaping method, comprising: a recursive structure extracting step of extracting a structure; and a shaping step of shaping a log by using the extracted recursive structure.
されたログを、コンピュータを利用して再整形するログ
整形方法において、 格納部に格納されたログ中に含まれるループ構造または
再帰構造の実行パターンを抽出して実行パターンが同じ
複数の部分があるか否かを判定するパターン判定ステッ
プと、 実行パターンが同じ複数の部分がある場合にそれらの複
数の部分を1つにまとめることにより根付き木構造を簡
約化する簡約化ステップと、を含むことを特徴とするロ
グ整形方法。8. A log shaping method for reforming a log shaped into a rooted tree structure that reflects a control structure using a computer, wherein a log structure or a recursive structure included in a log stored in a storage unit is used. The pattern judgment step that extracts the execution pattern and determines whether there are multiple parts with the same execution pattern, and if there are multiple parts with the same execution pattern, roots by combining these multiple parts into one. A log shaping method comprising: a reduction step of reducing a tree structure;
グ中に含まれる制御構造を反映した根付き木構造に整形
するためのプログラムにおいて、 格納部に格納されたログ中に含まれる各要素間の繋がり
を表現する有向グラフを作成するグラフ作成機能と、 作成された有向グラフから制御構造を抽出する制御構造
抽出機能と、 抽出された制御構造を利用してログを整形する整形機能
と、をコンピュータに実現させることを特徴とするプロ
グラム。9. A program for shaping a log into a rooted tree structure that reflects a control structure included in the log by using a computer, between elements included in the log stored in the storage unit. Implements on a computer a graph creation function that creates a directed graph that expresses connections, a control structure extraction function that extracts a control structure from the created directed graph, and a shaping function that shapes the log using the extracted control structure. A program characterized by:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002037407A JP2003241998A (en) | 2002-02-14 | 2002-02-14 | Control structure extraction method, log shaping method and program therefor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002037407A JP2003241998A (en) | 2002-02-14 | 2002-02-14 | Control structure extraction method, log shaping method and program therefor |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2003241998A true JP2003241998A (en) | 2003-08-29 |
Family
ID=27779015
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002037407A Pending JP2003241998A (en) | 2002-02-14 | 2002-02-14 | Control structure extraction method, log shaping method and program therefor |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2003241998A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009295021A (en) * | 2008-06-06 | 2009-12-17 | Internatl Business Mach Corp <Ibm> | Sequence diagram creation device, sequence diagram creation method, and computer program |
| JP2020144452A (en) * | 2019-03-04 | 2020-09-10 | ファナック株式会社 | Control system |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6470838A (en) * | 1987-09-11 | 1989-03-16 | Hitachi Ltd | Exclusive control system |
| JPH03260742A (en) * | 1990-03-12 | 1991-11-20 | Hitachi Ltd | Program trace display method |
| JPH04217034A (en) * | 1990-12-19 | 1992-08-07 | Fujitsu Ltd | Display system for program trace |
| JPH04337843A (en) * | 1991-05-15 | 1992-11-25 | Hitachi Ltd | Program operation display method |
-
2002
- 2002-02-14 JP JP2002037407A patent/JP2003241998A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6470838A (en) * | 1987-09-11 | 1989-03-16 | Hitachi Ltd | Exclusive control system |
| JPH03260742A (en) * | 1990-03-12 | 1991-11-20 | Hitachi Ltd | Program trace display method |
| JPH04217034A (en) * | 1990-12-19 | 1992-08-07 | Fujitsu Ltd | Display system for program trace |
| JPH04337843A (en) * | 1991-05-15 | 1992-11-25 | Hitachi Ltd | Program operation display method |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009295021A (en) * | 2008-06-06 | 2009-12-17 | Internatl Business Mach Corp <Ibm> | Sequence diagram creation device, sequence diagram creation method, and computer program |
| JP2020144452A (en) * | 2019-03-04 | 2020-09-10 | ファナック株式会社 | Control system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112100054B (en) | A program static analysis method and system for data management and control | |
| CN109800175B (en) | A method for detecting reentrancy vulnerabilities of Ethereum smart contracts based on code instrumentation | |
| US8656352B2 (en) | System and method for synchronized workflow management | |
| US6981249B1 (en) | Methods for enhancing type reconstruction | |
| US7934205B2 (en) | Restructuring computer programs | |
| JPH08512152A (en) | Incremental generation system | |
| WO2021128973A1 (en) | Combination method and apparatus for multiple change versions of software codes | |
| JPS6375835A (en) | Apparatus for generating intended code, program, list and design document | |
| US20110145799A1 (en) | Path-sensitive dataflow analysis including path refinement | |
| CN105138335A (en) | Function call path extracting method and device based on control flow diagram | |
| US20090031281A1 (en) | Method and System for Creating Visual Programs | |
| CN105243018B (en) | A kind of class testing data creation method of object-oriented | |
| CN119248347B (en) | Code reconstruction method and system based on data stream slicing and large language model driving | |
| Zhang et al. | Bidirectional object-oriented programming: Towards programmatic and direct manipulation of objects | |
| US9298858B1 (en) | System and method for reducing models based on a criterion | |
| CN116501742A (en) | A Simple and Flexible Tabular Data Acquisition and Output Method, Medium and System | |
| JP2003241998A (en) | Control structure extraction method, log shaping method and program therefor | |
| KR102329368B1 (en) | Information processing apparatus, information processing method, and information processing program stored in a recording medium | |
| Allen | Interprocedural analysis and the information derived by it | |
| CN111708572B (en) | A method for automatic generation of control flow diagram based on Clang program structure | |
| CN112817599B (en) | Formal Semantics of Software Functions and Formal Proof Script Automatic Generation Method | |
| Mosses | Component-based description of programming languages | |
| JP2002288004A (en) | Program source processing device, program source processing method, and program source processing program | |
| Bülow | Proof visualization for the lean 4 theorem prover | |
| Murphy-Hill | Improving refactoring with alternate program views |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050912 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050920 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20051118 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20060124 |