JP2000047902A - Profiling control method - Google Patents
Profiling control methodInfo
- Publication number
- JP2000047902A JP2000047902A JP10210671A JP21067198A JP2000047902A JP 2000047902 A JP2000047902 A JP 2000047902A JP 10210671 A JP10210671 A JP 10210671A JP 21067198 A JP21067198 A JP 21067198A JP 2000047902 A JP2000047902 A JP 2000047902A
- Authority
- JP
- Japan
- Prior art keywords
- program
- file
- load
- load program
- history
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
(57)【要約】
【課題】計算機システムでソースプログラムの再コンパ
イルなしに、本番用のロードプログラムから実行履歴を
採取するロードプログラムへ変換することを可能とする
プロファイリング制御方法。
【解決手段】ソースプログラムのコンパイル時のオブジ
ェクトファイルに冗長命令を持たせて、そのオブジェク
トファイルをリンケージしてロードプログラムを作成し
た時点で、その冗長命令へのアドレス情報をロードプロ
グラムファイルに格納しておくことにより、特定関数の
開始処理の冗長命令を、履歴採取関数への分岐命令に変
更する。
(57) [Summary] A profiling control method that enables a computer system to convert a production load program to a load program that collects an execution history without recompiling a source program. When a load program is created by linking the object file with an object file at the time of compiling a source program, address information for the redundant instruction is stored in the load program file. By doing so, the redundant instruction for starting the specific function is changed to a branch instruction to the history collection function.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、ロードプログラム
の実行時の履歴採取制御方法に関する。[0001] 1. Field of the Invention [0002] The present invention relates to a history collection control method when a load program is executed.
【0002】本制御方式を適用する業務は、大規模科学
技術計算のためのプログラムのような実行履歴を採取す
るためにソースプログラムの再コンパイルするコストが
大きく、実際にコンパイルを行うのが困難な業務が考え
られる。In the business to which the present control system is applied, the cost of recompiling a source program for collecting an execution history such as a program for large-scale scientific and technological calculation is large, and it is difficult to actually compile the program. Business is conceivable.
【0003】[0003]
【従来の技術】「UNIX System V/386リリース4 プログ
ラマーズ・リファレンス・マニュアル」ISBN4-8101-851
5-X のprof(1) 1〜 prof(1) 4ページに示すように、
プロファイリング(実行履歴)採取のためには、その為
の特殊なオプション(-p)でソースプログラムをコンパイ
ルし、オブジェクト中に実行履歴採取のための情報採取
関数呼び出しを挿入した、プロファイリング専用のオブ
ジェクトと、それをリンケージしたロードプログラムを
再作成する方法がある。[Prior Art] "UNIX System V / 386 Release 4 Programmer's Reference Manual" ISBN4-8101-851
5-X prof (1) 1-prof (1) As shown on page 4,
To collect profiling (execution history), compile a source program with a special option (-p) for that, insert an information collection function call for execution history collection into the object, There is a way to re-create the load program linked with it.
【0004】しかし、この方法では、実行履歴採取対象
のプログラムのソースの規模が大きい場合、再コンパイ
ルするためのコストが大きくなり、実際に再コンパイル
を行うのは困難であることが多い。However, in this method, when the size of the source of the program whose execution history is to be collected is large, the cost for recompiling becomes large, and it is often difficult to actually recompile.
【0005】また、プログラムで使用するライブラリを
他者から提供をうけていた場合にライブラリ自体のソー
スプログラムが手に入らず、履歴採取用のオブジェクト
が作成できず、該当ライブラリ中に性能のボトルネック
があっても解析できない場合があった。Further, when a library used by a program is provided by another party, the source program of the library itself cannot be obtained, an object for collecting history cannot be created, and a performance bottleneck occurs in the library. In some cases, analysis could not be performed even if there was.
【0006】また、「UNIXカーネルの設計 」ISBN4
-320-02551-2の225〜227ページに示すように、クロック
割り込みにてプログラムカウンタを採取することにより
サンプルとして実行情報を採取できるが、この方法では
関数のコール数や関数間の呼び出し関係までの履歴採取
までは行えず、性能解析データとしての情報量が少な
い。Also, "Design of UNIX Kernel" ISBN4
As shown on pages 225 to 227 of -320-02551-2, execution information can be collected as a sample by collecting a program counter with a clock interrupt. Cannot be collected, and the amount of information as performance analysis data is small.
【0007】[0007]
【発明が解決しようとする課題】実際の性能解析に効果
が高いプログラムの履歴情報を採取する為には、プログ
ラム内で使用する各関数(手続き、プロシジャ、サブル
ーチンとも呼ばれるが、以下では関数と呼ぶ)の開始処
理において、関数の呼び出し元(コール関係)を取得す
る履歴採取関数を呼び出す必要がある。また、本番運用
時には、履歴採関数の実行オーバヘッドが大きいためこ
れを取り除ける仕掛けが必要である。しかも、全ての関
数を常に履歴採取するのは、実行時間が大きくなるた
め、履歴採取の対象関数を、漸次絞っていくために、特
定の関数のみ履歴採取としたり、逆に履歴を採取しなく
したりを、容易に行うことを可能とする必要がある。In order to collect program history information that is highly effective in actual performance analysis, each function (also called a procedure, procedure, or subroutine) used in the program is called a function in the following. ), It is necessary to call a history collection function for acquiring the caller (call relation) of the function. In addition, at the time of the production operation, the execution overhead of the history collection function is large, so a mechanism for removing the history collection function is required. In addition, constantly collecting the history of all functions increases the execution time.Therefore, in order to gradually narrow down the functions for which the history is to be collected, only specific functions should be collected, or conversely, the history should not be collected. It is necessary to be able to easily perform the setting.
【0008】本発明の目的は、上記の要求を満たすよう
な、実行履歴を採取するためにソースプログラムを再コ
ンパイルすることなしに、本番運用用のロードプログラ
ムの全部まはた特定の関数を選択して実行履歴採取用の
ロードプログラムに変換する手段と、逆に実行履歴採取
用のロードプログラムの全部または特定の関数を実行履
歴を採取しないように変換する手段を有する実行履歴採
取制御方法を提供することにある。An object of the present invention is to select all or a specific function of a production load program without recompiling a source program to collect an execution history so as to satisfy the above requirements. And an execution history collection control method having means for converting all or a specific function of the execution history collection load program so as not to collect the execution history. Is to do.
【0009】[0009]
【課題を解決するための手段】ソースプログラムのコン
パイル時のオブジェクトファイルに関数のテキスト命令
郡の開始部分毎にあらかじめ実行時の性能に影響が小さ
いNOP(NO OREATION)命令からなる冗長命令を展開
し、その冗長命令へのオフセット情報をオブジェクトフ
ァイルに格納しておく。そして、そのオブジェクトファ
イルをリンケージしてロードプログラムを作成した時点
で、その冗長命令へのアドレス情報をロードプログラム
ファイルにマージして格納しておくことにより、実行履
歴が必要になった時点で、冗長命令へのアドレス情報よ
り対象関数の冗長命令を位置付け、該当関数の冗長命令
を実行履歴採取関数に分岐するように変更することによ
り実現する。A redundant instruction consisting of NOP (NO OREATION) instructions, which have little effect on the performance at the time of execution, is developed in advance in the object file at the time of compiling the source program for each start part of the text instruction group of the function. The offset information to the redundant instruction is stored in the object file. When the load file is created by linking the object file, the address information for the redundant instruction is merged and stored in the load program file, so that when the execution history becomes necessary, the redundant This is achieved by locating the redundant instruction of the target function based on the address information of the instruction and changing the redundant instruction of the function to branch to the execution history collection function.
【0010】[0010]
【発明の実施の形態】以下、図面を用いて本発明の一実
施例を説明する。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings.
【0011】図1は、本発明のシステム構成例を示した
ものである。計算機システムは、中央処理装置101と
磁気ディスク107から構成される。中央処理装置は、
命令を実行する命令実行プロセッサ102と命令実行プ
ロセサ102が入出力操作なしにアクセス可能な主記憶
装置103から構成される。コンパイラ104、リンケ
ージエディタ105、プロファイル変換エディタ106
は、磁気ディスク上のファイルと入出力を行う。FIG. 1 shows an example of a system configuration according to the present invention. The computer system includes a central processing unit 101 and a magnetic disk 107. The central processing unit
An instruction execution processor 102 for executing an instruction and a main storage device 103 accessible by the instruction execution processor 102 without input / output operations. Compiler 104, Linkage Editor 105, Profile Conversion Editor 106
Performs input / output with a file on a magnetic disk.
【0012】図2は、本発明のファイル構成を示したも
のである。ソースファイル201とヘッダファイル20
2を入力として、コンパイラ203はオブジェクトファ
イル204を出力する。オブジェクトファイル204と
オブジェクトファイルの集合体であるライブラリファイ
ル205を入力として、リンケージエディタ206は、
ロードファイル207を出力する。このロードファイル
を、プロファイル変換エディタ208により、履歴情報
取得用ロードファイル209に変換したり、逆に履歴情
報取得用ロードファイル209から履歴採取処理が実行
されない通常のロードファイル207に変換することを
行う。FIG. 2 shows the file structure of the present invention. Source file 201 and header file 20
2 as an input, the compiler 203 outputs an object file 204. With the object file 204 and the library file 205 which is an aggregate of the object files as inputs, the linkage editor 206
Output the load file 207. This load file is converted by the profile conversion editor 208 into a history information acquisition load file 209, and conversely, from the history information acquisition load file 209 to a normal load file 207 in which history collection processing is not executed. .
【0013】図3は、本発明におけるオブジェクトファ
イルへのテキストの展開方式の一例を示したものでる。
func1というシンボル名称の関数を含むソースファイル
301をコンパイルしてオブジェクトファイル302を
作成する。この時、func1のテキストの開始処理に予め
冗長なNOP命令を3命令埋め込み、オブジェクト中の
冗長テキストコードアドレスポインタ格納領域303
に、そのfunc1の開始アドレスから、そのNOP命令の
開始アドレスへのオフセットを格納しておく。FIG. 3 shows an example of a method of expanding a text into an object file according to the present invention.
The object file 302 is created by compiling the source file 301 including the function having the symbol name func1. At this time, three redundant NOP instructions are embedded in advance in the start processing of the text of func1, and the redundant text code address pointer storage area 303 in the object is stored.
The offset from the start address of func1 to the start address of the NOP instruction is stored in advance.
【0014】図4は、ロードプログラムのリンケージ方
式を示す。リンケージエディタは、オブジェクトファイ
ル1(401)とオブジェクトファイル2(402)の
オブジェクトを結合し(リンケージ)してロードプログ
ラムを作成し、関数func1のリンケージ後のアドレスを
確定後、オブジェクトファイル中に格納していた冗長コ
ードアドレスへのオフセット情報を加算し、ロードプロ
グラムファイルへ冗長テキストコードのリンケージ後の
テキスト開始位置からのオフセットを、冗長テキストコ
ードアドレスポインタ格納領域(以下プロファイルポイ
ンタ情報と呼ぶ)404に格納する。FIG. 4 shows a linkage method of a load program. The linkage editor combines (links) the objects of the object file 1 (401) and the object of the object file 2 (402) to create a load program, determines the linked address of the function func1, and stores it in the object file. The offset information to the redundant code address is added, and the offset from the text start position after linkage of the redundant text code to the load program file is stored in a redundant text code address pointer storage area (hereinafter referred to as profile pointer information) 404. I do.
【0015】図5は、履歴情報を採取しないロードファ
イルのテキスト501の冗長なNOP命令を、履歴情報
取得のためのロードプログラムのテキストに変換してい
る。変換後では、このNOP命令を引数レジスタ2にコ
ール関係が判別できる情報を格納して、履歴情報採取関
数に分岐させる命令に変換している。この変換するため
に、ロードプログラムのプロファイルポインタ情報50
2,504を参照し、変換後は、変換していることを識
別するためのフラグをオンとして格納している。FIG. 5 shows a case where the redundant NOP instruction of the text 501 of the load file from which the history information is not collected is converted into the text of the load program for acquiring the history information. After the conversion, the NOP instruction is stored in the argument register 2 with information for determining the call relation, and converted into an instruction for branching to the history information collection function. To perform this conversion, the profile pointer information 50 of the load program is used.
2, 504, and after conversion, a flag for identifying that conversion is being performed is stored as ON.
【0016】図6は、ロードファイルのファイル形式を
示す。ヘッダ構造体601には、このロードファイル中
のロードプログラムのテキスト情報602、データ情報
603、シンボル情報604、プロファイルポインタ情
報604へのオフセットと各々のサイズの情報が格納さ
れる。FIG. 6 shows the file format of the load file. The header structure 601 stores text information 602, data information 603, symbol information 604, and offsets to the profile pointer information 604 of the load program in the load file, and information of each size.
【0017】図7は、プロファイルポインタ情報605
の詳細なファイル形式を詳細を示す。プロファイルポイ
ンタヘッダ構造体701は、このプロファイルポインタ
で管理する関数のシンボルの数が格納されている。ロー
ドプログラムに格納されている関数1のシンボル名70
2、その関数内の冗長テキストコードアドレス702、
その関数1の冗長コードが履歴取得用に変換されている
か、またはNOP命令のまま変換されていないかをしめ
すフラグ703の3セットの情報関数毎に組みになり格
納される。FIG. 7 shows profile pointer information 605.
Detailed file format is shown below. The profile pointer header structure 701 stores the number of function symbols managed by the profile pointer. Symbol name 70 of function 1 stored in the load program
2, the redundant text code address 702 in the function,
A flag 703 indicating whether the redundant code of the function 1 has been converted for history acquisition or has not been converted as a NOP instruction is stored as a set for each of three sets of information functions.
【0018】図8は、リンケージ方式のフローチャート
を示す。リンケージエディタは、入力されたオブジェク
トファイル中の関数を検索する(ステップ801)。関
数があった場合は、そのオブジェクトファイルの冗長テ
キストコードポインタ情報格納領域から、ロードファイ
ルに格納する該当関数のプロファイルポインタ情報を作
成する(ステップ802)。オブジェクトをリンケージ
した結果のロードプログラムに未解決シンボルがなくな
れば、処理を終了し、あれば未解決シンボルを含むオブ
ジェクトファイルをライブラリファイルより検索する
(ステップ804)。検索が成功したら、ステップ80
1からを繰り返す。FIG. 8 shows a flowchart of the linkage method. The linkage editor searches for a function in the input object file (step 801). If there is a function, profile pointer information of the function to be stored in the load file is created from the redundant text code pointer information storage area of the object file (step 802). If there are no unresolved symbols in the load program as a result of linking the objects, the process is terminated, and if there is, an object file containing the unresolved symbols is searched from the library file (step 804). If the search is successful, step 80
Repeat from 1.
【0019】図9は、ロードプログラムの変換方式のフ
ローチャートである。履歴情報採取対象関数シンボル
を、プロファイルポインタ情報から検索する(ステップ
901)。見つからなければ、終了し、見つかった場
合、フラグ判定処理に進む(ステップ903)。フラグ
がオンであれば、履歴採取用に変換済みであるとして、
変換処理をスキップし終了する(ステップ904)。フ
ラグがオフであった場合は、プロファイルポインタ情報
より該当関数の冗長コードを履歴採取関数に分岐するよ
う命令を変更する(ステップ905)FIG. 9 is a flowchart of the load program conversion method. A history information collection target function symbol is searched from the profile pointer information (step 901). If not found, the process ends. If found, the process proceeds to flag determination processing (step 903). If the flag is on, it is determined that it has been converted for history collection,
The conversion process is skipped and the process ends (step 904). If the flag is off, the instruction is changed to branch the redundant code of the function to the history collection function from the profile pointer information (step 905).
【0020】[0020]
【発明の効果】本発明では、実行履歴を採取するために
ソースプログラムを再コンパイルすることなしに、本番
運用用のロードプログラムの全部まはた特定の関数を選
択して実行履歴採取用のロードプログラムに変換する手
段と、逆に実行履歴採取用のロードプログラムの全部ま
たは特定の関数を実行履歴を採取しないように変換でき
るため、性能解析の効率化ができる。According to the present invention, without recompiling the source program to collect the execution history, all or a specific function of the load program for the production operation is selected and the load for the execution history collection is selected. Since the means for converting to a program and, conversely, all or a specific function of the load program for collecting execution history can be converted so as not to collect execution history, efficiency of performance analysis can be improved.
【図1】本発明の一実施例のファイル構成を示す図であ
る。FIG. 1 is a diagram showing a file configuration according to an embodiment of the present invention.
【図2】本発明の一実施例をファイル構成を示すフロー
チャートである。FIG. 2 is a flowchart showing a file configuration according to an embodiment of the present invention.
【図3】オブジェクトファイルのテキスト命令展開方法
を示す図である。FIG. 3 is a diagram illustrating a method of expanding a text instruction in an object file.
【図4】ロードプログラムのリンケージ方式を示す図で
ある。FIG. 4 is a diagram showing a linkage method of a load program.
【図5】ロードプログラムのテキスト命令変換方式を示
す図である。FIG. 5 is a diagram showing a text instruction conversion method of a load program.
【図6】ロードプログラムのファイル形式を示す図であ
る。FIG. 6 is a diagram showing a file format of a load program.
【図7】プロファイルポインタ情報の詳細な形式を示す
図である。FIG. 7 is a diagram showing a detailed format of profile pointer information.
【図8】リンケージ方式を示すフローチャートである。FIG. 8 is a flowchart showing a linkage method.
【図9】ロードプログラムの変換方式を示すフローチャ
ートである。FIG. 9 is a flowchart showing a conversion method of a load program.
201…ソースファイル、 203…コンパイ
ラ、204…オブジェクトファイル、 206…リン
ケージエディタ、207…ロードファイル、
208…プロファイル変換エディタ、209…履歴取得
用ロードファイル。201: source file, 203: compiler, 204: object file, 206: linkage editor, 207: load file,
208: Profile conversion editor, 209: History acquisition load file.
───────────────────────────────────────────────────── フロントページの続き (72)発明者 小原 勲 神奈川県横浜市戸塚区戸塚町5030番地 株 式会社日立製作所ソフトウェア開発本部内 Fターム(参考) 5B042 FD02 FD13 ────────────────────────────────────────────────── ─── Continuing on the front page (72) Inventor Isao Ohara 5030 Totsuka-cho, Totsuka-ku, Yokohama-shi, Kanagawa Prefecture F-term in the Software Development Division, Hitachi, Ltd. F-reference (reference) 5B042 FD02 FD13
Claims (1)
行時の履歴採取制御方法において、ソースプログラムの
コンパイル時のオブジェクトファイルに冗長命令を持た
せておくことと、そのオブジェクトファイルをリンケー
ジしてロードプログラムを作成した時点で、 その冗長
命令へのアドレス情報をロードプログラムファイルに格
納しておくことにより、ソースプログラムの再コンパイ
ルなしに実行履歴を採取しないロードプログラムから全
体、または特定の関数の実行履歴を採取するロードプロ
グラムへ変換する手段と、実行履歴を採取するロードプ
ログラムの全体または特定の関数の実行履歴を採取しな
いロードプログラムに変換する手段を有することを特徴
とするプロファイリング制御方法。In a method for controlling the collection of a history when a load program is executed in a computer system, a redundant instruction is provided in an object file at the time of compiling a source program, and the load program is linked by linking the object file. By storing the address information for the redundant instructions in the load program file at the time of creation, the entire or specific function execution history can be collected from the load program that does not collect the execution history without recompiling the source program. A profiling control method comprising: means for converting a load program into a load program to be executed; and means for converting the entire load program for collecting an execution history or a load program from which the execution history of a specific function is not collected.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP10210671A JP2000047902A (en) | 1998-07-27 | 1998-07-27 | Profiling control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP10210671A JP2000047902A (en) | 1998-07-27 | 1998-07-27 | Profiling control method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2000047902A true JP2000047902A (en) | 2000-02-18 |
Family
ID=16593193
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP10210671A Pending JP2000047902A (en) | 1998-07-27 | 1998-07-27 | Profiling control method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2000047902A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005078309A (en) * | 2003-08-29 | 2005-03-24 | Nec Corp | Data processing system |
US8326965B2 (en) | 2001-05-03 | 2012-12-04 | Hewlett-Packard Development Company, L.P. | Method and apparatus to extract the health of a service from a host machine |
-
1998
- 1998-07-27 JP JP10210671A patent/JP2000047902A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8326965B2 (en) | 2001-05-03 | 2012-12-04 | Hewlett-Packard Development Company, L.P. | Method and apparatus to extract the health of a service from a host machine |
JP2005078309A (en) * | 2003-08-29 | 2005-03-24 | Nec Corp | Data processing system |
US7647485B2 (en) | 2003-08-29 | 2010-01-12 | Nec Corporation | Data processing system for debugging utilizing halts in a parallel device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3311462B2 (en) | Compile processing unit | |
US6954747B1 (en) | Methods for comparing versions of a program | |
US6931635B2 (en) | Program optimization | |
KR100555116B1 (en) | In-line database for receiver type in object-oriented systems | |
US5920723A (en) | Compiler with inter-modular procedure optimization | |
US5802338A (en) | Method of self-parallelizing and self-parallelizing multiprocessor using the method | |
US6983458B1 (en) | System for optimizing data type definition in program language processing, method and computer readable recording medium therefor | |
US20050278318A1 (en) | Iterative development with prioritized build | |
JP2000035893A (en) | Method for statically initializing arrangement of data processing system, data processing method, data processing system and computer readable storage medium storing program making computer execute its control procedure | |
JPH0338735A (en) | Method of detecting error in parallel program and support system | |
TW518511B (en) | Method of executing an interpreter program | |
US20020083421A1 (en) | Assembly language code compilation for an instruction-set architecture containing new instructions using the prior assembler | |
JPH08305581A (en) | Program conversion device and processor | |
JP2000047902A (en) | Profiling control method | |
JPS60136832A (en) | Logical data processing device that handles tagged data | |
JPH0887417A (en) | Compiler device | |
JP3018783B2 (en) | Compilation method | |
JP2729795B2 (en) | Parallel computer and control method thereof | |
JP3323147B2 (en) | Compiling device, compiling method, and recording medium recording compiler program | |
JP3114884B2 (en) | Fuzzy inference processing compilation system | |
JPH09319587A (en) | System for generating program through post-optimize using measured information | |
JP2004133827A (en) | core analyzer | |
JPH11195011A (en) | Language translation processor, language translation processing method and record medium recording language translation processing program | |
JP2004139369A (en) | Analysis method for pointer pointing constant address domain | |
JPH0573335A (en) | Automatic in-line development system for program |