JPH03158936A - Testing method for program - Google Patents

Testing method for program

Info

Publication number
JPH03158936A
JPH03158936A JP1297706A JP29770689A JPH03158936A JP H03158936 A JPH03158936 A JP H03158936A JP 1297706 A JP1297706 A JP 1297706A JP 29770689 A JP29770689 A JP 29770689A JP H03158936 A JPH03158936 A JP H03158936A
Authority
JP
Japan
Prior art keywords
program
instruction
execution
processing
time
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.)
Granted
Application number
JP1297706A
Other languages
Japanese (ja)
Other versions
JP2866410B2 (en
Inventor
Shoichi Yamamoto
昇一 山本
Kohei Seki
関 光平
Hiroshi Nakajima
宏 中島
Takashi Owaki
大脇 隆志
Keiji Oshima
大島 啓二
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
Hitachi Information and Control Systems Inc
Original Assignee
Hitachi Ltd
Hitachi Process Computer Engineering Inc
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, Hitachi Process Computer Engineering Inc filed Critical Hitachi Ltd
Priority to JP1297706A priority Critical patent/JP2866410B2/en
Publication of JPH03158936A publication Critical patent/JPH03158936A/en
Application granted granted Critical
Publication of JP2866410B2 publication Critical patent/JP2866410B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To facilitate the contention test of resources by delaying a specific program or the operation time of a specific processing of a specific program to an arbitrary value, and giving a difference to the execution speed of every program. CONSTITUTION:In the case the section to processings S4 - S7 is designated as an execution time delay section with respect to a program 1, a processor drives and executes an interruption processing program by the head of the processing S44, and executes the interruption for ending the interruption processing program by the end of the processing S7. Subsequently, the execution of the processing S5 of the suspended program is restarted, and after the execution of the next one instruction 4 is ended, the processor generates an interruption again. Thereafter, until the processor executes an interruption generation end instruction 6, an during interruption processing program 5 is executed at every one instruction. In such a way, during the instruction execution time of the program, the interruption processing program 5 is executed at every one instruction, therefore, it becomes virtually longer by the execution time portion of the interruption processing program, and the test of a contention management processing can be executed.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、プログラムのテスト方法、特に、実行時間の
遅延をはかってなるプログラムのテスト方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for testing a program, and particularly to a method for testing a program by measuring a delay in execution time.

〔従来の技術〕[Conventional technology]

電子計算機のO8は、ハードウェア資源の効率的な利用
及び応答性の向上を目的とした、複数プログラムを同時
に実行するマルチプログラミングやマルチユーザ○Sが
一般的である。ここで、マルチプログラミングとは、2
以上のプログラムが時分割に作動することであり、マル
チユーザO8とは、こうした2以−にのプログラムを作
動させるようにO8が形成されていることである。
The O8 of an electronic computer is generally multi-programming or multi-user ○S in which multiple programs are executed simultaneously for the purpose of efficient use of hardware resources and improvement of responsiveness. Here, multiprogramming means 2
The above programs operate in a time-division manner, and the multi-user O8 means that the O8 is configured to operate two or more of these programs.

マルチプログラミングO8下で平行に処理されるプログ
ラム同士が相互に協調して仕事をするためには、2つ以
」二のプログラムが主メモリ上の共通のデータ領域(共
用データ)をアクセスすることが必要である。
In order for programs that are processed in parallel to work together under multiprogramming O8, two or more programs must access a common data area (shared data) in main memory. is necessary.

この場合、複数のプロゲラへが同時に共用データを更新
すると不都合を生じることがある。
In this case, inconveniences may occur if shared data is updated by multiple pro gamers at the same time.

2つのプログラム1,2があり、共通にアクセスされる
共用データが主メモリ内にあるとする。
Assume that there are two programs 1 and 2, and shared data that is accessed in common is located in main memory.

それぞれのプログラムの動作は、例えば簡単のために、
プログラム1の動きは共用データの値を5つ増す。その
後で、プログラム2の動きは共用データの値を3つ増す
ものとする。従って、初期値が1であれば、(1+5)
+3=9の共用データにさせることを意味する。
For simplicity, the operation of each program is as follows:
The movement of program 1 increases the value of the shared data by 5. After that, the action of program 2 is to increase the value of the shared data by three. Therefore, if the initial value is 1, (1+5)
This means that +3=9 shared data.

それぞれのプログラムを実行する機械語の系列は次の様
になる。
The sequence of machine language that executes each program is as follows.

プログラム1の動き: (A1)共用データの値をプログラム1内共用データ用
バツフアに読み込む。
Movement of program 1: (A1) Read the shared data value into the shared data buffer within program 1.

− (A2)プログラム1内共用データ用バツフアの値に5
加える。
- (A2) The value of the buffer for shared data in program 1 is 5.
Add.

(A3)プログラム1内共用データ用バツフアの値を共
用データに書き込む。
(A3) Write the value of the shared data buffer in program 1 to the shared data.

プログラム2の動き: (B1)共用データの値をプログラム2内共用データ用
バツフアに読み込む。
Movement of program 2: (B1) Read the shared data value into the shared data buffer within program 2.

(B2)プログラム2内共用データ用バツフアの値に3
加える。
(B2) Set the buffer value for shared data within program 2 to 3.
Add.

(B3)プログラム2内共用データ用バツフアの値を共
用データに書き込む。
(B3) Write the value of the shared data buffer in program 2 to the shared data.

なお、関連する従来例には、特開昭60−65350号
公報等が挙げられる。
Incidentally, related conventional examples include Japanese Patent Application Laid-Open No. 60-65350.

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

プログラム1における命令(Al)、(A2)。 Instructions (Al) and (A2) in program 1.

(A3)の実行と、プログラム2における(Bl)。Execution of (A3) and (Bl) in program 2.

(B 2)、 (B 3)の実行とが時間的に用型なる
と、共用データの値は9にならない場合が生じ得る。
If the executions of (B2) and (B3) are different in time, the value of the shared data may not be 9.

例えば第2図の様に(A1)が実行され、次に(A2)
と(B1)が同時に実行(cpuの処理− 上で考えた場合)され、次に(A3)と(B2)が同時
に実行され、最後に(B3)が実行された場合である。
For example, as shown in Figure 2, (A1) is executed, then (A2)
This is a case where (B1) and (B1) are executed at the same time (CPU processing - considering above), then (A3) and (B2) are executed at the same time, and finally (B3) is executed.

この結果、(A3)により共用データは一時的に6とな
るが、(B3)の実行により共用データは9ではなく4
となってしまう。
As a result, the shared data temporarily becomes 6 due to (A3), but the shared data becomes 4 instead of 9 due to execution of (B3).
It becomes.

この問題を生じないようにするための方法は、2つ以上
のプログラムが同時に共用データを更新しないようにす
ること、すなわち相互排除できるようにすることである
A method to prevent this problem from occurring is to prevent two or more programs from updating shared data at the same time, that is, to allow them to mutually exclude each other.

この共用データの競合を管理し、相互排除を実現するの
が競合管理処理プログラムである。
A conflict management processing program manages conflicts in this shared data and achieves mutual exclusion.

競合管理処理プログラムのテストは、意図的に第2図に
示す如き共用データの競合発生させることが必要である
ため、1つのプログラムが共用データの更新処理を実行
中に他のプログラムの共用データの更新処理を実行しな
ければならない。しかし実際の共用データの更新処理の
実行時間は、I M I P S (Million 
In5truction Per 5econd)の電
子計算機で数μsにすぎないので、時間的には1つのプ
ログラムが共用データの更新処理を実行しようとしたと
き、他のプログラムが共用データの更新処理を実行中で
ある可能性は非常に小さい。
In testing the conflict management processing program, it is necessary to intentionally cause conflicts in shared data as shown in Figure 2, so while one program is updating shared data, it is necessary to Update processing must be performed. However, the actual execution time of the shared data update process is IMIP S (Million
Input per 5 seconds on an electronic computer is only a few μs, so when one program attempts to update shared data, it is possible that another program is in the process of updating shared data. sex is very small.

現実に競合管理処理に誤りがあった場合でも不都合が発
生するのは、24時間稼働するオンラインシステムでさ
え数年に一度程度である。
In reality, even if there is an error in the conflict management process, inconveniences occur only once every few years, even in online systems that operate 24 hours a day.

しかし競合管理処理プログラムの作成誤りは、システム
ダウンにつながる可能性が高く、発生による社会的影響
度が大きいため、テストで確実に発見することが必要で
ある。
However, errors in the creation of conflict management processing programs are highly likely to lead to system failure, and the social impact of such occurrences is large, so it is necessary to reliably detect them through testing.

しかし共用データの競合が発生する可能性そのものが小
さいため、共用データの競合を発生させることが必要な
競合管理処理のテストを確実に行うことは従来困難であ
った。
However, since the possibility of a shared data conflict occurring itself is small, it has conventionally been difficult to reliably test conflict management processing that requires the occurrence of a shared data conflict.

上記競合管理処理プログラムのテストを確実に行うため
には、命令を遅く実行することにより共用データの更新
処理の実行時間を長くすることで、時間的に共用データ
の競合が発生する可能性を大きくする必要がある。また
CPUの負荷を意図的に増大させて、過負荷時のCPU
の動きをテストしてみたいことがある。こうした場合も
、一部のプログラム又はその一部のステップの処理を遅
らせることが有効となるはずである。
In order to reliably test the conflict management processing program mentioned above, it is necessary to extend the execution time of shared data update processing by executing instructions slowly, thereby increasing the possibility of shared data conflicts occurring in terms of time. There is a need to. In addition, by intentionally increasing the CPU load, the CPU
I would like to test the movement of In such cases as well, it would be effective to delay the processing of some programs or some steps thereof.

なお、上記従来例の特開昭60−65350号は実行時
間を長くする例であるが、これはプログラムの動きを遅
くすることでそのプログラムの細かい動きをみようとす
るものであり、競合管理処理や負荷の増大といった記載
はない。
The above conventional example, JP-A No. 60-65350, is an example of lengthening the execution time, but this is an attempt to see the detailed movement of the program by slowing down the movement of the program, and the contention management process There is no mention of an increase in load.

本発明の目的は、競合管理処理のテストやCPU負荷の
増大テストを実行時間を変化させて実現させたプログラ
ム制御方法を提供するものである。
An object of the present invention is to provide a program control method in which a competition management process test and a CPU load increase test are realized by varying the execution time.

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

本発明は、■先ず、割込み処理プログラムの働く区間を
指定する。具体的には命令の実行時間を変化させる遅延
対象プログラム又は遅延対象ステップの先頭とその最後
尾とを指定する。0この指定を受けて処理装置は先頭位
置で割込み処理プログラムを起動させ、最後尾で割込み
処理プログラムを終了させる。■更に開始と終了との区
間にあっては、その間のプログラム又はステップの実行
速度を遅くする上記割込み処理プログラムを働かせる。
According to the present invention, (1) First, the section in which the interrupt processing program operates is specified. Specifically, the beginning and end of a program to be delayed or a step to be delayed whose instruction execution time is to be changed is specified. 0 Upon receiving this designation, the processing device starts the interrupt processing program at the beginning position, and terminates the interrupt processing program at the end position. (2) Furthermore, in the interval between the start and the end, the above-mentioned interrupt processing program is activated to slow down the execution speed of the program or step during that period.

■この割込み処理プログラムは実行時間を任意に設定可
能なプログラムである。
■This interrupt processing program is a program whose execution time can be set arbitrarily.

尚、具体的には、■、@の処理装置機能は、デバッグ時
に使用されるトレース割込みを利用すればよい。I−レ
ース割込みとは、1命令を実行する毎に、処理装置が自
分自身で割込みを発生させる機能である。従って、対象
がプログラムであればそのプログラムを構成する全ステ
ップについて割込み処理プログラムが働き、対象が1ス
テツプであればそのステップ1回限りで割込み処理プロ
グラムが働く。
Specifically, the processing device functions ① and @ may utilize trace interrupts used during debugging. The I-race interrupt is a function in which the processing device generates an interrupt by itself every time one instruction is executed. Therefore, if the target is a program, the interrupt processing program will work for all steps constituting that program, and if the target is one step, the interrupt processing program will work only once for that step.

〔作 用〕[For production]

第1図は本発明の原理図であり、第1図を用いて説明す
る。
FIG. 1 is a diagram showing the principle of the present invention, and will be explained using FIG.

1はプログラムの命令の並びを示し、2は処理装置の実
行順序を示、している。
1 indicates the sequence of program instructions, and 2 indicates the execution order of the processing device.

このプログラム1に対して、処理84〜S7までの区間
を実行時間遅延区間を指定したとする。この指定がある
と、処理装置は、処理S4の先頭で割込み処理プログラ
ムの起動をかけて実行し、処8− 理S7の最後尾で割込み処理プログラムを終了させる割
込みを行う。即ち、トレース割込みを採用した場合には
、処理装置は命令4を実行し、割込み発生開始命令3を
実行後、1命令実行終了毎に割込みを発生する。割込み
発生により処理装置は現在実行しているプログラムの処
理を中断し、割込み処理プログラム5を実行する。割込
み処理プログラム5では、任意の時間処理を行い、割込
み処理を終了する。
Assume that for this program 1, the section from processing 84 to S7 is designated as an execution time delay section. When this designation is made, the processing device starts and executes the interrupt processing program at the beginning of process S4, and performs an interrupt to end the interrupt processing program at the end of process S7. That is, when trace interrupts are adopted, the processing device executes instruction 4, and after executing interrupt generation start instruction 3, generates an interrupt every time execution of one instruction is completed. When an interrupt occurs, the processing device interrupts the processing of the currently executing program and executes the interrupt processing program 5. The interrupt processing program 5 performs arbitrary time processing and ends the interrupt processing.

処理装置は割込み処理路r後、中断していたプログラム
の処理S5の実行を再開する。次の1命令4の実行終了
後、処理装置は再び割込みを発生させる。
After the interrupt processing path r, the processing device resumes execution of the interrupted program process S5. After the execution of the next instruction 4 is completed, the processing device generates an interrupt again.

以降、処理装置が割込み発生終了命令6を実行するまで
、割込み処理プログラム5を1命令毎に実行して行く。
Thereafter, the interrupt processing program 5 is executed one instruction at a time until the processing device executes the interrupt generation termination instruction 6.

このことにより、プログラムの命令実行時間は、1命令
毎に割込み処理プログラム5を実行しているため、見か
け上側込み処理プログラムの実行時間分だけ長くなる。
As a result, the instruction execution time of the program is apparently increased by the execution time of the side interrupt processing program, since the interrupt processing program 5 is executed for each instruction.

〔実施例〕〔Example〕

以下、本発明をリソースの競合テストに用いた実施例で
、第3図、第4図、第5図、第7図により説明する。
Hereinafter, an embodiment in which the present invention is used for a resource contention test will be described with reference to FIGS. 3, 4, 5, and 7.

リソースの競合テストとは、複数のプログラム間で共有
する資源へのアクセスの競合を発生させることによる競
合管理処理部分の相互排除についてのテストである。
The resource conflict test is a test for mutual exclusion of conflict management processing parts by causing conflict in access to resources shared between multiple programs.

本実施例では、命令を遅くする手段として処理装置の割
込みを使用する。第7図が計算機システムのブロック図
であり、第7図は処理袋fi’iTO+。
In this embodiment, processing unit interrupts are used as a means of slowing down instructions. FIG. 7 is a block diagram of the computer system, and FIG. 7 is a processing bag fi'iTO+.

主メモリ102、周辺装置103より成る。処理装置1
01は命令制御部104、実行ユニット105より成り
、命令制御部104の命令の読出し、解読を受けて、実
行ユニット105がその実行を行う。実行ユニット10
5は、レジスタ群106.演算ユニット108より成り
、演算ユニット108より成り、演算ユニッh108は
、レジスタ群106との間でデータの受渡しを行いなが
ら所定の演算を行う。レジスタ群106中のステータス
レジスタ107が本実施例で重要な役割を果す。第33
図が割込み処理の概要である。
It consists of a main memory 102 and peripheral devices 103. Processing device 1
01 consists of an instruction control section 104 and an execution unit 105, and upon reading and decoding of instructions from the instruction control section 104, the execution unit 105 executes the instructions. execution unit 10
5 is a register group 106. It consists of an arithmetic unit 108, and the arithmetic unit h108 performs a predetermined operation while exchanging data with the register group 106. Status register 107 in register group 106 plays an important role in this embodiment. 33rd
The figure shows an overview of interrupt processing.

般に割込みは周辺装置103が処理装置101にサービ
スを要求するときや主メモリ装置】02に格納している
プログラムを実行中に異常が発生したとき、発生した異
常に対応する主メモリ装置102に格納している処理プ
ログラムを実行するために使用されている。本実施例で
はトレース割込みを使用する。
In general, an interrupt occurs when the peripheral device 103 requests a service from the processing unit 101 or when an error occurs while executing a program stored in the main memory device It is used to execute stored processing programs. This embodiment uses trace interrupts.

割込みが発生すると、処理装置1.01はどの処理プロ
グラムを実行するのかを識別するために各周辺装置10
3に割り当てた割込みベクタ番シン・(割込み種別を示
す信号)を周辺装置103から受は取り、割込みベクタ
番号から割込み処理プログラムの先頭アドレスを格納し
ている割込みベクタアドレスを算出し、割込みベクタを
読み込み、割込み処理プログラムを実行する。
When an interrupt occurs, the processing unit 1.01 checks each peripheral device 10 to identify which processing program to execute.
The interrupt vector number assigned to 3 (signal indicating the interrupt type) is received from the peripheral device 103, the interrupt vector address that stores the start address of the interrupt processing program is calculated from the interrupt vector number, and the interrupt vector is Read and execute the interrupt handling program.

割込み処理により命令の実行速度を見かけ」−遅くする
には、1命令の実行毎に割込みを発生し、時間遅延用(
例えばその間、何の実行も行わない処理であるノーオペ
処理)割込み処理プログラム1 を実行させ、割込み処理プログラムで時間を遅延させる
ことが必要である。
To slow down the instruction execution speed by interrupt processing, generate an interrupt every time one instruction is executed, and use the time delay (
For example, it is necessary to execute the interrupt processing program 1 (no-operation processing, which is processing in which nothing is executed) during that time, and to delay the time using the interrupt processing program.

1命令の実行毎に割込みを発生させるには、処理装置1
01の命令追跡機能(1−レース割込み機能)を使用す
る。命令追跡機能とは、処理装置のステータスレジスタ
107の命令追跡ビットが1のとき、1命令の実行毎に
、処理装置101が割込みを発生させる機能である。こ
の機能を使用するため、第5図のプログラム1の競合管
理処理開始部分ISの直前に、ステータスレジスタ10
7の命令追跡ビットを」にする処理を追加し、競合管理
処理路r部分子 I’:の直後に、ステータスレジスタ
107の命令追跡ビットを0にする処理を追加する。
To generate an interrupt every time one instruction is executed, processing device 1
Uses the 01 instruction trace function (1-race interrupt function). The instruction tracing function is a function in which the processing device 101 generates an interrupt every time one instruction is executed when the instruction tracing bit of the status register 107 of the processing device is 1. In order to use this function, immediately before the conflict management process start part IS of program 1 in FIG.
A process for setting the instruction trace bit of the status register 107 to "0" is added, and a process for setting the instruction trace bit of the status register 107 to 0 is added immediately after the contention management processing path r part molecule I':.

なお、命令の実行速度を遅くする区間は、割込みを発生
させる区間であるので、ステータスレジスタ107の命
令追跡ビットの操作処理の位置を変えることにより、命
令の実行速度を遅くする区間が任意に設定iJ能になる
Note that the section where the instruction execution speed is slowed is the section where an interrupt is generated, so by changing the position of the operation processing of the instruction tracking bit of the status register 107, the section where the instruction execution speed is slowed can be set arbitrarily. Become iJ Noh.

割込み発生時に割込み処理プロゲラ11を実行させるに
は、割込みベクタへ割込み処理プログラム2 の先頭アドレスを登録することが必要であるので、命令
追跡割込みの割込みベクタ番号から割込みベクタのアド
レスを算出し、割込み処理プログラムの先頭アドレスを
登録する。
In order to execute the interrupt processing program 11 when an interrupt occurs, it is necessary to register the start address of the interrupt processing program 2 in the interrupt vector. Therefore, the address of the interrupt vector is calculated from the interrupt vector number of the instruction tracking interrupt, and the interrupt Register the start address of the processing program.

第4図が割込み処理プログラムのフローチャートである
。割込み処理プログラムは見かけ上の命令の実行速度を
遅くするための時間稼ぎが1・1的であるため、ループ
回数を設定してループさせるだけで十分である。ループ
回数は命令を遅くする時間によって任意に設定可能であ
る。
FIG. 4 is a flowchart of the interrupt processing program. Since the interrupt processing program has a 1:1 gain in time to slow down the apparent execution speed of instructions, it is sufficient to set the number of loops and run the program in a loop. The number of loops can be arbitrarily set depending on the time to delay the instruction.

また割込み処理プログラムは、目的が時間稼ぎに有るの
で、割込み処理プログラムに共用データの競合発生の有
無を監視させることも可能である。
Furthermore, since the purpose of the interrupt processing program is to buy time, it is also possible to have the interrupt processing program monitor whether or not a conflict occurs in shared data.

競合管理処理プログラムは、1つのプログラムが共用デ
ータの更新処理中に共用データを更新しようとした他の
プログラムを待ち状態にする。待ち状態にしたプログラ
ムは、待ち状態を管理するテーブルへ登録され、共用デ
ータを更新中のプログラムが更新処理路Y後に競合管理
処理プロゲラ11により、待ち状態から解放される。
The conflict management processing program places another program that attempts to update shared data in a waiting state while one program is updating the shared data. The program placed in the waiting state is registered in a table that manages the waiting state, and the program that is updating the shared data is released from the waiting state by the conflict management processing progera 11 after the update processing path Y.

したがって共用データの競合発生の有無は、待ち状態を
管理するためのデープルを監視することで判断すること
ができるので、割込み処理プログラムにこのテーブルを
監視させることにより、競合発生の有無を簡単に調べる
ことができ、テスト効率が向」ニする。競合発生時のテ
ーブルの内容を出力させることにより、デパック効率が
向1−する。
Therefore, whether or not a conflict has occurred in shared data can be determined by monitoring the table for managing wait states.By having the interrupt processing program monitor this table, it is easy to check whether or not a conflict has occurred. This improves test efficiency. By outputting the contents of the table when a conflict occurs, depacking efficiency is improved.

また、割込みを発生させる代りに、ハード命令をラフ1
〜ウエアでシミュレーションすることにより、命令の実
行速度を遅くすることも可能である。
Also, instead of generating an interrupt, you can rough 1 hard instruction.
~ It is also possible to slow down the execution speed of instructions by simulating with software.

1命令毎に割込みを発生させるために、処理装置の命令
追跡機能(デパック時のトレース割込分のこと)を使用
した。命令追跡機能では、ステータスレジスタ」−にオ
ペレータの指定する割込み区間(第1図の例での84〜
S7の区間を云う)をセラ1〜するレジスタである。処
理装置はこのレジスタの指定データをみて割込みの起動
及び終了を指示する。そして処理装置のステータスレジ
スタの命令追跡ビットが1のとき、1命令を実行する毎
に割込みを発生させる。このトレース割込み機能を使用
するための処理例を第5図に丞す。第5図は、プログラ
ム1に割込みをかけ、プログラム2に割込みをかけない
例を示した。また、プログラム1は、第1図対応の84
〜S7の区間の割込み例であり、84〜S7の各実行後
(τh τ2.・・・の処理時間後)に、割込みプログ
ラムの実行(”I”、 + )を行オ)せている例を示
した。これにより、本来ならば競合発生の確率は少ない
のであるが、プログラム1の処理でわかるように区間1
゛3にわたって競合発生用の処理が生じたことになり、
意図的な競合発生を作り出せる。
In order to generate an interrupt for each instruction, the instruction tracing function (referring to trace interrupts during depacking) of the processing device was used. In the instruction tracking function, the interrupt interval specified by the operator (from 84 in the example in Figure 1) is stored in the status register.
This is a register for setting the range S7 to S7. The processing device looks at the specified data in this register and instructs the activation and termination of the interrupt. When the instruction trace bit of the status register of the processing device is 1, an interrupt is generated every time one instruction is executed. An example of processing for using this trace interrupt function is shown in FIG. FIG. 5 shows an example in which program 1 is interrupted but program 2 is not interrupted. In addition, program 1 is 84
This is an example of an interrupt in the interval from ~S7, and an example in which the interrupt program ("I", +) is executed after each execution of 84 to S7 (after the processing time of τh τ2...) showed that. As a result, the probability of conflict occurring is normally low, but as you can see in the processing of program 1,
゛3 processes for conflict occurrence occurred,
You can intentionally create conflicts.

以」〕の処理を実現するためには、第5図のプログラム
1の競合管理処理開始部分ISの直前に、ステータスレ
ジスタの命令追跡ビットを1にする処理を追加し、競合
管理処理終了部分IEの直後に、ステータスレジスタの
命令追跡ビットをOに戻す処理を追加すればよい。
In order to realize the above process, add a process to set the instruction tracking bit of the status register to 1 immediately before the conflict management process start part IS of program 1 in FIG. Immediately after, a process for returning the instruction trace bit of the status register to O may be added.

さて、第5図において、プログラム2は本発明を用いて
いないので、競合管理処理部分の実行時間T2はt、=
0.5となる。プログラム2の全体の実15− 待時間はt;=10であり、実行中は他のプログラムが
一様に実行できると仮定すると、競合が発生する確率は
、競合管理処理部分の実行時間/全体の実行時間で表さ
れ、0.05となる。
Now, in FIG. 5, since program 2 does not use the present invention, the execution time T2 of the conflict management processing part is t, =
It becomes 0.5. Assuming that the overall actual waiting time of program 2 is t;=10 and that other programs can be executed uniformly during execution, the probability that a conflict will occur is calculated as follows: execution time of conflict management processing part/total It is expressed as the execution time of 0.05.

しかし本発明を用いているプログラム1では、競合管理
処理部分の1命令の実行毎に割込み処理プログラムが実
行されているので、競合管理処理部分の実行時間′1゛
3は1.=]:lとなり、26倍長くなる。プログラム
1の全体の実行時間はt=21であるので、上記仮定の
上で競合が発生する確率を求めると0.62となり、本
発明を用いていない場合の12倍になる。
However, in the program 1 using the present invention, the interrupt processing program is executed every time one instruction of the conflict management processing section is executed, so the execution time '1'3 of the conflict management processing section is 1. =]:l, making it 26 times longer. Since the overall execution time of program 1 is t=21, the probability of conflict occurring based on the above assumption is 0.62, which is 12 times that of the case where the present invention is not used.

このように本発明により競合が発生する確率を高くする
ことができる。
In this way, the present invention can increase the probability that competition will occur.

次に本発明を負荷テス1〜に用いた実施例で、第4図、
第6図を用いて説明する。
Next, in an example in which the present invention was used for load tests 1 to 1, FIG.
This will be explained using FIG.

負荷テストとは、処理装置の負荷を増加させ、処理装置
によるプログラムの実行時間が激減したときの実行時間
が激減したプログラム及び他のプログラムへの影響につ
いてのテストである。
A load test is a test of increasing the load on a processing device and drastically reducing the execution time of the program by the processing device, and examining the effect on the program whose execution time has been drastically reduced and other programs.

】6− 割込み処理プログラムは第4図のフローチャー1−を使
用する。
]6- The interrupt processing program uses flowchart 1- in FIG.

第6図を用いてプログラムの動作を説明する。The operation of the program will be explained using FIG.

割込み発生区間はプログラム全体(IS〜TE)とする
The interrupt generation section is the entire program (IS to TE).

プログラム起動直後、−命令実行後置に割込みが発生す
る。このことによりプログラムの実行時間Ll−t2は
、(プログラムの処理時間Σl’l)+(割込み処理プ
ログラムの実行時間ΣT2)となる。
Immediately after the program starts, an interrupt occurs after the - instruction is executed. As a result, the program execution time Ll-t2 becomes (program processing time Σl'l)+(interrupt processing program execution time ΣT2).

よってプログラム−つだけしか動作していなくても、処
理装置がプログラムの処理を行っている割合は、ΣT1
/(Σ1゛1+ΣT2)となり、割込み処理プログラム
のループ回数を変更することにより、割込み処理プログ
ラムの実行時間T2を調節し、任意の値の負荷でプログ
ラムを実行することが容易に可能となる。
Therefore, even if only one program is running, the rate at which the processing device is processing the program is ΣT1
/(Σ1゛1+ΣT2), and by changing the number of loops of the interrupt processing program, it becomes possible to easily adjust the execution time T2 of the interrupt processing program and execute the program with an arbitrary value of load.

尚、以上の各実施例でトレース割込み例を使用したが、
その種類の割込みにより、実行時間を実質的に遅らせて
もよい。
Although trace interrupt examples were used in each of the above embodiments,
That type of interrupt may substantially delay execution time.

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

本発明によれば、特定プログラム又は特定プログラムの
特定処理の動作時間を任意の値まで遅くし、プログラム
毎の実行速度に差をつけることにより、複数プログラム
で共有されている資源に対し競合が発生する確率を高く
することができる。
According to the present invention, by slowing down the operation time of a specific program or specific processing of a specific program to an arbitrary value and making a difference in execution speed for each program, contention for resources shared by multiple programs occurs. The probability of doing so can be increased.

したがって、従来困難であったリソースの競合テストを
容易に実施することができる。
Therefore, a resource competition test, which has been difficult in the past, can be easily performed.

また、プログラム全体の命令の実行速度を遅くすること
により、少ないプログラムを実行することで処理装置に
多くの負荷が加わった状態にすることができる。
Furthermore, by slowing down the execution speed of the instructions of the entire program, it is possible to place a large load on the processing device by executing fewer programs.

したがって少ないプログラムを実行することで、容易に
負荷テストを実施することができる。
Therefore, load tests can be easily performed by executing a small number of programs.

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

第1−図は本発明の原理図、第2図は共用データ更新の
フローチャート、第3図は割込み処理の概要を示すフロ
ーチャート、第4図は割込み処理プログラムのフローチ
ャート、第5図は本発明をリソースの競合テストに用い
たときのタイムチャート、第6図は本発明を負荷テスト
に用いたときのタイムチャー1・、第7図は本発明の計
算機システム図である。 1・・・タスクの命令の並び、2・・・処理装置の実行
順序、3・・割込み発生開始命令、4・・・タスクの命
令、5・・・割込み処理プログラム。
Fig. 1 is a diagram of the principle of the present invention, Fig. 2 is a flowchart for updating shared data, Fig. 3 is a flowchart showing an overview of interrupt processing, Fig. 4 is a flowchart of an interrupt processing program, and Fig. 5 is a flowchart of the present invention. FIG. 6 is a time chart when the present invention is used for a load test. FIG. 7 is a diagram of a computer system according to the present invention. 1... Arrangement of task instructions, 2... Execution order of processing device, 3... Interrupt generation start instruction, 4... Task instructions, 5... Interrupt processing program.

Claims (1)

【特許請求の範囲】 1、プログラムの命令の実行速度を見かけ上遅くする操
作を行うプログラムのテスト方法において、上記操作は
、プログラムの1命令の実行毎に割込みを発生させ、1
命令毎の実行時間に時間遅延用の割込み処理プログラム
の実行時間を付加することを特徴とするプログラムのテ
スト方法。 2、プログラムの命令の実行速度を見かけ上遅くする操
作を行うプログラムのテスト方法において、上記操作は
、ハード命令をソフトウェアでシミュレーションし、1
命令毎の実行時間にシミュレーションすることによりオ
ーバヘッド時間を付加することを特徴とするプログラム
のテスト方法。 3、請求項1のテスト方法において、割込み処理プログ
ラムの処理時間を可変にすることで、1命令毎の実行時
間を可変にすることを特徴とするプログラムのテスト方
法。 4、上記請求項1〜3のいずれかのテスト方法において
、命令の実行速度を遅くする範囲を指定して、その範囲
の命令を遅く実行することを特徴とするプログラムのテ
スト方法。 5、上記請求項1〜4のいずれかのテスト方法において
、テストを行ったことにより発生した事象の監視を、命
令実行遅延過程の中に有することを特徴とするプログラ
ムのテスト方法。 6、複数のプログラムが並行して実行可能なマルチプロ
グラムシステムにおいて、請求項1〜5のいずれかのテ
スト方法によりテストを行うことを特徴とするプログラ
ムのテスト方法。 7、請求項6のテスト方法において、複数の動作中のプ
ログラムの命令実行遅延により、プログラムが共有する
ハードウェア資源の使用時間を長くすることを特徴とす
るプログラムのテスト方法。 8、請求項7のテスト方法において、排他制御が必要な
、プログラム間で共有する資源を、複数のプログラムが
操作時に、一部のプログラムの共有する資源を操作する
処理部分を命令実行遅延することで、各プログラム毎の
実行速度に差を付け、共有する資源の競合の発生確率を
高くすることを特徴とするプログラムのテスト方法。
[Claims] 1. In a program testing method that performs an operation to apparently slow down the execution speed of program instructions, the above operation generates an interrupt every time one instruction of the program is executed;
A method for testing a program, characterized in that the execution time of an interrupt processing program for time delay is added to the execution time of each instruction. 2. In a program testing method that performs an operation that apparently slows down the execution speed of program instructions, the above operation is performed by simulating hard instructions with software;
A program testing method characterized by adding overhead time by simulating the execution time of each instruction. 3. A program testing method according to claim 1, characterized in that the execution time of each instruction is made variable by making the processing time of the interrupt processing program variable. 4. A program testing method according to any one of claims 1 to 3, characterized in that a range in which the execution speed of instructions is to be slowed is specified, and instructions within that range are executed slowly. 5. A program testing method according to any one of claims 1 to 4, characterized in that an event occurring as a result of the test is monitored during the instruction execution delay process. 6. A program testing method, characterized in that a test is performed using the testing method according to any one of claims 1 to 5 in a multi-program system in which a plurality of programs can be executed in parallel. 7. The method for testing a program according to claim 6, characterized in that the usage time of hardware resources shared by the programs is lengthened by delaying instruction execution of a plurality of running programs. 8. In the test method according to claim 7, when a plurality of programs operate resources shared among programs that require exclusive control, instruction execution of a processing portion that operates the resources shared by some programs is delayed. A program testing method characterized by making a difference in the execution speed of each program and increasing the probability of occurrence of contention for shared resources.
JP1297706A 1989-11-17 1989-11-17 How to test the program Expired - Lifetime JP2866410B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1297706A JP2866410B2 (en) 1989-11-17 1989-11-17 How to test the program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1297706A JP2866410B2 (en) 1989-11-17 1989-11-17 How to test the program

Publications (2)

Publication Number Publication Date
JPH03158936A true JPH03158936A (en) 1991-07-08
JP2866410B2 JP2866410B2 (en) 1999-03-08

Family

ID=17850111

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1297706A Expired - Lifetime JP2866410B2 (en) 1989-11-17 1989-11-17 How to test the program

Country Status (1)

Country Link
JP (1) JP2866410B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013057769A1 (en) * 2011-10-20 2013-04-25 富士通株式会社 Information processing device, control method for information processing device and control program
JPWO2013057769A1 (en) * 2011-10-20 2015-04-02 富士通株式会社 Information processing apparatus, control method for information processing apparatus, and control program
US9760421B2 (en) 2015-03-18 2017-09-12 Fujitsu Limited Information processing device, method, and computer readable medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013057769A1 (en) * 2011-10-20 2013-04-25 富士通株式会社 Information processing device, control method for information processing device and control program
JPWO2013057769A1 (en) * 2011-10-20 2015-04-02 富士通株式会社 Information processing apparatus, control method for information processing apparatus, and control program
US9760421B2 (en) 2015-03-18 2017-09-12 Fujitsu Limited Information processing device, method, and computer readable medium

Also Published As

Publication number Publication date
JP2866410B2 (en) 1999-03-08

Similar Documents

Publication Publication Date Title
JP5102634B2 (en) How to count instructions for logging and playing deterministic event sequences
JP2765411B2 (en) Virtual computer system
US20090144742A1 (en) Method, system and computer program to optimize deterministic event record and replay
KR930000592B1 (en) Task searching apparatus
US8327336B2 (en) Enhanced thread stepping
KR100976280B1 (en) Multi processor and multi thread safe message queue with hardware assistance
JP5505914B2 (en) Method for optimizing logging and playback of multitasking applications in a single processor or multiprocessor computer system
US20130297282A1 (en) Dynamically Adjusting Speed Versus Accuracy of Computer Platform Simulation
US8843910B1 (en) Identifying a set of functionally distinct reorderings in a multithreaded program
JP2008529114A5 (en)
KR20170121219A (en) Apparatus and method for generating trace data in response to transaction execution
US6295602B1 (en) Event-driven serialization of access to shared resources
JP2008513899A (en) Method for processing a computer program on a computer system
US6684346B2 (en) Method and apparatus for machine check abort handling in a multiprocessing system
US7748003B2 (en) Hard real-time response
JPH03158936A (en) Testing method for program
JPH02294739A (en) Fault detecting system
WO2021037124A1 (en) Task processing method and task processing device
US9563494B2 (en) Systems and methods for managing task watchdog status register entries
US8732721B2 (en) Method for reducing trap overhead when executing a guest in a virtual machine
CN111143127A (en) Method, device, storage medium and equipment for supervising network equipment
Zuepke et al. Fast user space priority switching
US11681527B2 (en) Electronic device and multiplexing method of spatial
CN108196963B (en) Deterministic replay method based on adaptive release
Huang et al. A denotational model for interrupt-driven programs