JP2775830B2 - Instruction frequency measurement method - Google Patents

Instruction frequency measurement method

Info

Publication number
JP2775830B2
JP2775830B2 JP1090030A JP9003089A JP2775830B2 JP 2775830 B2 JP2775830 B2 JP 2775830B2 JP 1090030 A JP1090030 A JP 1090030A JP 9003089 A JP9003089 A JP 9003089A JP 2775830 B2 JP2775830 B2 JP 2775830B2
Authority
JP
Japan
Prior art keywords
instruction
execution
executed
frequency
sampling pulse
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
Application number
JP1090030A
Other languages
Japanese (ja)
Other versions
JPH02268343A (en
Inventor
和之 清水
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP1090030A priority Critical patent/JP2775830B2/en
Publication of JPH02268343A publication Critical patent/JPH02268343A/en
Application granted granted Critical
Publication of JP2775830B2 publication Critical patent/JP2775830B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 〔目 次〕 概要 産業上の利用分野 従来の技術と発明が解決しようとする課題 課題を解決するための手段 作用 実施例 発明の効果 〔概要〕 情報処理装置、より限定的には中央処理装置(CPU)
で実行されるプログラム中のどの命令がどの位の頻度で
実行されたかを測定する命令頻度測定方式に関し、 少ないハードウェア量で、且つ、計算機システムの運
用環境への擾乱が少ない命令頻度測定方式を提供するこ
とを目的とし、 周期的にサンプリングパルスを発生するサンプリング
パルス発生機構と、該サンプリングパルスに呼応して現
在実行中のプログラムの実行を一時中断する機構と、該
プログラムの中断時点の情報から、次に実行すべきであ
った命令を主記憶装置(MSU)から読み出す機構と、該
読み出した命令語を解読して命令頻度を計測する機構と
を備えた情報処理装置において、上記サンプリングパル
スに呼応して現在実行中のプログラムの実行を一時中断
するタイミングを、命令毎に予め定めた特定のタイミン
グとし、且つ、該特定のタイミングを全ての命令に対し
て同一の長さとする手段を設けて、該手段で生成された
信号に基づいて、上記命令頻度を計測する機構を起動
し、命令実行頻度を測定するように構成する。
Detailed Description of the Invention [Table of Contents] Overview Industrial field of application Conventional problems and problems to be solved by the invention Means to solve the problem Action Embodiment Effect of the invention [Overview] Information processing device, more limited Central processing unit (CPU)
An instruction frequency measurement method for measuring which instructions in a program executed in a computer are executed and at what frequency, the instruction frequency measurement method with a small amount of hardware and with little disturbance to the operating environment of the computer system. A sampling pulse generating mechanism for periodically generating a sampling pulse, a mechanism for temporarily suspending execution of a program currently being executed in response to the sampling pulse, and information from a point in time at which the program is interrupted. An information processing apparatus having a mechanism for reading the next instruction to be executed from the main storage unit (MSU) and a mechanism for decoding the read instruction word and measuring the instruction frequency; In response, the timing at which the execution of the currently executing program is temporarily suspended is a specific timing predetermined for each instruction, and Providing a means for setting the specific timing to the same length for all instructions, activating a mechanism for measuring the instruction frequency based on a signal generated by the means, and measuring the instruction execution frequency. The configuration is as follows.

〔産業上の利用分野〕[Industrial applications]

本発明は、情報処理装置、より限定的には中央処理装
置(CPU)で実行されるプログラム中のどの命令がどの
位の頻度で実行されたかを測定する命令頻度測定方式に
関する。
The present invention relates to an instruction frequency measurement method for measuring which instruction in a program executed by an information processing device, more specifically, a central processing unit (CPU), and how often the instruction is executed.

従来から、計算機システムの処理能力を向上させる為
に、ソフトウェア,ハードウェア込みで性能の評価をし
て、改善点を抽出する手段の一つとして、中央処理装置
(CPU)で実際にプログラムが実行される時に、どの命
令がどの位の頻度で実行されているかを測定することが
行われている。
Conventionally, in order to improve the processing capacity of a computer system, a program is actually executed by a central processing unit (CPU) as one of the means to evaluate the performance including software and hardware and extract the points of improvement. When done, measuring which instructions are being executed and how often are being performed.

この場合、できる限り少ないハードウェア量で、且
つ、より正確に、具体的には、計算機システムの運用環
境を擾乱させることを少なくして、命令実行頻度を測定
できる命令頻度測定方式が要求される。
In this case, an instruction frequency measurement method capable of measuring the instruction execution frequency with as little hardware as possible and more accurately, specifically, with less disturbance of the operating environment of the computer system is required. .

〔従来の技術と発明が解決しようとする課題〕[Problems to be solved by conventional technology and invention]

第2図は従来の命令頻度測定方式を説明する図であ
り、(a)は全体の構成例を示し、(b)はプログラム
・ステータス語の一例を示し、(c)はサンプリング方
式での割込み処理回路の一例を示し、(d)は該サンプ
リング方式での動作タイムチヤートを示している。
2A and 2B are diagrams for explaining a conventional instruction frequency measuring method, in which FIG. 2A shows an example of the entire configuration, FIG. 2B shows an example of a program status word, and FIG. An example of a processing circuit is shown, and (d) shows an operation time chart in the sampling method.

従来の命令頻度測定方式には、大別して、ハードウェ
ア方式とソフトウェア(或いは、ファームウェア方式)
の2方式がある。
Conventional instruction frequency measurement methods are roughly divided into hardware methods and software (or firmware methods).
There are two methods.

(1) ハードウェア方式 図示していないが、同時に実行頻度を測定したい命令
の種類の数だけ、カウンタをハードウェアで実現し、該
当命令が実行される毎に、該当のカウンタをカウントア
ップし、プログラムの実行終了時、又は、適当な時点
で、該カウンタの値を読み出して、命令実行頻度を計算
して求めるものである。
(1) Hardware method Although not shown, counters are implemented in hardware by the number of instructions whose execution frequency is to be measured at the same time, and the counter is counted up every time the instruction is executed. At the end of the execution of the program or at an appropriate time, the value of the counter is read and the instruction execution frequency is calculated and obtained.

従って、中央処理装置(CPU)が実行することができ
る命令の全種類の実行頻度を測定しようとすると、命令
の数、例えば、200命令前後のカウンタが必要となり、
ハードウェア量が膨大になってしまうという問題があっ
た。
Therefore, when trying to measure the execution frequency of all types of instructions that can be executed by the central processing unit (CPU), a counter of the number of instructions, for example, about 200 instructions is required,
There was a problem that the amount of hardware became enormous.

逆に、該カウンタの数を現実的な数、例えば、10個程
度に制限すると、同一の環境下で、20回程測定を繰り返
す必要があり、測定時間が膨大となるばかりでなく、プ
ログラムの内容によっては、同一環境を再現すること自
体が困難であるという問題があった。
Conversely, if the number of the counters is limited to a realistic number, for example, about 10, it is necessary to repeat the measurement about 20 times under the same environment, which not only increases the measurement time but also increases the contents of the program. In some cases, there is a problem that it is difficult to reproduce the same environment itself.

(2) ソフトウェア方式(或いは、ファームウェア方
式)(第2図参照) ソフトウェア方式とファームウェア方式とは、基本的
には同じである。即ち、以下の説明で「プログラム割込
み」を「ファームウェアへの割込み」とし、「命令頻度
測定ルーチン」22を「命令頻度測定ファームウェア」と
すれば、該ソフトウェア方式の説明はファームウェア方
式の説明となる。ファームウェア方式では、更に、カウ
ンタ用のデータ域を主記憶装置(MSU)2上にとる代わ
りに、該ファームウェアだけがアクセスできるローカル
ストレージ(LS)上にとることがある。
(2) Software method (or firmware method) (see FIG. 2) The software method and the firmware method are basically the same. In other words, in the following description, if "program interrupt" is "interrupt to firmware" and "instruction frequency measurement routine" 22 is "instruction frequency measurement firmware", the description of the software method is that of the firmware method. In the firmware method, the data area for the counter may be provided on a local storage (LS) accessible only by the firmware, instead of being provided on the main storage device (MSU) 2.

ソフトウェア方式にも、2方式があり、命令トレース
方式とサンプリング方式とがある。
There are also two software methods, an instruction trace method and a sampling method.

(A)命令トレース方式 第2図(a)において、中央処理装置(CPU)1がプ
ログラム23の1命令を実行する毎に、命令実行/割込み
制御回路12において、プログラム割込みを発生し、命令
頻度測定ルーチン22へ制御を渡すようにする。
(A) Instruction tracing method In FIG. 2 (a), every time the central processing unit (CPU) 1 executes one instruction of the program 23, the instruction execution / interrupt control circuit 12 generates a program interrupt and the instruction frequency. Control is passed to the measurement routine 22.

該割込み時に、その時のプログラム・ステータス語
(PSW)が旧プログラム・ステータス語(OLD PSW)21と
して、主記憶装置(MSU)2上の固定番地に格納され
る。
At the time of the interruption, the program status word (PSW) at that time is stored as an old program status word (OLD PSW) 21 at a fixed address on the main storage device (MSU) 2.

該旧プログラム・ステータス語(以下、OLD PSWとい
う)21には、次に実行すべき命令のアドレスが、(b)
図のプログラム・ステータス語(PSW)の命令アドレス
部(IA)に示されている。
The old program status word (hereinafter referred to as OLD PSW) 21 contains the address of the next instruction to be executed (b)
This is shown in the instruction address section (IA) of the program status word (PSW) in the figure.

該割込みで制御が渡された命令頻度測定ルーチン22
は、主記憶装置(MSU)2から、上記OLD PSW21(又は、
該OLD PSW21の上記“IA"部のみ)を読み出し、更に、そ
こから得た“IA"部を基に、主記憶装置(MSU)2内のプ
ログラム23中の、次に実行すべき命令語を読み出す。
The instruction frequency measurement routine 22 to which control was transferred by the interrupt 22
From the main storage unit (MSU) 2 to the OLD PSW21 (or
The above “IA” part of the OLD PSW 21 is read out, and based on the “IA” part obtained therefrom, the next instruction word to be executed in the program 23 in the main storage unit (MSU) 2 is determined. read out.

次に、その命令語を解釈し、予め、主記憶装置(MS
U)2上に命令の数だけ用意してある実行回数記録後
(1〜n)24の対応する後を読み出して‘+1'を行っ
て、同じ領域に再格納する。
Next, the command is interpreted and the main memory (MS
U) After recording the number of executions prepared for the number of instructions on 2 (1 to n) 24, the corresponding data after 24 is read, '+1' is performed, and the data is stored again in the same area.

この方式においては、1命令実行する毎に、割込ん
で、命令頻度測定ルーチン22が動作するので、オーバヘ
ッドが大きく、計算機システムの通常の動作環境を著し
く乱してしまう問題がある。従って、通常の動作環境で
の命令頻度とは異なる結果となる恐れがある。
In this method, each time one instruction is executed, the instruction frequency measurement routine 22 is interrupted, so that there is a problem that the overhead is large and the normal operating environment of the computer system is significantly disturbed. Therefore, the result may be different from the instruction frequency in a normal operation environment.

(B)サンプリング方式 元々、計算機システムの中央処理装置(CPU)1に
は、例えば、実時間処理を優先的に実行する為等を目的
としたタイマ割込み機構がある。
(B) Sampling method Originally, the central processing unit (CPU) 1 of the computer system has a timer interrupt mechanism for the purpose of giving priority to real-time processing, for example.

これは、サンプリングパルス発生機構11において、周
期的に発生するサンプリングパルスを基に、該サンプ
リングパルス発生時点で命令を実行中ならば、その命令
の実行の完了時点で、又、命令の実行中でなければ、
即、その時点で、プログラム割込みを発生して、該実時
間処理に制御を渡す機構である。
This is because in the sampling pulse generating mechanism 11, if an instruction is being executed at the time of the generation of the sampling pulse based on the periodically generated sampling pulse, the completion of the execution of the instruction and the If not,
Immediately at that time, a mechanism that generates a program interrupt and transfers control to the real-time processing.

具体的には、サンプリングパルス発生機構11から出力
されたサンプリングパルスは、(c)図に示したよう
に、ラッチ121で一旦ラッチされ、命令実行完了信号
を待ち、該実行中の命令が完了したことを示す命令実行
完了信号で論理積(AND)回路122で論理積が取られ
て、割込みラッチ123が起動され、上記実時間割込みル
ーチンの処理に制御が移るように機能する。{(d)図
の動作タイムチヤート参照} そこで、サンプリング方式による命令頻度測定は、該
タイマ割込み機構を使用して、サンプリングパルスが
発生し、実行中の命令が完了した時に、前述の命令頻度
測定ルーチン22に制御を渡すようにする。
Specifically, the sampling pulse output from the sampling pulse generating mechanism 11 is temporarily latched by the latch 121 as shown in FIG. 3C, waits for an instruction execution completion signal, and the instruction being executed is completed. The logical product (AND) circuit 122 obtains the logical product with the instruction execution completion signal indicating that this is the case, the interrupt latch 123 is activated, and the function shifts to the processing of the real-time interrupt routine. (Refer to the operation time chart shown in FIG. 6D) Therefore, the instruction frequency measurement by the sampling method is performed by using the timer interrupt mechanism when the sampling pulse is generated and the instruction being executed is completed. Control is passed to the routine 22.

プログラムの実行をサンプリングして、命令の実行頻
度を測定するので、実際の命令実行頻度とは一致しない
が、測定時間を長くすることにより、確率的には、実際
の命令実行頻度に極めて近い実行頻度を得ることがで
き、且つ、サンプリングしている為、通常の動作環境へ
の擾乱が少ないという特徴がある。
Since the execution frequency of the instruction is measured by sampling the execution of the program, it does not match the actual instruction execution frequency. However, by prolonging the measurement time, the execution time is extremely close to the actual instruction execution frequency. Since the frequency can be obtained and sampling is performed, there is a feature that disturbance to a normal operation environment is small.

この時の命令頻度測定ルーチン22が実行する処理内容
には、以下の2通りの方式がある。
At this time, the processing contents executed by the instruction frequency measurement routine 22 include the following two methods.

(B−1):最後に実行した命令の次の命令をサンプリ
ングする方法 前述の(A)方式と同様に、OLD PSW21を基に、次に
実行すべきであった命令語を読み出し、その命令語に対
応した主記憶装置(MSU)2上の実行回数記録語(1〜
n)24に‘1'を加算する。
(B-1): Method of sampling the instruction next to the last executed instruction As in the method (A), the instruction word to be executed next is read out based on the OLD PSW21, and the instruction is read out. The execution count recorded word (1 to 1) in the main storage device (MSU) 2 corresponding to the word
n) Add '1' to 24.

この方式では、分岐命令や、アドレスモードを変更す
る命令等を実行した場合でも、上記OLD PSW21は、分岐
先,アドレスモード変更先のものであるので、実際に実
行される命令のみが正しくカウントされる利点を持つ
が、確率的に、実行時間の長い命令を実行中にサンプリ
ングパルスが発生する回数が多くなることから、該実
行時間の長い命令の直後にある命令が実際の頻度より高
く測定されて、誤った測定を行うという問題がある。
In this method, even if a branch instruction or an instruction to change the address mode is executed, only the instruction that is actually executed is correctly counted because the OLD PSW 21 is a branch destination and an address mode change destination. However, since the number of times that a sampling pulse is generated during execution of a long-running instruction increases, the instruction immediately following the long-running instruction is measured at a higher frequency than the actual frequency. Therefore, there is a problem that wrong measurement is performed.

(B−2):最後に実行した命令をサンプリングする方
式 OLD PSW21には、割込み直前の命令、即ち、最後に実
行した命令の長さ情報{(b)図のPSWの命令長コード
(ILC)}が含まれているので、OLD PSW中の、次の実行
すべき命令アドレス(“IA"部)の値から、該直前の命
令の命令長コード(“ILC"部)の値を差し引くことによ
り、最後に実行した命令のアドレスを得ることができ
る。
(B-2): Method of sampling the last executed instruction The OLD PSW21 contains the instruction immediately before the interrupt, that is, the length information of the last executed instruction {(b) Instruction length code (ILC) of the PSW in FIG. Since} is included, the value of the instruction length code (“ILC” part) of the immediately preceding instruction is subtracted from the value of the next instruction address (“IA” part) to be executed in the OLD PSW. , The address of the last executed instruction can be obtained.

そこで、このアドレスを基に、該最後に実行された命
令の命令語を主記憶装置(MSU)2のプログラム23から
読み出し、上記(A)と同様にして、その命令に対応す
る主記憶装置(MSU)2上の実行回数記録語(1〜n)
の内容に‘1'を加算する。
Therefore, based on this address, the instruction word of the last executed instruction is read out from the program 23 of the main storage unit (MSU) 2 and, similarly to the above (A), the main storage unit ( MSU) Execution count recorded words on 2 (1-n)
Add '1' to the contents of

この方式では、実行時間の長い命令がサンプリングさ
れる回数が多くなることから、命令の実行時間を重みと
した。重み付命令頻度が測定できる利点があるが、前述
の命令アドレスを変更する分岐命令やアドレスモードを
変更する命令等を実行した場合には、該OLD PSW21は前
述のように、分岐先,アドレスモード変更先になってい
るので、最後に実行した命令のアドレスを求めることが
できず、上記の方法で命令頻度を測定すると、誤った命
令(実際に実行されることのない命令)をカウントする
という致命的な問題がある。
In this method, the execution time of an instruction is set as a weight because the number of times an instruction having a long execution time is sampled increases. There is an advantage that the weighted instruction frequency can be measured. However, when the above-described branch instruction for changing the instruction address or the instruction for changing the address mode is executed, the OLD PSW 21 is changed to the branch destination and the address mode as described above. Because it is the change destination, the address of the last executed instruction cannot be obtained, and if the instruction frequency is measured by the above method, an incorrect instruction (an instruction that is not actually executed) is counted. There is a fatal problem.

本発明は上記従来の欠点に鑑み、情報処理装置の中央
処理装置(CPU)で実行されるプログラム中のどの命令
がどの位の頻度で実行されたかを測定するのに、少ない
ハードウェア量で、且つ、計算機システムの運用環境へ
の擾乱が少ない命令頻度測定方式、即ち、最後に実行し
た命令の次の命令をサンプリングする方式で、実行時間
の長い命令が存在しても、直後の命令が実際の頻度より
高く測定されることがない命令頻度測定方式を提供する
ことを目的とするものである。
The present invention has been made in view of the above-described conventional drawbacks, and requires a small amount of hardware to measure which instruction in a program executed by a central processing unit (CPU) of an information processing apparatus has been executed. In addition, the instruction frequency measurement method that causes little disturbance to the operating environment of the computer system, that is, a method in which the instruction following the last executed instruction is sampled. It is an object of the present invention to provide an instruction frequency measuring method that is not measured higher than the frequency of the instruction.

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

上記の問題点は下記の如くに構成された命令頻度測定
方式によって解決される。
The above problem is solved by an instruction frequency measuring method configured as follows.

周期的にサンプリングパルスを発生するサンプリング
パルス発生機構と、該サンプリングパルスに呼応して現
在実行中のプログラムの実行を一時中断する機構と、該
プログラムの中断時点の情報から、次に実行すべきであ
った命令を主記憶装置(MSU)から読み出す機構と、該
読み出した命令語を解読して命令頻度を計測する機構と
を備えた情報処理装置において、 上記サンプリングパルスに呼応して現在実行中のプロ
グラムの実行を一時中断するタイミングを、命令毎に予
め定めた特定のタイミングとし、且つ、該特定のタイミ
ング)を全ての命令に対して同一の長さとする手段を設
けて、 該手段で生成された信号に基づいて、上記命令頻度を
計測する機構を起動し、命令実行頻度を測定するように
構成する。
A sampling pulse generating mechanism for periodically generating a sampling pulse, a mechanism for temporarily suspending the execution of a program currently being executed in response to the sampling pulse, and information on a point at which the program is interrupted should be executed next. An information processing apparatus having a mechanism for reading a given instruction from a main storage unit (MSU) and a mechanism for decoding the read instruction word and measuring the instruction frequency. A means for temporarily suspending the execution of the program is set to a specific timing predetermined for each instruction, and the specific timing is set to the same length for all instructions. On the basis of the received signal, a mechanism for measuring the instruction frequency is activated to measure the instruction execution frequency.

〔作用〕[Action]

一般に、情報処理装置の中央処理装置(CPU)で実行
される命令には、1マシンサイクルで実行を完了する基
本的な命令から、数十マシンサイクルかかる複雑な命令
まで、種々存在する。更には、極度に実行時間の長い特
殊命令も存在する。
Generally, there are various types of instructions to be executed by a central processing unit (CPU) of an information processing device, from basic instructions that complete execution in one machine cycle to complicated instructions that take several tens of machine cycles. Further, there are special instructions having extremely long execution times.

一定周期のサンプリングパルスが発生した時点で、あ
る命令が実行中である確率は、サンプリングパルスの発
生と命令の実行という2つの事象が独立であることか
ら、その命令の実行時間の長さに比例することになる。
The probability that an instruction is being executed at the time when a sampling pulse is generated at a fixed period is proportional to the length of execution time of the instruction because the two events of generation of the sampling pulse and execution of the instruction are independent. Will do.

又、前述の「最後に実行した命令の次の命令をサンプ
リングするB−1方式」では、該サンプリングパルス
が発生した時点で、ある命令が実行中であると、第2図
(c)のサンプリング方式の回路,及び、(d)図の動
作タイムチヤートから明らかな如く、その命令の実行が
完了する迄、該サンプリングパルスの発生事象を一時
ラッチ121に記憶しておき、該命令の実行完了と共に、
プログラム割込みが発生するようになっている。
In the above-mentioned "B-1 system for sampling the instruction next to the last executed instruction", if a certain instruction is being executed at the time when the sampling pulse is generated, the sampling shown in FIG. As is apparent from the circuit of the system and the operation time chart shown in FIG. 9D, the occurrence of the sampling pulse is stored in the temporary latch 121 until the execution of the instruction is completed. ,
A program interrupt is generated.

即ち、通常、割込みは、命令と命令との隙間で処理さ
れるようになっており、1つの命令実行中に生じた割込
み要因は、その命令の実行が完了する迄保留した後処理
される4ことになる。
That is, an interrupt is usually processed in a gap between instructions, and an interrupt factor generated during the execution of one instruction is suspended and processed until the execution of the instruction is completed. Will be.

従って、このような割込み処理機構を、そのまま利用
した命令頻度測定方式も、サンプリング方式では、該割
込み機構を使用することになる為、上記のような動作と
なる。
Therefore, the instruction frequency measurement method using such an interrupt processing mechanism as it is, the sampling method uses the interrupt mechanism in the sampling method, and thus the operation described above is performed.

この結果、実行時間の長い命令程、その実行時間に比
例して、命令頻度測定ルーチンを頻繁に起動することに
なる。一方、上記「最後に実行した命令の次の命令をサ
ンプリングするB−1方式」による命令頻度測定ルーチ
ンでは、最後に実行した命令の次の命令をカウントする
ことになっており、結果的には、全く無関係な直前の命
令の実行時間の長さで重み付けされた無意味な命令頻度
が測定されてしまう。
As a result, an instruction having a longer execution time frequently starts the instruction frequency measurement routine in proportion to the execution time. On the other hand, in the instruction frequency measurement routine according to the "B-1 method of sampling the instruction next to the last executed instruction", the instruction next to the last executed instruction is counted, and as a result, Insignificant instruction frequency, which is weighted by the length of execution time of the immediately unrelated instruction, is measured.

そこで、本発明では、「最後に実行した命令の次の命
令をサンプリングする命令頻度測定方式」即ち、前述の
B−1方式の欠点が「命令頻度の測定には無関係な直前
の命令の実行時間の長さで、実際に頻度測定を行う次の
命令に重み付けがされてしまう」点にあることに着目し
て、 (1) サンプリングパルスの参照を、全ての命令に
ついて、各命令の実行時に、唯一度だけ通過する特定の
タイミングに限定するようにし、 (2) 該サンプリングパルスが上記特定のタイミン
グ以外で発生した場合には、該サンプリングパルスを無
視し、該特定のタイミングで発生した時のみ、該サンプ
リングパルスを捕捉して、従来と同じタイマ割込みを
発生させ、命令頻度測定ルーチンに制御を渡すようにす
る。
Therefore, in the present invention, the "instruction frequency measuring method for sampling the instruction next to the last executed instruction", that is, the disadvantage of the B-1 method is that the execution time of the immediately preceding instruction irrelevant to the measurement of the instruction frequency. The following instruction that actually performs frequency measurement is weighted by the length of "." (1) The sampling pulse is referred to for all instructions at the time of execution of each instruction. (2) When the sampling pulse is generated at a timing other than the specific timing, the sampling pulse is ignored, and only when the sampling pulse is generated at the specific timing, The sampling pulse is captured, the same timer interrupt as in the past is generated, and control is passed to the instruction frequency measurement routine.

(3) 上記の特定タイミングの長さは、1マシンサイ
クルに限定する必要はないが、全ての命令に対して同じ
長さとして、命令の実行時間に影響されないようにす
る。
(3) The length of the specific timing need not be limited to one machine cycle, but is set to be the same for all instructions so as not to be affected by the execution time of the instructions.

(4) 特定タイミングの例として、各命令の実行時間
とは無関係な、例えば、命令実行の最初のサイクル(又
は、ステート)とか、実行の最終サイクルとかが考えら
れるが、通常、命令実行の最終サイクルは割込みの発生
を決定するサイクルでもあることから、該実行の最終サ
イクルを上記特定タイミングとして採用するのが効果的
である。
(4) As an example of the specific timing, for example, the first cycle (or state) of the instruction execution or the last cycle of the execution may be irrelevant to the execution time of each instruction. Since the cycle is also a cycle for determining the occurrence of an interrupt, it is effective to employ the last cycle of the execution as the specific timing.

(5) 例として、平均命令実行時間が3マシンサイク
ルの中央処理装置(CPU)で、上記1マシンサイクルの
特定タイミングを採用したとき、確率的に、サンプリン
グパルスの内の2/3が無駄に捨てられることになるの
で、このことを考慮して、サンプリングパルスの周期
を、3倍にするとか、該命令頻度の測定時間を3倍にす
ればよい。
(5) As an example, when a central processing unit (CPU) with an average instruction execution time of 3 machine cycles and the above-mentioned specific timing of one machine cycle is adopted, two-thirds of the sampling pulses are stochastically wasted. In consideration of this, the cycle of the sampling pulse may be tripled or the measurement time of the command frequency may be tripled.

このように、機能するので、少ないハードウェア量
で、且つ、計算機システムの運用環境への擾乱が少ない
サンプリング方式による命令頻度測定を行って、命令の
実行時間の長さに影響されない正確な命令頻度測定がで
きる効果がある。
Since it functions in this manner, the instruction frequency is measured by the sampling method with a small amount of hardware and with little disturbance to the operating environment of the computer system, and the accurate instruction frequency is not affected by the length of the instruction execution time. It has the effect of being able to measure.

〔実施例〕〔Example〕

以下本発明の実施例を図面によって詳述する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

第1図は本発明の一実施例を示した図であり、(a)
は構成例を示し、(b1),(b2)は動作タイムチヤート
を示しており、第2図(a)に示した全体の構成例にあ
るサンプリングパルス発生機構11から出力される一定周
期のサンプリングパルスを、命令実行時の特定タイミ
ングを示す信号、例えば、命令実行完了信号で論理積
をとって割込みラッチ123をセットする手段が本発明を
実施するのに必要な手段である。尚、全図を通して同じ
符号は同じ対象物を示している。
FIG. 1 is a view showing one embodiment of the present invention, and FIG.
(B1) and (b2) show operation time charts, and sampling at a constant period output from the sampling pulse generating mechanism 11 in the entire configuration example shown in FIG. 2 (a). Means for setting the interrupt latch 123 by ANDing a pulse with a signal indicating a specific timing at the time of instruction execution, for example, an instruction execution completion signal, is a means necessary for implementing the present invention. Note that the same reference numerals indicate the same object throughout the drawings.

以下、第1図によって本発明の命令頻度測定方式を説
明する。
Hereinafter, the instruction frequency measuring method of the present invention will be described with reference to FIG.

本発明を実施しても、サンプリング方式による命令頻
度測定の基本的な動作は従来方式と特に変わることはな
いので省略し、ここでは、各命令毎に、予め,定められ
た特定のタイミングを示す信号、例えば、命令実行完了
信号で、タイマ割込みを発生させて、命令頻度測定ル
ーチン22を起動する動作を中心にして説明する。
Even if the present invention is implemented, the basic operation of the instruction frequency measurement by the sampling method is not particularly different from that of the conventional method, and is omitted. Here, a specific timing predetermined for each instruction is shown. A description will be made mainly of an operation of generating a timer interrupt with a signal, for example, an instruction execution completion signal, and activating the instruction frequency measurement routine 22.

本実施例においては、前述のように、各命令毎に、予
め、定めた特定タイミングとして、最も効果的な、例え
ば、割込みの発生を決定するサイクルであり、各命令の
実行が開始されると、該命令の実行時間に、無関係に、
必ず、出力される命令実行完了信号を採用している
が、これに、限定されるものでないことはいう迄もない
ことである。
In this embodiment, as described above, for each instruction, the most effective, for example, a cycle for determining the occurrence of an interrupt as a predetermined specific timing, and when the execution of each instruction is started. Irrespective of the execution time of the instruction,
Although the output instruction execution completion signal is always employed, it is needless to say that the present invention is not limited to this.

この命令実行完了信号と、サンプリングパルス発生
機構11{第2図(a)参照}から、周期的に出力される
サンプリングパルスとを論理積(AND)回路120で論理
積をとり、一致が取れると、タイマ割込みラッチ123を
セットし、従来から使用されている命令頻度測定ルーチ
ン22を起動する。{(b2)図の動作タイムチヤート参
照} 従って、該各命令が持っている特定のタイミング、即
ち、命令実行完了信号と一致しないサンプリングパル
スは自動的に無視されることになる。{(b1)図の動
作タイムチヤート参照} この結果、該サンプリングパルスの一部が無駄に捨
てられることになるので、前述のように、該サンプリン
グパルスの周期を短くするとか、該命令頻度測定ルー
チン22による命令頻度測定時間を延長させる等の補正処
理が必要である。
When the instruction execution completion signal and the sampling pulse periodically output from the sampling pulse generating mechanism 11 (see FIG. 2A) are logically ANDed by an AND circuit 120, and a match is obtained. The timer interrupt latch 123 is set, and the conventionally used instruction frequency measurement routine 22 is started. {Refer to the operation time chart of FIG. 2 (b2)} Therefore, the specific timing of each instruction, that is, the sampling pulse that does not match the instruction execution completion signal is automatically ignored. << Refer to the operation time chart of FIG. 13 (b1) >> As a result, a part of the sampling pulse is wasted and discarded. Correction processing such as extending the command frequency measurement time by 22 is required.

このように、本発明は、計算機システムが元々備えて
いるタイマ割込み機構を用いて、タイマ割込みによるソ
フトウェア手段により、現在実行中のプログラムが中断
された時に主記憶装置(MSU)上に保存されるOLD PSWを
参照し、「最後に実行した命令の次の命令をサンプリン
グする」命令頻度測定方式において、該最後に実行し
た、命令頻度測定には無関係の命令の実行時間によっ
て、実際に測定される命令の頻度に重みが付くのを防止
する為に、各命令の実行時の特定のタイミング、例え
ば、割込み発生サイクルでもある命令実行完了信号と
一致するサンプリングパルスを捕捉して、上記タイマ
割込みを発生させ、命令頻度測定ルーチンを起動させる
ようにした所に特徴がある。
As described above, the present invention uses the timer interrupt mechanism originally provided in the computer system and saves the currently executing program on the main storage unit (MSU) when the currently executing program is interrupted by the software means by the timer interrupt. Refer to the OLD PSW, and in the "sample the next instruction after the last executed instruction" instruction frequency measurement method, it is actually measured by the execution time of the last executed instruction unrelated to the instruction frequency measurement. To prevent the frequency of instructions from being weighted, the timer interrupt is generated by capturing a specific timing at the time of execution of each instruction, for example, a sampling pulse that matches an instruction execution completion signal which is also an interrupt generation cycle. The feature is that the instruction frequency measurement routine is started.

〔発明の効果〕〔The invention's effect〕

以上、詳細に説明したように、本発明の命令頻度測定
方式は、情報処理装置の中央処理装置(CPU)で実行さ
れるプログラム中のどの命令がどの位の頻度で実行され
たかを測定するのに、周期的にサンプリングパルスを発
生するサンプリングパルス発生機構と、該サンプリング
パルスに呼応して現在実行中のプログラムの実行を一時
中断する機構と、該プログラムの中断時点の情報から、
次に実行すべきであった命令を主記憶装置(MSU)から
読み出す機構と、該読み出した命令語を解読して命令頻
度を計測する機構とを備えた情報処理装置において、上
記サンプリングパルスに呼応して現在実行中のプログラ
ムの実行を一時中断するタイミングを、命令毎に予め定
めた特定のタイミングとし、且つ、該特定のタイミング
を全ての命令に対して同一の長さとする手段を設けて、
該手段で生成された信号に基づいて、上記命令頻度を計
測する機構を起動し、命令実行頻度を測定するようにし
たものであるので、少ないハードウェア量で、且つ、計
算機システムの運用環境への擾乱が少ないサンプリング
方式による命令頻度測定を行って、命令の実行時間の長
さに影響されない正確な命令頻度測定ができる効果があ
る。
As described above in detail, the instruction frequency measurement method of the present invention measures which instruction in a program executed by a central processing unit (CPU) of an information processing apparatus has been executed and how frequently. A sampling pulse generating mechanism for periodically generating a sampling pulse, a mechanism for temporarily suspending the execution of a program currently being executed in response to the sampling pulse, and information on a point at which the program is interrupted.
An information processing apparatus having a mechanism for reading an instruction to be executed next from a main storage unit (MSU) and a mechanism for decoding the read instruction word and measuring the instruction frequency is provided. A means for temporarily suspending the execution of the program currently being executed is set to a specific timing predetermined for each instruction, and the specific timing is set to the same length for all instructions,
On the basis of the signal generated by the means, the mechanism for measuring the instruction frequency is activated to measure the instruction execution frequency, so that the amount of hardware is small and the operation environment of the computer system is reduced. There is an effect that an instruction frequency can be accurately measured without being affected by the length of the instruction execution time by performing the instruction frequency measurement by a sampling method with less disturbance of the instruction.

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

第1図は本発明の一実施例を示した図, 第2図は従来の命令頻度測定方式を説明する図, である。 図面において、 1は中央処理装置(CPU), 11はサンプリングパルス発生機構, 12は命令実行/割込み制御回路, 120,122は論理積(AND)回路, 121,123はラッチ, 2は主記憶装置(MSU), 21は旧プログラム・ステータス語(OLD PSW), 22は命令頻度測定ルーチン, 23はプログラム, 24は実行回数記録語(1〜n), はサンプリングパルス, は命令実行完了信号, をそれぞれ示す。 FIG. 1 is a diagram showing an embodiment of the present invention, and FIG. 2 is a diagram for explaining a conventional instruction frequency measuring method. In the drawing, 1 is a central processing unit (CPU), 11 is a sampling pulse generating mechanism, 12 is an instruction execution / interrupt control circuit, 120 and 122 are logical product (AND) circuits, 121 and 123 are latches, 2 is a main storage unit (MSU), 21 indicates an old program status word (OLD PSW), 22 indicates an instruction frequency measurement routine, 23 indicates a program, 24 indicates an execution count recording word (1 to n), indicates a sampling pulse, and indicates an instruction execution completion signal.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】周期的にサンプリングパルス()を発生
するサンプリングパルス発生機構(11)と、該サンプリ
ングパルス()に呼応して現在実行中のプログラムの
実行を一時中断する機構(12)と、該プログラムの中断
時点の情報から、次に実行すべきであった命令を主記憶
装置(MSU)(2)から読み出す機構(21,12)と、該読
み出した命令語を解読して命令頻度を計測する機構(1
2,22,24)とを備えた情報処理装置において、 上記サンプリングパルス()に呼応して現在実行中の
プログラムの実行を一時中断するタイミングを、命令毎
に予め定めた特定のタイミング()とし、且つ、該特
定のタイミング()を全ての命令に対して同一の長さ
とする手段(120)を設けて、 該手段(120)で生成された信号に基づいて、上記命令
頻度を計測する機構(12,22,24)を起動し、命令実行頻
度を測定することを特徴とする命令頻度測定方式。
A sampling pulse generating mechanism for periodically generating a sampling pulse; a mechanism for temporarily suspending execution of a program currently being executed in response to the sampling pulse; A mechanism (21, 12) for reading an instruction to be executed next from the main storage unit (MSU) (2) from information at the time of interruption of the program; Measurement mechanism (1
2, 22, 24), the timing at which the execution of the currently executing program is temporarily suspended in response to the sampling pulse () is set to a specific timing () predetermined for each instruction. And a means (120) for setting the specific timing () to the same length for all instructions, and a mechanism for measuring the instruction frequency based on a signal generated by the means (120). An instruction frequency measurement method characterized by activating (12,22,24) and measuring the instruction execution frequency.
JP1090030A 1989-04-10 1989-04-10 Instruction frequency measurement method Expired - Fee Related JP2775830B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1090030A JP2775830B2 (en) 1989-04-10 1989-04-10 Instruction frequency measurement method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1090030A JP2775830B2 (en) 1989-04-10 1989-04-10 Instruction frequency measurement method

Publications (2)

Publication Number Publication Date
JPH02268343A JPH02268343A (en) 1990-11-02
JP2775830B2 true JP2775830B2 (en) 1998-07-16

Family

ID=13987272

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1090030A Expired - Fee Related JP2775830B2 (en) 1989-04-10 1989-04-10 Instruction frequency measurement method

Country Status (1)

Country Link
JP (1) JP2775830B2 (en)

Also Published As

Publication number Publication date
JPH02268343A (en) 1990-11-02

Similar Documents

Publication Publication Date Title
EP0652518B1 (en) Operating system based performance monitoring of programs
US5608866A (en) System for measuring and analyzing operation of information processor
US6079032A (en) Performance analysis of computer systems
US6047390A (en) Multiple context software analysis
US5799143A (en) Multiple context software analysis
JP2006260542A (en) Determination of actual amount of time a processor consumes in executing code portion
JPH05197594A (en) Method and system for capturing and reducing resource data for data processing system in real time
US20050010908A1 (en) Method, apparatus and computer program product for implementing breakpoint based performance measurement
EP1125199B1 (en) Method of debugging a program thread
JP2775830B2 (en) Instruction frequency measurement method
JPH07334211A (en) Data tracing method for programmable controller
JPH10275092A (en) Trace information output method for microprocessor
JP4806577B2 (en) Trace data recording device
JPH0934754A (en) Instrument and method for measuring performance of program
JP2005165825A (en) Trace information recorder
JPH11327927A (en) Cpu using rate measurement system
JPH0357970A (en) Pulse input apparatus
JP2595718B2 (en) In-circuit emulator
JPH11102306A (en) Emulator
JPS607554A (en) Measuring system for performance of computer system
JPH0282334A (en) Bus cycle trace circuit
JPH02242440A (en) Instruction trace circuit
JPH048821B2 (en)
JPH05189277A (en) Program execution time measuring instrument for programmable controller
SE524799C2 (en) Debugging method for single or multi process real time systems, identifies significant event break off point with unique marker comprising check sum

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees