JP5572619B2 - Computer for calculating the number of trace information, method for calculating the number of trace information, and program for calculating the number of trace information - Google Patents

Computer for calculating the number of trace information, method for calculating the number of trace information, and program for calculating the number of trace information Download PDF

Info

Publication number
JP5572619B2
JP5572619B2 JP2011264227A JP2011264227A JP5572619B2 JP 5572619 B2 JP5572619 B2 JP 5572619B2 JP 2011264227 A JP2011264227 A JP 2011264227A JP 2011264227 A JP2011264227 A JP 2011264227A JP 5572619 B2 JP5572619 B2 JP 5572619B2
Authority
JP
Japan
Prior art keywords
program
trace information
computer
execution
node
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
JP2011264227A
Other languages
Japanese (ja)
Other versions
JP2013117803A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2011264227A priority Critical patent/JP5572619B2/en
Publication of JP2013117803A publication Critical patent/JP2013117803A/en
Application granted granted Critical
Publication of JP5572619B2 publication Critical patent/JP5572619B2/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 computer for calculating the number of trace information acquired by a tracer, a method for calculating the number of trace information acquired by the tracer, and a program for calculating the number of trace information acquired by the tracer.

企業で使用される計算機システムには、高い信頼性が求められているため、何らかの障害が発生した場合、システム保守担当者は迅速にその障害からシステムを回復させなければならない。そのため、システム保守担当者は、プログラムの構造やプログラム実行時の挙動を把握するための支援ツールであるプログラムトレーサ(以下、「トレーサ」という。)を使用し、プログラム実行における障害箇所を即時に発見している。トレーサは、実行プログラムにおけるメソッドの呼出し情報をトレースファイルとして出力するため、その出力されたトレース情報を解析することにより、障害発生を再現せずとも障害発生過程を把握することができる。   A computer system used in a company is required to have high reliability. Therefore, when a failure occurs, a system maintenance person must quickly recover the system from the failure. For this reason, system maintenance personnel use program tracer (hereinafter referred to as “tracer”), which is a support tool for grasping the program structure and behavior during program execution, to instantly find the faulty part in program execution. doing. Since the tracer outputs method call information in the execution program as a trace file, by analyzing the output trace information, it is possible to grasp the failure occurrence process without reproducing the failure occurrence.

特許文献1に開示されているトレース情報の取得方法のように、サンプリングを用い、取得するトレース情報を間引くことによってオーバヘッドを低減する手法が存在する。しかしながら、障害解析では正確なプログラム実行経路を取得する必要があるため、サンプリングを適用するには好ましくない。また、別のオーバヘッド対策として、トレーサ内部にトレース情報を一時的に保持するバッファを用意する手法がある。この手法ではメモリ上のバッファにキャッシュすることによって、ファイルなどへの外部出力を軽減できるため、オーバヘッドを削減することができる。しかし、トレース対象となるプログラムのトレース情報がバッファのサイズを超えた場合、外部出力を行うか、もしくは取得情報の一部を上書きする必要があり、前者の場合は高オーバヘッド、後者の場合は情報損失という問題が発生する。   As in the trace information acquisition method disclosed in Patent Document 1, there is a technique for reducing overhead by using sampling and thinning out trace information to be acquired. However, since it is necessary to acquire an accurate program execution path in failure analysis, it is not preferable to apply sampling. As another overhead countermeasure, there is a method of preparing a buffer that temporarily holds trace information inside the tracer. In this method, since the external output to a file or the like can be reduced by caching in a buffer on the memory, the overhead can be reduced. However, if the trace information of the program to be traced exceeds the size of the buffer, it is necessary to perform external output or overwrite a part of the acquired information. In the former case, high overhead, in the latter case information The problem of loss occurs.

上記の問題を解決する方法として、特許文献2には、マルチタスク環境で動作する通信制御プログラムを一例とするアプリケーションプログラムを実行する際に用いられるバッファのバッファサイズを調整する技術が開示されている。特許文献2には、アプリケーションプログラムを実行する際、プログラムの実行パターンと割り当てたバッファサイズとを記録し、記録した実行パターンが再度出現したとき、それに対応するサイズのバッファを割り当てる技術が開示されている。   As a method for solving the above problem, Patent Document 2 discloses a technique for adjusting the buffer size of a buffer used when executing an application program, for example, a communication control program operating in a multitask environment. . Patent Document 2 discloses a technique for recording an execution pattern of a program and an allocated buffer size when executing an application program, and allocating a buffer having a size corresponding to the recorded execution pattern when it appears again. Yes.

特開2010−9282号公報JP 2010-9282 A 特開平10−69429号公報JP 10-69429 A

特許文献2に開示された技術は、通常の運用時のようにプログラムの実行パターンが繰り返し現れる場合、そのプログラムを一度実行した後であれば、プログラム実行1回あたりに取得されるトレース情報の数を求めることができる。しかし、システム障害が発生した場合、通常とは異なるプログラムの実行パターンが現れるため、プログラム実行1回あたりに取得されるトレース情報の数は求めることはできない。また、取得されるトレース情報の数をプログラム実行前に求めることはできないため、トレース情報を格納するために必要なバッファのサイズを予め決定しておくことは困難である。   In the technique disclosed in Patent Document 2, when the execution pattern of a program appears repeatedly as in normal operation, the number of trace information acquired per program execution is once after the program is executed once. Can be requested. However, when a system failure occurs, an execution pattern of a program different from the normal one appears, so the number of trace information acquired per program execution cannot be obtained. Further, since the number of pieces of trace information to be acquired cannot be obtained before executing the program, it is difficult to determine in advance the size of the buffer necessary for storing the trace information.

本発明の代表的な一形態によれば、トレーサによって取得するトレース情報の数を算出する計算機であって、前記計算機は、プログラムの流れを制御する要素を特定する制御部を有し、前記制御部は、前記プログラムの実行前に前記要素の数を特定し、前記特定した要素の数を基に、取得するトレース情報の数を算出することを特徴とする。   According to a representative aspect of the present invention, a computer that calculates the number of trace information acquired by a tracer, the computer having a control unit that identifies an element that controls a flow of a program, the control The unit specifies the number of elements before execution of the program, and calculates the number of pieces of trace information to be acquired based on the specified number of elements.

本発明によれば、トレーサによって取得するトレース情報の数を、プログラムを実行する前に算出することができる。   According to the present invention, the number of pieces of trace information acquired by the tracer can be calculated before executing the program.

本発明を適用した一実施の形態である第1の実施形態における計算機の全体構成を示す図である。It is a figure which shows the whole structure of the computer in 1st Embodiment which is one embodiment to which this invention is applied. 本発明を適用した第1の実施形態における計算機が行う処理の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the process which the computer in 1st Embodiment to which this invention is applied performs. 本発明を適用した計算機の第1の実施形態における静的解析データ生成処理の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the static analysis data generation process in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における実行プログラムを示す図である。It is a figure which shows the execution program in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における図4Aに示す実行プログラムの構成要素ツリーを示す図である。It is a figure which shows the component tree of the execution program shown to FIG. 4A in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるノード生成処理の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the node production | generation process in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるプログラム内に再帰メソッドを含む実行プログラムを示す図である。It is a figure which shows the execution program which contains a recursive method in the program in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における図6Aに示す実行プログラムのプログラム構成要素ツリーを示す図である。It is a figure which shows the program component tree of the execution program shown to FIG. 6A in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるプログラム内に複数の再帰メソッドを含む実行プログラムを示す図である。It is a figure which shows the execution program which contains several recursive methods in the program in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における図7Aに示す実行プログラムのプログラム構成要素ツリーを示す図である。It is a figure which shows the program component tree of the execution program shown to FIG. 7A in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるプログラム内にループを含む実行プログラムを示す図である。It is a figure which shows the execution program which contains a loop in the program in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における図8Aに示す実行プログラムのプログラム構成要素ツリーを示す図である。It is a figure which shows the program component tree of the execution program shown to FIG. 8A in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるプログラム内に条件分岐を含む実行プログラムを示す図である。It is a figure which shows the execution program which contains a conditional branch in the program in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における図9Aに示す実行プログラムのプログラム構成要素ツリーを示す図である。It is a figure which shows the program component tree of the execution program shown to FIG. 9A in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるカレントノード変更処理の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the current node change process in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるカレントノード復元処理の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the current node restoration process in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるバッファサイズ計算処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the buffer size calculation process in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるプログラム書換処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the program rewriting process in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるプローブ挿入前のプログラムの例である。It is an example of the program before probe insertion in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるプローブ挿入後のプログラムイメージを示す図である。It is a figure which shows the program image after the probe insertion in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるトレース情報取得処理の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the trace information acquisition process in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における実行プログラムを示す図である。It is a figure which shows the execution program in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における図17Bに示す実行プログラムから取得したトレース情報のバッファ格納例を示す図である。It is a figure which shows the buffer storage example of the trace information acquired from the execution program shown to FIG. 17B in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態におけるトレース出力例である。It is an example of the trace output in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における実行プログラムを示す図である。It is a figure which shows the execution program in 1st Embodiment of the computer to which this invention is applied. 本発明を適用した計算機の第1の実施形態における図19Aに示す実行プログラムの実行中に障害が発生した場合のトレース情報の出力例である。It is an output example of trace information when a failure occurs during execution of the execution program shown in FIG. 19A in the first embodiment of the computer to which the present invention is applied. 本発明を適用した一実施の形態である第2の実施形態における計算機の全体構成を示す図である。It is a figure which shows the whole structure of the computer in 2nd Embodiment which is one Embodiment to which this invention is applied. 本発明を適用した第2の実施形態における実行プログラムを示す図である。It is a figure which shows the execution program in 2nd Embodiment to which this invention is applied. 本発明を適用した第2の実施形態における図21Aに示す実行プログラムの実行履歴データの一例を示す図である。It is a figure which shows an example of the execution history data of the execution program shown to FIG. 21A in 2nd Embodiment to which this invention is applied. 本発明を適用した第2の実施形態におけるユーザ実行データの一例を示す図である。It is a figure which shows an example of the user execution data in 2nd Embodiment to which this invention is applied. 本発明を適用した第2の実施形態における計算機が行う処理の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the process which the computer in 2nd Embodiment to which this invention is applied. 本発明を適用した第2の実施形態における拡張バッファサイズ計算処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the expansion buffer size calculation process in 2nd Embodiment to which this invention is applied. 本発明を適用した第2の実施形態における実行確率によるバッファサイズ算出処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the buffer size calculation process by the execution probability in 2nd Embodiment to which this invention is applied. 本発明を適用した第2の実施形態における実行プログラムの各ノードの実行確率表を示す表示画面の一例を示す図である。It is a figure which shows an example of the display screen which shows the execution probability table | surface of each node of the execution program in 2nd Embodiment to which this invention is applied. 本発明を適用した第2の実施形態における図26Aに示す実行確率表を基に選択されたプログラム構成要素ツリーを示す。The program component tree selected based on the execution probability table | surface shown to FIG. 26A in 2nd Embodiment to which this invention is applied is shown. 本発明を適用した第2の実施形態におけるバッファ再割当処理の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the buffer reallocation process in 2nd Embodiment to which this invention is applied.

[第1の実施形態]
本発明を適用した計算機システムの第1の実施形態では、プログラムの障害解析に用いるトレーサにおいて、対象システム上のプログラム1回の実行で実行され得るプログラム構成要素の数をソースプログラム及びバイナリから求めるための方法を説明する。ここで、プログラム構成要素とは、プログラムの流れを制御する要素である。具体的には、メソッド、ループ、条件分岐、再帰、引数・返り値及びローカル変数等の変数アクセスを指す。なお、本実施形態はJava(登録商標)で記述されたシステムを対象として説明するが、他の言語で記述されたシステムに対しても有効である。また、以下の記述において、単にプログラムという場合、Javaのバイトコード(バイナリ)を指すこととする。ただし、プログラムの具体例を用いて説明する場合においては、説明の容易化のためプログラムをソースコードの形式で表現している。
[First Embodiment]
In the first embodiment of the computer system to which the present invention is applied, in the tracer used for program failure analysis, the number of program components that can be executed in one execution of the program on the target system is obtained from the source program and binary. The method will be described. Here, the program component is an element that controls the flow of the program. Specifically, it refers to variable access such as method, loop, conditional branch, recursion, argument / return value, and local variable. Although this embodiment will be described for a system described in Java (registered trademark), it is also effective for systems described in other languages. Further, in the following description, the term “program” refers to Java bytecode (binary). However, in the case of description using a specific example of the program, the program is expressed in the form of source code for easy explanation.

一般に、トレース対象のプログラム中にあるループ及び再帰内では、メソッドの呼出しをはじめとするプログラム構成要素の実行が著しく多くなってしまう。そのため、ループ及び再帰中の全てのプログラム構成要素に関する情報を取得するには、バッファサイズも取得数に比例して確保する必要があり、メモリを枯渇させる虞やメモリを計画的に使用することができない虞がある。   In general, in a loop and recursion in a program to be traced, the execution of program components such as method calls is remarkably increased. For this reason, in order to obtain information on all program components in the loop and recursion, it is necessary to secure the buffer size in proportion to the number of acquisitions. There is a possibility that it cannot be done.

本実施形態では、トレース対象のJavaプログラムからプログラム構成要素ツリーを生成する。そして、プログラム構成要素ツリーを元に、プログラム実行1回あたりのプログラム構成要素数を求め、トレース情報を格納するバッファのサイズを算出する。また、ループや再帰処理内部で障害が発生したとしても、障害を再現することなく障害発生原因を特定するために必要な、「ループや再帰が実行された履歴」、「ループや再帰の繰り返し回数」及び「繰り返しを構成する要素群の最終実行履歴」のみをバッファに格納する。これにより、プログラムにループや再帰の実行があったとしても、そのループや再帰の実行に伴う全てのトレース情報を取得する必要はないため、メモリの枯渇を生じさせることなく、メモリを計画的に使用することができる。   In the present embodiment, a program component tree is generated from a Java program to be traced. Then, based on the program component tree, the number of program components per program execution is obtained, and the size of the buffer storing the trace information is calculated. In addition, even if a failure occurs in the loop or recursion process, the "History of loop or recursion execution" or "Loop or recursion repeat count" required to identify the cause of the failure without reproducing the failure. "And" Last execution history of element group constituting repetition "are stored in the buffer. As a result, even if a loop or recursion is executed in the program, it is not necessary to acquire all trace information associated with the execution of the loop or recursion. Can be used.

以降では、図面を用いて本実施形態の構成及び処理の流れを詳細に説明する。
図1は、本発明を適用した第1の実施形態である計算機101の全体構成を示す。
計算機101は、CPU102とメモリ103とを有する。CPU102はJava仮想マシン104を実行する。Java仮想マシン104は、プログラム読込部105、静的解析データ生成部106、静的解析データ読込部107、バッファサイズ計算部108、プログラム書換部109、プログラム実行部110、トレース情報取得部111及びトレース情報出力部112を含む。上記の機能部は、CPU102と、プログラム113とが協働することにより実現される。
メモリ103は、プログラム113、拡張プログラム114、静的解析データ115及びトレース情報117を保持するバッファ116を有する。なお、プログラム113、拡張プログラム114、静的解析データ115はメモリ103上ではなく、外部記憶装置118に格納されていることもある。また、本実施形態では、メモリ103内にバッファ116を設けることとして説明するが、バッファ116をCPU102に設ける構成でもよい。
Hereinafter, the configuration and processing flow of the present embodiment will be described in detail with reference to the drawings.
FIG. 1 shows the overall configuration of a computer 101 according to the first embodiment to which the present invention is applied.
The computer 101 has a CPU 102 and a memory 103. The CPU 102 executes the Java virtual machine 104. The Java virtual machine 104 includes a program reading unit 105, a static analysis data generation unit 106, a static analysis data reading unit 107, a buffer size calculation unit 108, a program rewriting unit 109, a program execution unit 110, a trace information acquisition unit 111, and a trace. An information output unit 112 is included. The functional unit described above is realized by the cooperation of the CPU 102 and the program 113.
The memory 103 has a buffer 116 that holds a program 113, an extension program 114, static analysis data 115, and trace information 117. Note that the program 113, the extended program 114, and the static analysis data 115 may be stored in the external storage device 118 instead of on the memory 103. In the present embodiment, the buffer 116 is described as being provided in the memory 103, but the buffer 116 may be provided in the CPU 102.

プログラム読込部105は、メモリ103に格納されたプログラム113を読込む。
静的解析データ生成部106は、読込んだプログラム113の静的解析データ115を生成する。なお、静的解析データ115は、プログラム構成要素の実行順序を示す情報である。本実施形態では、プログラム構成要素をノードとしたツリー(以下、「プログラム構成要素ツリー」という。)で、静的解析データ115を構成するものとする。
静的解析データ読込部107は、静的解析データ生成部106で生成された静的解析データ115をメモリ103上から読込む。
バッファサイズ計算部108は、読込んだ静的解析データ115からバッファサイズを計算し、計算したバッファサイズのバッファ116をメモリ103上に生成する。
プログラム書換部109は、プログラム113にトレース情報117を取得するためのプローブを挿入し、プローブを挿入した拡張プログラム114をメモリ103に配置する。
プログラム実行部110は、拡張プログラム114をメモリ103から読込み、実行する。
トレース情報取得部111は、実行した拡張プログラム114からトレース情報117を取得し、取得したトレース情報117をバッファ116に格納する。
トレース情報出力部112は、バッファ116に格納したトレース情報117を外部記憶装置118に出力する。トレース情報117は、プログラム113を実行する度に取得されるため、取得済みのトレース情報117を外部記憶装置118に出力することで、バッファ116の使用量やメモリ103の負荷を低減することができる。
The program reading unit 105 reads the program 113 stored in the memory 103.
The static analysis data generation unit 106 generates static analysis data 115 of the read program 113. The static analysis data 115 is information indicating the execution order of program components. In the present embodiment, it is assumed that the static analysis data 115 is composed of a tree having program components as nodes (hereinafter referred to as “program component tree”).
The static analysis data reading unit 107 reads the static analysis data 115 generated by the static analysis data generation unit 106 from the memory 103.
The buffer size calculation unit 108 calculates a buffer size from the read static analysis data 115, and generates a buffer 116 having the calculated buffer size on the memory 103.
The program rewriting unit 109 inserts a probe for acquiring the trace information 117 into the program 113 and arranges the extended program 114 into which the probe is inserted in the memory 103.
The program execution unit 110 reads the extension program 114 from the memory 103 and executes it.
The trace information acquisition unit 111 acquires the trace information 117 from the executed extension program 114 and stores the acquired trace information 117 in the buffer 116.
The trace information output unit 112 outputs the trace information 117 stored in the buffer 116 to the external storage device 118. Since the trace information 117 is acquired every time the program 113 is executed, the usage amount of the buffer 116 and the load on the memory 103 can be reduced by outputting the acquired trace information 117 to the external storage device 118. .

図2は、本実施形態の計算機101で実行する処理全体の流れを示すフローチャートである。
はじめに、S201で、プログラム読込部105が、メモリ103上に格納されているプログラム113を読込む。
次に、S202で、静的解析データ生成部106が、静的解析データ115が未生成であるか否かを確認する。静的解析データ115が未生成である場合(S202:Yes)、S203で、静的解析データ生成部106が、メモリ103上にあるプログラム113から静的解析データ115を生成し、メモリ103に配置する(静的解析データ生成処理)。静的解析データ115が生成済みである場合(S202:No)、S204で、静的解析データ読込部107が、メモリ103上から静的解析データ115を読込む(静的解析データ読込処理)。
次に、S205で、バッファサイズ計算部108が、静的解析データ115を基にバッファサイズを計算し、メモリ103上に計算したバッファサイズのバッファ116を生成する(バッファサイズ計算処理)。
次に、S206で、プログラム書換部109が、読込んだプログラム113にトレース情報117を取得するためのプローブを挿入し、プローブ挿入済みのプログラムを拡張プログラム114としてメモリ103に配置する(プログラム書換処理)。
次に、S207で、プログラム実行部110が、拡張プログラム114をメモリ103から読込み、読込んだ拡張プログラム114を実行しながらトレース情報117を取得する(プログラム実行処理)。このとき、取得したトレース情報117に障害発生しているか否かを確認する。なお、障害発生とは、Java仮想マシン104やJava仮想マシン104上で動作しているスレッド(Javaスレッド)が不正終了するような障害、任意もしくは特定の例外が発生する障害及び結果的に不正が発生する障害のことを指す。
次に、S208で、トレース情報取得部111が、取得したトレース情報117を、バッファ116に格納する(トレース情報取得処理)。
最後に、S209で、トレース情報出力部112が、システムの障害発生等を契機に、バッファ116に格納したトレース情報117を画面や外部出力デバイス(不図示)に出力する(トレース情報出力処理)。
FIG. 2 is a flowchart showing the overall flow of processing executed by the computer 101 of this embodiment.
First, in S <b> 201, the program reading unit 105 reads the program 113 stored on the memory 103.
Next, in S202, the static analysis data generation unit 106 checks whether the static analysis data 115 has not been generated. If the static analysis data 115 has not been generated (S202: Yes), the static analysis data generation unit 106 generates the static analysis data 115 from the program 113 on the memory 103 and places it in the memory 103 in S203. (Static analysis data generation processing). When the static analysis data 115 has been generated (S202: No), the static analysis data reading unit 107 reads the static analysis data 115 from the memory 103 (static analysis data reading process) in S204.
In step S <b> 205, the buffer size calculation unit 108 calculates the buffer size based on the static analysis data 115 and generates the buffer 116 having the calculated buffer size on the memory 103 (buffer size calculation processing).
Next, in S206, the program rewriting unit 109 inserts a probe for acquiring the trace information 117 into the read program 113, and arranges the program into which the probe has been inserted in the memory 103 as the expansion program 114 (program rewriting process). ).
Next, in S207, the program execution unit 110 reads the extension program 114 from the memory 103, and acquires the trace information 117 while executing the read extension program 114 (program execution process). At this time, it is confirmed whether or not a failure has occurred in the acquired trace information 117. The failure occurrence means that the Java virtual machine 104 or a thread (Java thread) operating on the Java virtual machine 104 terminates illegally, a failure in which an arbitrary or specific exception occurs, and an illegal operation as a result. Refers to a failure that occurs.
Next, in S208, the trace information acquisition unit 111 stores the acquired trace information 117 in the buffer 116 (trace information acquisition process).
Finally, in S209, the trace information output unit 112 outputs the trace information 117 stored in the buffer 116 to a screen or an external output device (not shown) when a system failure occurs (trace information output process).

以下、図2に示した各処理について、より詳細に説明する。
図3は、静的解析データ生成部106が行う静的解析データ生成処理(図2のS203)の処理の流れを示すフローチャートを示す。静的解析データ生成処理は、プログラム113を元にプログラム構成要素ツリーを生成する。なお、プログラム構成要素ツリーでは、プログラム構成要素をノードとして扱う。また、ループや条件分岐等のボディ部(ループや条件分岐内における実処理部分)に存在する構成要素は、それらを内包する構成要素(ループノード、条件分岐ノード、再帰ノード)を親ノードとする子ノードとして扱う。
Hereinafter, each process shown in FIG. 2 will be described in more detail.
FIG. 3 is a flowchart showing the flow of the static analysis data generation process (S203 in FIG. 2) performed by the static analysis data generation unit 106. In the static analysis data generation process, a program component tree is generated based on the program 113. In the program component tree, program components are handled as nodes. In addition, a component existing in a body part (actual processing part in a loop or conditional branch) such as a loop or conditional branch is a parent node of a component (loop node, conditional branch node, or recursive node) that contains them. Treat as a child node.

はじめに、S301で、トレース対象のプログラム113に対して制御フロー解析を実行する。制御フロー解析とは、プログラム113を実行したときのプログラムの流れを、プログラム構成要素単位で抽出することをいう。
次に、S302で、プログラム113から始点メソッドを探索し、探索した始点メソッドに対応するノードを生成する。始点メソッドはJavaでいうmainメソッド、スレッドプログラミングのrunメソッド、サーブレットのdoGetメソッド等の処理の始点となるメソッドとする。なお、始点メソッドはユーザが任意で指定することもできる。
次に、S303で、生成したノードをカレントノードに設定する。カレントノードとは、プログラム構成要素ツリーに子ノードを追加する際の親ノードを意味する。
次に、S304で、設定したカレントノードに属するプログラム内から子ノードとなる次のプログラム構成要素を探す。
次に、S305で、探索したプログラム構成要素が、カレントノードに対応するプログラム構成要素の最後かどうかを確認する。すなわち、親ノードがメソッドノードなら、メソッドを構成する最終要素、ループノードならループボディを構成する最終要素であるかを確認する。
First, in S301, a control flow analysis is executed for the program 113 to be traced. Control flow analysis refers to extracting the program flow when the program 113 is executed in units of program components.
Next, in S302, a start point method is searched from the program 113, and a node corresponding to the searched start point method is generated. The starting point method is a method that becomes a starting point of processing such as a main method in Java, a run method of thread programming, and a doGet method of a servlet. Note that the start point method can be arbitrarily specified by the user.
Next, in S303, the generated node is set as the current node. The current node means a parent node when a child node is added to the program component tree.
Next, in S304, the next program component that becomes a child node is searched for in the program belonging to the set current node.
In step S305, it is checked whether the searched program component is the last program component corresponding to the current node. That is, if the parent node is a method node, it is confirmed whether it is the last element constituting the method, and if it is a loop node, it is the last element constituting the loop body.

ここで、設定したカレントノードに対応するプログラム構成要素の最後でない場合(S305:No)、S306で、S301で抽出したプログラム構成要素を制御フロー順に読込む。
そして、S307で、読込んだプログラム構成要素が、ノード生成対象であるかを確認する。ここで、ノード生成対象である場合(S307:Yes)、S308で、ノード生成処理を行う。ノード生成対象でない場合(S307:No)、S305に戻る(ノード生成処理)。
次に、S309で、現在のカレントノードから生成した新しいノードにカレントノードの変更を行う(カレントノード変更処理)。そして、S305に戻りカレントノードに対応するプログラム構成要素の最後かどうかを確認する。
If it is not the last program component corresponding to the set current node (S305: No), the program component extracted in S301 is read in the order of control flow in S306.
In step S307, it is confirmed whether the read program component is a node generation target. Here, if it is a node generation target (S307: Yes), node generation processing is performed in S308. If it is not a node generation target (S307: No), the process returns to S305 (node generation processing).
Next, in S309, the current node is changed to a new node generated from the current current node (current node changing process). Then, the process returns to S305 to check whether it is the last program component corresponding to the current node.

一方、設定したカレントノードがプログラム構成要素の最後である場合(S305:Yes)、S310で、そのカレントノードが始点メソッドのプログラム構成要素の最後であるかを確認する。
カレントノードが、始点メソッドのプログラム構成要素の最後でない場合(S310:No)、S311で、現在カレントノードとして設定されているカレントノードを親ノードに設定する(カレントノード復元処理)。
他方、カレントノードが、始点メソッドのプログラム構成要素の最後である場合(S310:Yes)、S312で、生成したプログラム構成要素ツリーを静的解析データ115として、メモリ103に出力しノード生成処理を終了する。
On the other hand, if the set current node is the last program component (S305: Yes), it is checked in S310 whether the current node is the last program component of the start method.
If the current node is not the last program component of the start point method (S310: No), the current node currently set as the current node is set as the parent node in S311 (current node restoration process).
On the other hand, if the current node is the last program component of the start method (S310: Yes), the generated program component tree is output to the memory 103 as the static analysis data 115 in S312 and the node generation process is terminated. To do.

以上の静的解析データ生成処理について、具体例を用いてさらに詳細に説明する。図4Aに、計算機で実行されるプログラム113の一例として、プログラム401を示す。また、図4Bに、図4Aで示したプログラム401にノード生成処理を実行した場合のプログラム構成要素ツリーを示す。
まず、プログラム401について、制御フロー解析を行う(図3のS301)。そして、プログラム401からプログラムの始点メソッドであるmainメソッド402を探索し、mainメソッド402のノード405を生成する(S302)。次いで、ノード405をカレントノードに設定し(S303)、mainメソッド402内の次のプログラム構成要素を探す(S304)。その結果、mainメソッド402内のmethodA403のプログラム構成要素を抽出し、methodA403はプログラム構成要素の最後ではなく(S305:No)、さらにノード生成対象のプログラムであるため(S307:Yes)、methodA403のノード406を生成する(S308)。そして、カレントノード変更処理を行い(S309)、methodA403内の次のプログラム構成要素としてmethodB404を抽出し、methodB404のノード408を生成する。
The static analysis data generation process described above will be described in more detail using a specific example. FIG. 4A shows a program 401 as an example of the program 113 executed by the computer. FIG. 4B shows a program component tree when the node generation process is executed for the program 401 shown in FIG. 4A.
First, a control flow analysis is performed on the program 401 (S301 in FIG. 3). Then, the main method 402 that is the program start point method is searched from the program 401, and a node 405 of the main method 402 is generated (S302). Next, the node 405 is set as the current node (S303), and the next program component in the main method 402 is searched (S304). As a result, the program component of methodA403 in the main method 402 is extracted, and since methodA403 is not the last program component (S305: No), and is a program that is a node generation target (S307: Yes), the node of methodA403 406 is generated (S308). Then, a current node change process is performed (S309), methodB404 is extracted as the next program component in methodA403, and node 408 of methodB404 is generated.

図5は、静的解析データ生成部106が行うノード生成処理(図3のS308)の処理の流れを示すフローチャートを示す。ノード生成処理は、図3のS308でノード生成対象と判断されたノード(メソッドノード、再帰ノード、ループノード及び条件分岐ノード等)を生成する。なお、プログラム構成要素の判定には、図3のS301で得た制御フロー解析の結果を用いる。
はじめに、S501で、ノード生成対象のプログラム構成要素がメソッドを呼出すプログラム構成要素であるか否かを確認する。メソッドを呼出すプログラム構成要素である場合(S501:Yes)、S502で、そのプログラム構成要素が再帰メソッドであるか否かを判断する。そして、再帰メソッドである場合(S502:Yes)、S503で、再帰メソッドノードを生成する。再帰メソッドでない場合(S502:No)、S504で、メソッドノードを生成する。
FIG. 5 is a flowchart showing a process flow of the node generation process (S308 in FIG. 3) performed by the static analysis data generation unit 106. The node generation process generates nodes (method nodes, recursive nodes, loop nodes, conditional branch nodes, etc.) determined as node generation targets in S308 of FIG. Note that the result of the control flow analysis obtained in S301 of FIG.
First, in S501, it is confirmed whether or not the program component that is a node generation target is a program component that calls a method. If it is a program component that calls a method (S501: Yes), in S502, it is determined whether or not the program component is a recursive method. If the method is a recursive method (S502: Yes), a recursive method node is generated in S503. If it is not a recursive method (S502: No), a method node is generated in S504.

例えば、図6Aは、再帰メソッド602を含むプログラム601を示す。プログラム601のプログラム構成要素ツリーは、図6Bの603あるいは608のように表現される。methodBは602のように自分自身のメソッドを呼び出す再帰メソッドであり、プログラム構成要素ツリー603のノード606として表現される。また、ノード606内に示す数字は再帰ノードに一意に割り当てられる再帰IDである。また、再帰メソッドは、プログラム構成要素ツリー608の再帰ノード611のように1つのノードとして扱ってもよい。なお、図7Aに示すプログラム701のように、複数メソッドにまたがる再帰呼出しの場合、プログラム構成要素ツリーは図7Bで表現される。   For example, FIG. 6A shows a program 601 that includes a recursive method 602. The program component tree of the program 601 is expressed as 603 or 608 in FIG. 6B. methodB is a recursive method that calls its own method as in 602, and is expressed as a node 606 in the program component tree 603. The number shown in the node 606 is a recursion ID uniquely assigned to the recursive node. Further, the recursive method may be handled as one node like the recursive node 611 of the program component tree 608. In the case of a recursive call that extends over a plurality of methods like the program 701 shown in FIG. 7A, the program component tree is expressed in FIG. 7B.

次に、ノード生成対象のプログラム構成要素がメソッドを呼出すプログラム構成要素でない場合(S501:No)、S505で、そのプログラム構成要素がループを示すプログラム構成要素であるか否かを判断する。そして、ループを示すプログラム構成要素である場合(S505:Yes)、S506で、ループノードを生成する。   Next, when the program component that is a node generation target is not a program component that calls a method (S501: No), in S505, it is determined whether or not the program component is a program component that indicates a loop. If it is a program component indicating a loop (S505: Yes), a loop node is generated in S506.

例えば、図8Aに示すループを含むプログラム801に対するプログラム構成要素ツリーは、図8Bで示される。ループを示す802部分は、ループノードとして図8Bのforループノード807として示される。なお、forループノード807内の数字はループIDを表す。また、803及び804で示すループ内のメソッド呼出し群は、forループノード807の子ノード808及び809として示される。なお、図8は、forループのみの記載について例示しているが、whileループ、do whileループにおいても、forループと同様に、それぞれwhileループノード、do whileループノードと示しても良い。   For example, a program component tree for program 801 including the loop shown in FIG. 8A is shown in FIG. 8B. A portion 802 indicating a loop is shown as a for loop node 807 in FIG. 8B as a loop node. The number in the for loop node 807 represents the loop ID. A group of method calls in the loop indicated by 803 and 804 are shown as child nodes 808 and 809 of the for loop node 807. 8 illustrates the description of only the for loop, but the while loop and the do while loop may also be indicated as a while loop node and a do while loop node, respectively, similarly to the for loop.

次に、ノード生成対象のプログラム構成要素がループを示すプログラム構成要素でない場合(S505:No)、S507で、そのプログラム構成要素が条件分岐を示すプログラム構成要素であるか否かを判断する。条件分岐を示すプログラム構成要素である場合(S507:Yes)、S508で、条件分岐ノードを生成する。条件分岐を示すプログラム構成要素でない場合(S507:No)、ノード生成処理を終了する。   Next, when the program component to be generated is not a program component indicating a loop (S505: No), it is determined in S507 whether the program component is a program component indicating a conditional branch. If it is a program component indicating a conditional branch (S507: Yes), a conditional branch node is generated in S508. If it is not a program component indicating a conditional branch (S507: No), the node generation process is terminated.

例えば、図9Aに示す条件分岐を含むプログラム901のプログラム構成要素ツリーは、図9Bで示される。なお、902及び903の条件分岐を示す部分は、プログラム構成要素ツリー上では条件分岐ノード906及び909で表現される。なお、903のelse if文は902のif文で生成した条件分岐ノード906の子ノードとして表現され、904のelse文は903のelse if文で生成した条件分岐ノード909の子ノードとして表現される。また、906及び909の条件分岐ノード内の数字は条件分岐IDを表す。   For example, the program component tree of the program 901 including the conditional branch shown in FIG. 9A is shown in FIG. 9B. The portions indicating the conditional branches 902 and 903 are represented by conditional branch nodes 906 and 909 on the program component tree. The else if statement of 903 is expressed as a child node of the conditional branch node 906 generated by the if statement of 902, and the else statement of 904 is expressed as a child node of the conditional branch node 909 generated by the else if statement of 903. . The numbers in the conditional branch nodes 906 and 909 represent the conditional branch ID.

図10は、静的解析データ生成部106が行うカレントノード変更処理(図3のS309)の処理の流れを示すフローチャートを示す。カレントノード変更処理は、ノード生成処理(図3のS308)で生成した各ノードを、順にカレントノードに設定する。
はじめに、S1001で、ノード生成処理(図3のS308)で生成したノードがメソッドノードであるか否かを確認する。
生成したノードが、メソッドノードである場合(S1001:Yes)、S1002で、次に読み込む構成要素の位置を呼出し先メソッドの先頭とする。
そして、S1003で、ノード生成処理で生成したノードをカレントノードに設定し、カレントノード変更処理を終了する。
また、生成したノードが、メソッドノードでない場合(S1001:No)、S1003を実行し、カレントノード変更処理を終了する。
FIG. 10 is a flowchart showing the flow of the current node change process (S309 in FIG. 3) performed by the static analysis data generation unit 106. In the current node changing process, each node generated in the node generating process (S308 in FIG. 3) is set in order as the current node.
First, in S1001, it is confirmed whether or not the node generated in the node generation process (S308 in FIG. 3) is a method node.
If the generated node is a method node (S1001: Yes), in S1002, the position of the component to be read next is set as the head of the call destination method.
In step S1003, the node generated by the node generation process is set as the current node, and the current node change process ends.
If the generated node is not a method node (S1001: No), S1003 is executed, and the current node change process is terminated.

図11は、静的解析データ生成部106が行うカレントノード復元処理(図3のS312)の処理の流れを示すフローチャートを示す。カレントノード復元処理は、カレントノードをカレントノードの親ノードに設定する。
はじめに、S1101で、プログラム構成要素の最後がメソッドであるか否かを確認する。プログラム構成要素の最後がメソッドである場合(S1101:Yes)、S1102で、プログラム113中のメソッドの呼出し元がある箇所に移動し、カレントノード復元処理を再開する。
そして、S1103で、現在カレントノードとして設定しているノードをカレントノードの親ノードに設定し、カレントノード復元処理を終了する。
また、プログラム構成要素の最後がメソッドでない場合(S1101:No)、S1103を実行しカレントノード復元処理を終了する。
以上が、静的解析データ生成処理の流れである。
FIG. 11 is a flowchart showing the flow of the current node restoration process (S312 in FIG. 3) performed by the static analysis data generation unit 106. In the current node restoration process, the current node is set as a parent node of the current node.
First, in S1101, it is confirmed whether or not the last program component is a method. If the last program component is a method (S1101: Yes), in S1102, the method is moved to a location where the method call source is located in the program 113, and the current node restoration process is resumed.
In step S1103, the node currently set as the current node is set as the parent node of the current node, and the current node restoration process is terminated.
If the last program component is not a method (S1101: No), S1103 is executed and the current node restoration process is terminated.
The above is the flow of the static analysis data generation process.

次いで、図12にバッファサイズ計算処理の流れを示すフローチャートを示す。バッファサイズ計算処理は、静的解析データ115中のプログラム構成要素ツリーのノード数に基づいてバッファサイズを算出し、求めたバッファサイズのバッファ116を確保する。
はじめに、S1201で、静的解析データ115からプログラム構成要素ツリーの総ノード数を取得する。例えば、図9Bに示すプログラム構成要素ツリーの総ノード数は905〜912の8である。
次に、S1202で、総ノード数をもとにバッファサイズを算出する。なお、本実施形態では、バッファサイズを、「バッファサイズ=プログラム構成要素ツリーの総ノード数×1プログラム構成要素分のトレース情報を取得するのに必要なバッファサイズ」より求めるものとする。
次に、S1203で、メモリ103に算出したバッファサイズのバッファ領域をバッファ116として確保する。
FIG. 12 is a flowchart showing the flow of the buffer size calculation process. In the buffer size calculation process, the buffer size is calculated based on the number of nodes of the program component tree in the static analysis data 115, and the buffer 116 having the obtained buffer size is secured.
First, in S1201, the total number of nodes in the program component tree is acquired from the static analysis data 115. For example, the total number of nodes in the program component tree shown in FIG. 9B is 8 from 905 to 912.
In step S1202, the buffer size is calculated based on the total number of nodes. In this embodiment, the buffer size is obtained from “buffer size = total number of nodes in the program component tree × buffer size necessary to acquire trace information for one program component”.
In step S <b> 1203, a buffer area having the buffer size calculated in the memory 103 is secured as the buffer 116.

なお、本実施形態では、メソッドの階層的な呼出し関係を把握するために、メソッドの開始時と終了時にトレース情報117を取得するものとするが、どのタイミングでトレース情報117を取得するかは、ユーザが指定することができる。また、本実施形態では、条件分岐、ループ及び再帰に関しても、メソッドの場合と同様に各要素の開始及び終了時にトレース情報117を取得するものとする。   In this embodiment, in order to grasp the hierarchical calling relationship of methods, the trace information 117 is acquired at the start and end of the method. However, at what timing the trace information 117 is acquired, Can be specified by the user. In the present embodiment, with respect to conditional branching, looping, and recursion, the trace information 117 is acquired at the start and end of each element as in the case of the method.

そして、本実施形態では、1プログラム構成要素分の情報を取得するのに必要なバッファサイズを2とする。例えば、図9Bで示されるプログラム構成要素ツリーの総ノード数は、前述のように8であるため、図9Aのプログラム901の実行により取得するトレース情報117を格納するために必要なバッファサイズは、8×2=16と算出される。また、このバッファサイズはトレーサが保持する配列の長さであり、プログラム901の場合、メモリ103上のバッファ116は配列長16の配列となる。
なお、本実施形態では、1プログラム構成要素分のトレース情報117を取得するために必要なバッファサイズを2としているが、バッファサイズはトレース情報117を格納するバッファ116の仕様によってユーザが適宜指定することができる。
In this embodiment, the buffer size required to acquire information for one program component is set to 2. For example, since the total number of nodes in the program component tree shown in FIG. 9B is 8, as described above, the buffer size required to store the trace information 117 acquired by executing the program 901 in FIG. 9A is It is calculated as 8 × 2 = 16. The buffer size is the length of the array held by the tracer. In the case of the program 901, the buffer 116 on the memory 103 has an array length of 16.
In the present embodiment, the buffer size necessary to acquire the trace information 117 for one program component is set to 2, but the user appropriately specifies the buffer size according to the specifications of the buffer 116 for storing the trace information 117. be able to.

図13は、プログラム書換部109が行うプログラム書換処理(図2のS206)の処理の流れを示すフローチャートを示す。プログラム書換処理は、プログラム読込処理(図2のS201)で読込んだプログラム113のトレース情報117を取得するために、プログラム113にプローブを挿入する。なお、本実施形態では、Javaが持つBytecode Instrumentation機能を用いて、トレーサで取得する各イベントに該当するバイトコードの前後にイベントを取得するためのプローブを挿入する。   FIG. 13 is a flowchart showing the flow of the program rewriting process (S206 in FIG. 2) performed by the program rewriting unit 109. In the program rewriting process, a probe is inserted into the program 113 in order to acquire the trace information 117 of the program 113 read in the program reading process (S201 in FIG. 2). In the present embodiment, a probe for acquiring events is inserted before and after the bytecode corresponding to each event acquired by the tracer using the Bytecode Instrumentation function of Java.

はじめに、S1301で、メモリ103上のプログラム113に読込むクラスがあるか否かを確認する。ここでいうクラスとは、Javaソースコードから生成したバイトコード群(バイナリ)とする。読込むクラスがある場合(S1301:Yes)、S1302で、メモリ103上のプログラム113からクラスを読込む。
次に、S1303で、読込んだクラスがプログラム書換え対象のクラスか否かを確認する。読込んだクラスが書換え対象である場合(S1303:Yes)、S1304に進む。書換え対象のメソッドがない場合(S1303:No)、S1301に戻る。
次に、S1304で、書換え対象のメソッドがあるか否かを確認する。書換え対象のメソッドがある場合(S1304:Yes)、S1305で、再帰関連、メソッド関連、ループ関連及び条件分岐関連の各ノードに対応するイベント取得用プローブを挿入する。書換え対象のメソッドがない場合(S1304:No)、S1301に戻る。
そして、S1301で読込むクラスがない場合(S1301:No)、S1306で、書換えたプログラムを拡張プログラム114としてメモリ103に出力し、プログラム書換処理を終了する。
First, in S1301, it is confirmed whether or not there is a class to be read in the program 113 on the memory 103. The class here is a byte code group (binary) generated from Java source code. If there is a class to be read (S1301: Yes), the class is read from the program 113 on the memory 103 in S1302.
In step S1303, it is checked whether the read class is a class to be rewritten. If the read class is the target of rewriting (S1303: Yes), the process proceeds to S1304. If there is no method to be rewritten (S1303: No), the process returns to S1301.
In step S1304, it is confirmed whether there is a method to be rewritten. When there is a method to be rewritten (S1304: Yes), in S1305, an event acquisition probe corresponding to each node related to recursion, method, loop, and conditional branch is inserted. If there is no method to be rewritten (S1304: No), the process returns to S1301.
If there is no class to be read in S1301 (S1301: No), the rewritten program is output to the memory 103 as the extended program 114 in S1306, and the program rewriting process is terminated.

なお、本実施形態で取得するイベントは、「メソッドの開始・終了」、「再帰の開始・終了」、「ループの開始・終了」及び「条件分岐の開始・終了」であるとする。図14に、プログラム1401に、「メソッドの開始・終了」、「再帰の開始・終了」、「ループの開始・終了」のプローブを挿入したイメージを示し、図15に「条件分岐の開始・終了」のプローブを挿入したイメージを示す。   The events acquired in this embodiment are assumed to be “method start / end”, “recursion start / end”, “loop start / end”, and “conditional branch start / end”. 14 shows an image in which probes of “method start / end”, “recursion start / end”, and “loop start / end” are inserted in the program 1401, and FIG. 15 shows “condition branch start / end”. The image which inserted the probe of "is shown.

代表して、図15に示すプローブ挿入後のイメージについて詳細に説明する。
methodEntry 1502は、メソッドの開始イベントを取得するためのプローブである。methodEntry 1502を用いることで、メソッド固有のIDを取得し、どのメソッドが開始したかを把握することができる。なお、methodEntry 1502はメソッドの処理の先頭に挿入する。
ifEntry 1503は、条件分岐の開始イベントを取得するためのプローブである。ifEntry 1503を用いることで、条件分岐固有のIDと条件分岐が保持する条件とを取得し、どの条件分岐が開始したかを把握することができる。なお、ifEntry 1503は条件分岐の処理の先頭に挿入する。
As a representative, the image after the probe insertion shown in FIG. 15 will be described in detail.
A methodEntry 1502 is a probe for acquiring a method start event. By using methodEntry 1502, it is possible to acquire a method-specific ID and grasp which method has started. Note that methodEntry 1502 is inserted at the beginning of the method processing.
The ifEntry 1503 is a probe for acquiring a conditional branch start event. By using the ifEntry 1503, it is possible to acquire the ID unique to the conditional branch and the condition held by the conditional branch and grasp which conditional branch has started. Note that ifEntry 1503 is inserted at the head of conditional branch processing.

recursiveEntry 1504は、再帰の開始イベントを取得するためのプローブである。recursiveEntry 1504を用いることで、再帰固有のIDと再帰の繰り返し回数とを取得し、どの再帰が何回繰り返し実行されたのかを把握することができる。なお、recursiveEntry 1504は、再帰メソッドの処理の先頭に挿入する。
recursiveExit 1505は、再帰の終了イベントを取得するためのプローブである。recursiveExit 1505を用いることで、再帰固有のIDを取得し、どの再帰が実行終了したかを把握することができる。なお、recursiveExit 1505は、再帰処理終了直後に挿入する。
The recursiveEntry 1504 is a probe for acquiring a recursion start event. By using recursiveEntry 1504, it is possible to acquire the ID unique to the recursion and the number of recursion iterations, and to know which recursion has been repeatedly executed. The recursive entry 1504 is inserted at the beginning of the recursive method process.
The recursive Exit 1505 is a probe for acquiring a recursion end event. By using recursiveExit 1505, it is possible to acquire a unique ID of recursion and grasp which recursion has been executed. The recursiveExit 1505 is inserted immediately after the recursive process is completed.

forLoopEntry 1506は、ループ(forループ)の開始イベントを取得するためのプローブである。forLoopEntry 1506を用いることで、ループ固有のIDとループの繰り返し回数とを取得し、どのループが何回繰り返し実行されたかを把握することができる。なお、forLoopEntry 1506はループ内の繰り返し処理の先頭に挿入する。また、このforLoopEntry 1506は何度も実行される。これは、forLoopEntry 1506の実行により、繰り返し回数を把握するためである。
forLoopExit 1507は、forループの終了イベントを取得するためのプローブである。forLoopExit 1507を用いることで、ループ固有のIDを取得し、どのループが実行終了したかを把握することができる。なお、forLoopExit 1507は、ループ処理終了直後に挿入する。
The forLoopEntry 1506 is a probe for acquiring a start event of a loop (for loop). By using forLoopEntry 1506, it is possible to acquire a loop-specific ID and the number of loop repetitions, and to know which loop has been repeatedly executed. The forLoopEntry 1506 is inserted at the beginning of the iterative process in the loop. The forLoopEntry 1506 is executed many times. This is because the number of repetitions is grasped by executing forLoopEntry 1506.
The forLoopExit 1507 is a probe for acquiring a for loop end event. By using forLoopExit 1507, it is possible to acquire an ID unique to the loop and grasp which loop has finished executing. The forLoopExit 1507 is inserted immediately after the end of the loop process.

methodExit 1508は、メソッドの終了イベントを取得するためのプローブである。methodExit 1508を用いることで、メソッド固有のIDを取得し、どのメソッドが終了したかを把握することができる。なお、methodExit 1508は、メソッド内の処理の最後に挿入する。
ifExit 1509は、条件分岐の終了イベントを取得するためのプローブである。ifExit 1509を用いることで、条件分岐固有のIDを取得し、どの条件分岐が終了したかを把握することができる。なお、ifExit 1509は条件分岐の最後に挿入する。
A methodExit 1508 is a probe for acquiring a method end event. By using the methodExit 1508, it is possible to acquire a method-specific ID and grasp which method has ended. Note that methodExit 1508 is inserted at the end of processing in the method.
The ifExit 1509 is a probe for acquiring a conditional branch end event. By using ifExit 1509, it is possible to acquire an ID unique to a conditional branch and grasp which conditional branch has ended. Note that ifExit 1509 is inserted at the end of the conditional branch.

また、1504及び1506にプローブの引数として記載されているcount1及びcount2は、ループあるいは再帰の繰り返し回数を表している変数であり、ループあるいは再帰の開始イベントを検出する度に1ずつ増加する。なお、上記のcount1及びcount2の繰り返し回数は、ループID及び再帰IDにつき一つ割り当てられる。   In addition, count1 and count2 described as probe arguments in 1504 and 1506 are variables indicating the number of loop or recursion iterations, and increase by 1 each time a loop or recursion start event is detected. The number of repetitions of count1 and count2 is assigned to each loop ID and recursion ID.

また、本実施形態では、1506及び1507のループに関するプローブをforループに限定して記述しているが、whileループあるいはdo whileループに対してwhileLoopEntryあるいはdoWhileLoopEntryのプローブといったforループ同様のプローブを設定しても良い。
そして、本実施形態では、各プローブの取得項目に関しても、取得項目を限定した記載となっているが、イベントの発生時間などの付加情報を取得してもよい。また、取得するイベントについても、上記した「メソッドの開始・終了」、「再帰の開始・終了」、「ループの開始・終了」及び「条件分岐の開始・終了」の8つのイベントに限定しているが、引数・返り値などの変数の取得・変更イベントなどのイベントを対象としても良い。
In this embodiment, the probes related to the loops 1506 and 1507 are limited to the for loop. However, a probe similar to the for loop, such as a while LoopEntry or a doWoopLoopEntry probe, is set for the while loop or the do while loop. May be.
In the present embodiment, the acquisition items of each probe are also described with limited acquisition items, but additional information such as the occurrence time of an event may be acquired. Also, the events to be acquired are limited to the above-mentioned eight events of “method start / end”, “recursion start / end”, “loop start / end”, and “condition branch start / end”. However, it is also possible to target events such as acquisition / change events of variables such as arguments and return values.

以上で説明したプログラム書換処理により、プローブを挿入したプログラム113を拡張プログラム114に書換える。また、拡張プログラム114は、生成後メモリ103に格納される。なお、このプログラム書換処理は、パッケージ名やクラス名などのユーザ指定がある場合、プログラム113全てに対して実施する必要はなく、指定されたメソッドに対してのみ実施してもよい。   The program 113 in which the probe is inserted is rewritten to the extended program 114 by the program rewriting process described above. The extension program 114 is stored in the generated memory 103. Note that this program rewriting process need not be performed for all the programs 113 when there is a user designation such as a package name or a class name, and may be performed only for a designated method.

図16は、トレース情報取得部111が行うトレース情報取得処理(図2のS208)の処理の流れを示すフローチャートである。トレース情報取得処理では、拡張プログラム114を実行することで得たトレース情報117をメモリ103上のバッファ116に格納する。
はじめに、S1601で、プローブを埋め込んだ拡張プログラム114を実行し、トレース情報117を取得する。
つぎに、S1602で、取得したトレース情報117が、ループの開始あるいは再帰の開始であるか否かを確認する。トレース情報117がループの開始あるいは再帰の開始である場合(S1602:Yes)、S1603で、ループあるいは再帰による繰り返し処理を初期化するために、ループあるいは再帰開始以降のトレース情報117をバッファ116から削除する。なお、初期化オーバヘッドが大きい場合、次のトレース情報117の格納位置を示すポインタを、ループノードもしくは再帰ノードの位置に戻してデータを上書きするようにしてもよい。
次に、S1604で、ループあるいは再帰による繰り返し処理を行った回数を記録する繰り返しカウンタの値を1増加させる。
そして、S1605で、トレース情報117を繰り返しカウンタの値とともにバッファ116に格納し、トレース情報117の取得処理を終了する。繰り返しカウンタは、ループ開始及び再帰開始の各イベントに対応するトレース情報117とともにバッファ116に格納する。
また、S1601で取得したトレース情報117が、ループあるいは再帰開始でない場合(S1602:No)、S1606で、取得したトレース情報117をバッファ116に格納する。
FIG. 16 is a flowchart showing the flow of the trace information acquisition process (S208 in FIG. 2) performed by the trace information acquisition unit 111. In the trace information acquisition process, the trace information 117 obtained by executing the extension program 114 is stored in the buffer 116 on the memory 103.
First, in S1601, the extension program 114 in which the probe is embedded is executed, and the trace information 117 is acquired.
Next, in S1602, it is confirmed whether the acquired trace information 117 is the start of a loop or the start of recursion. If the trace information 117 is the start of a loop or recursion (S1602: Yes), in S1603, the trace information 117 after the start of the loop or recursion is deleted from the buffer 116 in order to initialize the loop or recursion process. To do. If the initialization overhead is large, the pointer indicating the storage position of the next trace information 117 may be returned to the position of the loop node or recursive node to overwrite the data.
In step S1604, the value of the iteration counter that records the number of times the iteration processing by loop or recursion has been performed is incremented by one.
In step S1605, the trace information 117 is stored in the buffer 116 together with the value of the repetitive counter, and the process of acquiring the trace information 117 is terminated. The repetition counter is stored in the buffer 116 together with trace information 117 corresponding to each event of loop start and recursion start.
If the trace information 117 acquired in S1601 is not a loop or recursion start (S1602: No), the acquired trace information 117 is stored in the buffer 116 in S1606.

このように、本実施形態では、バッファ116内に格納したループや再帰などの繰り返し部分に該当するトレース情報117に対しては、トレース情報117の削除あるいは上書きを行う。そのため、ループや再帰が実行されたという履歴と、ループや再帰の繰り返し回数、その繰り返しの最終実行履歴のみがバッファ116上に残ることになる。これにより、プログラム113中に含まれる繰り返し処理によって、ループや再帰のプログラムを実行した際に発生するトレース情報117を全てバッファ116上に残すことは不要となり、必要以上に大きいサイズのバッファ116を確保しておく必要や、確保しておいたバッファ116が不足してしまうことはなく、メモリ103を計画的に効率よく使用することができる。   As described above, in this embodiment, the trace information 117 corresponding to the repeated portion such as loop or recursion stored in the buffer 116 is deleted or overwritten. Therefore, only the history that the loop or recursion has been executed, the number of iterations of the loop or recursion, and the final execution history of the iteration remain in the buffer 116. As a result, it is not necessary to leave all the trace information 117 generated when the loop or recursive program is executed by the iterative process included in the program 113, and a buffer 116 having a size larger than necessary is secured. The memory 103 can be used in a planned and efficient manner without the necessity of running out of the buffer 116 or the reserved buffer 116.

次に、図17を用いて、ループが含まれるプログラム113及びバッファ116の格納例について説明する。図17Aに、ループが含まれるプログラムの一例としてプログラム1701を示し、図17Bに、バッファ116上での格納例を示す
図17Bにおいて、「C」はメソッドの開始イベント、「Le」はループの開始イベント、「R」はメソッドの終了イベント又「Lx」はループの終了イベントをそれぞれ示す。矢印1723〜1727は、トレース情報117の次の格納先を指すポインタを示す。1707〜1712は、バッファ116上に格納されるトレース情報の第1状態から第6状態までの状態遷移図を示す。なお、1707〜1712で示す各状態遷移図は、バッファ116条にトレース情報117を格納する様の一部を模式的に示したものである。
Next, a storage example of the program 113 and the buffer 116 including the loop will be described with reference to FIG. 17A shows a program 1701 as an example of a program including a loop. FIG. 17B shows an example of storage on the buffer 116. In FIG. 17B, “C” is a method start event, and “Le” is a loop start. Event, “R” indicates a method end event, and “Lx” indicates a loop end event. Arrows 1723 to 1727 indicate pointers indicating the next storage destination of the trace information 117. 1707 to 1712 show state transition diagrams from the first state to the sixth state of the trace information stored on the buffer 116. Each state transition diagram indicated by reference numerals 1707 to 1712 schematically shows a part of the trace information 117 stored in the buffer 116.

まず、図17Aに示すプログラム1701を実行すると、mainメソッド1702の開始イベント及びその内部のmethodA1703の開始イベントが発生するため、第1状態1707のように、mainメソッドの開始イベント1713及びmethodAメソッドの開始イベント1714の2つの開始イベント示すトレース情報117が格納される。
次に、methodA1703内のループ1704が1回実行されると、第2状態1708のように、ループの開始イベント1715、methodB1705の開始イベント1716、methodB1705の終了イベント1717、methodC1706の開始イベント1718、methodC1706の終了イベント1719を示すトレース情報117が格納される。
First, when the program 1701 shown in FIG. 17A is executed, a start event of the main method 1702 and a start event of the methodA 1703 inside the main method 1702 are generated. Therefore, as shown in the first state 1707, the start event 1713 of the main method and the start of the methodA method Trace information 117 indicating two start events of the event 1714 is stored.
Next, when the loop 1704 in the method A 1703 is executed once, as shown in the second state 1708, the start event 1715 of the loop, the start event 1716 of the method B 1705, the end event 1717 of the method B 1705, the start event 1718 of the method C 1706, and the method C 1706 Trace information 117 indicating the end event 1719 is stored.

そして、1719の次の格納位置を示すポインタ1724をループ開始イベントLe 1715の位置に戻すことで、第3状態1709のようにループ開始イベントLe 1715から最後のメソッド終了イベントR 1719までのトレース情報117を削除する。あるいは、ポインタ1724をループ開始イベントLe 1715の位置に戻して、次回以降はトレース情報117を上書きして格納していく。これは、ループ開始イベントが再度発生するため、過去に取得した繰り返しデータの削除あるいは上書きによって繰り返し部分のトレース情報117を同じ格納先に格納するためである。   Then, by returning the pointer 1724 indicating the next storage position of 1719 to the position of the loop start event Le 1715, the trace information 117 from the loop start event Le 1715 to the last method end event R 1719 as in the third state 1709. Is deleted. Alternatively, the pointer 1724 is returned to the position of the loop start event Le 1715, and the trace information 117 is overwritten and stored thereafter. This is because the loop start event occurs again, and thus the trace information 117 of the repeated portion is stored in the same storage destination by deleting or overwriting the repeated data acquired in the past.

次に、繰り返し部分のトレース情報117の初期化後、第4状態1710のように、再度ループの開始イベント1715に対応するトレース情報117を格納する。このとき繰り返しカウンタをトレース情報117の付随情報として格納する。
次に、ループ処理が終了するとき、第5状態1711のように、バッファ116の最後にループ終了イベント1720を示すトレース情報117を格納する。
最後に、第6状態1712のように、methodAメソッドの終了イベント1721及びmainメソッドの終了イベント1722を示すトレース情報117を格納する。
Next, after initializing the trace information 117 of the repeated portion, the trace information 117 corresponding to the loop start event 1715 is stored again as in the fourth state 1710. At this time, the repetition counter is stored as accompanying information of the trace information 117.
Next, when the loop processing ends, trace information 117 indicating the loop end event 1720 is stored at the end of the buffer 116 as in the fifth state 1711.
Finally, as in the sixth state 1712, trace information 117 indicating the end event 1721 of the methodA method and the end event 1722 of the main method is stored.

また、バッファサイズに関しても、図17Aのプログラム1701において、ループ内にあるメソッドの数の合計が2、1メソッド分の呼出し情報を取得するのに必要なバッファサイズが2、ループの開始・終了情報が2であることから、バッファサイズは2×2+2=6となる。従って、1712のようにmain1702の開始イベント1713並びに1722及びmethodA1703の開始イベント1714並びに終了イベント1721を除いたバッファ使用量6と一致する。なお、上記の例はループの例のみを例示しているが、再帰がある場合でも、ループの例と同様に取得するトレース情報117の数を算出することができる。   Further, regarding the buffer size, in the program 1701 of FIG. 17A, the total number of methods in the loop is 2, the buffer size necessary for acquiring the call information for one method is 2, and the loop start / end information. Is 2, the buffer size is 2 × 2 + 2 = 6. Therefore, the buffer usage amount 6 except the start event 1713 and 1722 of the main 1702 and the start event 1714 and the end event 1721 of the method A 1703 as in 1712 is the same. Note that the above example illustrates only a loop example, but even when there is recursion, the number of pieces of trace information 117 to be acquired can be calculated in the same manner as the loop example.

このように、従来では、ループや再帰等の繰り返しを指示する要素がプログラムに含まれている場合、取得するトレース情報の数がループや再帰の繰り返し回数に依存するため、取得するトレース情報の数を算出することはできなかった。それに伴い、そのトレース情報を格納するために必要なバッファサイズを予め把握することができなかった。しかし、本実施形態では、上記のようにループや再帰等の繰り返しを指示する要素が含まれるプログラムから取得するトレース情報の数を算出することができるため、予めトレース情報を格納するためのバッファサイズを算出することもできる。   In this way, conventionally, when an element that indicates repetition such as loop or recursion is included in the program, the number of trace information to be acquired depends on the number of iterations of loop or recursion. Could not be calculated. As a result, the buffer size necessary for storing the trace information could not be grasped in advance. However, in this embodiment, since the number of trace information acquired from a program including an element that indicates repetition such as loop or recursion as described above can be calculated, the buffer size for storing the trace information in advance Can also be calculated.

図18に、トレース情報117の出力例を示す。本実施形態では、図1のトレース情報出力部112が、トレース情報117をファイルとして外部記憶装置118に出力する。なお、図18は、図17Aに示すプログラム1701を実行したトレース情報117の出力結果であり、1〜10の各行がトレース情報117を示している。
トレース情報1801は、mainメソッドの開始を表している。method_entry 1805はメソッドの開始イベント、main 1806はmethod_entry 1805の対象メソッドをそれぞれ表している。
トレース情報1802は、ループIDが1のループが開始されたこと及びそのループが100回繰り返し実行されたことを表している。for_loop_entry 1807はループの開始イベント、1808はループID、1809は繰り返しカウンタをそれぞれ表している。
トレース情報1803は、methodBが終了したことを表しており、method_exit 1810はメソッドの終了イベント、methodB 1811はmethod_exit 1810の対象メソッドをそれぞれ表している。
トレース情報1804は、ループIDが1のループが終了したことを表している。for_loop_exit 1812はループの終了イベント、1813はループIDをそれぞれ表している。
FIG. 18 shows an output example of the trace information 117. In the present embodiment, the trace information output unit 112 in FIG. 1 outputs the trace information 117 to the external storage device 118 as a file. 18 shows the output result of the trace information 117 obtained by executing the program 1701 shown in FIG. 17A, and each line 1 to 10 shows the trace information 117.
Trace information 1801 represents the start of the main method. A method_entry 1805 represents a method start event, and a main 1806 represents a target method of the method_entry 1805.
Trace information 1802 indicates that a loop with a loop ID of 1 has been started and that the loop has been repeatedly executed 100 times. For_loop_entry 1807 represents a loop start event, 1808 represents a loop ID, and 1809 represents a repeat counter.
The trace information 1803 indicates that methodB has ended, method_exit 1810 indicates a method end event, and methodB 1811 indicates a target method of method_exit 1810.
Trace information 1804 indicates that the loop with the loop ID 1 has been completed. For_loop_exit 1812 represents a loop end event, and 1813 represents a loop ID.

最後に、本実施形態によって取得できるトレース情報の利用態様の一例について説明する。計算機101のプログラム実行において、ループ実行中に障害が発生した場合を想定して説明する。図19Aに、計算機101が実行するプログラム113の一例としてプログラム1901を示す。図19Bに、ループ実行中に障害が発生した場合のトレース情報117の出力例を示す。
トレース情報1903より、forループの10回目の繰り返しを実施していたことがわかる。また、トレース情報1904より、methodCが開始されたことがわかる。従って、トレース情報1902の出力例から、forループの10回目の繰り返し中のmethodCで、何らかの障害が発生したことがわかる。
なお、図19Aはループが含まれるプログラム1901を実行した場合のトレース情報117の出力例を示しているが、再帰の場合も同様のトレース情報117の出力が可能である。従って、本実施形態では、ループ・再帰に対してトレース情報117の格納の省略を行っても、障害解析に十分なトレース情報117を残すことが可能である。
Finally, an example of how trace information can be acquired according to the present embodiment will be described. In the program execution of the computer 101, description will be made assuming that a failure occurs during loop execution. FIG. 19A shows a program 1901 as an example of the program 113 executed by the computer 101. FIG. 19B shows an output example of the trace information 117 when a failure occurs during loop execution.
It can be seen from the trace information 1903 that the for loop was repeated 10 times. Also, it can be seen from the trace information 1904 that methodC has been started. Therefore, it can be seen from the output example of the trace information 1902 that some failure has occurred in methodC during the tenth iteration of the for loop.
FIG. 19A shows an output example of the trace information 117 when a program 1901 including a loop is executed, but the same trace information 117 can be output in the case of recursion. Therefore, in the present embodiment, it is possible to leave sufficient trace information 117 for failure analysis even if the storage of the trace information 117 is omitted for loop / recursion.

[第2の実施形態]
次に、本発明を適用した計算機の第2の実施形態について説明する。第2の実施形態は、ユーザの実行頻度が高いプログラム実行経路を構成するプログラム構成要素を選択し、それを基にバッファサイズを算出する実施形態である。
図20に、第2の実施形態における計算機の全体構成を示す。第1の実施形態の全体構成図を示す図1と異なる構成について、以降では説明する。
[Second Embodiment]
Next, a second embodiment of a computer to which the present invention is applied will be described. The second embodiment is an embodiment in which a program component constituting a program execution path having a high user execution frequency is selected, and a buffer size is calculated based on the selected program component.
FIG. 20 shows the overall configuration of the computer in the second embodiment. A configuration different from FIG. 1 showing the overall configuration diagram of the first embodiment will be described below.

まず、本実施形態では、Java仮想マシン104上に、拡張バッファサイズ計算部2001、バッファ再割当部2002及びユーザ実行データ集計部2003の機能部を新たに設ける。また、メモリ103上に、実行履歴データ2004及びユーザ実行データ2005を保持する。
拡張バッファサイズ計算部2001は、プログラム構成要素ツリーから、実行確率の高いプログラム実行経路を抽出し、抽出されたプログラム実行経路に属するノード数からバッファサイズを計算する
バッファ再割当部2002は、割当てたバッファサイズのバッファが不足する場合に、バッファの再割当をする。
ユーザ実行データ集計部2003は、プログラムの実行履歴データ2004をユーザ毎に集計し、ユーザ実行データ2005を生成する。
実行履歴データ2004は、全ユーザのプログラム構成要素ツリーの各ノード(プログラム構成要素)の実行履歴を示すデータである。
ユーザ実行データ2005は、実行履歴データ2004をユーザ毎にプログラム構成要素の各ノードを実行した回数を集計したデータである。
なお、実行履歴データ2004及びユーザ実行データ2005は、メモリ103上ではなく、外部記憶装置118に格納されることもある。
First, in this embodiment, functional units of an extended buffer size calculation unit 2001, a buffer reallocation unit 2002, and a user execution data totaling unit 2003 are newly provided on the Java virtual machine 104. In addition, execution history data 2004 and user execution data 2005 are stored on the memory 103.
The extended buffer size calculation unit 2001 extracts a program execution path with a high execution probability from the program component tree, and calculates the buffer size from the number of nodes belonging to the extracted program execution path. The buffer reallocation unit 2002 allocates When the buffer size is insufficient, the buffer is reallocated.
A user execution data totaling unit 2003 totals program execution history data 2004 for each user, and generates user execution data 2005.
The execution history data 2004 is data indicating the execution history of each node (program component) of the program component tree of all users.
The user execution data 2005 is data obtained by tabulating the execution history data 2004 for the number of times each node of the program component is executed for each user.
Note that the execution history data 2004 and the user execution data 2005 may be stored not in the memory 103 but in the external storage device 118.

図21Bは、図21Aのプログラム2101を実行して得られる実行履歴データ2004の一例である。実行履歴データ2004は、ユーザID2102、ノード名2103及びタイムスタンプ2104から構成される。
図22は、図21Bの実行履歴データ2004から生成したユーザ実行データ2005の一例である。図22は、ユーザIDが「1」及び「2」であるユーザのユーザ実行データ2005を示しており、ユーザ実行データ2005は、ノード名2201と各ノードの実行回数の集計値を示す実行回数2202とから構成される。
FIG. 21B is an example of execution history data 2004 obtained by executing the program 2101 of FIG. 21A. The execution history data 2004 includes a user ID 2102, a node name 2103, and a time stamp 2104.
FIG. 22 is an example of user execution data 2005 generated from the execution history data 2004 of FIG. 21B. FIG. 22 shows user execution data 2005 of users whose user IDs are “1” and “2”. The user execution data 2005 includes the node name 2201 and the execution count 2202 indicating the total value of the execution count of each node. It consists of.

図23に、本発明を適用した第2の実施形態における処理の概要を示す。なお、S2301からS2304までの処理は、図2に示すS201からS204までの処理と同様の処理であるため説明を省略する。
まず、S2305で、拡張バッファサイズ計算部2001が、メモリ103上の実行履歴データ2004を読込み、読込んだ実行履歴データ2004と静的解析データ115からバッファサイズを算出する。そして、算出したサイズのバッファ116をメモリ103上に確保する(拡張バッファサイズ計算処理)。
次に、S2306で、プログラム書換部109が、プログラム書換処理を実行する(プログラム書換処理)。
次に、S2307で、プログラム書換部109が、プログラム実行処理を実行する(プログラム実行処理)。なお、このとき取得したトレース情報に障害が発生しているか否かを確認する。
次に、S2308で、プログラム書換部109が、トレース取得処理を実行する(トレース情報取得処理)。なお、S2306〜S2308は、第1の実施形態と同様の処理である。
次に、S2309で、バッファ再割当部2002が、割り当てたバッファ116が不足しているかを確認する。割り当てたバッファ116が不足している場合(S2309:Yes)、S2310で、バッファ再割当部2002が、バッファ再割当処理を行う(バッファ再割当処理)。バッファ再割当処理は、バッファ再割当部2002が、メモリ103上にあるバッファ116を、プログラム構成要素ツリーのノード数に基づいて計算したバッファサイズのバッファ116に置き換える処理である。そして、バッファ再割当処理の実行後、S2307に戻る。
また、割り当てたバッファ116が不足していない場合(S2309:No)、S2311でトレース情報117を出力し、一連の処理を終了する(トレース情報出力処理)。
FIG. 23 shows an outline of processing in the second embodiment to which the present invention is applied. Note that the processing from S2301 to S2304 is the same as the processing from S201 to S204 shown in FIG.
First, in step S <b> 2305, the extended buffer size calculation unit 2001 reads the execution history data 2004 on the memory 103, and calculates the buffer size from the read execution history data 2004 and the static analysis data 115. Then, the buffer 116 having the calculated size is secured on the memory 103 (extended buffer size calculation process).
Next, in S2306, the program rewriting unit 109 executes program rewriting processing (program rewriting processing).
Next, in S2307, the program rewriting unit 109 executes program execution processing (program execution processing). Note that whether or not a failure has occurred in the trace information acquired at this time is confirmed.
Next, in S2308, the program rewriting unit 109 executes a trace acquisition process (trace information acquisition process). Note that S2306 to S2308 are the same processes as those in the first embodiment.
In step S <b> 2309, the buffer reallocation unit 2002 confirms whether the allocated buffer 116 is insufficient. If the allocated buffer 116 is insufficient (S2309: Yes), in S2310, the buffer reallocation unit 2002 performs buffer reallocation processing (buffer reallocation processing). The buffer reallocation process is a process in which the buffer reallocation unit 2002 replaces the buffer 116 on the memory 103 with a buffer 116 having a buffer size calculated based on the number of nodes in the program component tree. Then, after executing the buffer reallocation process, the process returns to S2307.
If the allocated buffer 116 is not insufficient (S2309: No), the trace information 117 is output in S2311, and a series of processing ends (trace information output processing).

以降では、プログラム構成要素のツリーから、実行頻度の高いプログラム実行経路を抽出する方法について説明する。本実施形態では、プログラム構成要素ツリーの各ノードにノードの実行回数を割り当て、割り当てた実行回数から実行確率を求める。そして、求めた実行確率を元に実行頻度が高いノードから構成されるプログラム実行経路を抽出する。なお、実行確率の差は、条件分岐での分岐方向の偏りに起因することが多いため、本実施形態では条件分岐における実行確率を評価する。実行確率は、「条件分岐ノードの子ノードの実行回数÷条件分岐ノードの実行回数」から求めるものとする。   Hereinafter, a method for extracting a program execution path with high execution frequency from a tree of program components will be described. In this embodiment, the node execution count is assigned to each node of the program component tree, and the execution probability is obtained from the assigned execution count. Then, a program execution path composed of nodes having a high execution frequency is extracted based on the obtained execution probability. Since the difference in execution probability is often caused by a deviation in the branch direction in the conditional branch, the execution probability in the conditional branch is evaluated in this embodiment. The execution probability is obtained from “the number of executions of the child node of the conditional branch node ÷ the number of executions of the conditional branch node”.

図24は、拡張バッファサイズ計算部2001が行う拡張バッファサイズ計算処理の流れを示すフローチャートである。拡張バッファサイズ計算処理は、プログラム構成要素ツリーのノード数に基づくバッファサイズと、実行履歴データ2004とから算出したユーザごとに必要とされる効率的なバッファサイズとを求め、求めたバッファサイズのバッファ116をメモリ103上に確保する。
はじめに、S2401で、実行履歴データ2004をメモリ103から読込む。
次に、S2402で、静的解析データ115から総ノード数を取得する。
そして、S2403で、総ノード数に基づいて最大バッファサイズを算出する。
FIG. 24 is a flowchart showing the flow of extended buffer size calculation processing performed by the extended buffer size calculator 2001. The extended buffer size calculation process obtains a buffer size based on the number of nodes in the program component tree and an efficient buffer size required for each user calculated from the execution history data 2004, and a buffer having the obtained buffer size 116 is secured on the memory 103.
First, the execution history data 2004 is read from the memory 103 in S2401.
Next, in S2402, the total number of nodes is acquired from the static analysis data 115.
In step S2403, the maximum buffer size is calculated based on the total number of nodes.

次に、S2404で、実行確率によるバッファサイズを算出する。バッファサイズを算出するため、ユーザ実行データ2005に基づき、静的解析データ115から各条件分岐ノード及びその子ノードの実行確率を計算し、実行確率が高いプログラム実行経路を抽出する(実行確率によるバッファサイズ算出処理)。そして、そのプログラム実行経路に属するノード数から、バッファサイズを算出する。なお、S2404では、実行履歴データ2004をユーザごとに集計した上で、現在実行中のユーザに該当するデータを用いて、プログラム構成要素の実行確率を求めるものとする。
次に、S2405で、算出したバッファサイズのバッファ領域をメモリ103上に確保し、処理を終了する。
このように、本実施形態では、プログラムの実行経路について実行確率を評価することで、ユーザ毎に最適なバッファサイズを決定することができる。従って、各ユーザが、実行するプログラムに応じてメモリを使用することができる。
Next, in S2404, the buffer size based on the execution probability is calculated. In order to calculate the buffer size, the execution probability of each conditional branch node and its child node is calculated from the static analysis data 115 based on the user execution data 2005, and a program execution path having a high execution probability is extracted (buffer size based on execution probability). Calculation process). Then, the buffer size is calculated from the number of nodes belonging to the program execution path. In step S2404, the execution history data 2004 is aggregated for each user, and the execution probability of the program component is obtained using data corresponding to the currently executing user.
In step S2405, a buffer area having the calculated buffer size is secured on the memory 103, and the process ends.
Thus, in this embodiment, the optimal buffer size can be determined for each user by evaluating the execution probability with respect to the execution path of the program. Therefore, each user can use the memory according to the program to be executed.

図25は、拡張バッファサイズ計算部2001が行う実行確率によるバッファサイズ算出処理(図24のS2404)の処理の流れを示すフローチャートである。実行確率によるバッファサイズ算出処理は、プログラム構成要素の始点メソッドのメソッドノードから順次、最近傍の条件分岐ノードをたどってプログラム実行経路を抽出し、抽出したプログラム実行経路に属するノード数からバッファサイズを算出する。
はじめに、S2501で、静的解析データ115中のプログラム構成要素ツリーの各ノードに実行回数データを付与する。なお、ここで付与される実行回数データは、ユーザ実行データ2005の付与対象のノードに対する実行回数である。
次に、S2502で、プログラム構成要素ツリーの始点ノードをカレントノードに設定する。
そして、S2503で、未評価の条件分岐ノードがあるかを確認する。未評価の条件分岐ノードとは、実行確率を評価していない子ノードを持つ条件分岐ノードのことをいう。未評価の条件分岐ノードがある場合(S2503:Yes)、S2504で、カレントノードからたどれる最近傍の条件分岐ノードをカレントノードに設定する。また、未評価の条件分岐ノードがない場合(S2503:No)、S2506に進む。ただし、評価対象のノードはカレントノードから見てプログラム構成要素ツリーの末端方向にあるノードとする。
FIG. 25 is a flowchart showing the flow of the buffer size calculation process (S2404 in FIG. 24) based on the execution probability performed by the extended buffer size calculation unit 2001. The buffer size calculation process based on the execution probability is performed by extracting the program execution path sequentially from the method node of the start method of the program component, following the nearest conditional branch node, and calculating the buffer size from the number of nodes belonging to the extracted program execution path. calculate.
First, in S2501, execution frequency data is assigned to each node of the program component tree in the static analysis data 115. The execution frequency data given here is the number of executions for the node to which the user execution data 2005 is given.
In step S2502, the starting point node of the program component tree is set as the current node.
In step S2503, it is confirmed whether there is an unevaluated conditional branch node. An unevaluated conditional branch node is a conditional branch node having a child node whose execution probability is not evaluated. If there is an unevaluated conditional branch node (S2503: Yes), the nearest conditional branch node traced from the current node is set as the current node in S2504. If there is no unevaluated conditional branch node (S2503: No), the process proceeds to S2506. However, the node to be evaluated is a node in the end direction of the program component tree as viewed from the current node.

次に、S2505で、条件分岐ノードの子ノードの実行確率を算出する。なお、本実施形態では、子ノードの実行確率は「条件分岐ノードの子ノードの実行回数÷条件分岐ノードの実行回数」により算出するものとする。
次に、S2506で、条件分岐ノードの子ノード間で実行確率を比較し、実行確率が低いノードをバッファサイズの算出対象から除外する。ただし、子ノード間で実行確率を比較するとき、実行確率の差が閾値以下の場合、子ノードを除外対象としなくても良い。なお、この閾値は予め所定の値に設定するのでも、ユーザが指定するのでもよい。そして、S2506終了後、S2503に戻る。ただし、S2506で除外されたノードは、S2503の評価対象とはならないものとする。
最後に、S2507で、プログラム構成要素ツリー中の除外されなかったノードの数を求め、そのノード数からバッファサイズを算出して処理を終了する。なお、プログラム実行経路が複数存在する場合は、ノード数が最大となるプログラム実行経路を元にバッファサイズを算出する。また、バッファサイズの算出方法は、第1の実施形態と同様の方法で行う。
In step S2505, the execution probability of the child node of the conditional branch node is calculated. In this embodiment, the execution probability of the child node is calculated by “the number of executions of the child node of the conditional branch node ÷ the number of executions of the conditional branch node”.
Next, in S2506, the execution probabilities are compared between the child nodes of the conditional branch node, and nodes with a low execution probability are excluded from the buffer size calculation targets. However, when comparing execution probabilities between child nodes, if the difference in execution probabilities is equal to or less than a threshold value, the child nodes may not be excluded. This threshold value may be set in advance to a predetermined value or specified by the user. Then, after S2506 ends, the process returns to S2503. However, it is assumed that the node excluded in S2506 is not an evaluation target in S2503.
Finally, in S2507, the number of nodes not excluded in the program component tree is obtained, the buffer size is calculated from the number of nodes, and the process is terminated. When there are a plurality of program execution paths, the buffer size is calculated based on the program execution path with the maximum number of nodes. The buffer size calculation method is the same as that in the first embodiment.

図26Aに、図21Aに示すプログラム2101の各ノードの実行確率表と、ノードを選択する際に用いる実行確率の差の閾値設定を行う表示画面の一例を示す。各ノードの実行確率表は、ノード名2601、ノードの実行回数2602及びノードの実行確率2603からなる。また、実行確率の差の閾値は2604でユーザが指定できる。ここでは、実行確率の差の閾値を10%に設定した例を示している。これは、条件分岐ノードの実行確率の差が10%以上である場合、その条件分岐に属する子ノードをバッファサイズの算出対象から除外することを意味する。   FIG. 26A shows an example of an execution probability table for each node of the program 2101 shown in FIG. 21A and a display screen for setting a threshold value for a difference in execution probability used when selecting a node. The execution probability table for each node includes a node name 2601, a node execution count 2602, and a node execution probability 2603. Further, the threshold value of the difference between execution probabilities can be designated by the user at 2604. Here, an example is shown in which the execution probability difference threshold is set to 10%. This means that if the difference in execution probability between conditional branch nodes is 10% or more, the child nodes belonging to the conditional branch are excluded from the buffer size calculation targets.

図26Bは、図26Aに示す各ノードの実行確率を基に選択されたプログラム構成要素ツリーを示す。
はじめに、プログラム構成要素ツリーの最初の条件分岐ノードであるif_1 2606について、子ノードの実行確率を評価する。図26Aの各ノードの実行確率表より、子ノードであるmethodB 2607の実行確率は30%、if_2 2609の条件分岐ノードの実行確率は70%であることがわかる。従って、実行確率の差は、70%−30%=40%であるため、methodB 2607以下のノードである、methodB 2607及びmethodC 2608がバッファサイズの算出対象から除外される。なお、図26Aでは、除外されたノードを点線で描いている。
FIG. 26B shows a program component tree selected based on the execution probability of each node shown in FIG. 26A.
First, the execution probability of the child node is evaluated for if_1 2606, which is the first conditional branch node of the program component tree. From the execution probability table of each node in FIG. 26A, it can be seen that the execution probability of methodB 2607 as a child node is 30%, and the execution probability of the conditional branch node of if_2 2609 is 70%. Therefore, since the difference in execution probability is 70% −30% = 40%, methodB 2607 and methodC 2608, which are nodes below methodB 2607, are excluded from the buffer size calculation targets. In FIG. 26A, the excluded nodes are drawn with dotted lines.

図27は、バッファ再割当部2002が行うバッファ再割当処理(図23のS2310)の処理の概要をフローチャートで示す。バッファ再割当処理は、拡張バッファサイズ計算部2001が確保したバッファ116を、最大バッファサイズまでのバッファ116に割り当て直す。なお、本実施形態では、バッファ再割当処理を行うのは、プログラム113を実行して取得したトレース情報117を格納するために必要なバッファサイズが、確保したバッファサイズでは不足する場合を想定しているが、これに限られず、ユーザが指定した場合等、任意の条件で処理を実行できる。
はじめに、S2701で、拡張バッファサイズ計算部2001で算出した最大バッファサイズのバッファ116をメモリ103上に確保する。
次に、S2702で、既存のバッファ116(実行履歴データ2004に基づいて計算したバッファサイズのバッファ)内に格納してあるトレース情報117を確保したバッファ116にコピーする。
そして、S2703で、既存のバッファ116の領域を解放し、バッファ再割当処理を終了する。本処理により、プログラム中の実行確率の低い経路を実行したことで、トレース取得量がバッファサイズよりも多くなったとしても、トレース情報117の取得漏れを生じさせることなく、トレースを行うことができる。
FIG. 27 is a flowchart showing an outline of the process of the buffer reallocation process (S2310 in FIG. 23) performed by the buffer reallocation unit 2002. In the buffer reassignment process, the buffer 116 secured by the extended buffer size calculation unit 2001 is reassigned to the buffer 116 up to the maximum buffer size. In this embodiment, the buffer reallocation process is performed on the assumption that the buffer size necessary for storing the trace information 117 obtained by executing the program 113 is insufficient for the secured buffer size. However, the present invention is not limited to this, and processing can be executed under arbitrary conditions such as when the user designates it.
First, in step S <b> 2701, the buffer 116 having the maximum buffer size calculated by the extended buffer size calculation unit 2001 is secured on the memory 103.
Next, in S2702, the trace information 117 stored in the existing buffer 116 (buffer having a buffer size calculated based on the execution history data 2004) is copied to the secured buffer 116.
In step S2703, the existing buffer 116 area is released, and the buffer reallocation process ends. With this process, even if the trace acquisition amount becomes larger than the buffer size due to the execution of a route with a low execution probability in the program, tracing can be performed without causing the omission of acquisition of the trace information 117. .

本実施形態では、実行履歴データ2004からシステムのユーザごとに、おおよそ必要なバッファサイズを算出することを考える。そして、バッファ116が不足したとき等、任意の条件で第1の実施形態に示すプログラム構成要素ツリーのノード数に基づいて計算したバッファサイズのバッファ116に割り当て直すことを想定している。従って、実行履歴データ2004に基づいて計算したバッファサイズのバッファ116と、プログラム構成要素ツリーのノード数に基づいて計算したバッファサイズのバッファ116とを併用することにより、トレース情報117を格納するバッファ116をさらに効率的に利用することができる。   In the present embodiment, it is assumed that an approximate required buffer size is calculated for each system user from the execution history data 2004. Then, it is assumed that the buffer 116 is reassigned to the buffer size calculated based on the number of nodes of the program component tree shown in the first embodiment under an arbitrary condition such as when the buffer 116 is insufficient. Therefore, the buffer 116 for storing the trace information 117 is used in combination with the buffer 116 having the buffer size calculated based on the execution history data 2004 and the buffer 116 having the buffer size calculated based on the number of nodes in the program component tree. Can be used more efficiently.

101計算機、102CPU、103メモリ、104Java仮想マシン、105プログラム読込部、106静的解析データ生成部、107静的解析データ読込部、
108バッファサイズ計算部、109プログラム書換部、110プログラム実行部、111トレース情報取得部、112トレース情報出力部、113プログラム、114拡張プログラム、115静的解析データ、116バッファ、117トレース情報、118外部記憶装置、2001拡張バッファサイズ計算部、2002バッファ再割当部、2003ユーザ実行データ集計部、2004実行履歴データ、2005ユーザ実行データ
101 computer, 102 CPU, 103 memory, 104 Java virtual machine, 105 program reading unit, 106 static analysis data generating unit, 107 static analysis data reading unit,
108 buffer size calculator, 109 program rewrite unit, 110 program execution unit, 111 trace information acquisition unit, 112 trace information output unit, 113 program, 114 extended program, 115 static analysis data, 116 buffer, 117 trace information, 118 external Storage device, 2001 extended buffer size calculation unit, 2002 buffer reallocation unit, 2003 user execution data totaling unit, 2004 execution history data, 2005 user execution data

Claims (19)

トレーサによって取得するトレース情報の数を算出する計算機であって、
前記計算機は、プログラムの流れを制御する要素を特定する制御部を有し、前記制御部は、前記プログラムの実行前に前記要素の数を特定し、前記特定した要素の数を基に、取得するトレース情報の数を算出することを特徴とする計算機。
A computer for calculating the number of trace information acquired by the tracer,
The computer has a control unit that identifies an element that controls a flow of a program, the control unit identifies the number of elements before execution of the program, and acquires the number based on the number of identified elements. A computer characterized in that the number of trace information to be calculated is calculated.
請求項1に記載の計算機であって、
前記制御部は、前記取得するトレース情報の数に基づいて、トレース情報を格納するメモリ領域のサイズを決定することを特徴とする計算機。
The computer according to claim 1,
The control unit determines a size of a memory area for storing trace information based on the number of pieces of trace information to be acquired.
請求項2に記載の計算機であって、
前記制御部は、前記特定した要素の数と、前記要素の一つ分のトレース情報を格納するために必要なメモリ領域のサイズとによって、前記実行するプログラムのトレース情報を格納するメモリ領域のサイズを決定することを特徴とする計算機。
The computer according to claim 2,
The control unit determines the size of the memory area for storing the trace information of the program to be executed according to the number of the specified elements and the size of the memory area necessary for storing the trace information for one element. A computer characterized by determining.
請求項3に記載の計算機であって、
前記特定した要素が、処理の繰り返しを指示する要素である場合、前記制御部は、前記処理の繰り返しを指示する要素から取得するトレース情報を削除あるいは上書きしてメモリ領域に格納することを特徴とする計算機。
The computer according to claim 3, wherein
When the specified element is an element that instructs the repetition of the process, the control unit deletes or overwrites the trace information acquired from the element that instructs the repetition of the process, and stores the trace information in a memory area. Calculator to do.
請求項1に記載の計算機であって、
前記制御部は、前記プログラムの流れを制御する要素で構成されたツリーを生成して前記要素の数を特定することを特徴とする計算機。
The computer according to claim 1,
The computer is characterized in that the control unit generates a tree composed of elements that control the flow of the program and specifies the number of the elements.
請求項5に記載の計算機であって、
前記制御部は、さらに前記ツリーを構成するノードを実行した記録である実行頻度をノード毎に管理し、前記実行頻度に応じて所定のプログラム実行経路を特定し、前記特定したプログラム実行経路に含まれるノードの数に基づいて取得するトレース情報の数を算出することを特徴とする計算機。
The computer according to claim 5, wherein
The control unit further manages, for each node, an execution frequency, which is a record of executing nodes constituting the tree, specifies a predetermined program execution path according to the execution frequency, and is included in the specified program execution path A computer that calculates the number of trace information to be acquired based on the number of nodes to be acquired.
請求項5に記載の計算機であって、
前記制御部は、さらに前記ツリーを構成する各ノードを実行した記録である実行頻度をノード毎に管理し、前記実行頻度から実行頻度の高いプログラム実行経路を特定し、前記特定したプログラム実行経路に含まれるノードの数に基づいて取得するトレース情報の数を算出することを特徴とする計算機。
The computer according to claim 5, wherein
The control unit further manages, for each node, an execution frequency that is a record of executing each node constituting the tree, specifies a program execution path having a high execution frequency from the execution frequency, and sets the specified program execution path to the specified program execution path. A computer that calculates the number of trace information to be acquired based on the number of nodes included.
請求項6又は7に記載の計算機であって、
前記制御部は、前記取得するトレース情報の数に基づいて、トレース情報を格納するメモリ領域のサイズを決定することを特徴とする計算機。
The computer according to claim 6 or 7,
The control unit determines a size of a memory area for storing trace information based on the number of pieces of trace information to be acquired.
請求項8に記載の計算機であって、
前記制御部は、前記プログラムを実行し、実行して取得したトレース情報を格納するためのメモリ領域のサイズが、前記決定したメモリ領域のサイズでは不足する場合、前記決定したメモリ領域のサイズから、前記ツリーに含まれる全てのノードの数に基づいて算出されるトレース情報を格納するメモリ領域のサイズまでの大きさのメモリ領域のサイズに変更することを特徴とする計算機。
A computer according to claim 8, wherein
When the size of the memory area for storing the trace information obtained by executing the program and executing the program is insufficient with the size of the determined memory area, the control unit, from the size of the determined memory area, The computer is changed to the size of the memory area up to the size of the memory area for storing the trace information calculated based on the number of all nodes included in the tree.
計算機がトレーサによって取得するトレース情報の数を算出する方法であって、
前記計算機は、プログラムの流れを制御する要素を前記プログラムの実行前に特定し、
前記特定した要素の数を基に、取得するトレース情報の数を算出することを特徴とする方法。
A method for calculating the number of trace information acquired by a computer by a tracer,
The computer identifies an element that controls the flow of the program before the execution of the program,
A method of calculating the number of pieces of trace information to be acquired based on the specified number of elements.
請求項10に記載の方法であって、
前記計算機は、前記取得したトレース情報の数に基づいて、トレース情報を格納するメモリ領域のサイズを決定することを特徴とする方法。
The method of claim 10, comprising:
It said computer based on the number of the acquired trace information, wherein the determining the size of a memory area for storing trace information.
請求項11に記載の方法であって、
前記計算機は、前記特定した要素の数と、前記要素の一つ分のトレース情報を格納するために必要なメモリ領域のサイズとによって、前記実行するプログラムのトレース情報を格納するメモリ領域のサイズを決定することを特徴とする方法。
The method of claim 11, comprising:
The computer determines the size of the memory area for storing the trace information of the program to be executed according to the number of the specified elements and the size of the memory area necessary for storing the trace information for one element. A method characterized by determining.
請求項12に記載の方法であって、
前記特定した要素が、処理の繰り返しを指示する要素である場合、前記計算機は、前記繰り返しを指示する要素から取得するトレース情報を削除あるいは上書きしてメモリ領域に格納することを特徴とする方法。
The method of claim 12, comprising:
When the specified element is an element that instructs repetition of processing, the computer deletes or overwrites trace information acquired from the element that indicates repetition, and stores the trace information in a memory area.
請求項10に記載の方法であって、
前記計算機は、前記プログラムの流れを制御する要素で構成されたツリーを生成して前記要素の数を特定することを特徴とする方法。
The method of claim 10, comprising:
The computer generates a tree composed of elements that control the flow of the program and specifies the number of elements.
計算機にトレーサによって取得するトレース情報の数を算出させるプログラムであって、
前記計算機に、トレース対象プログラムの流れを制御する要素を前記トレース対象プログラムの実行前に特定させ、前記特定された要素の数を基に、取得するトレース情報の数を算出させることを特徴とするプログラム。
A program for causing a computer to calculate the number of trace information acquired by the tracer,
In said computer, an element for controlling the flow of the trace target program is specified before the execution of the traced program, based on the number of the identified elements, characterized in that to calculate the number of trace information to be obtained program.
請求項15に記載のプログラムであって、
前記計算機に、前記取得したトレース情報の数に基づいて、トレース情報を格納するメモリ領域のサイズを決定させることを特徴とするプログラム。
The program according to claim 15,
A program for causing the computer to determine the size of a memory area for storing trace information based on the number of acquired trace information.
請求項16に記載のプログラムであって、
前記計算機に、前記特定された要素の数と、前記要素の一つ分のトレース情報を格納するために必要なメモリ領域のサイズとによって、前記実行するトレース対象プログラムのトレース情報を格納するメモリ領域のサイズを決定させることを特徴とするプログラム。
The program according to claim 16, wherein
In said computer, said the number of identified elements, by the size of the memory area required to store the trace information of a single component of the element, a memory area for storing the trace information in the trace target program to the execution A program characterized by determining the size of a program.
請求項17に記載のプログラムであって、
前記特定された要素が、処理の繰り返しを指示する要素である場合、前記計算機に、前記繰り返しを指示する要素から取得するトレース情報を削除あるいは上書きしてメモリ領域に格納させることを特徴とするプログラム。
A program according to claim 17,
When the specified element is an element instructing repetition of processing, the computer causes the computer to delete or overwrite the trace information acquired from the element instructing repetition and store it in a memory area. .
請求項15に記載のプログラムであって、
前記計算機に、前記トレース対象プログラムの流れを制御する要素で構成されたツリーを生成させて前記要素の数を特定させることを特徴とするプログラム。
The program according to claim 15,
A program that causes the computer to generate a tree composed of elements that control the flow of the trace target program and to specify the number of the elements.
JP2011264227A 2011-12-02 2011-12-02 Computer for calculating the number of trace information, method for calculating the number of trace information, and program for calculating the number of trace information Expired - Fee Related JP5572619B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011264227A JP5572619B2 (en) 2011-12-02 2011-12-02 Computer for calculating the number of trace information, method for calculating the number of trace information, and program for calculating the number of trace information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011264227A JP5572619B2 (en) 2011-12-02 2011-12-02 Computer for calculating the number of trace information, method for calculating the number of trace information, and program for calculating the number of trace information

Publications (2)

Publication Number Publication Date
JP2013117803A JP2013117803A (en) 2013-06-13
JP5572619B2 true JP5572619B2 (en) 2014-08-13

Family

ID=48712344

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011264227A Expired - Fee Related JP5572619B2 (en) 2011-12-02 2011-12-02 Computer for calculating the number of trace information, method for calculating the number of trace information, and program for calculating the number of trace information

Country Status (1)

Country Link
JP (1) JP5572619B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6496640B2 (en) * 2015-09-14 2019-04-03 株式会社エクサ COBOL source code conversion program
EP3200080B1 (en) * 2015-12-16 2021-12-22 Tata Consultancy Services Limited Methods and systems for memory suspect detection
EP3862873A4 (en) 2018-10-03 2021-10-13 Mitsubishi Electric Corporation Software analysis device, software analysis method, and software analysis program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09282173A (en) * 1996-04-10 1997-10-31 Hitachi Ltd Static analysis method for program
JP4914609B2 (en) * 2005-12-28 2012-04-11 富士通株式会社 Source code problem prediction program
JP2008131278A (en) * 2006-11-20 2008-06-05 Oki Electric Ind Co Ltd Tracing device

Also Published As

Publication number Publication date
JP2013117803A (en) 2013-06-13

Similar Documents

Publication Publication Date Title
US20230094191A1 (en) Scalable execution tracing for large program codebases
Sambasivan et al. Principled workflow-centric tracing of distributed systems
CN101894065B (en) System and method for demonstrating the correctness of an execution trace in concurrent processing environments
US5987250A (en) Transparent instrumentation for computer program behavior analysis
US7213175B2 (en) Methods and systems for managing an application&#39;s relationship to its run-time environment
CN104391787B (en) Monitoring method aiming at target method as well as thermal cutting-in method and device
US9355003B2 (en) Capturing trace information using annotated trace output
Sambasivan et al. So, you want to trace your distributed system? Key design insights from years of practical experience
JP5572619B2 (en) Computer for calculating the number of trace information, method for calculating the number of trace information, and program for calculating the number of trace information
CN112597064B (en) Method for simulating program, electronic device and storage medium
CN111913878A (en) Program analysis result-based bytecode instrumentation method, device and storage medium
CN113778890B (en) Code testing method and device, electronic equipment and storage medium
US10877873B2 (en) Using historic execution data to visualize tracepoints
CN107451038B (en) Hardware event acquisition method, processor and computing system
US8756580B2 (en) Instance-based field affinity optimization
JP7116562B2 (en) Trace data representation
Singh et al. MG++: Memory graphs for analyzing dynamic data structures
JP2016081126A (en) Job control language automatic generation program
JP5937530B2 (en) Software error analysis device, error information creation device
JP6437396B2 (en) Trace information management system, method, and program
Upp et al. Using reservoir sampling and parallelization to improve dynamic binary instrumentation
CN104572424B (en) Test method and device
JP2009064125A (en) Server device and program thereof
CN114385584A (en) Data writing method and data reading method
CN115203030A (en) Test information processing method and device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130913

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140328

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140408

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140424

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: 20140603

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140630

LAPS Cancellation because of no payment of annual fees