JPH0362136A - Measuring system for number of times of subroutine access - Google Patents

Measuring system for number of times of subroutine access

Info

Publication number
JPH0362136A
JPH0362136A JP1197584A JP19758489A JPH0362136A JP H0362136 A JPH0362136 A JP H0362136A JP 1197584 A JP1197584 A JP 1197584A JP 19758489 A JP19758489 A JP 19758489A JP H0362136 A JPH0362136 A JP H0362136A
Authority
JP
Japan
Prior art keywords
subroutine
exception
measuring
program
processing unit
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
JP1197584A
Other languages
Japanese (ja)
Inventor
Akira Ueshima
上嶋 暁
Hidetoshi Iwasaki
岩崎 秀俊
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.)
NEC Corp
NEC Solution Innovators Ltd
Original Assignee
NEC Corp
NEC Solution Innovators 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 NEC Corp, NEC Solution Innovators Ltd filed Critical NEC Corp
Priority to JP1197584A priority Critical patent/JPH0362136A/en
Publication of JPH0362136A publication Critical patent/JPH0362136A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To realize simple measurement by registering exception so that it is caused in a CPU at the time of executing subroutine access, and controlling a measuring means through an exception processing means. CONSTITUTION:The exception is registered by an exception registering means 1 so that it is caused in the CPU 4 at the time of the executing the subroutine access. Then, the CPU 4 causes the exception in response to a subroutine access command from a program 7 to be measured, and simultaneously, it discontinues the execution of a subroutine access instruction, and delivers control of the exception processing means 5. Next, the control is delivered from the means 5 to the measuring means 2, and it is counted that the subroutine part 7-2 of the program 7 is accessed by a measurement table 8, and the control is returned to the means 5, and the execution of the instruction of the subroutine access is re-started in the CPU 4. Through this configuration, an object measuring program outputted from a usual complier can be used as it is, and the simultaneously, the program being applied actually need not be re-complied, and the number of times of the access can be simply measured.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はサブルーチン呼び出し回数測定方式に関し、特
にサブルーチンがリンクされたプログラムにおける性能
改善のために必要なデータである各サブルーチンの呼び
出し回数を測定するサブルーチン呼び出し回数測定方式
に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a method for measuring the number of subroutine calls, and in particular, a method for measuring the number of calls of each subroutine, which is data necessary for improving the performance of a program to which subroutines are linked. Concerning a method for measuring the number of subroutine calls.

〔従来の技術〕[Conventional technology]

プログラムを作成する場合に、処理手続きを機能ごとに
細分イビしてサブルーチン化したり、汎用のサブルーチ
ンライブラリを利用したりして一つの大きなプログラム
が作成される。
When creating a program, one large program is created by dividing processing procedures into subroutines for each function or by using a general-purpose subroutine library.

これらのプログラムの性能改善を行う場合に、各サブル
ーチンの呼び出し回数を測定し、呼び出し回数が多いサ
ブルーチンについての処理の見直j7を行うことにより
、性能を高めることがよく行われている。
When improving the performance of these programs, performance is often improved by measuring the number of times each subroutine is called and reviewing the processing for subroutines that are called a large number of times.

従来のサブルーチン呼び出し回数測定方式は、まず、コ
ンパイラにサブルーチン呼び出し回数測定手段を呼び出
すオブジェクトを作成するオプションを設けている。そ
して、コンパイラが、サブルーチン呼び出し回数測定手
段の呼び出しに関するオプションの指定の有無により、
出力するオブジェクトを変更している。したがって、従
来のサブルーチン呼び出し回数測定方式は、サブルーチ
ン呼び出し回数を測定するために、わざわざ別のオブジ
ェクトを作り、それを実行してサブルーチン呼び出し回
数を測定している。
The conventional method for measuring the number of subroutine calls first provides a compiler with an option to create an object that calls a means for measuring the number of subroutine calls. Then, the compiler determines whether or not the option for calling the subroutine call count measurement means is specified.
The object to be output is changed. Therefore, in the conventional method for measuring the number of subroutine calls, in order to measure the number of subroutine calls, a separate object is created and the object is executed to measure the number of subroutine calls.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来のサブルーチン呼び出し回数測定方式は、
コンパイル時にサブルーチン呼び出し回数の計測処理を
呼び出す手続きが各サブルーチンごとに出力されるため
に、テスト時にはそのサブルーチンを使用できるが、実
際に使用するプログラムにそのまま利用すると、各サブ
ルーチン呼び出し回数の計測手段を呼び出す分がオーバ
ヘッドとなり性能が低下するという欠点を有している。
The conventional subroutine call count measurement method described above is
Since the procedure that calls the process for measuring the number of subroutine calls is output for each subroutine when compiling, you can use that subroutine during testing, but if you use it as is in the actual program, it will call the method for measuring the number of subroutine calls. This has the disadvantage that the amount of time required is overhead and performance is degraded.

また、従来のサブルーチン呼び出し回数測定方式は、サ
ブルーチン呼び出し回数の計測手段を呼び出さないサブ
ルーチンをリンクしたプログラムで、実装に使用し始め
たときに、サブルーチン呼び出し回数の測定を行うこと
が出来ないという欠点を有している。
In addition, the conventional method for measuring the number of subroutine calls has the disadvantage that it is not possible to measure the number of subroutine calls when a program is linked with a subroutine that does not call a means for measuring the number of subroutine calls. have.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のサブルーチン呼び出し回数測定方式は、サブル
ーチンをリンクしたプログラムの各サブルーチンの呼び
出し回数を測定するサブルーチン呼び出し回数測定方式
において、サブルーチン呼び出し命令の実行時に例外が
発生するように設定できる中央処理装置と、前記中央処
理装置に例外が発生したときにあらかじめ登録してある
例外処理手続きを実行する例外処理手段と、各サブルー
チンの呼び出し回数を計測する計測手段と、前記計測手
段をサブルーチン呼び出し命令の実行時の例外処理手続
きとして前記例外処理手段に登録して前記中央処理装置
に対してサブルーチン呼び出し命令の実行時に例外が発
生するように設定する例外登録手段とを有し、サブルー
チン呼び出し命令の実行時に対する例外の発生が前記例
外登録手段に設定されている場合に、前記中央処理装置
がサブルーチン呼び出し命令の実行時に前記例外処理手
段に制御を渡し、前記例外処理手段が前記計測手段に制
御を渡し、前記計測手段による計測処理を終了して前記
中央処理装置がサブルーチンの呼び出しを再開すること
により構成されている。
The subroutine call count measuring method of the present invention measures the number of calls to each subroutine of a program in which subroutines are linked, and includes: a central processing unit that can be set to cause an exception to occur when a subroutine call instruction is executed; an exception handling means for executing a pre-registered exception handling procedure when an exception occurs in the central processing unit; a measuring means for measuring the number of times each subroutine is called; exception registration means for registering in the exception handling means as an exception handling procedure and setting the central processing unit to generate an exception when a subroutine call instruction is executed; If occurrence is set in the exception registration means, the central processing unit passes control to the exception handling means when executing a subroutine call instruction, the exception handling means passes control to the measuring means, and the exception handling means passes control to the measuring means, and the exception handling means passes control to the measuring means. The central processing unit resumes calling the subroutine after completing the measurement process.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明のサブルーチン呼び出し回数測定方式の
一実施例を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of the method for measuring the number of subroutine calls of the present invention.

1は例外登録手段、2は計測手段、3は編集処理部、4
は中央処理装置、5は例外処理手段、6は測定結果出力
部、7は被測定プログラム、7−1は被測定プログラム
7のメイン部、7−2は被測定プログラム7のサブルー
チン部、8は計測テーブルである。
1 is an exception registration means, 2 is a measurement means, 3 is an editing processing section, 4
5 is a central processing unit, 5 is an exception handling means, 6 is a measurement result output unit, 7 is a program to be measured, 7-1 is a main part of the program to be measured 7, 7-2 is a subroutine part of the program to be measured 7, and 8 is a subroutine part of the program to be measured 7. This is a measurement table.

サブルーチン呼び出し回数を測定する場合に、例外登録
手段1は、計測手段2を例外処理手段5におけるサブル
ーチン呼び出し命令の実行時の例外処理手続きとして登
録し、同時に中央処理装置4にサブルーチン呼び出し命
令の実行時に例外が発生するように設定して(S−1)
、被測定プログラム7に制御を渡す(S−2)。
When measuring the number of subroutine calls, the exception registration means 1 registers the measurement means 2 as an exception handling procedure when the subroutine call instruction is executed in the exception handling means 5, and at the same time, the exception registration means 1 registers the measurement means 2 as an exception handling procedure when the subroutine call instruction is executed in the exception handling means 5, and at the same time, Set so that an exception occurs (S-1)
, transfers control to the program under test 7 (S-2).

そこで、被測定プログラム7では、被測定プログラム7
のメイン部7−1が実行され(s−3,5−4)、被測
定プログラム7のサブルーチン部7−2のサブルーチン
呼び出し命令であるCALL  SUBが実行される(
S−5)。サブルーチン呼び出し命令が中央処理装置4
によって行われる(S−6)と、サブルーチン呼び出し
命令の実行時に例外が発生するように設定されているた
めに、中央処理装置4はサブルーチン呼び出し命令の実
行を中断し、例外処理手段5に制御を渡す(S−7)。
Therefore, in the program under test 7, the program under test 7
The main part 7-1 of is executed (s-3, 5-4), and CALL SUB, which is a subroutine call command of the subroutine part 7-2 of the program under test 7, is executed (s-3, 5-4).
S-5). A subroutine call instruction is sent to the central processing unit 4.
(S-6), since the setting is such that an exception occurs when the subroutine call instruction is executed, the central processing unit 4 interrupts the execution of the subroutine call instruction and gives control to the exception handling means 5. Hand it over (S-7).

そして、例外処理手段5は、例外処理手続きである計測
手段2に制御を渡す(S−8)。計測手段2は、計測テ
ーブル8に被測定プログラム7のサブルーチン部7−2
が呼び出されたことをカウントしくS−16)、例外処
理手段5に制御を返す(S−9)。そこで、例外処理手
段5は、サブルーチン呼び出し命令の実行を中央処理装
置4に再開させる(S−10)。
The exception handling means 5 then passes control to the measuring means 2, which is an exception handling procedure (S-8). The measurement means 2 stores the subroutine part 7-2 of the program to be measured 7 in the measurement table 8.
is counted (S-16), and returns control to the exception handling means 5 (S-9). Therefore, the exception handling means 5 causes the central processing unit 4 to resume execution of the subroutine call instruction (S-10).

このため、中央処理装置4は、サブルーチン呼び出し命
令の中断点から再開し、被測定プログラム7のサブルー
チン部7−2を呼び出す(S−11)。
Therefore, the central processing unit 4 resumes from the interruption point of the subroutine call instruction and calls the subroutine portion 7-2 of the program under test 7 (S-11).

その後、被測定プログラム7のサブルーチン部7−2の
処理が終了すると被測定プログラム7のメイン部7−1
に制御が返される(S−12)。
Thereafter, when the processing of the subroutine section 7-2 of the program under test 7 is completed, the main section 7-1 of the program under test 7
Control is returned to (S-12).

また、被測定プログラム7のメイン部7−1の処理が終
了すると(S−13)、編集処理部3が呼び出される(
S−14)。そして、編集処理部3により編集処理され
たサブルーチン呼び出し回数の測定結果が、測定結果出
力部6で出力される(S−15)。
Furthermore, when the processing of the main section 7-1 of the program under test 7 is completed (S-13), the editing processing section 3 is called (
S-14). Then, the measurement result of the number of subroutine calls edited by the editing processing unit 3 is outputted by the measurement result output unit 6 (S-15).

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明のサブルーチン呼び出し回
数測定方式は、サブルーチン呼び出し命令の実行時にサ
ブルーチン呼び出し回数の測定に対する実行の可否が決
められるために、通常のコンパイラが出力したオブジェ
クトの測定プログラムをそのまま利用することができる
という効果を有している。
As explained above, the method for measuring the number of subroutine calls of the present invention uses the object measurement program output by a normal compiler as is because it is determined whether or not to measure the number of subroutine calls when a subroutine call instruction is executed. It has the effect of being able to

このため、本発明のサブルーチン呼び出し回数測定方式
は、実際に運用しているプログラムについても、再コン
パイルを行わずに実行環境を設定するのみで、容易にサ
ブルーチン呼び出し回数の測定が行えるという効果を有
している。
Therefore, the method for measuring the number of subroutine calls of the present invention has the effect that it is possible to easily measure the number of subroutine calls even for programs that are actually in use, by simply setting the execution environment without recompiling. are doing.

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

第1図は本発明のサブルーチン呼び出し回数測定方式の
一実施例を示すブロック図である。 1・・・例外登録手段、2・・・計測手段、3・・・編
集処理部、4・・・中央処理装置、5・・・例外処理手
段、6・・・測定結果出力部、7・・・被測定プログラ
ム、7−1・・・メイン部、7−2・・・サブルーチン
部、8・・・計測テーブル。
FIG. 1 is a block diagram showing an embodiment of the method for measuring the number of subroutine calls of the present invention. DESCRIPTION OF SYMBOLS 1... Exception registration means, 2... Measurement means, 3... Editing processing section, 4... Central processing unit, 5... Exception processing means, 6... Measurement result output section, 7. ...Program to be measured, 7-1... Main part, 7-2... Subroutine part, 8... Measurement table.

Claims (1)

【特許請求の範囲】[Claims] サブルーチンをリンクしたプログラムの各サブルーチン
の呼び出し回数を測定するサブルーチン呼び出し回数測
定方式において、サブルーチン呼び出し命令の実行時に
例外が発生するように設定できる中央処理装置と、前記
中央処理装置に例外が発生したときにあらかじめ登録し
てある例外処理手続きを実行する例外処理手段と、各サ
ブルーチンの呼び出し回数を計測する計測手段と、前記
計測手段をサブルーチン呼び出し命令の実行時の例外処
理手続きとして前記例外処理手段に登録して前記中央処
理装置に対してサブルーチン呼び出し命令の実行時に例
外が発生するように設定する例外登録手段とを有し、サ
ブルーチン呼び出し命令の実行時に対する例外の発生が
前記例外登録手段に設定されている場合に、前記中央処
理装置がサブルーチン呼び出し命令の実行時に前記例外
処理手段に制御を渡し、前記例外処理手段が前記計測手
段に制御を渡し、前記計測手段による計測処理を終了し
て前記中央処理装置がサブルーチンの呼び出しを再開す
ることを特徴とするサブルーチン呼び出し回数測定方式
In a subroutine call count measurement method that measures the number of calls to each subroutine in a program in which subroutines are linked, there is provided a central processing unit that can be set to generate an exception when a subroutine call instruction is executed, and when an exception occurs in the central processing unit. an exception handling means for executing an exception handling procedure registered in advance in the exception handling means; a measuring means for measuring the number of times each subroutine is called; and registering the measuring means in the exception handling means as an exception handling procedure at the time of execution of a subroutine call instruction. and an exception registration means for setting the central processing unit so that an exception occurs when a subroutine call instruction is executed, and the exception registration means is configured to set the occurrence of an exception when the subroutine call instruction is executed. When the central processing unit executes a subroutine call instruction, the central processing unit passes control to the exception handling means, the exception handling means passes control to the measurement means, ends the measurement processing by the measurement means, and returns the control to the central processing unit. A method for measuring the number of subroutine calls, characterized in that the device restarts subroutine calls.
JP1197584A 1989-07-28 1989-07-28 Measuring system for number of times of subroutine access Pending JPH0362136A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1197584A JPH0362136A (en) 1989-07-28 1989-07-28 Measuring system for number of times of subroutine access

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1197584A JPH0362136A (en) 1989-07-28 1989-07-28 Measuring system for number of times of subroutine access

Publications (1)

Publication Number Publication Date
JPH0362136A true JPH0362136A (en) 1991-03-18

Family

ID=16376921

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1197584A Pending JPH0362136A (en) 1989-07-28 1989-07-28 Measuring system for number of times of subroutine access

Country Status (1)

Country Link
JP (1) JPH0362136A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04263336A (en) * 1991-02-18 1992-09-18 Fujitsu Ltd Executing route output method for recurrent call

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04263336A (en) * 1991-02-18 1992-09-18 Fujitsu Ltd Executing route output method for recurrent call

Similar Documents

Publication Publication Date Title
JPH0314025A (en) Instruction execution control system
US7016826B2 (en) Apparatus and method of developing software for a multi-processor chip
JPH0362136A (en) Measuring system for number of times of subroutine access
JPH05127952A (en) Measurement system for number of repetition times for program repetition processing
JPH02226441A (en) Software test device
JPS60124746A (en) Data processing unit
JPH02118733A (en) System for controlling execution of task
JPH05324402A (en) Test state measuring system for program
JPH05241889A (en) Step execution system of machine instruction
JP3638505B2 (en) Simulation apparatus and software simulation method for microprocessor
JPH03240831A (en) Interruption processing system
JPH02271437A (en) Task running time measuring system
JP3614198B2 (en) Instruction scheduling method in assembler
JPH05189269A (en) Object program running simulation device
JPH01229338A (en) System for supporting function evaluation of information processor
JPH01106109A (en) Checking device for numerical control part program
JPS62266629A (en) Event recording method for data processor
JPH05298149A (en) Program debugging processing system
JPH0377140A (en) Debugging mode switching processing system
JPH04205430A (en) Program execution controller
JPH04178734A (en) Program language processor
JPH0148564B2 (en)
JPH02128244A (en) System for counting executable instruction by instruction with execution counter
JPH0318939A (en) In-circuit emulator
JPH1083325A (en) Program debugging device