JP3206535B2 - Measured value display method of performance measurement tool - Google Patents
Measured value display method of performance measurement toolInfo
- Publication number
- JP3206535B2 JP3206535B2 JP01555198A JP1555198A JP3206535B2 JP 3206535 B2 JP3206535 B2 JP 3206535B2 JP 01555198 A JP01555198 A JP 01555198A JP 1555198 A JP1555198 A JP 1555198A JP 3206535 B2 JP3206535 B2 JP 3206535B2
- Authority
- JP
- Japan
- Prior art keywords
- code
- measurement
- object code
- instruction
- value distribution
- 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
Links
- 238000005259 measurement Methods 0.000 title claims description 92
- 238000000034 method Methods 0.000 title claims description 23
- 239000013256 coordination polymer Substances 0.000 claims 1
- 238000005457 optimization Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000010355 oscillation Effects 0.000 description 1
- YDLQKLWVKKFPII-UHFFFAOYSA-N timiperone Chemical compound C1=CC(F)=CC=C1C(=O)CCCN1CCC(N2C(NC3=CC=CC=C32)=S)CC1 YDLQKLWVKKFPII-UHFFFAOYSA-N 0.000 description 1
- 229950000809 timiperone Drugs 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Description
【0001】[0001]
【発明の属する技術分野】本発明は性能測定ツールの測
定値表示方式に関し、特に、最適化が介在する翻訳,実
行環境において、ソースコードレベルでの性能解析やチ
ューニングを効率化する性能測定ツールの測定値表示方
式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a measurement value display method of a performance measurement tool, and more particularly, to a performance measurement tool for efficiently performing performance analysis and tuning at a source code level in a translation and execution environment where optimization is involved. It relates to a measurement value display method.
【0002】[0002]
【従来の技術】性能測定ツールは、一般に、プログラム
中の特定の構造について実行時間などの性能値を測定
し、その結果を表やグラフ形式で表示する機能を持つ。
測定の対象となる特定の構造は、測定される性能値の有
用性や測定の効率性などを考慮して、多くの場合、ルー
チン,ループ,基本ブロックなどである。2. Description of the Related Art Generally, a performance measurement tool has a function of measuring a performance value such as an execution time of a specific structure in a program and displaying the result in a table or a graph format.
The specific structure to be measured is often a routine, a loop, a basic block, or the like in consideration of the usefulness of the measured performance value and the efficiency of the measurement.
【0003】実行時間を測定する性能測定ツールの一例
として、特開平5―20135号公報を挙げる。この公
報の発明では、コンパイル時に関数を分岐を含まない基
本ブロックに分解して各基本ブロックに実行回数加算コ
ードを埋め込み、実行時に加算累積値から基本ブロック
ごとの実行回数を測定し、あらかじめ計算しておいた各
基本ブロックの1回当たりのCPU時間に、測定された
実行回数を乗じて基本ブロックごとの実行時間を計算し
て表示するようにしている。An example of a performance measurement tool for measuring execution time is disclosed in Japanese Patent Laid-Open No. Hei 5-20135. According to the invention of this publication, at the time of compilation, a function is decomposed into basic blocks that do not include branches, an execution count addition code is embedded in each basic block, and at execution, the execution count for each basic block is measured from the accumulated value and calculated in advance. The CPU time per one time of each basic block is multiplied by the measured number of executions, and the execution time for each basic block is calculated and displayed.
【0004】これ以外にも、ループやルーチンの前後に
時刻測定用コードを挿入し、当該構造の実行時間を直接
的に測定する性能測定ツールや、実行時に一定間隔で割
り込みを発生させ、割り込み時に実行していたアドレス
の分布状況からルーチンごとの性能を見積もる性能測定
ツールなどが一般に知られている。In addition to this, a time measurement code is inserted before and after a loop or a routine, a performance measurement tool for directly measuring the execution time of the structure, an interrupt is generated at regular intervals during execution, and There is generally known a performance measurement tool for estimating the performance of each routine from the distribution state of the addresses being executed.
【0005】上述した従来の性能測定ツールは、いずれ
も、測定されたオブジェクトコード中の構造の性能を、
そのままオブジェクトコード中の構造と対応させて表示
する方式のものである。[0005] All of the conventional performance measurement tools described above measure the performance of a structure in the measured object code.
This is a method of displaying the data as it is in correspondence with the structure in the object code.
【0006】[0006]
【発明が解決しようとする課題】しかしながら、測定さ
れたオブジェクトコード中の構造についてそのまま測定
結果を表示する上述した従来の表示方法では、最適化を
行う最近のコンパイラでは、測定結果の表示がユーザに
とって分かりにくいという問題点がある。However, according to the above-mentioned conventional display method for displaying the measurement result as it is for the measured structure in the object code, the display of the measurement result is difficult for a user with a recent compiler that performs optimization. There is a problem that it is difficult to understand.
【0007】すなわち、最近のコンパイラは、複雑なプ
ログラムの変形を行うため、ユーザが理解するソースコ
ード中の構造と、実際に測定されて表示されるオブジェ
クトコード中の構造とは、1対1に対応していないこと
が少なくない。従って、ユーザが表示された数値から自
分のソースコードの各部の性能を知るためには、最適化
の履歴などを基に変換しなければならないので、手間が
かかる上に最適化に関する高度な知識が必要となる。That is, since recent compilers perform complicated program transformation, the structure in the source code understood by the user and the structure in the object code actually measured and displayed are one-to-one. Not often. Therefore, in order for the user to know the performance of each part of his or her source code from the displayed numerical values, it is necessary to perform conversion based on the optimization history and the like, which is troublesome and requires advanced knowledge on optimization. Required.
【0008】本発明の目的は、上記の問題点に鑑み、コ
ンパイラが行う最適化の程度にかかわらず、オブジェク
トコード中の構造に対して行われた測定結果を、ソース
コード中の構造に還元してユーザに表示することであ
る。In view of the above problems, an object of the present invention is to reduce a measurement result performed on a structure in object code to a structure in source code regardless of the degree of optimization performed by a compiler. To display to the user.
【0009】[0009]
【課題を解決するための手段】請求項1の性能測定ツー
ルの測定値表示方式は、ソースコードをオブジェクトコ
ードに翻訳して測定コードを埋め込みオブジェクトコー
ド中の構造の実行時間を測定する性能測定ツールの測定
値表示方式において、オブジェクトコードを実行するハ
ードウェアの各命令の実行に要するCPU時間があらか
じめ記述された命令CPU時間表と、オブジェクトコー
ド生成時に作成されオブジェクトコード中の各命令がソ
ースコード中のどの部分に起源を有するかを記述するコ
ード対応表と、測定されたオブジェクトコード中の構造
の実行時間を対応するソースコード中の構造に配分する
割合を記述する測定値配分表と、前記コード対応表およ
び命令CPU時間表に基づいて測定単位となるオブジェ
クトコード中の構造内に存在する各命令のCPU時間
を、当該命令の起源であるソースコード中の構造が複数
あるときはそれらの各構造に均等に振り分けて、ソース
コード中の対応する各構造に積算し積算値の比をとるこ
とにより配分割合を計算し前記測定値配分表に記述する
測定値配分計算手段と、オブジェクトコードの実行によ
り測定されたオブジェクトコード中の構造の実行時間を
前記測定値配分表に基づいてソースコード中の対応する
複数の構造に配分して表示する実行時間表示手段とを備
えている。According to a first aspect of the present invention, there is provided a performance measuring tool for displaying a measured value, wherein a source code is translated into an object code, a measuring code is embedded, and an execution time of a structure in the object code is measured. In the measured value display method, an instruction CPU time table in which CPU time required to execute each instruction of hardware for executing an object code is described in advance, and each instruction in the object code created when the object code is generated is included in the source code. A code correspondence table describing which part of the structure has the origin, a measured value distribution table describing a ratio of allocating the measured execution time of the structure in the object code to the corresponding structure in the source code, and the code The structure in the object code as the unit of measurement based on the correspondence table and the instruction CPU time table CPU time for each instruction that is present within
And when the structure of the source code is the origin of those instruction have multiple divided Ri equally oscillation in their respective structures, by taking the ratio of the integrated values integrated in each corresponding structure in the source Sukodo A measurement value distribution calculating means for calculating a distribution ratio and describing the measurement value distribution table in the measurement value distribution table; and executing the execution time of the structure in the object code measured by executing the object code in the source code based on the measurement value distribution table. Execution time display means for distributing and displaying a plurality of structures.
【0010】請求項2の性能測定ツールの測定値表示方
式は、請求項1記載の性能測定ツールの測定値表示方式
において、ソースコードを翻訳し測定コードが埋め込ま
れたオブジェクトコードを生成するコンパイラ部が前記
命令CPU時間表および測定値配分計算手段を備えて前
記測定値配分表と測定コードが埋め込まれたオブジェク
トコードとを出力し、測定実行時に性能表示処理部が前
記測定値配分表を入力し前記実行時間表示手段により表
示を行うことを特徴としている。According to a second aspect of the present invention, there is provided a method for displaying a measured value of a performance measurement tool, comprising the steps of: translating a source code and generating an object code in which a measurement code is embedded. Comprises the instruction CPU time table and the measured value distribution calculating means, outputs the measured value distribution table and the object code in which the measurement code is embedded, and the performance display processing unit inputs the measured value distribution table when executing the measurement. The display is performed by the execution time display means.
【0011】請求項3の性能測定ツールの測定値表示方
式は、請求項2記載の性能測定ツールの測定値表示方式
において、前記コンパイラ部が異なる実行用計算機に対
応する複数の命令CPU時間表を備え、その一つを選択
して前記測定値配分表を出力することを特徴としてい
る。According to a third aspect of the present invention, there is provided a method for displaying a measured value of a performance measuring tool according to the second aspect of the present invention, wherein the compiler unit includes a plurality of instruction CPU time tables corresponding to different execution computers. And selecting one of them to output the measured value distribution table.
【0012】請求項4の性能測定ツールの測定値表示方
式は、請求項1記載の性能測定ツールの測定値表示方式
において、ソースコードを翻訳し測定コードが埋め込ま
れたオブジェクトコードを生成するコンパイラ部が前記
測定値配分計算手段を備え、外部記憶装置から前記命令
CPU時間表を読み込んで前記測定値配分表および測定
コードが埋め込まれたオブジェクトコードを出力し、測
定実行時に性能表示処理部が前記測定値配分表を入力し
前記実行時間表示手段により表示を行うことを特徴とし
ている。According to a fourth aspect of the present invention, there is provided a method for displaying a measured value of a performance measuring tool, wherein the compiler section translates a source code and generates an object code in which a measuring code is embedded. Comprises the measured value distribution calculating means, reads the instruction CPU time table from an external storage device, and outputs an object code in which the measured value distribution table and the measurement code are embedded. It is characterized in that a value distribution table is inputted and displayed by the execution time display means.
【0013】請求項5の性能測定ツールの測定値表示方
式は、請求項1記載の性能測定ツールの測定値表示方式
において、ソースコードを翻訳し測定コードが埋め込ま
れたオブジェクトコードを生成するコンパイラ部が前記
コード対応表と測定コードが埋め込まれたオブジェクト
コードとを出力し、性能表示処理部が前記命令CPU時
間表および測定値配分計算手段を備え、測定実行時に前
記コード対応表を用いて前記測定値配分表を作成し、前
記実行時間表示手段により表示を行うことを特徴として
いる。According to a fifth aspect of the present invention, there is provided a method for displaying a measured value of a performance measurement tool, comprising the steps of: translating a source code and generating an object code in which a measurement code is embedded. Outputs the code correspondence table and the object code in which the measurement code is embedded, and the performance display processing unit includes the instruction CPU time table and the measurement value distribution calculating means, and performs the measurement by using the code correspondence table when executing the measurement. A value distribution table is created and displayed by the execution time display means.
【0014】[0014]
【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して説明する。Next, embodiments of the present invention will be described with reference to the drawings.
【0015】図1は、本発明の第1の実施の形態の構成
を示すブロック図である。本発明の第1の実施の形態
は、図1に示すように、ソースコード5を入力して測定
値配分表3及び測定コードが挿入されたオブジェクトコ
ード6を出力するコンパイラ1と、オブジェクトコード
6を実行しオブジェクトコード中の構造単位で測定され
た性能データ7を出力する実行用計算機4と、性能デー
タ7を入力し測定値配分表3を参照してソースコード中
の構造単位に変換した測定データをディスプレイ9に表
示したり性能表示リスト8として出力する実行時間表示
手段21を備えた性能表示ツール2とで構成されてい
る。FIG. 1 is a block diagram showing the configuration of the first embodiment of the present invention. In the first embodiment of the present invention, as shown in FIG. 1, a compiler 1 that inputs a source code 5 and outputs a measured value distribution table 3 and an object code 6 into which the measured code is inserted, And outputs the performance data 7 measured in the structural unit in the object code, and the measurement in which the performance data 7 is input and converted into the structural unit in the source code with reference to the measured value distribution table 3. The performance display tool 2 includes an execution time display unit 21 for displaying data on the display 9 and outputting the data as the performance display list 8.
【0016】コンパイラ1は、ソースコード5の構文を
解析する構文解析部11と、構文解析部11の処理結果
に基づき最適化を行ってオブジェクトコード6を生成す
ると共にコード対応表13を作成するオブジェクトコー
ド生成部12と、生成されるオブジェクトコードに測定
用コードを挿入する測定コード埋め込み手段15と、実
行用計算機4の各命令の実行に要するCPU時間があら
かじめ登録されている命令CPU時間表14と、コード
対応表13,命令CPU時間表14から実行用計算機4
で測定されるオブジェクトコード中の構造の測定データ
をソースコード中の対応する構造に配分する割合を算出
して測定値配分表3を出力する測定値配分計算手段16
と、これらを制御する制御部17とで構成されている。The compiler 1 includes a syntax analyzer 11 for analyzing the syntax of the source code 5 and an object for generating an object code 6 by performing optimization based on the processing result of the syntax analyzer 11 and creating a code correspondence table 13. A code generation unit 12, a measurement code embedding unit 15 for inserting a measurement code into a generated object code, and an instruction CPU time table 14 in which CPU time required for executing each instruction of the execution computer 4 is registered in advance. From the code correspondence table 13 and the instruction CPU time table 14
Measurement value calculation means 16 for calculating the ratio of allocating the measurement data of the structure in the object code measured in the above to the corresponding structure in the source code and outputting the measurement value distribution table 3
And a control unit 17 for controlling these.
【0017】以下、上記のように構成された第1の実施
の形態の動作について詳細に説明する。コンパイラ1に
入力されたソースコード5は、構文解析部11による解
析結果と共にオブジェクトコード生成部12に送られ
る。オブジェクトコード生成部12は、解析結果に基づ
いて最適化処理を行い、オブジェクトコードを生成する
と測定コード埋め込み手段15を呼び出す。Hereinafter, the operation of the first embodiment configured as described above will be described in detail. The source code 5 input to the compiler 1 is sent to the object code generation unit 12 together with the analysis result by the syntax analysis unit 11. The object code generation unit 12 performs optimization processing based on the analysis result, and calls the measurement code embedding unit 15 when the object code is generated.
【0018】測定コード埋め込み手段15は、生成され
たオブジェクトコード内に存在するループなどの測定単
位となる構造を認識し、認識した構造の前後に計時処理
を行うための測定コードを埋め込む。これにより、測定
コードが挿入されたオブジェクトコード6が生成され、
実行時にオブジェクトコード中の構造の実行時間を測定
することが可能となる。The measurement code embedding means 15 recognizes a structure serving as a measurement unit such as a loop existing in the generated object code, and embeds a measurement code for performing timekeeping processing before and after the recognized structure. Thereby, the object code 6 in which the measurement code is inserted is generated,
It is possible to measure the execution time of the structure in the object code at the time of execution.
【0019】次に、オブジェクトコード生成部12は、
オブジェクトコードの生成に使用した解析情報などを基
にしてコード対応表13を生成する。コード対応表13
は、オブジェクトコード中の構造に含まれる各命令が、
ソースコード中のどの部分に起源を持つかを記述した対
応表であり、最適化に伴って1対1に対応しなくなった
ソースコード中の構造とオブジェクトコード中の構造と
の間の関係を記述したものである。コード対応表13の
作成が終了すると、オブジェクトコード生成部12は測
定値配分計算手段16を呼び出す。Next, the object code generation unit 12
The code correspondence table 13 is generated based on the analysis information used for generating the object code. Code Correspondence Table 13
Means that each instruction included in the structure in the object code is
This is a correspondence table that describes which part in the source code has the origin, and describes the relationship between the structure in the source code and the structure in the object code that no longer corresponds one-to-one due to optimization. It was done. When the creation of the code correspondence table 13 is completed, the object code generation unit 12 calls the measured value distribution calculation unit 16.
【0020】測定値配分計算手段16は、一つの測定単
位となるオブジェクトコード中の構造の中に存在する各
命令のCPU時間を命令CPU時間表14から取得し、
コード対応表13を参照してその命令の起源である表示
単位となるソースコード中の構造に積算する。この際、
一つの命令がソースコード中の複数の命令に起源を持つ
場合は複数の構造に等分に振り分けて積算する。すべて
の命令の積算が終了すると、ソースコード中の構造間で
積算値の比をとることにより、測定されるオブジェクト
コード中の構造の実行時間をソースコード中の対応する
複数の構造に配分する割合を計算し、その配分割合を測
定値配分表3に記録し出力する。The measurement value distribution calculation means 16 acquires the CPU time of each instruction existing in the structure in the object code as one measurement unit from the instruction CPU time table 14,
With reference to the code correspondence table 13, the multiplication is added to the structure in the source code which is the display unit from which the instruction originates. On this occasion,
If one instruction originates from a plurality of instructions in the source code, the instructions are equally divided into a plurality of structures and integrated. When all instructions have been integrated, the ratio of the execution time of the measured structure in the object code to the corresponding multiple structures in the source code, by taking the ratio of the integrated value between the structures in the source code Is calculated, and the distribution ratio is recorded in the measured value distribution table 3 and output.
【0021】図2は、測定値配分計算手段16の動作を
示すフローチャートである。起動されると、オブジェク
トコード中から測定コードが埋め込まれた構造を検出し
(ステップS1)、その処理を開始する(ステップS
2)。その構造内に未処理の文があれば(ステップS
3)、その文を読み出して命令に対応するCPU時間を
命令CPU時間表14から求め(ステップS4)、コー
ド対応表13を参照してその命令の起源であるソースコ
ード中の命令の属する構造が複数であるか否かを判断す
る(ステップS5)。その結果、複数であればステップ
S4で求めたCPU時間をソースコード中の該当する複
数の構造に均等に配分して加算し(ステップS6)、複
数でなければ該当する構造にそのまま加算する(ステッ
プS7)。ステップS3〜ステップS7の処理をその構
造中の文がなくなるまで繰り返し、文がなくなり測定対
象構造の終了を示す測定コードを検出すると、ステップ
S8に進んでソースコード中の各構造間の積算値の比を
求めて配分割合を算出し、測定値配分表3に記述してス
テップS1に戻る。以上の動作を未処理の構造がなくな
るまで繰り返すことにより、オブジェクトコード中のす
べての測定対象構造に対して測定値配分表3が作成され
る。FIG. 2 is a flowchart showing the operation of the measured value distribution calculating means 16. When activated, the structure in which the measurement code is embedded is detected from the object code (step S1), and the processing is started (step S1).
2). If there is an unprocessed statement in the structure (step S
3), the statement is read out, and the CPU time corresponding to the instruction is obtained from the instruction CPU time table 14 (step S4). It is determined whether there is more than one (step S5). As a result, if there is a plurality, the CPU time obtained in step S4 is equally distributed to a plurality of corresponding structures in the source code and added (step S6), and if not, the CPU time is added to the corresponding structure as it is (step S6). S7). The processes in steps S3 to S7 are repeated until there is no sentence in the structure. When a measurement code indicating the end of the structure to be measured is detected and no sentence is found, the process proceeds to step S8 to calculate the integrated value between the structures in the source code. The distribution ratio is calculated by calculating the ratio, described in the measured value distribution table 3, and the process returns to step S1. By repeating the above operation until there is no unprocessed structure, the measurement value distribution table 3 is created for all the measurement target structures in the object code.
【0022】以上のようにしてコンパイラ1で作成され
たオブジェクトコード6と測定値配分表3とを用い、実
行用計算機4により測定単位となるオブジェクトコード
の構造について測定され性能データ7として出力された
実行時間値は、測定表示ツール2の実行時間表示手段2
1により、ソースコード中の対応する構造に還元されて
表示される。この結果、ソースコード5中のループ,ル
ーチンなどの構造ごとの性能値(実行時間)が、ユーザ
に分かりやすく利用価値の高い形式でディスプレイ9に
表示され、性能表示リスト8として出力される。Using the object code 6 created by the compiler 1 and the measured value distribution table 3 as described above, the execution computer 4 measures the structure of the object code as a unit of measurement and outputs it as performance data 7. The execution time value is stored in the execution time display unit 2 of the measurement display tool 2.
By means of 1, it is reduced to the corresponding structure in the source code and displayed. As a result, the performance value (execution time) for each structure such as loops and routines in the source code 5 is displayed on the display 9 in a format that is easy for the user to understand and has high utility value, and is output as the performance display list 8.
【0023】次に、上述した第1の実施の形態の動作を
具体例により説明する。ここで、コンパイラ1はFor
tran言語のコンパイラであり、図4(a)に示すソ
ースコード5を入力し、最適化処理を行って図4(b)
に示すオブジェクトコード6を出力したものとする。な
お、命令CPU時間表14は、実行用計算機4に対応し
て図3に示すように与えられているものとする。Next, the operation of the above-described first embodiment will be described with a specific example. Here, Compiler 1 is For
This is a tran language compiler that inputs the source code 5 shown in FIG.
It is assumed that the object code 6 shown in FIG. Note that the instruction CPU time table 14 is given as shown in FIG. 3 corresponding to the execution computer 4.
【0024】図4(a)に示すソースコード5の入力に
対して、コンパイラ1は、3行目から始まるループであ
るループ1と6行目から始まるループであるループ2と
を融合する最適化を行う。この結果、オブジェクトコー
ド生成部12が出力するオブジェクトコード6は、図4
(b)のようになる。図4(b)の4行目から10行目
までが一つのループ(ループP)を形成しているが、こ
のループPは、ソースコード中のループ1とループ2と
の融合の結果生成されたものである。測定単位がループ
であるので、測定コード埋め込み手段15により測定を
行うルーチンであるf_loopbegin()及びf
_loopend()の呼び出し文がそれぞれループP
の直前と直後とに挿入されている。With respect to the input of the source code 5 shown in FIG. 4A, the compiler 1 optimizes the fusion of the loop 1 starting from the third line and the loop 2 starting from the sixth line. I do. As a result, the object code 6 output by the object code generation unit 12 is
(B). The fourth to tenth lines in FIG. 4B form one loop (loop P). This loop P is generated as a result of the fusion of loop 1 and loop 2 in the source code. It is a thing. Since the measurement unit is a loop, f_loopbegin () and f_loopbegin () are routines for performing measurement by the measurement code embedding unit 15.
_Loopopen () call statement is loop P
Are inserted immediately before and after.
【0025】図4(a)のソースコード5から図4
(b)のオブジェクトコード6を生成すると共に、オブ
ジェクトコード生成部12は、図4(c)のようなコー
ド対応表13を生成する。オブジェクトコード6の各行
の命令が、ソースコード5のどの行の命令に対応してい
るかを示したものである。The source code 5 shown in FIG.
In addition to generating the object code 6 in (b), the object code generation unit 12 generates a code correspondence table 13 as shown in FIG. The instruction of each line of the object code 6 indicates which line of the source code 5 corresponds to the instruction.
【0026】測定値配分計算手段16は、図4(b)の
ループP内の各行の文について逐次処理を行う。図4
(b)の4行目の文は、コード対応表13から図4
(a)の3行目と6行目との両方に対応するから、ルー
プ1とループ2との両方に起源を持つ。図4(b)の4
行目のCPU時間は図3に示した命令CPU時間表14
から5であるので、5÷2=2.5をループ1及びルー
プ2の両方に加算する。次の図4(b)の5,6行目の
文は、コード対応表13から図4(a)の4行目から生
成された文であり、共にループ1に起源を持つ。図4
(b)の5,6行目に対応するCPU時間の合計は、図
3の命令CPU時間表14から10+20=30である
ので、ループ1について30を加算する。同様に、図4
(b)の7,8行目の文は、コード対応表13から図4
(a)の7行目から生成された文であり、共にループ2
に起源を持つことが分かる。図4(b)の7,8行目の
CPU時間の合計は、命令CPU時間表14から40+
20=60であるので、ループ2に60を加算する。続
く図4(b)の9,10行目の文は、4行目と同様にル
ープ1とループ2との両方に起源を持つので、5÷2=
2.5をループ1,ループ2の両方に加算する。上記の
ようにして、ループ1には合計35が加算され、ループ
2には65が加算される。従って、図4(b)のループ
Pの実行時間をループ1とループ2とに配分する割合
は、35:65=0.35:0.65となり、測定値配
分計算手段16は、この割合を図4(d)に示すように
測定値配分表3に記録する。The measurement value distribution calculation means 16 sequentially processes the statements on each line in the loop P of FIG. 4B. FIG.
The sentence on the fourth line in FIG.
Since it corresponds to both the third and sixth lines in (a), it originates in both loop 1 and loop 2. 4 in FIG.
The CPU time in the row is the instruction CPU time table 14 shown in FIG.
Since 5 で あ 2, 5 ÷ 2 = 2.5 is added to both the loop 1 and the loop 2. The next sentence in the fifth and sixth lines in FIG. 4B is a sentence generated from the fourth line in FIG. FIG.
Since the total CPU time corresponding to the fifth and sixth lines in (b) is 10 + 20 = 30 from the instruction CPU time table 14 in FIG. 3, 30 is added for loop 1. Similarly, FIG.
The sentences on the seventh and eighth lines in (b) are shown in FIG.
This is a sentence generated from the seventh line of (a), and both are loop 2
You can see that it has origin. The sum of the CPU time in the seventh and eighth lines in FIG.
Since 20 = 60, 60 is added to loop 2. The sentence on the ninth and tenth lines in the following FIG. 4B has the origin in both the loop 1 and the loop 2 as in the fourth line, so that 5 ÷ 2 =
2.5 is added to both loop 1 and loop 2. As described above, a total of 35 is added to the loop 1 and 65 is added to the loop 2. Therefore, the ratio at which the execution time of the loop P in FIG. 4B is distributed to the loop 1 and the loop 2 is 35: 65 = 0.35: 0.65, and the measured value distribution calculating means 16 calculates this ratio. It is recorded in the measured value distribution table 3 as shown in FIG.
【0027】次に、実行用計算機4によりオブジェクト
コード6を実行した結果、ループPの実行時間が10秒
であったとすると、実行時間表示手段21は、この10
秒を測定値配分表3に記述された配分割合に従ってルー
プ1とループ2とに配分し、ループ1の実行時間を3.
5秒、ループ2の実行時間を6.5秒として性能表示リ
スト8に出力し、又はディスプレイ9に表示する。Next, assuming that the execution time of the loop P is 10 seconds as a result of executing the object code 6 by the execution computer 4, the execution time display means 21
Seconds are allocated to Loop 1 and Loop 2 according to the distribution ratio described in the measured value distribution table 3, and the execution time of Loop 1 is set to 3.
Output to the performance display list 8 or display on the display 9 assuming that the execution time of the loop 2 is 6.5 seconds for 5 seconds.
【0028】上述した第1の実施の形態の説明では、測
定を実施する実行用計算機4のハードウェアに対応する
命令CPU時間表14がコンパイラ1内に備えられてい
るものとした。しかしながら、命令CPU時間表は実行
用計算機が異なれば対応して変更する必要があるので、
外部記憶装置から測定に使用する実行用計算機に対応す
るものを読み込むようにすると、複数の実行用計算機に
対応することができ適応性がよくなる。なお、異なる実
行用計算機に対応する複数の命令CPU時間表をコンパ
イラ内に備えておき、任意の一つを選択使用できるよう
にしても同様な効果が得られる。In the description of the first embodiment, it is assumed that the instruction CPU time table 14 corresponding to the hardware of the execution computer 4 for performing the measurement is provided in the compiler 1. However, since the instruction CPU time table needs to be changed correspondingly for different execution computers,
By reading from the external storage device the one corresponding to the execution computer used for measurement, it is possible to support a plurality of execution computers and the adaptability is improved. A similar effect can be obtained even if a plurality of instruction CPU time tables corresponding to different execution computers are provided in the compiler so that any one can be selectively used.
【0029】図5は、本発明の第2の実施の形態の構成
を示すブロック図である。図5に示す本発明の第2の実
施の形態は、ソースコード5を入力し測定コードが挿入
されたオブジェクトコード6及びコード対応表13aを
出力するコンパイラ1aと、オブジェクトコード6を実
行しオブジェクト構造単位で測定された性能データ7を
出力する実行用計算機4と、性能データ7を入力してコ
ード対応表13a及びオブジェクトコード6から測定値
配分表23を作成してソースコードの構造単位に変換し
た測定データをディスプレイ9に表示したり性能表示リ
スト8として出力したりする性能表示ツール2aとで構
成されている。FIG. 5 is a block diagram showing the configuration of the second embodiment of the present invention. In the second embodiment of the present invention shown in FIG. 5, a compiler 1a that inputs a source code 5 and outputs an object code 6 into which a measurement code is inserted and a code correspondence table 13a, and executes an object code 6 to execute an object structure The execution computer 4 that outputs the performance data 7 measured in units, the performance data 7 is input, and the measured value distribution table 23 is created from the code correspondence table 13a and the object code 6 and converted into the structural unit of the source code. A performance display tool 2a for displaying measured data on a display 9 and outputting the data as a performance display list 8.
【0030】前述した図1の第1の実施の形態との相違
点は、コンパイラ1aが構文解析部11,オブジェクト
コード生成部12a,測定コード埋め込み手段15及び
制御部17aから成り、測定値配分計算手段を含まずオ
ブジェクトコード6とコード対応表13aとを出力し、
実行用計算機4によりオブジェクトコード6を実行する
際に、性能表示ツール2aの測定値配分計算手段22が
命令CPU時間表24を用いて測定値配分表23を作成
し、これを用いて実行時間表示手段21がソースコード
中の構造に還元して表示を行っていることである。従っ
て、コンパイル時に作成されるオブジェクトコード6及
びコード対応表13aは、実行用計算機4が異なっても
そのまま使用できる利点がある。The difference from the first embodiment shown in FIG. 1 is that the compiler 1a comprises a syntax analysis unit 11, an object code generation unit 12a, a measurement code embedding unit 15, and a control unit 17a. Outputting the object code 6 and the code correspondence table 13a without including the means,
When the execution computer 4 executes the object code 6, the measured value distribution calculating means 22 of the performance display tool 2a creates the measured value distribution table 23 using the instruction CPU time table 24, and displays the execution time using this. This means that the means 21 performs display by reducing to the structure in the source code. Therefore, there is an advantage that the object code 6 and the code correspondence table 13a created at the time of compiling can be used as they are even if the execution computer 4 is different.
【0031】[0031]
【発明の効果】以上詳細に説明したように、本発明の性
能測定ツールの測定値表示方式によれば、コンパイラが
複雑なプログラムの変形を行う場合でも、オブジェクト
コード中の構造について測定された実行時間が、ユーザ
が理解しているソースコード中の構造に配分して表示さ
れるため、測定結果がユーザにとって分かりやすく利用
しやすいという効果がある。As described above in detail, according to the measured value display method of the performance measuring tool of the present invention, even when the compiler deforms a complicated program, the measured execution of the structure in the object code is performed. Since the time is distributed and displayed in the structure in the source code understood by the user, there is an effect that the measurement result is easy to understand and use for the user.
【図1】本発明の第1の実施の形態の構成を示すブロッ
ク図である。FIG. 1 is a block diagram showing a configuration of a first exemplary embodiment of the present invention.
【図2】図1の測定値配分計算手段の処理手順を示した
フローチャートである。FIG. 2 is a flowchart showing a processing procedure of a measured value distribution calculating means of FIG. 1;
【図3】図1の命令CPU時間表のデータ構成例を示し
た説明図である。FIG. 3 is an explanatory diagram showing a data configuration example of an instruction CPU time table of FIG. 1;
【図4】図1の第1の実施の形態の動作を具体例で示す
ための説明図である。FIG. 4 is an explanatory diagram showing a specific example of the operation of the first embodiment of FIG. 1;
【図5】本発明の第2の実施の形態の構成を示すブロッ
ク図である。FIG. 5 is a block diagram showing a configuration of a second exemplary embodiment of the present invention.
1,1a コンパイラ 2,2a 性能表示ツール 3,23 測定値配分表 4 実行用計算機 5 ソースコード 6 オブジェクトコード 7 性能データ 8 性能表示リスト 9 ディスプレイ 11 構文解析部 12,12a オブジェクトコード生成部 13,13a コード対応表 14,24 命令CPU時間表 15 測定コード埋め込み手段 16,22 測定値配分計算手段 17,17a 制御部 21 実行時間表示手段 1, 1a Compiler 2, 2a Performance display tool 3, 23 Measurement value distribution table 4 Execution computer 5 Source code 6 Object code 7 Performance data 8 Performance display list 9 Display 11 Syntax analyzer 12, 12a Object code generator 13, 13a Code correspondence table 14, 24 Instruction CPU time table 15 Measurement code embedding means 16, 22 Measured value distribution calculation means 17, 17a Control unit 21 Execution time display means
───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 11/28 - 11/36 G06F 9/06 - 9/45 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 11/28-11/36 G06F 9/06-9/45
Claims (5)
訳して測定コードを埋め込みオブジェクトコード中の構
造の実行時間を測定する性能測定ツールの測定値表示方
式において、オブジェクトコードを実行するハードウェ
アの各命令の実行に要するCPU時間があらかじめ記述
された命令CPU時間表と、オブジェクトコード生成時
に作成されオブジェクトコード中の各命令がソースコー
ド中のどの部分に起源を有するかを記述するコード対応
表と、測定されたオブジェクトコード中の構造の実行時
間を対応するソースコード中の構造に配分する割合を記
述する測定値配分表と、前記コード対応表および命令C
PU時間表に基づいて測定単位となるオブジェクトコー
ド中の構造内に存在する各命令のCPU時間を、当該命
令の起源であるソースコード中の構造が複数あるときは
それらの各構造に均等に振り分けて、ソースコード中の
対応する各構造に積算し積算値の比をとることにより配
分割合を計算し前記測定値配分表に記述する測定値配分
計算手段と、オブジェクトコードの実行により測定され
たオブジェクトコード中の構造の実行時間を前記測定値
配分表に基づいてソースコード中の対応する複数の構造
に配分して表示する実行時間表示手段とを備えたことを
特徴とする性能測定ツールの測定値表示方式。In a measurement value display method of a performance measurement tool for translating a source code into an object code, embedding a measurement code, and measuring an execution time of a structure in the object code, each instruction of hardware for executing the object code is executed. An instruction CPU time table in which the CPU time required for execution is described in advance, and a code correspondence table that is created when the object code is generated and describes where in the source code each instruction in the object code originates are measured. Distribution table which describes a ratio of allocating the execution time of the structure in the object code to the corresponding structure in the source code, the code correspondence table and the instruction C
The CPU time for each instruction that is present in the structure in the object code to be measured unit based on PU timetable, equally on each of their structure when the structure of the source code is the origin of those instruction there are multiple and Ri divided vibration measurements, and corresponding measurements allocation calculation means for describing the allocation ratio calculated the measured value allocation table by taking the ratio of the integrated and the integrated value in each structure in the source Sukodo, by the execution of the object code Execution time display means for distributing and displaying the execution time of the structure in the object code obtained based on the measured value distribution table to a plurality of corresponding structures in the source code. Measurement value display method.
込まれたオブジェクトコードを生成するコンパイラ部が
前記命令CPU時間表および測定値配分計算手段を備え
て前記測定値配分表と測定コードが埋め込まれたオブジ
ェクトコードとを出力し、測定実行時に性能表示処理部
が前記測定値配分表を入力し前記実行時間表示手段によ
り表示を行うことを特徴とする請求項1記載の性能測定
ツールの測定値表示方式。2. A compiler section for translating a source code and generating an object code in which a measurement code is embedded includes the instruction CPU time table and a measurement value distribution calculating means, wherein the measurement value distribution table and the measurement code are embedded. 2. A method for displaying a measured value of a performance measurement tool according to claim 1, wherein an object code is output, and a performance display processing unit inputs the measured value distribution table and displays the measured value distribution table when the measurement is executed. .
に対応する複数の命令CPU時間表を備え、その一つを
選択して前記測定値配分表を出力することを特徴とする
請求項2記載の性能測定ツールの測定値表示方式。3. The method according to claim 2, wherein said compiler unit comprises a plurality of instruction CPU time tables corresponding to different execution computers, and selects one of them to output said measurement value distribution table. Measurement value display method of the performance measurement tool.
込まれたオブジェクトコードを生成するコンパイラ部が
前記測定値配分計算手段を備え、外部記憶装置から前記
命令CPU時間表を読み込んで前記測定値配分表および
測定コードが埋め込まれたオブジェクトコードを出力
し、測定実行時に性能表示処理部が前記測定値配分表を
入力し前記実行時間表示手段により表示を行うことを特
徴とする請求項1記載の性能測定ツールの測定値表示方
式。4. A compiler section for translating a source code and generating an object code in which a measurement code is embedded includes the measurement value distribution calculation means, reads the instruction CPU time table from an external storage device, and reads the measurement value distribution table. 2. The performance measurement device according to claim 1, wherein an object code in which the measurement code is embedded is output, and a performance display processing unit inputs the measurement value distribution table and displays the measurement value distribution table when the measurement is executed. Tool measurement value display method.
込まれたオブジェクトコードを生成するコンパイラ部が
前記コード対応表と測定コードが埋め込まれたオブジェ
クトコードとを出力し、性能表示処理部が前記命令CP
U時間表および測定値配分計算手段を備え、測定実行時
に前記コード対応表を用いて前記測定値配分表を作成
し、前記実行時間表示手段により表示を行うことを特徴
とする請求項1記載の性能測定ツールの測定値表示方
式。5. A compiler for translating a source code and generating an object code in which a measurement code is embedded outputs the code correspondence table and the object code in which the measurement code is embedded, and a performance display processing unit outputs the instruction CP.
2. The apparatus according to claim 1, further comprising a U time table and a measurement value distribution calculating means, wherein the measurement value distribution table is created using the code correspondence table at the time of measurement execution, and is displayed by the execution time display means. Measurement value display method of the performance measurement tool.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP01555198A JP3206535B2 (en) | 1998-01-28 | 1998-01-28 | Measured value display method of performance measurement tool |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP01555198A JP3206535B2 (en) | 1998-01-28 | 1998-01-28 | Measured value display method of performance measurement tool |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH11212834A JPH11212834A (en) | 1999-08-06 |
| JP3206535B2 true JP3206535B2 (en) | 2001-09-10 |
Family
ID=11891917
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP01555198A Expired - Fee Related JP3206535B2 (en) | 1998-01-28 | 1998-01-28 | Measured value display method of performance measurement tool |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3206535B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5356635B2 (en) * | 2000-04-11 | 2013-12-04 | アナログ デバイセス インコーポレーテッド | Non-intrusive application code profiling method and apparatus |
| JP2010160716A (en) * | 2009-01-09 | 2010-07-22 | Toyota Motor Corp | Verification device |
-
1998
- 1998-01-28 JP JP01555198A patent/JP3206535B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH11212834A (en) | 1999-08-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR970005456B1 (en) | Method and apparatus for cost-based heuristic instruction scheduling | |
| US5557774A (en) | Method for making test environmental programs | |
| JPH08202545A (en) | Object-oriented system and method for generation of target language code | |
| JPH1097430A (en) | Method and system for inserting assembly code routines into source code routines for optimization | |
| US20030066060A1 (en) | Cross profile guided optimization of program execution | |
| JP3206535B2 (en) | Measured value display method of performance measurement tool | |
| JP2009075965A (en) | Software development method and software development apparatus | |
| JP2011186991A (en) | Method, program and system for solving ordinary differential equation | |
| JP6137962B2 (en) | Information processing apparatus, information processing method, and program | |
| US20080141223A1 (en) | Mock source program generation program, method and apparatus | |
| JP2008250838A (en) | Software generation apparatus, method, and program | |
| JP4870956B2 (en) | Embedded program generation method, embedded program development system, and information table section | |
| JP5021584B2 (en) | Microcomputer simulator, simulation method thereof, program, and computer-readable medium | |
| JP6752393B1 (en) | Design support system and design support program | |
| JP3327674B2 (en) | Program translation apparatus and method | |
| EP4600830A1 (en) | Method for performing an energy consumption analysis of a program, system and software development tool | |
| JP4860564B2 (en) | Program profiling apparatus, program profiling method, and program | |
| US20140173572A1 (en) | Constraint derivation in context following for use with object code insertion | |
| JPH07295612A (en) | High-level language sequence instruction program generator and general-purpose sequencer | |
| JP7725003B1 (en) | Controller, monitoring system, monitoring method, and program | |
| JP2731252B2 (en) | Power plant simulation device and simulation code generation device for the device | |
| KR100310291B1 (en) | Method for simulating parallel program on single system | |
| JP2002342126A (en) | Program execution device and program execution method | |
| Huang et al. | A model-driven tool for performance measurement and analysis of parallel programs | |
| JP2001273174A (en) | Apparatus and method for measuring the number of program steps, software performance evaluation method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20010605 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20070706 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080706 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090706 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100706 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110706 Year of fee payment: 10 |
|
| LAPS | Cancellation because of no payment of annual fees |