JP2699738B2 - Overhead information calculation method - Google Patents
Overhead information calculation methodInfo
- Publication number
- JP2699738B2 JP2699738B2 JP3340414A JP34041491A JP2699738B2 JP 2699738 B2 JP2699738 B2 JP 2699738B2 JP 3340414 A JP3340414 A JP 3340414A JP 34041491 A JP34041491 A JP 34041491A JP 2699738 B2 JP2699738 B2 JP 2699738B2
- Authority
- JP
- Japan
- Prior art keywords
- information
- program
- overhead
- executions
- calculating
- 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 - Lifetime
Links
Landscapes
- Debugging And Monitoring (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は、高級プログラミング言
語で作成されたプログラムの動的解析情報の採取時にお
けるオーバーヘッド時間に関する情報を、静的解析によ
り自動的に算出するオーバーヘッド情報算出方式に関す
るものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an overhead information calculating method for automatically calculating, by static analysis, information on overhead time when dynamic analysis information of a program created in a high-level programming language is collected. is there.
【0002】[0002]
【従来の技術】プログラムの実行性能を評価する等の目
的のために所定のツールを用いた動的解析が行われる。
なお、動的解析情報を採取する測定箇所は、動的解析機
構で決められたプログラム単位やDOループといった特
定の測定箇所と、利用者が指定した特定の箇所とがあ
る。2. Description of the Related Art Dynamic analysis using a predetermined tool is performed for the purpose of evaluating the execution performance of a program.
The measurement points for collecting the dynamic analysis information include a specific measurement point such as a program unit and a DO loop determined by the dynamic analysis mechanism, and a specific point specified by the user.
【0003】ところで、動的解析情報の採取のために
は、オーバーヘッド時間と呼ばれる情報採取のための実
行時間が必要であり、限られた時間内で測定を行う場合
には、その値を事前に把握することは重要である。By the way, in order to collect dynamic analysis information, an execution time for information collection called an overhead time is required, and when measurement is performed within a limited time, the value is set in advance. It is important to understand.
【0004】しかし、オーバーヘッド時間が正確にどの
くらいになるかはプログラムを実際に実行してみなけれ
ば分からず、簡単に求めることはできない。However, the exact amount of overhead time cannot be known without actually executing a program, and cannot be easily obtained.
【0005】利用者がオーバーヘッド時間を予測するた
めには、ソースリストやソースプログラムを静的に解析
して得られる変数名の相互参照リスト等から測定箇所ま
での実行経路を分析し、その各々の実行回数を算出する
と共に、実行1回当たりのオーバーヘッド時間を測定
し、それらを乗算して測定箇所毎のオーバーヘッド時間
を算出していた。なお、実行1回当たりのオーバーヘッ
ド時間は採取する情報の種別に応じて異なった値とな
る。In order to predict the overhead time, the user analyzes the execution path from the source list or the cross-reference list of the variable names obtained by statically analyzing the source program to the measurement location, and executes each analysis. In addition to calculating the number of executions, the overhead time per execution was measured, and the result was multiplied to calculate the overhead time for each measurement point. Note that the overhead time per execution has a different value depending on the type of information to be collected.
【0006】[0006]
【発明が解決しようとする課題】上述したように、従来
は、利用者が測定箇所のオーバーヘッド時間を予測する
ためには、いろいろな情報を集め、測定箇所の実行経路
を分析して実行回数を算出し、採取する情報の種別に応
じた重み付けをして計算しなければならず、利用者の作
業が非常に繁雑であるという欠点があった。As described above, conventionally, in order for a user to predict the overhead time of a measurement location, various types of information are collected, the execution path of the measurement location is analyzed, and the number of executions is reduced. It has to be calculated and weighted according to the type of information to be collected, and the calculation has to be performed, and there is a disadvantage that the work of the user is very complicated.
【0007】また、作業が繁雑なため、実行情報採取に
よるオーバーヘッド時間がわからないままプログラムを
実行する場合は、測定箇所がループ回数の多いループ中
にあったりすると、膨大な実行時間を費やしてしまうと
いう問題もあった。[0007] In addition, since the work is complicated, when the program is executed without knowing the overhead time due to the collection of the execution information, an enormous amount of execution time is consumed if the measurement location is in a loop having a large number of loops. There were also problems.
【0008】本発明は上記の点に鑑み提案されたもので
あり、その目的とするところは、自動的にオーバーヘッ
ド情報を算出することのできるオーバーヘッド情報算出
方式を提供することにある。The present invention has been proposed in view of the above points, and an object of the present invention is to provide an overhead information calculation method capable of automatically calculating overhead information.
【0009】[0009]
【課題を解決するための手段】本発明は上記の目的を達
成するため、ソースプログラムと情報採取情報とを入力
し、ソースプログラム中のループ構造や制御の分岐にか
かる構造を静的に解析してプログラム構造情報を生成す
るプログラム構造解析手段と、生成されたプログラム構
造情報に基づいて測定箇所毎の実行回数を算出し、採取
する情報の種別毎に設定されたオーバーヘッドの重みを
考慮してオーバーヘッド情報を算出するオーバーヘッド
情報算出手段と、測定箇所の実行回数を算出するために
必要な情報が不定な場合、それらの不定な情報を表示し
てその値を入力させ、あるいは、不定な情報を表示する
ことなく、入力された不定値に関する情報の中から実行
回数を算出するために必要な値を検索する不定情報入力
手段とを備えるようにしている。According to the present invention, in order to achieve the above object, a source program and information collection information are input, and a loop structure and a structure related to a control branch in the source program are statically analyzed. Means for generating program structure information by calculating the number of executions for each measurement location based on the generated program structure information, and taking into account the weight of the overhead set for each type of information to be collected. Overhead information calculation means for calculating information, and if the information required to calculate the number of executions of the measurement location is undefined, display those undefined information and input the value, or display the undefined information And an indefinite information input means for searching for a value required to calculate the number of executions from the input information on the undefined value without performing It has to.
【0010】[0010]
【作用】本発明のオーバーヘッド情報算出方式にあって
は、プログラム構造解析手段が、ソースプログラムと情
報採取情報とを入力し、ソースプログラム中のループ構
造や制御の分岐にかかる構造を静的に解析してプログラ
ム構造情報を生成する。オーバーヘッド情報算出手段
は、生成されたプログラム構造情報に基づいて測定箇所
毎の実行回数を算出し、採取する情報の種別毎に設定さ
れたオーバーヘッドの重みを考慮してオーバーヘッド情
報を算出する。また、不定情報入力手段は、測定箇所の
実行回数を算出するために必要な情報が不定な場合、そ
れらの不定な情報を表示してその値を入力させ、あるい
は、不定な情報を表示することなく、入力された不定値
に関する情報の中から実行回数を算出するために必要な
値を検索する。According to the overhead information calculation method of the present invention, the program structure analysis means inputs a source program and information collection information and statically analyzes a loop structure and a control branch structure in the source program. To generate program structure information. The overhead information calculation means calculates the number of executions for each measurement location based on the generated program structure information, and calculates overhead information in consideration of the weight of the overhead set for each type of information to be collected. In addition, if the information necessary for calculating the number of executions of the measurement location is undefined, the undefined information input means may display such undefined information and input the value, or display the undefined information. Instead, a value necessary for calculating the number of executions is searched from the input information on the indefinite value.
【0011】[0011]
【実施例】以下、本発明の実施例につき、図面を参照し
て説明する。Embodiments of the present invention will be described below with reference to the drawings.
【0012】図1は本発明のオーバーヘッド情報算出方
式の一実施例を示す構成図である。FIG. 1 is a block diagram showing an embodiment of an overhead information calculation method according to the present invention.
【0013】図1において、本実施例は、ソースプログ
ラム1と情報採取情報2とを入力し、必要に応じて不定
情報8を呈示すると共に不定値情報9を入力し、オーバ
ーヘッド情報10を算出して出力する静的特性解析機構
3により構成されている。Referring to FIG. 1, in the present embodiment, a source program 1 and information collection information 2 are inputted, uncertain information 8 is presented as necessary, and uncertain value information 9 is inputted, and overhead information 10 is calculated. And a static characteristic analysis mechanism 3 for outputting the data.
【0014】ソースプログラム1はFORTRAN言語
等の高級プログラミング言語で記述されたプログラムで
あり、主プログラム,サブルーチン等の複数のプログラ
ム単位から構成されている。また、情報採取情報2は、
情報を採取する箇所(測定箇所)に関する情報と、採取
する情報の種別(例えば、実行時間)に関する情報とを
含んでいる。The source program 1 is a program described in a high-level programming language such as the FORTRAN language, and is composed of a plurality of program units such as a main program and subroutines. In addition, information collection information 2
The information includes information on the location where information is collected (measurement location) and information on the type of information to be collected (for example, execution time).
【0015】また、静的特性解析機構3は、ソースプロ
グラム1を解析してプログラム構造情報5を生成するプ
ログラム構造解析手段4と、生成されたプログラム構造
情報5を参照してオーバーヘッド情報を算出するオーバ
ーヘッド情報算出手段6と、オーバーヘッド情報の算出
に当たって不定な情報(例えば、変数で指定され、明示
されていないループ回数)がある場合に利用者から入力
を行う不定情報入力手段7とを含んでいる。The static characteristic analysis mechanism 3 analyzes the source program 1 to generate program structure information 5, and calculates overhead information by referring to the generated program structure information 5. It includes an overhead information calculation means 6 and an indefinite information input means 7 for inputting from the user when there is indefinite information (for example, the number of loops specified by a variable and not specified) in calculating the overhead information. .
【0016】以下、具体例を交えて上記の実施例の動作
を説明する。Hereinafter, the operation of the above embodiment will be described with reference to specific examples.
【0017】プログラム構造解析手段4は、ソースプロ
グラム1と情報採取情報2とを入力し、ソースプログラ
ム1中からプログラム単位の呼び出し文(CALL文や
関数呼び出しを含む文等)、ループ制御や分岐制御を行
う文(DO文,IFブロック文,GOTO文等)、制御
の移動がある文(文番号の定義されている文やENDI
F文等)、および、実行情報を採取する測定箇所を検索
し、必要な情報を抽出する。The program structure analyzing means 4 inputs the source program 1 and the information collection information 2 and calls program-based call statements (such as CALL statements and function calls) from the source program 1, loop control and branch control. (DO statement, IF block statement, GOTO statement, etc.), statement with control transfer (sentence with defined statement number, ENDI
An F sentence, etc.) and a measurement location for collecting execution information are searched, and necessary information is extracted.
【0018】また、ループ制御を行う文,分岐制御を行
う文,制御の移動がある文の情報をもとに制御フロー解
析を行い、ループ構造や制御の移動先を特定する。Also, a control flow analysis is performed based on information of a statement for performing loop control, a statement for performing branch control, and a statement for which control is to be moved, and a loop structure and a control transfer destination are specified.
【0019】プログラム構造解析手段4は、これらの解
析結果をプログラム構造情報5としてまとめる。The program structure analyzing means 4 compiles these analysis results as program structure information 5.
【0020】また、ソースプログラム1に含まれる全て
のプログラム単位の解析が終了した後、各プログラム単
位間の呼び出し関係を解析し、結果を保持する。After the analysis of all the program units included in the source program 1 is completed, the calling relationship between the program units is analyzed, and the result is held.
【0021】図2はFORTRAN言語で記述されたソ
ースプログラム1の例を示したものである。FIG. 2 shows an example of a source program 1 described in the FORTRAN language.
【0022】プログラム単位1Aは、「AAA」という
名前の主プログラムであり、プログラム単位の呼び出し
文101,103,105と、DOループを構成するル
ープ制御文102および制御の移動がある文104とを
含んでいる。The program unit 1A is a main program named "AAA", and includes a call statement 101, 103, 105 for each program, a loop control statement 102 constituting a DO loop, and a statement 104 having control transfer. Contains.
【0023】プログラム単位1Bは、「BBB」という
名前のサブルーチンであり、ループを構成する制御の移
動がある文106および分岐制御文113と、DOルー
プを構成するループ制御文107,108,110およ
び制御の移動がある文109,111,112とを含ん
でいる。The program unit 1B is a subroutine named "BBB", and includes a statement 106 and a branch control statement 113 having a transfer of control constituting a loop, loop control statements 107, 108, 110 constituting a DO loop. Statements 109, 111, and 112 that include a transfer of control are included.
【0024】プログラム単位1Cは、「CCC」という
名前のサブルーチンであり、IFブロックを構成する分
岐制御文114および制御の移動がある文117と、D
Oループを構成するループ制御文115,118および
制御の移動がある文116,119とを含んでいる。The program unit 1C is a subroutine named "CCC", and includes a branch control statement 114 constituting an IF block, a statement 117 having control transfer, and D
It includes loop control statements 115 and 118 constituting the O-loop and statements 116 and 119 with control transfer.
【0025】一方、上記の測定対象となるソースプログ
ラム1に対して、情報採取情報2は、全てのCALL文
とDO文とを情報の測定箇所として指定し、測定箇所で
は実行時間の測定を指示しているものとする。On the other hand, for the source program 1 to be measured, the information collection information 2 specifies all the CALL statements and DO statements as information measurement locations, and instructs the measurement locations to measure the execution time. It is assumed that
【0026】先ず、プログラム構造解析手段4は、プロ
グラム単位1Aを入力し、プログラム単位の呼び出し文
101を検出し、プログラム単位の呼び出し文の種別
「CALL」と、付属情報として呼び出すプログラム単
位名「BBB」とを、図3に示すようなプログラム単位
1Aに対応するプログラム構造情報5Aに登録する。ま
た、プログラム単位の呼び出し文101は情報採取の対
象でもあるため、測定箇所である旨もプログラム構造情
報5Aに登録する。First, the program structure analysis means 4 inputs the program unit 1A, detects the call statement 101 of the program unit, and identifies the type of call statement "CALL" of the program unit and the program unit name "BBB" to be called as additional information. Is registered in the program structure information 5A corresponding to the program unit 1A as shown in FIG. In addition, since the call statement 101 for each program is also a target of information collection, the fact that it is a measurement location is also registered in the program structure information 5A.
【0027】次いで、ループ制御文102を検出する
と、種別「DOループ」,文番号「10」,制御変数
「I」,初期値「1」,終値「20」,増分値「1」等
の情報を付属情報としてプログラム構造情報5Aに登録
する。Next, when the loop control statement 102 is detected, information such as the type "DO loop", statement number "10", control variable "I", initial value "1", end value "20", increment value "1", etc. Is registered as additional information in the program structure information 5A.
【0028】プログラム単位の呼び出し文103はプロ
グラム単位の呼び出し文101と同様に処理する。The call statement 103 for each program is processed in the same manner as the call statement 101 for each program.
【0029】次いで、制御の移動がある文(文番号の定
義されている文等)104を検出すると、種別「lab
el」と文番号「10」とをプログラム構造情報5Aに
登録する。Next, when a sentence (sentence or the like in which a sentence number is defined) 104 having a control shift is detected, the type “lab” is detected.
"el" and the statement number "10" are registered in the program structure information 5A.
【0030】プログラム単位の呼び出し文105はプロ
グラム単位の呼び出し文101,103と同様に処理す
る。The call statement 105 for each program is processed in the same manner as the call statements 101 and 103 for each program.
【0031】プログラム単位1Aの解析の終了後、制御
の移動がある文104とループ制御文102のプログラ
ム構造情報5A上の付属情報を参照し、同じ文番号「1
0」を有していることから、ループ構造が存在すると判
断し、ループ制御文102のループ情報としてプログラ
ム構造情報5A中のエントリ番号「4」を登録する。After the analysis of the program unit 1A is completed, referring to the attached information on the program structure information 5A of the statement 104 having the control transfer and the loop control statement 102, the same statement number "1" is used.
Since it has "0", it is determined that the loop structure exists, and the entry number "4" in the program structure information 5A is registered as the loop information of the loop control statement 102.
【0032】同様に、プログラム単位1B,1Cについ
て解析を行った結果のプログラム構造情報5B,5Cを
図4,図5に示す。Similarly, FIGS. 4 and 5 show program structure information 5B and 5C obtained by analyzing the program units 1B and 1C.
【0033】ここで、プログラム単位1Bではエントリ
番号が「1」と「8」、「2」と「7」、「3」と
「4」、「5」と「6」の間でループが構成されている
ことが判明する。また、プログラム単位1Cではエント
リ番号が「1」と「4」、「2」と「3」、「5」と
「6」の間でループが構成されていることが判明する。Here, in the program unit 1B, a loop is formed between entry numbers "1" and "8", "2" and "7", "3" and "4", and "5" and "6". It turns out that it is. It is also found that a loop is formed between the entry numbers “1” and “4”, “2” and “3”, and “5” and “6” in the program unit 1C.
【0034】次いで、プログラム構造解析手段4は、プ
ログラム単位毎のプログラム構造情報5A,5B,5C
をもとにプログラム単位間の呼び出し関係を関連付け、
図6に示すように、プログラム単位1Aがプログラム単
位1Bを2回呼び出し、プログラム単位1Cを1回呼び
出すものと認識する。Next, the program structure analyzing means 4 generates program structure information 5A, 5B, 5C for each program unit.
Associate the calling relationship between program units based on
As shown in FIG. 6, it is recognized that the program unit 1A calls the program unit 1B twice and the program unit 1C calls once.
【0035】次に、図1に戻り、オーバーヘッド情報算
出手段6は、プログラム構造解析手段4によって生成さ
れたプログラム構造情報5に基づき、各プログラム単位
が1回実行される場合の各測定箇所の実行回数を算出す
る。これは、主プログラムのプログラム単位ではそれが
1回実行される時の実行回数であり、サブルーチンのプ
ログラム単位では呼び出しが1回行われる時の実行回数
となる。Next, returning to FIG. 1, the overhead information calculation means 6 executes the execution of each measurement point when each program unit is executed once based on the program structure information 5 generated by the program structure analysis means 4. Calculate the number of times. This is the number of executions when the main program is executed once in a program unit, and the number of executions when the call is executed once in a subroutine program unit.
【0036】次いで、オーバーヘッド情報算出手段6
は、プログラム単位の呼び出し経路毎にプログラム単位
の呼び出し回数を算出して加算することでプログラム単
位の呼び出し回数を算出し、プログラム単位の呼び出し
回数と1回の呼び出しでの各測定箇所の実行回数を乗算
して測定箇所毎の総実行回数を算出する。なお、主プロ
グラムのプログラム単位の呼び出し回数は1回とする。Next, overhead information calculating means 6
Calculates the number of calls per program for each call path per program and adds it to calculate the number of calls per program. The number of calls per program and the number of executions at each measurement point in one call The total number of executions for each measurement location is calculated by multiplication. Note that the number of calls of the main program in the program unit is one.
【0037】次いで、オーバーヘッド情報算出手段6
は、各測定箇所の総実行回数に、採取する情報の種別に
より決まる実行1回当たりのオーバーヘッド時間を乗算
し、測定箇所毎のオーバーヘッド時間を算出する。Next, overhead information calculating means 6
Calculates the overhead time for each measurement location by multiplying the total number of executions at each measurement location by the overhead time per execution determined by the type of information to be collected.
【0038】そして、オーバーヘッド情報算出手段6
は、測定箇所毎のオーバーヘッド時間を加算してプログ
ラム単位毎やプログラム全体のオーバーヘッド時間を算
出し、オーバーヘッド情報10として外部に出力する。Then, the overhead information calculating means 6
Calculates the overhead time for each program unit or for the entire program by adding the overhead time for each measurement point, and outputs it as overhead information 10 to the outside.
【0039】また、オーバーヘッド情報算出手段6の処
理に際して、実行回数を算出するために必要な情報(ル
ープ回数等)であって値が不定な情報がある場合には、
不定情報入力手段7を呼び出す。In the processing of the overhead information calculating means 6, if there is information (number of loops, etc.) necessary for calculating the number of executions and information having an indefinite value,
The indefinite information input means 7 is called.
【0040】不定情報入力手段7は、不定情報8をディ
スプレイ等に表示し、利用者に不定値情報9として入力
させる。また、不定情報8を表示することなく、別途に
入力された不定値情報9の中から実行回数を算出するた
めの必要な値を検索するようにしてもよい。The indefinite information input means 7 displays the indefinite information 8 on a display or the like, and allows the user to input it as indefinite value information 9. Further, a value required for calculating the number of executions may be searched from the separately input indefinite value information 9 without displaying the indefinite information 8.
【0041】また、不定情報入力手段7を設けず、不定
な情報に所定の値を仮定値として設定してしまうことも
できる。この場合、最終的に算出されるオーバーヘッド
情報は誤差を含むものとなるが、構成が簡略化でき、お
おまかな予測で良いような場合には適している。It is also possible to set a predetermined value as the assumed value for the indefinite information without providing the indefinite information input means 7. In this case, although the overhead information finally calculated includes an error, the overhead information can be simplified, and is suitable when rough prediction is sufficient.
【0042】図2のソースプログラム1についてのオー
バーヘッド情報算出手段6の動作は次のようになる。The operation of the overhead information calculating means 6 for the source program 1 shown in FIG. 2 is as follows.
【0043】オーバーヘッド情報算出手段6は、先ず、
図3のプログラム構造情報5Aから測定箇所として指定
されているものを検索し、最初に測定箇所101を検出
する。なお、説明に際し、測定箇所を示す符号として前
述したソースプログラム1中の文の番号を使用するもの
とする。The overhead information calculation means 6 firstly
The program structure information 5A shown in FIG. 3 is searched for the one designated as the measurement location, and the measurement location 101 is detected first. In the description, the number of the sentence in the source program 1 described above is used as the code indicating the measurement location.
【0044】図3のプログラム構造情報5Aから判断し
て、プログラム単位1A中に含まれるループ構造はエン
トリ番号が「2」〜「4」の間だけであり、測定箇所1
01は分岐制御にもループ制御にも含まれていないた
め、その実行回数は1回となる。Judging from the program structure information 5A of FIG. 3, the loop structure included in the program unit 1A has only the entry number between "2" and "4",
Since 01 is not included in either the branch control or the loop control, the number of executions is one.
【0045】測定箇所102も同様に実行回数は1回と
なる。なお、ループの入口,出口はループ内とは考えな
い。Similarly, the number of executions of the measurement point 102 is one. The entrance and exit of the loop are not considered to be inside the loop.
【0046】測定箇所103は、ループ構造の中にある
ため、実行回数はそのループ構造のループ回数である
「20」となる。このループ回数はプログラム構造情報
5Aの付属情報から求めることができる。Since the measurement point 103 is in the loop structure, the number of executions is "20" which is the number of loops of the loop structure. The number of loops can be obtained from the additional information of the program structure information 5A.
【0047】同様に、測定箇所105も実行回数は1回
となる。Similarly, the number of executions of the measurement point 105 is one.
【0048】次に、プログラム単位1Bに対応する図4
のプログラム構造情報5Bに対して、測定箇所107,
108,110についての実行回数を算出する。Next, FIG. 4 corresponding to the program unit 1B
For the program structure information 5B of FIG.
The number of executions for 108 and 110 is calculated.
【0049】ここで、測定箇所107,108,110
は、エントリ番号「1」のlabelとエントリ番号
「8」の分岐との間のループ回数が不定なループに含ま
れるため、その回数をαとしておく。また、測定箇所1
08,110はエントリ番号「2」のDOループとエン
トリ番号「7」のlabelとの間の不定なループ回数
Mのループに含まれる。従って、測定箇所107の実行
回数はα回、測定箇所108,110の実行回数はα*
M回となる。Here, the measurement points 107, 108, 110
Since the number of loops between the label having the entry number “1” and the branch having the entry number “8” is included in an indefinite loop, the number is set to α. Measurement point 1
08 and 110 are included in a loop having an indefinite number of loops M between the DO loop having the entry number “2” and the label having the entry number “7”. Therefore, the number of executions of the measurement point 107 is α times, and the number of executions of the measurement points 108 and 110 is α *
M times.
【0050】同様に、プログラム単位1Cに対応する図
5のプログラム構造情報5Cに対して、測定箇所11
5,118についての実行回数を算出する。Similarly, for the program structure information 5C of FIG.
The number of executions for 5,118 is calculated.
【0051】ここで、測定箇所115はエントリ番号
「1」の分岐とエントリ番号「4」のENDIFとの間
の分岐制御の中に含まれるため、その分岐率をβとする
と、実行回数はβ回となる。また、測定箇所118の実
行回数は1回となる。Since the measurement point 115 is included in the branch control between the branch of the entry number “1” and the ENDIF of the entry number “4”, if the branch rate is β, the number of executions is β Times. Also, the number of executions of the measurement point 118 is one.
【0052】オーバーヘッド情報算出手段6は、不定情
報入力手段7を起動し、上記のα,M,βを入力させ、
あるいは、別途に入力された情報から検索して確定す
る。また、不定情報入力手段7が存在しない場合には、
自ら値を仮定する。なお、ループ回数等を最小値に仮定
して算出したオーバーヘッド時間は、最小オーバーヘッ
ド時間とみなすことができる。The overhead information calculation means 6 activates the indefinite information input means 7 and inputs the above α, M, β,
Alternatively, it is determined by searching from separately input information. If the indefinite information input means 7 does not exist,
Assumes a value of its own. The overhead time calculated by assuming the number of loops and the like to be the minimum value can be regarded as the minimum overhead time.
【0053】上記の例でα=1,M=10,β=0.5
と決定した場合における実行回数の算出結果を図7の中
欄に示す。In the above example, α = 1, M = 10, β = 0.5
The calculation result of the number of times of execution when it is determined is shown in the middle column of FIG.
【0054】次に、オーバーヘッド情報算出手段6は、
プログラム単位の呼び出し経路毎の呼び出し回数を算出
し、それを加算することによりプログラム単位の呼び出
し回数を算出する。Next, the overhead information calculating means 6
The number of calls for each call path is calculated for each program, and the sum is added to calculate the number of calls for each program.
【0055】プログラム単位1Aの場合、主プログラム
のため呼び出し回数は1回となる。In the case of the program unit 1A, the number of calls is one because of the main program.
【0056】プログラム単位1Bの場合、呼び出し経路
はプログラム単位1Aのプログラム単位の呼び出し文1
01,103(図2参照)の2経路があり、各々の呼び
出し文の実行回数は1回と20回であるため、プログラ
ム単位1Bの呼び出し回数は21回となる。In the case of the program unit 1B, the call path is the program unit call statement 1 of the program unit 1A.
Since there are two paths 01 and 103 (see FIG. 2) and the number of executions of each call statement is 1 and 20, the number of calls of the program unit 1B is 21.
【0057】プログラム単位1Cの場合、呼び出し経路
はプログラム単位1Aのプログラム単位の呼び出し文1
05からの1経路であり、その呼び出し文の実行回数は
1回であるため、プログラム単位1Cの呼び出し回数は
1回となる。In the case of the program unit 1C, the call path is the program unit call statement 1 of the program unit 1A.
Since the number of executions of the call statement is one, the number of calls of the program unit 1C is one.
【0058】次に、オーバーヘッド情報算出手段6は、
測定箇所毎の実行回数と、その測定箇所の含まれるプロ
グラム単位の実行回数とを乗算することにより、測定箇
所毎の総実行回数を算出する。Next, the overhead information calculating means 6
By multiplying the number of executions for each measurement point by the number of executions for each program including the measurement point, the total number of executions for each measurement point is calculated.
【0059】上記の例における測定箇所毎の総実行回数
の算出結果を、図7の右欄に示す。The calculation result of the total number of executions for each measurement point in the above example is shown in the right column of FIG.
【0060】次に、オーバーヘッド情報算出手段6は、
測定箇所毎の総実行回数と、採取する情報の種別に応じ
た実行1回当たりのオーバーヘッド時間とを乗算するこ
とにより、測定箇所毎のオーバーヘッド時間を算出す
る。ここで、実行1回当たりのオーバーヘッド時間は、
固定的に値を設定してもよいし、予め実際に情報を採取
する平均的プログラムを実行して決定した値を使用して
もよい。Next, the overhead information calculating means 6
The overhead time for each measurement point is calculated by multiplying the total number of executions for each measurement point by the overhead time for one execution in accordance with the type of information to be collected. Here, the overhead time per execution is
A fixed value may be set, or a value determined by executing an average program for actually collecting information in advance may be used.
【0061】今の例では、各測定箇所につき全て実行時
間を測定することを指示されているので、オーバーヘッ
ド時間を一律にt時間とすることができ、図7の総実行
回数にtを乗算した値が各測定箇所毎のオーバーヘッド
時間となる。In this example, since it is instructed to measure the execution time for each measurement point, the overhead time can be uniformly set to t, and the total number of executions in FIG. 7 is multiplied by t. The value is the overhead time for each measurement point.
【0062】そして、測定箇所毎のオーバーヘッド時間
から、プログラム単位毎のオーバーヘッド時間およびプ
ログラム全体のオーバーヘッド時間を算出することがで
きる。図7の例では、プログラム全体でのオーバーヘッ
ド時間は、465.5*t時間となる。Then, the overhead time for each program unit and the overhead time for the entire program can be calculated from the overhead time for each measurement point. In the example of FIG. 7, the overhead time of the entire program is 465.5 * t time.
【0063】[0063]
【発明の効果】以上説明したように、本発明のオーバー
ヘッド情報算出方式にあっては、次のような効果があ
る。As described above, the overhead information calculation method of the present invention has the following effects.
【0064】測定箇所のオーバーヘッド情報を自動的
に算出することができるため、利用者が種々の情報を収
集してオーバーヘッド時間を算出するという繁雑な処理
を行わないで済み、オーバーヘッド時間の予測を容易に
することができる。Since the overhead information of the measurement location can be automatically calculated, the user does not need to perform a complicated process of collecting various information and calculating the overhead time, and can easily predict the overhead time. Can be
【0065】算出されたオーバーヘッド情報を利用す
ることで、オーバーヘッド時間の多くかかる測定箇所を
測定対象から外す等の測定箇所の選択を容易に行うこと
ができ、無駄な実行を行わずに済む。By using the calculated overhead information, it is possible to easily select a measurement point such as excluding a measurement point that requires a large amount of overhead time from a measurement target, and to avoid unnecessary execution.
【0066】ソースプログラムの静的解析だけでは確
定できない不定要素をオーバーヘッド情報が含む場合に
は、利用者から不定要素に対する情報を得ることができ
るので、より正確なオーバーヘッド情報を算出すること
ができる。If the overhead information includes an indeterminate element that cannot be determined only by static analysis of the source program, information on the indeterminate element can be obtained from the user, so that more accurate overhead information can be calculated.
【図1】本発明のオーバーヘッド情報算出方式の一実施
例を示す構成図である。FIG. 1 is a configuration diagram showing an embodiment of an overhead information calculation method according to the present invention.
【図2】ソースプログラムの例を示す図である。FIG. 2 is a diagram illustrating an example of a source program.
【図3】プログラム構造情報の例を示す図である。FIG. 3 is a diagram illustrating an example of program structure information.
【図4】プログラム構造情報の例を示す図である。FIG. 4 is a diagram showing an example of program structure information.
【図5】プログラム構造情報の例を示す図である。FIG. 5 is a diagram showing an example of program structure information.
【図6】プログラム単位間の呼び出し関係の例を示す図
である。FIG. 6 is a diagram illustrating an example of a calling relationship between program units.
【図7】測定箇所毎の実行回数および総実行回数の算出
結果の例を示す図である。FIG. 7 is a diagram illustrating an example of calculation results of the number of executions and the total number of executions for each measurement location.
1…………………………ソースプログラム 1A,1B,1C………プログラム単位 2…………………………情報採取情報 3…………………………静的特性解析機構 4…………………………プログラム構造解析手段 5,5A,5B,5C…プログラム構造情報 6…………………………オーバーヘッド情報算出手段 7…………………………不定情報入力手段 8…………………………不定情報 9…………………………不定値情報 10………………………オーバーヘッド情報 1 ... Source program 1A, 1B, 1C ... Program unit 2 ... Information collection information 3 ... ... Static Characteristic analysis mechanism 4 Program structure analysis means 5, 5A, 5B, 5C Program structure information 6 Overhead information calculation means 7 ………………………………………… ·················································· Overhead information
Claims (2)
力し、ソースプログラム中のループ構造や制御の分岐に
かかる構造を静的に解析してプログラム構造情報を生成
するプログラム構造解析手段と、 生成されたプログラム構造情報に基づいて測定箇所毎の
実行回数を算出し、採取する情報の種別毎に設定された
オーバーヘッドの重みを考慮してオーバーヘッド情報を
算出するオーバーヘッド情報算出手段とを備えたことを
特徴とするオーバーヘッド情報算出方式。1. A program structure analysis means for inputting a source program and information collection information and statically analyzing a loop structure or a structure related to a control branch in the source program to generate program structure information. Information calculating means for calculating the number of executions for each measurement location based on the program structure information obtained, and calculating overhead information in consideration of the weight of the overhead set for each type of information to be collected. Overhead information calculation method.
要な情報が不定な場合、それらの不定な情報を表示して
その値を入力させ、あるいは、不定な情報を表示するこ
となく、入力された不定値に関する情報の中から実行回
数を算出するために必要な値を検索する不定情報入力手
段を備えたことを特徴とする請求項1記載のオーバーヘ
ッド情報算出方式。2. When information necessary for calculating the number of executions of a measurement location is uncertain, display the uncertain information and input the value, or input the value without displaying the uncertain information. 2. The overhead information calculation method according to claim 1, further comprising an indefinite information input means for searching a value required to calculate the number of executions from the information on the determined indefinite values.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3340414A JP2699738B2 (en) | 1991-11-29 | 1991-11-29 | Overhead information calculation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3340414A JP2699738B2 (en) | 1991-11-29 | 1991-11-29 | Overhead information calculation method |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH05151031A JPH05151031A (en) | 1993-06-18 |
JP2699738B2 true JP2699738B2 (en) | 1998-01-19 |
Family
ID=18336721
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP3340414A Expired - Lifetime JP2699738B2 (en) | 1991-11-29 | 1991-11-29 | Overhead information calculation method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2699738B2 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4716259B2 (en) | 2006-03-29 | 2011-07-06 | 日本電気株式会社 | Sizing support system, method, and program |
JP5282908B2 (en) * | 2007-10-03 | 2013-09-04 | 日本電気株式会社 | Hierarchical load estimation system, method and program |
JP6926921B2 (en) * | 2017-01-27 | 2021-08-25 | 富士通株式会社 | Compile program, compilation method and parallel processing device |
US10768915B2 (en) * | 2018-10-18 | 2020-09-08 | Denso International America, Inc. | Systems and methods for selectively instrumenting a program according to performance characteristics |
-
1991
- 1991-11-29 JP JP3340414A patent/JP2699738B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JPH05151031A (en) | 1993-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8839210B2 (en) | Program performance analysis apparatus | |
US6408430B2 (en) | Interactive software testing system and method | |
US4710872A (en) | Method for vectorizing and executing on an SIMD machine outer loops in the presence of recurrent inner loops | |
KR100921514B1 (en) | A Software Development Apparatus for Providing Performance Prediction and A method thereof | |
CN102207901A (en) | Method and apparatus for analyzing software | |
CN111104335A (en) | A C language defect detection method and device based on multi-level analysis | |
JP2708405B2 (en) | Loop unrolling method in compiler | |
KR101788279B1 (en) | Measuring system and method of worst-case execution time using test techniques | |
JP2003044275A (en) | System, method and program for measuring change risk | |
JP2699738B2 (en) | Overhead information calculation method | |
Gustafsson et al. | A tool for automatic flow analysis of C-programs for WCET calculation | |
Lomet | Data flow analysis in the presence of procedure calls | |
EP1141825B1 (en) | Method and system for identifying locations to move portions of the computer program | |
JP2007179488A (en) | Source code problem prediction program | |
CN111290946B (en) | Floating point error detection method and device based on atomic state function | |
JP2751977B2 (en) | Dynamic analysis information prediction calculation method | |
JPH06202875A (en) | Compiler for attaining optimization with in-line expansion | |
JPH09101880A (en) | Program analyzer | |
JP2002229818A (en) | Program execution time analytical method and its device | |
US20220036280A1 (en) | Skill index provision device, skill index provision method, and program | |
JP2697401B2 (en) | Execution information collection method | |
JPH04182833A (en) | Cross reference list output system | |
JPH09160784A (en) | Paralleled compiling system | |
Kirner et al. | Consideration of optimizing compilers in the context of WCET analysis | |
JP2864589B2 (en) | Function value difference output system |