JP2003316611A - Program performance analysis method, execution device therefor and processing program therefor - Google Patents

Program performance analysis method, execution device therefor and processing program therefor

Info

Publication number
JP2003316611A
JP2003316611A JP2002116886A JP2002116886A JP2003316611A JP 2003316611 A JP2003316611 A JP 2003316611A JP 2002116886 A JP2002116886 A JP 2002116886A JP 2002116886 A JP2002116886 A JP 2002116886A JP 2003316611 A JP2003316611 A JP 2003316611A
Authority
JP
Japan
Prior art keywords
function
information
program
performance
performance information
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
JP2002116886A
Other languages
Japanese (ja)
Inventor
Takenori Shimozaka
健則 下坂
Yoshiyuki Hayashida
義幸 林田
Shinichi Tanaka
慎一 田中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2002116886A priority Critical patent/JP2003316611A/en
Publication of JP2003316611A publication Critical patent/JP2003316611A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technique capable of quickly and accurately recognizing the tuning point of a program and supporting the development of the program of high performance at a low cost. <P>SOLUTION: A program performance analysis method for gathering the performance information of respective functions constituting the program and analyzing the performance comprises: a step of executing the program and outputting function start information or function end information indicating the start or end of the function when the function constituting the program is started or ended; a step of outputting address information corresponding to the calling origin function of the function during execution in the case that the function start information or the function end information is outputted; and a step of storing the performance information of the function during the execution in a storage place indicated by the outputted address information. <P>COPYRIGHT: (C)2004,JPO

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はプログラムの性能を
解析する性能解析装置に関し、特にプログラムを構成す
る各関数の性能情報を収集してその性能解析を行う性能
解析装置に適用して有効な技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a performance analysis device for analyzing the performance of a program, and particularly a technique effectively applied to a performance analysis device for collecting the performance information of each function constituting the program and performing the performance analysis. It is about.

【0002】[0002]

【従来の技術】プログラムの性能解析に関する従来の技
術には、特開平6−259245号公報等に記載されて
いる技術が知られている。この従来技術は、プログラム
をブロックと呼ばれる命令群に分割して、プログラム実
行時に各ブロックの稼動情報を採取することにより、プ
ログラムの実行後に各関数の性能情報を算出、表示する
というものである。
2. Description of the Related Art As a conventional technique related to program performance analysis, a technique described in Japanese Patent Laid-Open No. 6-259245 is known. This conventional technique is to divide a program into a group of instructions called a block and collect the operation information of each block when the program is executed to calculate and display the performance information of each function after the execution of the program.

【0003】[0003]

【発明が解決しようとする課題】前述の従来技術では、
オブジェクト中の各関数実体毎に性能情報を解析する
為、例えば、関数A、Bが共に関数Cを呼び出すプログ
ラムでは、関数Cの実行時間は関数Aから呼び出した場
合と関数Bから呼び出した場合の和として算出され、ど
ちらのケースの処理負荷が大きいかを判定することがで
きず、この様な判定を行いたい場合には、ソースプログ
ラムを改変する必要がある。
In the above-mentioned prior art,
In order to analyze the performance information for each function entity in the object, for example, in a program in which both functions A and B call function C, the execution time of function C depends on whether it is called from function A or from function B. It is calculated as a sum, and in which case the processing load is large cannot be determined, and in order to make such a determination, it is necessary to modify the source program.

【0004】本発明の目的は上記問題を解決し、プログ
ラムのチューニングポイントのより早い的確な把握や、
高性能かつ低コストのプログラム開発を支援することが
可能な技術を提供することにある。
An object of the present invention is to solve the above problems, to obtain a faster and more accurate understanding of the tuning points of a program,
It is to provide technology capable of supporting high-performance and low-cost program development.

【0005】[0005]

【課題を解決するための手段】本発明は、プログラムを
構成する各関数の性能情報を収集してその性能解析を行
う性能解析装置において、呼び出し元関数毎に関数の性
能情報を収集するものである。
According to the present invention, in a performance analysis device that collects performance information of each function constituting a program and analyzes the performance, the performance information of the function is collected for each calling function. is there.

【0006】本発明の性能解析装置では、まずソースプ
ログラムをコンパイルして実行形式のプログラムである
ロードモジュールを生成する際に、そのプログラムを構
成する関数の開始または終了を示す関数開始情報または
関数終了情報の出力を行う命令を埋め込んでおく。
In the performance analysis apparatus of the present invention, when a source program is first compiled to generate a load module which is an executable program, function start information or function end indicating the start or end of the function that constitutes the program. An instruction to output information is embedded.

【0007】次に、前記の様にして生成された実行形式
のプログラムを実行し、そのプログラムを構成する関数
の開始または終了が行われた際に前記命令により関数開
始情報または関数終了情報が出力されると、実行中の関
数とその関数を呼び出した呼び出し元関数の組み合わせ
に対応する格納場所を示すアドレス情報を出力し、その
出力されたアドレスで示される格納場所へ実行中の関数
の性能情報を格納する。
Next, the program of the execution format generated as described above is executed, and when the function constituting the program is started or ended, the function start information or the function end information is output by the instruction. Then, the address information indicating the storage location corresponding to the combination of the function being executed and the calling function that called the function is output, and the performance information of the function being executed to the storage location indicated by the output address. To store.

【0008】前記の様に本発明では、その呼び出し元関
数毎に異なる格納場所へ関数の性能情報を格納するの
で、ある関数の実行時、どの呼び出し元関数から呼び出
された場合に実行時間や命令数が多くなるかを判定する
ことができ、その呼び出し元関数から呼び出された場合
の実行部分をチューニングポイントとして把握して改良
することにより、高性能かつ低コストのプログラムの開
発を行うことが可能となる。
As described above, according to the present invention, the performance information of a function is stored in a different storage location for each caller function. Therefore, when a function is executed, which caller function is called, the execution time and the instruction are executed. It is possible to determine whether the number is large, and it is possible to develop a high-performance and low-cost program by grasping and improving the execution part when called from the calling function as a tuning point. Becomes

【0009】以上の様に本発明の性能解析装置によれ
ば、呼び出し元関数毎に関数の性能情報を収集するの
で、プログラムのチューニングポイントのより早い的確
な把握や、高性能かつ低コストのプログラム開発を支援
することが可能である。
As described above, according to the performance analysis apparatus of the present invention, the performance information of the function is collected for each calling function, so that the tuning point of the program can be grasped more quickly and accurately, and the high performance and low cost program can be obtained. It is possible to support development.

【0010】[0010]

【発明の実施の形態】以下にプログラムを構成する各関
数の性能情報を収集してその性能解析を行う一実施形態
の性能解析装置について説明する。
BEST MODE FOR CARRYING OUT THE INVENTION A performance analysis apparatus of one embodiment for collecting performance information of each function constituting a program and analyzing the performance will be described below.

【0011】図1は本実施形態の性能解析装置の概略構
成を示す図である。図1に示す様に本実施形態の性能解
析装置102は、ロードモジュール実行部103と、テ
ーブル管理部104と、性能情報採取部106と、性能
情報管理部107とを有している。
FIG. 1 is a diagram showing a schematic configuration of the performance analysis apparatus of this embodiment. As shown in FIG. 1, the performance analysis device 102 of the present exemplary embodiment includes a load module execution unit 103, a table management unit 104, a performance information collection unit 106, and a performance information management unit 107.

【0012】ロードモジュール実行部103は、実行形
式のプログラムであるロードモジュール101を実行
し、そのプログラムを構成する関数の開始または終了が
行われた際に当該関数の開始または終了を示す関数開始
情報または関数終了情報をテーブル管理部104へ出力
する処理部である。
The load module execution unit 103 executes the load module 101, which is an executable program, and when a function forming the program is started or ended, function start information indicating the start or end of the function. Alternatively, it is a processing unit that outputs the function end information to the table management unit 104.

【0013】テーブル管理部104は、前記関数開始情
報または関数終了情報がロードモジュール実行部103
から出力された場合に、実行中の関数の呼び出し元関数
に対応したアドレス情報として、実行中の関数とその呼
び出し元関数の組み合わせ毎に異なる性能情報テーブル
のアドレスを性能情報管理部107へ出力する処理部で
ある。
The table management unit 104 stores the function start information or the function end information in the load module execution unit 103.
Output from the performance information management unit 107, as the address information corresponding to the caller function of the function being executed, a different address in the performance information table for each combination of the function being executed and the caller function is output to the performance information management unit 107. It is a processing unit.

【0014】性能情報採取部106は、実行中の関数の
性能情報を採取して性能情報管理部107へ出力する処
理部である。性能情報管理部107は、テーブル管理部
104から出力されたアドレス情報で示される格納場所
の性能情報テーブルへ、性能情報採取部106から出力
された性能情報を格納する処理部である。
The performance information collection unit 106 is a processing unit that collects performance information of a function being executed and outputs it to the performance information management unit 107. The performance information management unit 107 is a processing unit that stores the performance information output from the performance information collection unit 106 in the performance information table at the storage location indicated by the address information output from the table management unit 104.

【0015】性能解析装置102をロードモジュール実
行部103、テーブル管理部104、性能情報採取部1
06及び性能情報管理部107として機能させる為のプ
ログラムは、CD−ROM等の記録媒体に記録され磁気
ディスク等に格納された後、メモリにロードされて実行
されるものとする。なお前記プログラムを記録する記録
媒体はCD−ROM以外の他の記録媒体でも良い。また
前記プログラムを当該記録媒体から情報処理装置にイン
ストールして使用しても良いし、ネットワークを通じて
当該記録媒体にアクセスして前記プログラムを使用する
ものとしても良い。
The performance analysis device 102 includes a load module execution unit 103, a table management unit 104, and a performance information collection unit 1.
The program for functioning as 06 and the performance information management unit 107 is recorded on a recording medium such as a CD-ROM and stored in a magnetic disk or the like, and then loaded into a memory and executed. The recording medium for recording the program may be a recording medium other than the CD-ROM. The program may be installed in the information processing apparatus from the recording medium and used, or the recording medium may be accessed through the network to use the program.

【0016】図1において、101はロードモジュー
ル、102は性能解析装置、103はロードモジュール
実行部、104はテーブル管理部、105はアドレス変
換テーブル、106は性能情報採取部、107は性能情
報管理部、108は性能情報テーブル群、109は関数
管理テーブル群、110は性能情報表示装置、111は
出力結果を表している。
In FIG. 1, 101 is a load module, 102 is a performance analysis device, 103 is a load module execution unit, 104 is a table management unit, 105 is an address conversion table, 106 is a performance information collection unit, and 107 is a performance information management unit. , 108 is a performance information table group, 109 is a function management table group, 110 is a performance information display device, and 111 is an output result.

【0017】ここでロードモジュールとは、実行可能な
オブジェクトプログラムであり、オブジェクトプログラ
ム内の各関数を実行する際に、該当関数の実行が開始し
たことを意味する関数開始情報、又は該当関数の実行が
終了したことを意味する関数終了情報を出力するものを
指す。ここで、関数開始情報とは、各関数を識別できる
情報でなくてはならない。例としては、各関数名や各関
数に対応したオブジェクトプログラムの仮想記憶上での
アドレス(以下、関数アドレス)等が挙げられる。
Here, the load module is an executable object program, and when executing each function in the object program, function start information indicating that execution of the corresponding function has started, or execution of the corresponding function Indicates that the function end information that means that has ended is output. Here, the function start information must be information that can identify each function. Examples include the name of each function and the address on the virtual memory of the object program corresponding to each function (hereinafter, function address).

【0018】本実施形態において、関数開始情報又は関
数終了情報を出力する仕組みは、ソースプログラムから
ロードモジュールを生成する際に組み込むものとする。
ここでソースプログラムとは、C、C++、FORTR
ANの様な高級言語によって記述されたプログラムを指
す。
In the present embodiment, the mechanism for outputting the function start information or the function end information is incorporated when the load module is generated from the source program.
Here, the source program is C, C ++, FORTR.
A program written in a high-level language such as AN.

【0019】図1で示す様に、性能解析装置102は、
ロードモジュール実行部103、テーブル管理部10
4、アドレス変換テーブル105、性能情報採取部10
6、性能情報管理部107、性能情報テーブル群10
8、関数管理テーブル群109を備えている。
As shown in FIG. 1, the performance analysis device 102 is
Load module execution unit 103, table management unit 10
4, address conversion table 105, performance information collection unit 10
6, performance information management unit 107, performance information table group 10
8. A function management table group 109 is provided.

【0020】図1に示す様にロードモジュール実行部1
03は、ロードモジュール101の実行を行い、実行中
に関数開始情報又は関数終了情報を出力し、テーブル管
理部104は、ロードモジュール101の実行中に出力
される関数開始情報又は関数終了情報を入力として、そ
の関数の関数管理テーブル中の性能情報テーブルアドレ
スを含む情報を出力する。
As shown in FIG. 1, the load module execution unit 1
03 executes the load module 101, outputs function start information or function end information during execution, and the table management unit 104 inputs function start information or function end information output during execution of the load module 101. , The information including the performance information table address in the function management table of the function is output.

【0021】図6は本実施形態の関数管理テーブルの一
例を示す図である。テーブル管理部104は、関数開始
情報又は関数終了情報を入力すると、関数管理テーブル
群109を参照し、関数管理テーブル例601のエント
リの構成要素にある、呼び出し元関数名602、呼び出
し元関数管理テーブルアドレス603及び性能情報テー
ブルアドレス604の対、又は、性能情報テーブルアド
レス604のみのいずれかを出力する。
FIG. 6 is a diagram showing an example of the function management table of this embodiment. Upon inputting the function start information or the function end information, the table management unit 104 refers to the function management table group 109 and refers to the function management table example 601 entry constituent element, which is the caller function name 602 and the caller function management table. Either the pair of the address 603 and the performance information table address 604 or only the performance information table address 604 is output.

【0022】アドレス変換テーブル105では、各関数
の実行直後に出力される関数開始情報と関数管理テーブ
ルの対応関係を格納しており、アドレス変換テーブル1
05の内容は、ロードモジュール101の実行中に呼び
出される関数に対する関数開始情報がアドレス変換テー
ブル105に登録されていない場合にテーブル管理部1
04の処理の中で随時更新される。
The address conversion table 105 stores a correspondence relationship between the function start information and the function management table output immediately after the execution of each function.
The contents of 05 are the table management unit 1 when the function start information for the function called during the execution of the load module 101 is not registered in the address conversion table 105.
It is updated at any time in the processing of 04.

【0023】図5は本実施形態のアドレス変換テーブル
105の一例を示す図である。図5に示す様にアドレス
変換テーブル例501は、関数名502、関数アドレス
503、関数管理テーブルアドレス504を構成要素と
するエントリの集合である。ここで、関数アドレス50
3は関数名502に対応したオブジェクトプログラムの
仮想記憶上でのアドレスを表し、関数管理テーブルアド
レス504は、該当関数に対応した関数管理テーブルの
アドレスを表すものとする。
FIG. 5 is a diagram showing an example of the address conversion table 105 of this embodiment. As shown in FIG. 5, the address conversion table example 501 is a set of entries having the function name 502, the function address 503, and the function management table address 504 as constituent elements. Here, the function address 50
3 represents an address on the virtual memory of the object program corresponding to the function name 502, and the function management table address 504 represents an address of the function management table corresponding to the corresponding function.

【0024】図1に示す様に性能情報採取部106は、
ロードモジュール101の実行に伴って採取した性能情
報を出力する。ここで性能情報とは、プログラムの実行
に要した時間、総実行命令数、浮動小数点演算数等、性
能に関わる数値一般を指すものとする。
As shown in FIG. 1, the performance information collecting unit 106
The performance information collected by the execution of the load module 101 is output. Here, the performance information refers to general numerical values related to performance such as the time required to execute the program, the total number of executed instructions, and the number of floating-point arithmetic operations.

【0025】また性能情報管理部107は、テーブル管
理部104から出力された性能情報テーブルアドレス、
及び性能情報採取部106から出力される性能情報を入
力として、その入力された性能情報テーブルアドレスの
性能情報テーブルの更新を行う。
Further, the performance information management unit 107 outputs the performance information table address output from the table management unit 104,
Also, the performance information output from the performance information collection unit 106 is input, and the performance information table of the input performance information table address is updated.

【0026】そして性能情報表示装置110は、性能情
報テーブル群108と関数管理テーブル群109を入力
として、性能情報テーブル群108内の性能情報テーブ
ル毎に各関数の性能情報を算出し、出力結果111を表
示する。以上が、図1の処理の説明である。
The performance information display device 110 receives the performance information table group 108 and the function management table group 109 as input, calculates the performance information of each function for each performance information table in the performance information table group 108, and outputs the output result 111. Is displayed. The above is the description of the processing in FIG.

【0027】図2は本実施形態のソースプログラムから
ロードモジュール101を生成する過程の概要を示す図
である。図2に示す様にロードモジュール生成装置20
2は、コンパイラ203と、リンカ206を備えてお
り、コンパイラ203は、内部に関数開始終了情報出力
命令埋め込み部204を有している。なお性能解析装置
102にコンパイラ203及びリンカ206をインスト
ールし、ロードモジュール生成装置202としても機能
させるものとしても良い。
FIG. 2 is a diagram showing an outline of a process of generating the load module 101 from the source program of this embodiment. As shown in FIG. 2, the load module generation device 20
2 includes a compiler 203 and a linker 206, and the compiler 203 internally has a function start / end information output instruction embedding unit 204. The compiler 203 and the linker 206 may be installed in the performance analysis device 102 so that the performance analysis device 102 also functions as the load module generation device 202.

【0028】図2に示す様にコンパイラ203は、ソー
スプログラム201を入力として、中間オブジェクト2
05を出力する。中間オブジェクト205とは、オブジ
ェクトプログラムの集まりを表し、それぞれは必ずしも
実行可能ではない。
As shown in FIG. 2, the compiler 203 receives the source program 201 as an input, and the intermediate object 2
05 is output. The intermediate object 205 represents a group of object programs, and each is not necessarily executable.

【0029】関数開始終了情報出力命令埋め込み部20
4は、コンパイラ203が中間オブジェクト205を生
成する過程で、関数開始情報又は関数終了情報を出力す
る命令を埋め込む役割を果たす。リンカ206は、中間
オブジェクト205を入力としてロードモジュール10
1を出力する。以上が、図2の処理の説明である。
Function start / end information output instruction embedding unit 20
4 plays a role of embedding an instruction to output function start information or function end information in the process of the compiler 203 generating the intermediate object 205. The linker 206 receives the intermediate object 205 as an input and loads the load module 10.
1 is output. The above is the description of the processing in FIG.

【0030】図4は本実施形態のソースプログラム20
1の一形式例を示す図である。以下、図4に示すソース
プログラム201の一形式例であるFORTRAN言語
によるソースプログラム例401を元に、プログラムの
性能解析システムの一連の流れを説明する。
FIG. 4 shows the source program 20 of this embodiment.
It is a figure showing an example of one format of No. A series of flows of the program performance analysis system will be described below based on a source program example 401 in the FORTRAN language, which is a format example of the source program 201 shown in FIG.

【0031】図4のソースプログラム例401は、1つ
のメインプログラムと3つのサブルーチンプログラムか
ら構成されている例を表しており、サブルーチンX、サ
ブルーチンYは、共にサブルーチンZを呼び出す。
The source program example 401 of FIG. 4 represents an example composed of one main program and three subroutine programs. The subroutine X and the subroutine Y both call the subroutine Z.

【0032】ソースプログラム例401を、ロードモジ
ュール生成装置202に入力すると、関数開始終了情報
出力命令埋め込み部204によってサブルーチンX、
Y、Zの実行文の先頭に対応する部分へそれぞれ関数開
始情報出力命令を、実行文の最後に対応する部分へ関数
終了情報出力命令が埋め込まれ、ロードモジュール10
1として出力される。ここでは、関数開始情報とは関数
アドレスとする。
When the source program example 401 is input to the load module generator 202, the function start / end information output instruction embedding unit 204 causes the subroutine X,
The function start information output instruction is embedded in the portion corresponding to the beginning of the Y and Z execution statements, and the function end information output instruction is embedded in the portion corresponding to the end of the execution statement.
It is output as 1. Here, the function start information is a function address.

【0033】ロードモジュール101を、性能解析装置
102に入力し、ロードモジュール実行部103で実行
すると、各関数の性能情報は、性能情報採取部106に
よって採取される。各関数の性能情報の格納先は、テー
ブル管理部104及び性能情報管理部107によって決
定される。
When the load module 101 is input to the performance analysis device 102 and executed by the load module execution unit 103, the performance information of each function is collected by the performance information collection unit 106. The storage destination of the performance information of each function is determined by the table management unit 104 and the performance information management unit 107.

【0034】上記の各関数の性能情報の格納先を決定す
るテーブル管理部104の処理の流れを、図3を用いて
説明する。
The flow of processing of the table management unit 104 for determining the storage location of the performance information of each function will be described with reference to FIG.

【0035】図3は本実施形態のテーブル管理部104
の処理手順を示すフローチャートである。テーブル管理
部104の処理が開始されると、図3に示す様にステッ
プ301でテーブル管理部104は、ロードモジュール
実行部103から送られてくる入力情報が関数開始情報
か関数終了情報かを調べ、入力情報が関数開始情報であ
る場合にはステップ302へ進む。
FIG. 3 shows the table management unit 104 of this embodiment.
5 is a flowchart showing the processing procedure of step S1. When the processing of the table management unit 104 is started, as shown in FIG. 3, the table management unit 104 checks in step 301 whether the input information sent from the load module execution unit 103 is function start information or function end information. If the input information is the function start information, the process proceeds to step 302.

【0036】ステップ302では、前記入力した関数開
始情報である関数アドレスがアドレス変換テーブル10
5に登録されているかどうかを調べ、その関数アドレス
が登録されていない場合にはステップ303へ進む。
In step 302, the function address which is the input function start information is converted into the address conversion table 10.
5 is checked, and if the function address is not registered, the process proceeds to step 303.

【0037】ステップ303では、当該関数の関数管理
テーブルの領域を割当てた後、その関数の関数名、関数
アドレス及び前記割当てた関数管理テーブルのアドレス
値をアドレス変換テーブル105に新規に登録する。
In step 303, after allocating the area of the function management table of the function, the function name and function address of the function and the address value of the allocated function management table are newly registered in the address conversion table 105.

【0038】またステップ302で調べた結果、前記入
力した関数開始情報である関数アドレスがアドレス変換
テーブル105に登録済みである場合にはステップ30
4へ進む。
As a result of checking in step 302, if the function address which is the input function start information is already registered in the address conversion table 105, step 30
Go to 4.

【0039】ステップ304では、前記入力した関数開
始情報の関数アドレスに対応する関数管理テーブルアド
レス値をアドレス変換テーブル105の関数管理テーブ
ルアドレス504から取得する。
In step 304, the function management table address value corresponding to the function address of the input function start information is acquired from the function management table address 504 of the address conversion table 105.

【0040】ステップ305では、前記取得した関数管
理テーブルアドレス値を、予めテーブル管理部104で
用意したスタック領域SにPUSHする。その後ステッ
プ307では、該当関数管理テーブルアドレスの関数管
理テーブルを現在実行中の関数の関数管理テーブルとし
て設定する。
In step 305, the obtained function management table address value is PUSHed into the stack area S prepared in advance by the table management unit 104. Then, in step 307, the function management table of the corresponding function management table address is set as the function management table of the function currently being executed.

【0041】一方、ステップ301において、テーブル
管理部104への入力情報が関数開始情報でない場合、
すなわち、入力情報が関数終了情報である場合にはステ
ップ306へ進み、スタック領域Sの値をPOPした
後、スタック領域Sから最新の値(関数管理テーブルア
ドレス)を取得し、ステップ307では、該当関数管理
テーブルアドレスの関数管理テーブルを現在実行中の関
数の関数管理テーブルとして設定する。
On the other hand, in step 301, if the input information to the table management unit 104 is not the function start information,
That is, when the input information is the function end information, the process proceeds to step 306, POPs the value of the stack area S, and then acquires the latest value (function management table address) from the stack area S. Sets the function management table of the function management table address as the function management table of the function currently being executed.

【0042】関数管理テーブルを設定した後、ステップ
308では、スタック領域Sに2つ以上の値が存在する
かを調べ、スタック領域Sに2つ以上の値が存在する場
合にはステップ309へ進み、最新より一つ古い値を取
得する。
After setting the function management table, in step 308, it is checked whether or not there are two or more values in the stack area S. If there are two or more values in the stack area S, the process proceeds to step 309. , Get the value one older than the latest.

【0043】ステップ310では、前記取得した関数管
理テーブルアドレス値が現在の関数管理テーブル上の呼
び出し元関数管理テーブルアドレスとして存在している
かどうかを調べ、存在している場合にはステップ312
へ進み、そのエントリの呼び出し元関数名、呼び出し元
関数管理テーブルアドレス及び性能情報テーブルアドレ
スを出力する。
In step 310, it is checked whether or not the acquired function management table address value exists as a calling function management table address on the current function management table. If it exists, step 312
Then, the procedure proceeds to and outputs the caller function name, caller function management table address and performance information table address of the entry.

【0044】またステップ310で調べた結果、前記取
得した関数管理テーブルアドレス値が現在の関数管理テ
ーブル上の呼び出し元関数管理テーブルアドレスとして
存在していない場合にはステップ311へ進む。
As a result of checking in step 310, if the acquired function management table address value does not exist as the calling function management table address on the current function management table, the process proceeds to step 311.

【0045】ステップ311では、現在の関数管理テー
ブルに対応する実行中の関数と、前記取得した関数管理
テーブルアドレス値に対応する呼び出し元関数につい
て、それらの組み合わせ毎に異なる性能情報テーブルの
領域を割当てた後、現在の関数管理テーブル上へ新規に
エントリを追加し、前記呼び出し元関数の名称と、前記
取得した関数管理テーブルアドレス値と、前記割当てた
性能情報テーブルのアドレスとを、そのエントリの呼び
出し元関数名、呼び出し元関数管理テーブルアドレス及
び性能情報テーブルアドレスに登録する。そしてステッ
プ312では、前記登録した呼び出し元関数名、呼び出
し元関数管理テーブルアドレス及び性能情報テーブルア
ドレスを出力する。
In step 311, different areas of the performance information table are allocated for each combination of the function being executed corresponding to the current function management table and the calling function corresponding to the acquired function management table address value. Then, a new entry is added to the current function management table, and the name of the caller function, the acquired function management table address value, and the address of the assigned performance information table are called for that entry. Register to the original function name, caller function management table address and performance information table address. Then, in step 312, the registered caller function name, caller function management table address, and performance information table address are output.

【0046】一方ステップ308で調べた結果、スタッ
ク領域Sに2つ以上の値が存在していない場合には、O
Sから呼び出されるMAINの処理であるものとしてス
テップ313へ進む。
On the other hand, as a result of checking in step 308, if two or more values do not exist in the stack area S, O
The process proceeds to step 313 assuming that it is the MAIN process called from S.

【0047】ステップ313では、現在の関数管理テー
ブル上に登録されている性能情報テーブルアドレスを読
み出す。現在の関数管理テーブル上に性能情報テーブル
アドレスが登録されていない場合には、OSから呼び出
されるMAIN用の性能情報テーブルの領域を割当てた
後、現在の関数管理テーブル上へ新規にエントリを追加
し、前記割当てた性能情報テーブルのアドレスを、その
エントリの性能情報テーブルアドレスに登録した後、そ
の性能情報テーブルアドレスを用いる。そしてステップ
312では、前記性能情報テーブルアドレスを出力す
る。
In step 313, the performance information table address registered on the current function management table is read. If the performance information table address is not registered in the current function management table, the area of the performance information table for MAIN called from the OS is allocated, and then a new entry is added to the current function management table. After registering the assigned performance information table address in the performance information table address of the entry, the performance information table address is used. Then, in step 312, the performance information table address is output.

【0048】図5及び図6では、以上のテーブル管理部
104の処理によって蓄積されたアドレス変換テーブル
105の例と関数Zの関数管理テーブルの例をそれぞれ
表している。ソースプログラム例401は4つの関数か
ら構成される為、アドレス変換テーブル105内のエン
トリの数は4つとなる。関数Zの呼び出し元関数は、関
数XとYの2つのみであるから、関数管理テーブル内の
エントリの数も2つとなる。
5 and 6 respectively show an example of the address conversion table 105 and an example of the function management table of the function Z accumulated by the processing of the table management unit 104 described above. Since the source program example 401 is composed of four functions, the number of entries in the address conversion table 105 is four. Since there are only two caller functions, function X and Y, of function Z, the number of entries in the function management table is also two.

【0049】性能情報管理部107は、テーブル管理部
104から性能情報テーブルアドレスが出力されると性
能情報テーブルの切り替えを行い、性能情報採取部10
6から出力される性能情報を切り替え後の性能情報テー
ブルに格納する処理を行う。また必要に応じて切り替え
の際に性能情報の集計処理も行うものとする。
When the performance information table address is output from the table management unit 104, the performance information management unit 107 switches the performance information tables, and the performance information collection unit 10
A process of storing the performance information output from No. 6 in the performance information table after switching is performed. In addition, performance information tabulation processing is also performed at the time of switching.

【0050】例えばMAINから関数Xが呼び出された
後、関数Xから関数Zが呼び出され、テーブル管理部1
04から性能情報テーブルアドレス604の「ZX」が
出力されると、MAINを呼び出し元とする関数Xの性
能情報を集計し、関数Xの実行に要した時間、総実行命
令数、浮動小数点演算数等を算出してMAIN及び関数
Xの組み合わせに対応する性能情報テーブルに格納した
後、前記出力された性能情報テーブルアドレス値「Z
X」の領域に性能情報テーブルへ切り替え、関数Xを呼
び出し元とする関数Zの性能情報を「ZX」の性能情報
テーブルへ格納する。
For example, after the function X is called from MAIN, the function Z is called from the function X, and the table management unit 1
When “ZX” of the performance information table address 604 is output from 04, the performance information of the function X having the call source of MAIN is aggregated, and the time required to execute the function X, the total number of executed instructions, and the number of floating point arithmetic operations Etc. are calculated and stored in the performance information table corresponding to the combination of MAIN and function X, and then the output performance information table address value “Z
The performance information table is switched to the area of “X”, and the performance information of the function Z that calls the function X is stored in the performance information table of “ZX”.

【0051】図7は本実施形態の呼び出し元関数別の性
能情報の出力結果例を示す図である。性能情報表示装置
110は、前記の様にして各性能情報テーブルに蓄えら
れた性能情報を、関数管理テーブルの情報を元に集計処
理し、図7の呼び出し元関数別の性能情報を出力結果例
701として表示する。図7では、関数Zの関数管理テ
ーブル例601の情報を反映して、関数Zの性能情報
を、関数Zの呼び出し元関数である関数Xと関数Yに区
別して表示している。
FIG. 7 is a diagram showing an example of the output result of the performance information for each caller function of this embodiment. The performance information display device 110 totalizes the performance information stored in each performance information table as described above based on the information in the function management table, and outputs the performance information for each calling function in FIG. 7 as an output result example. It is displayed as 701. In FIG. 7, the information of the function management table example 601 of the function Z is reflected, and the performance information of the function Z is displayed separately for the function X and the function Y that are the calling functions of the function Z.

【0052】以上説明した様に本実施形態の性能解析装
置によれば、呼び出し元関数毎に関数の性能情報を収集
するので、プログラムのチューニングポイントのより早
い的確な把握や、高性能かつ低コストのプログラム開発
を支援することが可能である。
As described above, according to the performance analysis apparatus of this embodiment, since the performance information of the function is collected for each calling function, the tuning point of the program can be grasped more quickly and accurately, and high performance and low cost can be obtained. It is possible to support the program development of.

【0053】[0053]

【発明の効果】本発明によれば呼び出し元関数毎に関数
の性能情報を収集するので、プログラムのチューニング
ポイントのより早い的確な把握や、高性能かつ低コスト
のプログラム開発を支援することが可能である。
According to the present invention, since the performance information of a function is collected for each calling function, it is possible to support a quick and accurate grasp of the tuning point of the program and the development of a high-performance and low-cost program. Is.

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

【図1】本実施形態の性能解析装置の概略構成を示す図
である。
FIG. 1 is a diagram showing a schematic configuration of a performance analysis apparatus of the present embodiment.

【図2】本実施形態のソースプログラムからロードモジ
ュール101を生成する過程の概要を示す図である。
FIG. 2 is a diagram showing an outline of a process of generating a load module 101 from a source program of this embodiment.

【図3】本実施形態のテーブル管理部104の処理手順
を示すフローチャートである。
FIG. 3 is a flowchart showing a processing procedure of a table management unit 104 of this embodiment.

【図4】本実施形態のソースプログラム201の一形式
例を示す図である。
FIG. 4 is a diagram showing an example of a format of a source program 201 of this embodiment.

【図5】本実施形態のアドレス変換テーブル105の一
例を示す図である。
FIG. 5 is a diagram showing an example of an address conversion table 105 of this embodiment.

【図6】本実施形態の関数管理テーブルの一例を示す図
である。
FIG. 6 is a diagram showing an example of a function management table of the present embodiment.

【図7】本実施形態の呼び出し元関数別の性能情報の出
力結果例を示す図である。
FIG. 7 is a diagram showing an example of an output result of performance information for each caller function of the present embodiment.

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

101…ロードモジュール、102…性能解析装置、1
05…アドレス変換テーブル、108…性能情報テーブ
ル群、109…関数管理テーブル群、110…性能情報
表示装置、111…出力結果、103…ロードモジュー
ル実行部、104…テーブル管理部、106…性能情報
採取部、107…性能情報管理部、201…ソースプロ
グラム、202…ロードモジュール生成装置、203…
コンパイラ、204…関数開始終了情報出力命令埋め込
み部、205…中間オブジェクト、206…リンカ、4
01…ソースプログラム例、501…アドレス変換テー
ブル例、502…関数名、503…関数アドレス、50
4…関数管理テーブルアドレス、601…関数管理テー
ブル例、602…呼び出し元関数名、603…呼び出し
元関数管理テーブルアドレス、604…性能情報テーブ
ルアドレス、701…出力結果例。
101 ... Load module, 102 ... Performance analysis device, 1
05 ... Address conversion table, 108 ... Performance information table group, 109 ... Function management table group, 110 ... Performance information display device, 111 ... Output result, 103 ... Load module execution unit, 104 ... Table management unit, 106 ... Performance information collection Section, 107 ... Performance information management section, 201 ... Source program, 202 ... Load module generation device, 203 ...
Compiler, 204 ... Function start / end information output instruction embedding section, 205 ... Intermediate object, 206 ... Linker, 4
01 ... Source program example, 501 ... Address conversion table example, 502 ... Function name, 503 ... Function address, 50
4 ... Function management table address, 601 ... Function management table example, 602 ... Caller function name, 603 ... Caller function management table address, 604 ... Performance information table address, 701 ... Output result example.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 田中 慎一 神奈川県横浜市戸塚区戸塚町5030番地 株 式会社日立製作所ソフトウェア事業部内 Fターム(参考) 5B042 HH20 MC24 MC33    ─────────────────────────────────────────────────── ─── Continued front page    (72) Inventor Shinichi Tanaka             5030 Totsuka Town, Totsuka Ward, Yokohama City, Kanagawa Prefecture             Ceremony company Hitachi Ltd. software division F-term (reference) 5B042 HH20 MC24 MC33

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 プログラムを構成する各関数の性能情報
を収集してその性能解析を行うプログラム性能解析方法
において、 プログラムを実行し、そのプログラムを構成する関数の
開始または終了が行われた際に当該関数の開始または終
了を示す関数開始情報または関数終了情報を出力するス
テップと、前記関数開始情報または関数終了情報が出力
された場合に、実行中の関数の呼び出し元関数に対応し
たアドレス情報を出力するステップと、前記出力された
アドレス情報で示される格納場所へ実行中の関数の性能
情報を格納するステップとを有することを特徴とするプ
ログラム性能解析方法。
1. A program performance analysis method for collecting performance information of each function constituting a program and analyzing the performance thereof, when a program is executed and a function constituting the program is started or ended. When outputting the function start information or the function end information indicating the start or end of the function, and when the function start information or the function end information is output, the address information corresponding to the calling function of the function being executed is displayed. A program performance analysis method comprising: a step of outputting and a step of storing performance information of a function being executed in a storage location indicated by the output address information.
【請求項2】 実行中の関数とその呼び出し元関数の組
み合わせ毎に異なる性能情報テーブルのアドレスを前記
アドレス情報として出力し、性能情報の格納先を呼び出
し元関数毎に異なる性能情報テーブルへ切り替えること
により、各関数の性能情報を呼び出し元関数との対応毎
に生成することを特徴とする請求項1に記載されたプロ
グラム性能解析方法。
2. An address of a performance information table that differs for each combination of the function being executed and its calling function is output as the address information, and the performance information storage destination is switched to a different performance information table for each calling function. The program performance analysis method according to claim 1, wherein the performance information of each function is generated for each correspondence with the calling function.
【請求項3】 前記格納した性能情報を呼び出し元関数
毎に表示することを特徴とする請求項1または請求項2
のいずれかに記載されたプログラム性能解析方法。
3. The stored performance information is displayed for each calling function.
The program performance analysis method described in any one of.
【請求項4】 プログラムを構成する各関数の性能情報
を収集してその性能解析を行う性能解析装置において、 プログラムを実行し、そのプログラムを構成する関数の
開始または終了が行われた際に当該関数の開始または終
了を示す関数開始情報または関数終了情報を出力するロ
ードモジュール実行部と、前記関数開始情報または関数
終了情報が出力された場合に、実行中の関数の呼び出し
元関数に対応したアドレス情報を出力するテーブル管理
部と、前記出力されたアドレス情報で示される格納場所
へ実行中の関数の性能情報を格納する性能情報管理部と
を備えることを特徴とする性能解析装置。
4. A performance analyzer that collects performance information of each function that constitutes a program and analyzes the performance thereof when the program is executed and the function that constitutes the program is started or ended. A load module execution unit that outputs function start information or function end information indicating the start or end of a function, and an address corresponding to the caller function of the function being executed when the function start information or function end information is output. A performance analysis apparatus comprising: a table management unit that outputs information, and a performance information management unit that stores performance information of a function being executed in a storage location indicated by the output address information.
【請求項5】 プログラムを構成する各関数の性能情報
を収集してその性能解析を行う性能解析装置としてコン
ピュータを機能させる為のプログラムにおいて、 プログラムを実行し、そのプログラムを構成する関数の
開始または終了が行われた際に当該関数の開始または終
了を示す関数開始情報または関数終了情報を出力するロ
ードモジュール実行部と、前記関数開始情報または関数
終了情報が出力された場合に、実行中の関数の呼び出し
元関数に対応したアドレス情報を出力するテーブル管理
部と、前記出力されたアドレス情報で示される格納場所
へ実行中の関数の性能情報を格納する性能情報管理部と
してコンピュータを機能させることを特徴とするプログ
ラム。
5. A program for causing a computer to function as a performance analysis device that collects performance information of each function that constitutes a program and analyzes the performance of the program, starts the function that constitutes the program, or executes the program. A load module execution unit that outputs function start information or function end information that indicates the start or end of the function when the end is performed, and a function that is being executed when the function start information or function end information is output. Of the table function that outputs the address information corresponding to the calling function of the computer and the performance information management unit that stores the performance information of the function being executed in the storage location indicated by the output address information. Characteristic program.
JP2002116886A 2002-04-19 2002-04-19 Program performance analysis method, execution device therefor and processing program therefor Pending JP2003316611A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002116886A JP2003316611A (en) 2002-04-19 2002-04-19 Program performance analysis method, execution device therefor and processing program therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002116886A JP2003316611A (en) 2002-04-19 2002-04-19 Program performance analysis method, execution device therefor and processing program therefor

Publications (1)

Publication Number Publication Date
JP2003316611A true JP2003316611A (en) 2003-11-07

Family

ID=29534261

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002116886A Pending JP2003316611A (en) 2002-04-19 2002-04-19 Program performance analysis method, execution device therefor and processing program therefor

Country Status (1)

Country Link
JP (1) JP2003316611A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007249844A (en) * 2006-03-17 2007-09-27 Fujitsu Ltd Performance tuning program, recording medium with the program recorded thereon, performance tuning apparatus and performance tuning method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007249844A (en) * 2006-03-17 2007-09-27 Fujitsu Ltd Performance tuning program, recording medium with the program recorded thereon, performance tuning apparatus and performance tuning method
US8762975B2 (en) 2006-03-17 2014-06-24 Fujitsu Semiconductor Limited Performance tuning apparatus, performance tuning method, and computer product

Similar Documents

Publication Publication Date Title
JP4681491B2 (en) Profiling program and profiling method
JP2003050715A (en) Compiler and debugging device
WO2017128952A1 (en) Stack protection method and device
JP2008217721A (en) Program profiling system, program profiling method, and program
JP2003036278A (en) Fmea system
JP2003316611A (en) Program performance analysis method, execution device therefor and processing program therefor
JP2008090696A (en) Program analysis apparatus and program analysis method
JP2002163129A (en) Log level defining method and storage medium for program realizing the method
JPH03257548A (en) Measurement system for instruction executing frequency of program
JPS60238948A (en) Device for measuring processing time of computer system
JP2004133827A (en) Core analysis system
JP3941848B2 (en) Performance measuring apparatus, recording medium storing performance measuring program, and performance measuring method
JP3184669B2 (en) Linkage editing program creation method
JPS616722A (en) Method for calculating execution cost of sentence
JPH02304640A (en) Memory dump collecting system
KR930014005A (en) Interrupt handler implementation in real-time operating system
JPH03225440A (en) Measurement system for program execution time
JP2002215434A (en) Method and system for analyzing program performance, and compiler
JPS63104141A (en) Register fixing system
JPH0553782A (en) System for obtaining dynamic characteristic analysis information of specified part
JPH05119903A (en) Terminal function key input system
JPH0997182A (en) Program converter and debugger
JPH03129535A (en) Collecting volume optimizing system for debugging information
JP2000293410A (en) Profiler
JPH0362238A (en) Back-up system for decision of file capacity

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040804

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070813

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071009

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080603

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080804

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090203