JPH0635752A - Analysis program generation system - Google Patents

Analysis program generation system

Info

Publication number
JPH0635752A
JPH0635752A JP4186909A JP18690992A JPH0635752A JP H0635752 A JPH0635752 A JP H0635752A JP 4186909 A JP4186909 A JP 4186909A JP 18690992 A JP18690992 A JP 18690992A JP H0635752 A JPH0635752 A JP H0635752A
Authority
JP
Japan
Prior art keywords
program
measurement
analysis
source program
analyzed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4186909A
Other languages
Japanese (ja)
Inventor
Akiko Ishizuka
章子 石塚
Yushi Fukuchi
雄史 福地
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP4186909A priority Critical patent/JPH0635752A/en
Publication of JPH0635752A publication Critical patent/JPH0635752A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide a system for generating a program for measurement for obtaining the program for the measurement by adding only a required measurement sentence to a source program to be analyzed to prepare the source program for the measurement for sampling only required information at the time of generating the source program for the measurement from the source program to be analyzed. CONSTITUTION:This system for generating the program for the measurement makes an analysis information specifying file 104 have data in which analysis information to be sampled is recorded, at the time of generating the program for the measurement. At the time of generating the program for the measurement, a generation device 102 for the program for the measurement reads the information, uses the information and generates the source program 103 for the measurement.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、例えば、ソースプログ
ラムから測定用ソースプログラムを生成してプログラム
の動的特性を解析するプログラム解析に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to program analysis for generating a measurement source program from a source program and analyzing the dynamic characteristics of the program.

【0002】[0002]

【従来の技術】[Prior art]

従来例1.プログラムの実行時の動的特性を解析する方
法としては、例えば、特開昭63−163545号公報
にあるように、被解析プログラム中に実行時情報を測定
するための計測文を付加して、測定用プログラムを作成
し、この測定用プログラムを実行して実行時情報を収集
して、解析するという方法が一般に知られている。ここ
でいう、プログラムの実行時の動的特性とは、原始プロ
グラムの各プログラム単位の実行時間、各文の実行回
数、各手続き呼び出し回数、各文・手続き呼び出しの実
行時刻(タイムログ)等を指す。被解析プログラム中に
実行時情報を測定するための計測文を付加した測定用ソ
ースプログラムを作成するには、通常は計測文を自動的
に埋め込む測定用プログラム生成装置を使用する。ここ
では、プログラム中の各手続きの実行時刻(タイムロ
グ)を収集する場合を例にして、従来例の動作を説明す
る。図3は、被解析ソースプログラムを測定用プログラ
ム生成装置に入力して、測定用ソースプログラムを出力
する流れを示した図である。図において、301は被解
析ソースプログラムであり、302は測定用プログラム
生成装置であり、303は測定用ソースプログラムであ
る。図4は測定用プログラム生成装置内の処理の流れを
示した図である。
Conventional example 1. As a method for analyzing the dynamic characteristics of a program at the time of execution, for example, as disclosed in Japanese Patent Laid-Open No. 63-163545, a measurement statement for measuring runtime information is added to a program to be analyzed, A method of creating a measurement program, executing the measurement program, collecting runtime information, and analyzing it is generally known. Here, the dynamic characteristics of a program at execution include the execution time of each program unit of the source program, the number of times each statement is executed, the number of times each procedure is called, the execution time (time log) of each statement / procedure, etc. Point to. In order to create a measurement source program in which a measurement statement for measuring runtime information is added to the analyzed program, a measurement program generator for automatically embedding a measurement statement is usually used. Here, the operation of the conventional example will be described by taking as an example the case where the execution time (time log) of each procedure in the program is collected. FIG. 3 is a diagram showing a flow of inputting the analyzed source program to the measurement program generation device and outputting the measurement source program. In the figure, 301 is an analyzed source program, 302 is a measurement program generation device, and 303 is a measurement source program. FIG. 4 is a diagram showing the flow of processing in the measurement program generation device.

【0003】従来例1の測定用プログラム生成法におい
ては、被解析ソースプログラム301を測定用プログラ
ム生成装置302に入力すると、測定用プログラム生成
装置302は、被解析ソースプログラム301を解析し
て、被解析ソースプログラム301内の全ての手続き呼
び出し文に対して、実行時刻(タイムログ)計測文を付
加して、測定用プログラム303を出力する。次に、測
定用プログラム生成装置302内の処理を、図4に沿っ
て説明する。測定用プログラム生成装置302は、被解
析プログラム301から、1文ずつソースプログラムを
読み込み、その文が手続き呼び出し文かどうかを判定す
る。読み込んだ文が手続き呼び出し文でなければ、測定
用プログラム303にその文をそのまま出力する。読み
込んだ文が手続き呼び出し文であれば、時刻計測文を付
加して、測定用プログラム303にその文を出力する。
ソースプログラム301中の全ての文に対して以上のよ
うな作業を行ない、測定用プログラム303を生成す
る。
In the measurement program generation method of Conventional Example 1, when the analyzed source program 301 is input to the measurement program generation device 302, the measurement program generation device 302 analyzes the analyzed source program 301 and The execution time (time log) measurement statement is added to all the procedure call statements in the analysis source program 301, and the measurement program 303 is output. Next, the processing in the measurement program generation device 302 will be described with reference to FIG. The measurement program generation device 302 reads the source program one sentence at a time from the analyzed program 301 and determines whether the sentence is a procedure call sentence. If the read sentence is not a procedure call sentence, the sentence is output to the measurement program 303 as it is. If the read sentence is a procedure call sentence, a time measurement sentence is added and the sentence is output to the measurement program 303.
The above operation is performed for all the statements in the source program 301 to generate the measurement program 303.

【0004】従来例2.図5は、特開平2−20155
3号公報に開示されたプログラム解析方式のブロック図
であり、501は被解析ソースプログラム、502は測
定用プログラム生成装置、503は生成された測定用ソ
ースプログラム、504は範囲指定テーブルである。図
5において測定用プログラム生成装置502は、利用者
によって被解析ソースプログラム501の解析すべき行
の開始行番号と終了行番号が指定されている時、メモリ
上の範囲指定テーブル504に開始行と終了行の行番号
を格納する。文判定手段は、被解析ソースプログラム5
01の各行が、プログラムの「開始文」か「終了文」か
「その他の文」かを判断し、開始文と終了文である場合
は、それぞれその文と解析情報計測用の開始と終了の文
を測定用ソースプログラム503に出力する。「その他
の文」の時は、範囲指定テーブル504を参照しながら
その行の範囲にある場合には、付加すべき解析情報計測
用の文をその文と共に測定用ソースプログラム503に
出力する。範囲指定テーブル404の範囲外の時は、被
解析ソースプログラム501の文だけを測定用ソースプ
ログラム501に出力する。
Conventional example 2. FIG. 5 shows Japanese Patent Laid-Open No. 2-20155.
3 is a block diagram of the program analysis method disclosed in Japanese Patent Publication No. 3), in which 501 is a source program to be analyzed, 502 is a measurement program generation device, 503 is a generated measurement source program, and 504 is a range designation table. In FIG. 5, when the user specifies the start line number and the end line number of the line to be analyzed in the analyzed source program 501, the measurement program generation device 502 identifies the start line in the range designation table 504 on the memory. Stores the line number of the end line. The sentence determination means is the analyzed source program 5
Each line of 01 determines whether it is the "start statement", "end statement", or "other statement" of the program, and if it is the start statement and the end statement, the statement and the start and end of the analysis information measurement respectively The sentence is output to the measurement source program 503. In the case of "other sentence", if the line is within the range of the line while referring to the range designation table 504, the sentence for analysis information measurement to be added is output to the measurement source program 503 together with the sentence. When it is out of the range of the range specification table 404, only the sentence of the analyzed source program 501 is output to the measurement source program 501.

【0005】[0005]

【発明が解決しようとする課題】従来例1の、測定用プ
ログラムは以上のように生成されているため、例えば、
手続きの実行時刻を計測する場合、被測定プログラム中
の全ての手続き呼び出し文に対して時刻計測文を付加す
ることになる。そのため、一部の手続き呼び出し文の実
行時刻を知りたいような場合においては、通常このよう
な解析用データは非常に大きくなるため、得られた解析
用データから必要な情報を探すのが困難になる。すなわ
ち、従来の方式では、とらなくても良いデータまで採取
しているという問題があった。
Since the measurement program of Conventional Example 1 is generated as described above, for example,
When measuring the execution time of a procedure, a time measurement statement is added to all procedure call statements in the measured program. Therefore, when you want to know the execution time of some procedure call statements, such analysis data is usually very large, making it difficult to find the necessary information from the obtained analysis data. . That is, the conventional method has a problem in that even unnecessary data is collected.

【0006】また、従来例2の解析プログラム生成方式
では、被解析ソースプログラムの解析したい行の範囲を
指定できるが、範囲を行番号で指定するため、プログラ
ムの変更があるたびに、指定する行の範囲を変えなけれ
ばいけないという問題点があった。また、範囲を指定す
るテーブルが、メモリ上にあるため、プログラムの実行
のたびに行番号を指定しなければならず、汎用性に欠け
るという問題点があった。
In the analysis program generation method of Conventional Example 2, the range of lines to be analyzed in the analyzed source program can be specified. However, since the range is specified by the line number, the specified line is changed every time the program is changed. There was a problem that we had to change the range of. Further, since the table for designating the range is on the memory, the line number must be designated every time the program is executed, and there is a problem that the versatility is lacking.

【0007】この発明は、上記のような問題点を解決す
るためになされたもので、被解析ソースプログラムから
解析用ソースプログラムを作成する際に、煩わしいオペ
レーションなしに必要な情報のみを採取する解析用ソー
スプログラムを作成する解析プログラム生成方式を得る
ことを目的とする。
The present invention has been made in order to solve the above problems, and when an analysis source program is created from an analyzed source program, an analysis for collecting only necessary information without a troublesome operation. The purpose is to obtain an analysis program generation method for creating a source program for use.

【0008】[0008]

【課題を解決するための手段】この発明に係わる解析プ
ログラム生成方式は、例えば解析用プログラムを生成す
る際に、採取したい解析情報を記録しておく情報を手続
名として持たせ、測定用プログラムを生成する際には、
解析用プログラム生成装置が、その情報を読み込み、そ
の手続名を使用して、被解析ソースプログラムに必要な
計測文を付加することにより、解析用プログラムを生成
するものであり以下の要素を有するものである。 (a)プログラムの解析の対象の範囲を手続名で指定す
る解析対象手続名指定手段、(b)上記解析対象手続名
指定手段によって指定された手続名にもとづいてプログ
ラムに解析情報を付加する解析情報付加手段。
In the analysis program generation method according to the present invention, for example, when generating an analysis program, the analysis program is provided with information for recording the analysis information to be collected as a procedure name. When you generate
The analysis program generation device generates the analysis program by reading the information and using the procedure name to add the necessary measurement statement to the analyzed source program. It has the following elements. Is. (A) Analysis target procedure name designating means for designating the scope of analysis target of the program by procedure name, (b) Analysis for adding analysis information to the program based on the procedure name designated by the analysis target procedure name designating means Information addition means.

【0009】[0009]

【作用】この発明に係わる測定用プログラム生成方式
は、測定用プログラムを生成する際に、解析したい手続
名を指定したデータを持たせ、測定用プログラムを生成
する際に、測定用プログラム生成装置は、その情報を読
み込み、その情報に従って、被解析プログラムの必要な
箇所に測定用手続きを挿入して、測定用プログラムを生
成するため解析データには無駄がなく、必要な情報を探
しやすくなり、プログラムの解析を容易にする。
In the measuring program generating method according to the present invention, when the measuring program is generated, the measuring program generating device is provided with data specifying the procedure name to be analyzed, and when generating the measuring program. , The information is read, and the measurement procedure is inserted into the required part of the analyzed program according to the information to generate the measurement program. Facilitate the analysis of.

【0010】[0010]

【実施例】【Example】

実施例1.ここでは、従来例の説明と同様にプログラム
中の各手続きの実行時刻(タイムログ)を収集する場合
を例にして、動作を説明する。図1は、被解析ソースプ
ログラムを測定用プログラム生成装置に入力して、測定
用ソースプログラムを出力する流れを示した図である。
図1においては、101は被解析ソースプログラムであ
り、102は測定用プログラム生成装置であり、103
は測定用ソースプログラムであり、104は解析情報指
定ファイルである。
Example 1. Here, the operation will be described by taking as an example the case where the execution time (time log) of each procedure in the program is collected as in the case of the conventional example. FIG. 1 is a diagram showing a flow of inputting an analyzed source program to a measurement program generation device and outputting the measurement source program.
In FIG. 1, 101 is a source program to be analyzed, 102 is a measurement program generation device, and 103
Is a measurement source program, and 104 is an analysis information designation file.

【0011】図2は測定用プログラム生成装置内の処理
の流れを示した図である。以下でその流れを説明する。
被解析ソースプログラム101を測定用プログラム生成
装置102に入力すると、測定用プログラム生成装置1
02は、被解析ソースプログラム101を解析して、被
解析ソースプログラム101内の手続き呼び出し文のう
ちで、解析情報指定ファイル104内に時刻を計測すべ
き手続きだと指定してある手続きのみに、実行時刻(タ
イムログ)計測文を付加して、測定用プログラム103
を出力する。
FIG. 2 is a diagram showing a flow of processing in the measuring program generating apparatus. The flow will be described below.
When the analyzed source program 101 is input to the measurement program generation device 102, the measurement program generation device 1
02 analyzes only the analyzed source program 101, and among the procedure call statements in the analyzed source program 101, only the procedure which is specified in the analysis information specification file 104 as the procedure for measuring the time, The measurement program 103 with the execution time (time log) measurement statement added
Is output.

【0012】測定用プログラム生成装置102内の処理
を、図2に沿って説明する。測定用プログラム生成装置
102は、被解析プログラム101から、1文ずつソー
スプログラムを読み込み、その文が手続き呼び出し文か
どうかを判定する。読み込んだ文が手続き呼び出し文で
なければ、測定用プログラム103にその文をそのまま
出力する。読み込んだ文が手続き呼び出し文であれば、
その手続きが、解析情報指定ファイル104内に時刻を
計測すべき手続きとして指定されているかどうかを調べ
る。時刻を計測すべき手続きとして指定されていなけれ
ば、測定用プログラム103にその文をそのまま出力す
る。時刻を計測すべき手続きとして指定されていれば、
時刻計測文を付加して、測定用プログラム103にその
文を出力する。被解析プログラム101中の全ての文に
対して以上のような作業を行ない、測定用プログラム1
03を生成する。
The processing in the measuring program generating device 102 will be described with reference to FIG. The measurement program generation device 102 reads the source program one sentence at a time from the analyzed program 101, and determines whether the sentence is a procedure call sentence. If the read sentence is not a procedure call sentence, the sentence is output to the measurement program 103 as it is. If the read statement is a procedure call statement,
It is checked whether or not the procedure is designated in the analysis information designation file 104 as a procedure for measuring time. If the time is not specified as the procedure to be measured, the statement is output to the measurement program 103 as it is. If it is specified as a procedure for measuring time,
A time measurement sentence is added and the sentence is output to the measurement program 103. The measurement program 1 which performs the above-mentioned operations for all the sentences in the analyzed program 101
03 is generated.

【0013】以上のように、この実施例では、ソースプ
ログラム中にプログラムの動的特性解析情報を計測する
解析情報計測文を付加してできた測定用ソースプログラ
ムを実際に実行して、ソースプログラム中の各文・各手
続き呼びだしの実行回数、各文・各手続き呼びだし実行
時間、各文・各手続き呼びだし実行時刻(タイムログ)
等のプログラムの動的特性情報を収集する測定用ソース
プログラム生成装置において、被解析ソースプログラム
に解析情報計測文を付加する際に、どのような情報を解
析するかを指定した解析情報指定データを別にあたえ、
そのデータを基に、被解析ソースプログラム中に解析情
報指定データに指定された解析情報を採取する解析情報
計測文のみを付加して、測定用ソースプログラムを生成
する測定用ソースプログラム生成装置を説明した。
As described above, in this embodiment, the source program for measurement, which is formed by adding the analysis information measurement statement for measuring the dynamic characteristic analysis information of the program to the source program, is actually executed, and the source program is executed. Number of executions of each statement / procedure call, execution time of each statement / procedure, execution time of each statement / procedure (time log)
In the measurement source program generator that collects the dynamic characteristic information of the program such as the above, when adding the analysis information measurement statement to the analyzed source program, the analysis information specification data that specifies what information to analyze is specified. Give it separately,
Describes the measurement source program generator that generates the measurement source program by adding only the analysis information measurement statement that collects the analysis information specified in the analysis information specification data in the analyzed source program based on the data. did.

【0014】実施例2.実施例の説明においては、プロ
グラム中の各手続きの実行時刻(タイムログ)を収集す
る例で説明したが、同様の方法で、各文・各手続き呼び
出しの実行回数、各文・各手続き呼び出しの実行時間、
各文・手続き呼び出しの実行時刻(タイムログ)等のプ
ログラムの実行時の動的特性を解析するための測定用プ
ログラムを生成することができる。
Example 2. In the description of the embodiment, an example of collecting the execution time (time log) of each procedure in the program has been described, but in the same manner, the execution count of each statement / procedure call, the execution count of each statement / procedure call, Execution time,
It is possible to generate a measurement program for analyzing dynamic characteristics at the time of execution of a program such as execution time (time log) of each statement / procedure call.

【0015】[0015]

【発明の効果】以上のように、この発明によれば、プロ
グラムを解析する際に、不必要な情報は計測せず、必要
な情報のみ計測する測定用ソースプログラムを生成する
ことができ、解析対象の手続名は、プログラムが変更さ
れても、繰り返し使用することができるため解析作業に
無駄がなく必要な情報を探しやすくなることによって、
プログラムの解析をしやすくなる。
As described above, according to the present invention, when analyzing a program, it is possible to generate a measurement source program for measuring only necessary information without measuring unnecessary information. Since the target procedure name can be used repeatedly even if the program is changed, it is easy to find necessary information without wasting analysis work.
It will be easier to analyze the program.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の実施例1による解析プログラム生成方
式の全体構成図である。
FIG. 1 is an overall configuration diagram of an analysis program generation method according to a first embodiment of the present invention.

【図2】本発明の実施例1による測定用プログラム生成
装置内の処理の流れを示した図である。
FIG. 2 is a diagram showing a flow of processing in the measurement program generating apparatus according to the first embodiment of the present invention.

【図3】従来例1の解析プログラム生成方式の全体構成
図である。
FIG. 3 is an overall configuration diagram of an analysis program generation method of Conventional Example 1.

【図4】従来例1の測定用プログラム生成装置内の処理
の流れを示した図である。
FIG. 4 is a diagram showing a flow of processing in a measurement program generation device of Conventional Example 1.

【図5】従来例2の解析プログラム生成方式の全体構成
図である。
5 is an overall configuration diagram of an analysis program generation method of Conventional Example 2. FIG.

【符号の説明】[Explanation of symbols]

101 被解析ソースプログラム 102 測定用プログラム生成装置 103 測定用ソースプログラム 104 解析情報指定ファイル 101 Analyzed Source Program 102 Measurement Program Generation Device 103 Measurement Source Program 104 Analysis Information Designation File

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 以下の要素を有する解析プログラム生成
方式、(a)プログラムの解析の対象の範囲を手続名で
指定する解析対象手続名指定手段、(b)上記解析対象
手続名指定手段によって指定された手続名にもとづいて
プログラムに解析情報を付加する解析情報付加手段。
1. An analysis program generation method having the following elements, (a) an analysis target procedure name designating means for designating a range of a program analysis target by a procedure name, and (b) designation by the analysis target procedure name designating means. Analysis information adding means for adding analysis information to a program based on the created procedure name.
JP4186909A 1992-07-14 1992-07-14 Analysis program generation system Pending JPH0635752A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4186909A JPH0635752A (en) 1992-07-14 1992-07-14 Analysis program generation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4186909A JPH0635752A (en) 1992-07-14 1992-07-14 Analysis program generation system

Publications (1)

Publication Number Publication Date
JPH0635752A true JPH0635752A (en) 1994-02-10

Family

ID=16196812

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4186909A Pending JPH0635752A (en) 1992-07-14 1992-07-14 Analysis program generation system

Country Status (1)

Country Link
JP (1) JPH0635752A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5270838A (en) * 1990-06-14 1993-12-14 Eastman Kodak Company Document scanning apparatus for scanning image information on a single sided document whether the document is right side up or upside down

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5270838A (en) * 1990-06-14 1993-12-14 Eastman Kodak Company Document scanning apparatus for scanning image information on a single sided document whether the document is right side up or upside down

Similar Documents

Publication Publication Date Title
JPH11212837A (en) Method and device for language processing and storage medium recording language processing program
JP3494376B1 (en) Program analysis device and program
JPH0635752A (en) Analysis program generation system
JPH09101880A (en) Program analyzer
JP2004287869A (en) Program execution monitoring device and method
JPH02201553A (en) System for analyzing program by row number designation
JP2811804B2 (en) Variable output range specification method
JP4536576B2 (en) Software coverage measuring apparatus and method
JPH02220145A (en) Program tracing system
JPS6254337A (en) Specification displaying system for program hierarchy
JPH04158446A (en) Calculation system for parallelization part ratio
JP2001331312A (en) System for acquiring related information among plural programs
JPH0553871A (en) Execution information sampling system
JP2000293410A (en) Profiler
JPH0580992A (en) Output system for procedure-function relation chart
JPH01297737A (en) System for estimating program execution time
JPH0340144A (en) Snap shot dump output processor containing pattern analyzing function
JPH04330521A (en) Cross reference list forming system
JPH03260828A (en) Information processor
JPH01298436A (en) Automatic measuring system for program automatic preparing ratio data
JPH11312104A (en) Device for generating program for profiler
Dauphin Knowledge bases in debugging parallel and distributed systems based on event traces
JP2003005965A (en) Device for automatically generating data editing tool/ data access library
JPH0553782A (en) System for obtaining dynamic characteristic analysis information of specified part
JPH05143392A (en) System for forming testing program