JPS63269239A - Processor load measuring system - Google Patents

Processor load measuring system

Info

Publication number
JPS63269239A
JPS63269239A JP62105031A JP10503187A JPS63269239A JP S63269239 A JPS63269239 A JP S63269239A JP 62105031 A JP62105031 A JP 62105031A JP 10503187 A JP10503187 A JP 10503187A JP S63269239 A JPS63269239 A JP S63269239A
Authority
JP
Japan
Prior art keywords
task
time
counter
cpu
task number
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
JP62105031A
Other languages
Japanese (ja)
Inventor
Akira Sugimura
杉村 章
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP62105031A priority Critical patent/JPS63269239A/en
Publication of JPS63269239A publication Critical patent/JPS63269239A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To reduce the load on a CPU and to improve the measurement precision by providing a counter which measures the time, when the CPU is used, of a fixed time and a counter which measures the time when the CPU is used by a specific task. CONSTITUTION:A system program writes the task number of a task to a task number storage register 6 at the time of starting this task, and a comparator 8 compares the contents of a task number setter 7 and the task number storage register 6 with each other, and a counter 9 is started to measure the execution time of this task if they coincide with each other. A comparator 10 compares the contents of the task number storage register 6 with 0, and a counter 11 is started if it is not 0. After the measuring time elapses, a CPU (central processing unit) 1 reads out counted values of counters 9 and 11 by the interruption of a timer 2 to calculate the used rate of the CPU 1 in the fixed time and the used rate of the CPU 1 for the measured task which is the time when the CPU 1 is used by the specific task.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、計算機等において実行中のプログラムのC
PUの使用時間の測定、及びCPUの負荷測定に関する
ものである。
[Detailed Description of the Invention] [Field of Industrial Application] This invention provides C
This relates to measuring the usage time of the PU and measuring the load on the CPU.

〔従来の技術〕[Conventional technology]

第4図は従来のプロセッサの負荷測定方式の構成を示す
ブロック図である。図において、1はCP(J(中央処
理装置)、2は一定時間ごとlこ割込みを発生するタイ
マ(TIMIiFL)、3はプログラムを格納するEL
OM(読出し専用メモリ)、4はデータ等を収容するa
AM(ランダムアクセスメモリ)である。
FIG. 4 is a block diagram showing the configuration of a conventional processor load measurement method. In the figure, 1 is the CP (Central Processing Unit), 2 is the timer (TIMIiFL) that generates an interrupt at regular intervals, and 3 is the EL that stores the program.
OM (read-only memory), 4 is a for storing data etc.
It is AM (Random Access Memory).

第5図は第4図のプロセッサの負荷測定方式の動作を説
明するためのフローチャートである。
FIG. 5 is a flowchart for explaining the operation of the processor load measuring method shown in FIG.

次に、上記第4図に示す従来のプロセッサの負荷測定方
式の動作について説明する。タイマ2より一定時間ごと
にCPoljこ対し割込みを発生させる。すると、CP
U 1はROM3の割込み処理プログラムの先頭に処理
を移す。第5図に示すフローチャートに従う処理動作に
おいて、タイマ2により一定時間ごとにCPUIに割込
みを発生させると、最初に時間カウント用変数iに1を
加算する。次に、現在タスクが動作していれば、全タス
クの実行時間カウント用変数jに1を加算し、もし現在
タスクが動作していなければ5次の処理ステップに進む
、また、時間カウント用変数iが設定値を越えていれば
、次の処理ステ、ブに進んで処理を行い、もし時間カウ
ント用変数iが設定値を越えていなければこのルーチン
を抜けてシステムプログラムに制御が移る。
Next, the operation of the conventional processor load measurement method shown in FIG. 4 will be described. Timer 2 generates an interrupt for CPolj at fixed time intervals. Then, C.P.
U1 moves the processing to the beginning of the interrupt processing program in ROM3. In the processing operation according to the flowchart shown in FIG. 5, when the timer 2 generates an interrupt to the CPUI at regular intervals, 1 is first added to the time count variable i. Next, if the task is currently running, add 1 to the execution time count variable j of all tasks, and if the task is not currently running, proceed to the 5th processing step. If i exceeds the set value, the process proceeds to the next processing step, and if the time count variable i does not exceed the set value, this routine is exited and control is transferred to the system program.

以上のような動作を一定時間ごとに繰り返して行う。そ
して1時間カウント用変数iが設定値を越えることlこ
より一定時間の経過を知り、一定時間の経過後に、全タ
スクの実行時間カウント用変数jであるタスクの動作回
数を時間カウント用変数iである経過時間カウント数で
割ることにより。
The above operations are repeated at regular intervals. Then, we know that a certain amount of time has passed since the one-hour count variable i exceeds the set value, and after the certain period of time has elapsed, we use the time count variable i to calculate the number of task operations, which is the execution time count variable j for all tasks. By dividing by some elapsed time count number.

その時間内でのCPtJlの負荷率を計算し、その後、
時間カウント用変数iと全タスクの実行時間カウント用
変数jを共に0にして初期化を行う。
Calculate the load factor of CPtJl within that time, and then
Initialization is performed by setting both the time count variable i and the execution time count variable j of all tasks to 0.

〔発鳴が解決しようとする問題点〕[Problems that pronunciation attempts to solve]

上記従来のプロセッサの負荷測定方式は以上のように構
成されているので、一定時間のサンプリングによってタ
スクの動作回数を測定しているために正確な負荷測定が
困難であるという問題点があった。また、測定精度を上
げるためにはサンプリングの周期を早くする必要があり
、このようにサンプリングの周期を早くするとCPU 
1の負荷が増加するという問題点があった。
Since the conventional processor load measurement method described above is configured as described above, there is a problem in that it is difficult to accurately measure the load because the number of task operations is measured by sampling over a fixed period of time. In addition, in order to improve measurement accuracy, it is necessary to make the sampling period faster, and if the sampling period is made faster in this way, the CPU
There was a problem that the load on 1 increased.

この発明は、かかる問題点を解決するためになされたも
ので、測定精度の向上と負荷測定のためのプロセ、すの
負荷を低減し、及び各タスクごとの使用率の測定を可能
とするプロセッサの負荷測定方式を得ることを目的とす
る。
The present invention was made to solve these problems, and it provides a processor that improves measurement accuracy, reduces the load on a process for measuring load, and makes it possible to measure the usage rate of each task. The purpose is to obtain a load measurement method for

〔問題点を解決するための手段〕[Means for solving problems]

この発明に係るプロセッサの負荷測定方式は。 A processor load measurement method according to the present invention is as follows.

実行中のタスク番号を記憶するタスク番号記憶レジスタ
と、タスク番号を判定して第1のカウンタ及び第2のカ
ウンタを起動する装置を設け、上記第1のカウンタは一
定時間のCPLIの使用時間を測定するカウンタとして
、タスク番号のO以外の時に起動されるカウンタであり
、また、上記第2のカウンタは特定のタスクによるCP
Uの使用時間を測定するカウンタとして、設定されたタ
スク番号と一致する番号をシステムプログラムが書き込
んだ時に起動されるカウンタであるように構成したもの
である。
A task number storage register for storing the number of the task being executed, and a device for determining the task number and starting a first counter and a second counter are provided, and the first counter measures the usage time of the CPLI for a certain period of time. The counter to be measured is a counter that is activated when the task number is other than O, and the second counter is a counter that is activated when the task number is other than O.
The counter for measuring the usage time of U is configured to be activated when the system program writes a number that matches the set task number.

〔作用〕[Effect]

この発明のプロセッサの負荷測定方式においては、2個
のカウンタが設けられ、そのうち第1のカウンタは一定
時間のCPUの使用時間を測定するカウンタとして使用
し、第2のカウンタは特定のタスクによるCPUの使用
時間を測定するカウンタとして使用する。システムプロ
グラムにヨQタスク起動時に、起動タスクの情報を出力
させてタスク番号の判定を行いカウンタを起動する。タ
スク終了時には、システムプログラムよりタスク番号の
0を出力することによってハードウェア的番こ負荷測定
を行う。
In the processor load measurement method of the present invention, two counters are provided, the first of which is used as a counter to measure the CPU usage time for a certain period of time, and the second counter is used to measure the CPU usage time by a specific task. Use as a counter to measure usage time. When the system program starts the YoQ task, it outputs the information of the starting task, determines the task number, and starts the counter. When the task is completed, the system program outputs the task number 0 to measure the hardware load.

〔実施例〕〔Example〕

第1図はこの発明の一実施例であるプロセッサの負荷測
定方式の構成を示すブロック図である。
FIG. 1 is a block diagram showing the configuration of a processor load measuring method according to an embodiment of the present invention.

図において、各符号1〜4は第4図に示す従来方式と同
一のものである。また、5はカウンタのリセット回路で
あり、測定を開始する前にCPU1の指令により後述す
るカウンタ9とカウンタ11にリセット信号を送る機能
を行う。6はタスク番号を記録するタスク番号記憶レジ
スタであり、システムプログラムが出力する現在起動中
のタスク番号を保持する機能を持つ。7は測定するタス
ク番号をリップスイッチ(図示しない)で設定するタス
ク番号設定器、8は測定すべきタスク番号と現在実行中
のタスクを比較し、両者が一致していれば出力する比較
器、9は測定中のタスクの実行時間を測定するカウンタ
であり、比較58の出力で起動され、測定対象のタスク
のみの実行時間をカウントする。IOは待状態とタスク
の実行を判定する比較器であり、全タスクの実行時間を
カウントt 6 f、−めに、システムプログラムが出
力するタスク番号のO以外の時に起動信号を出力する。
In the figure, each reference numeral 1 to 4 is the same as the conventional system shown in FIG. Further, 5 is a counter reset circuit, which performs a function of sending a reset signal to a counter 9 and a counter 11, which will be described later, in response to a command from the CPU 1 before starting measurement. A task number storage register 6 records the task number, and has the function of holding the currently activated task number output by the system program. 7 is a task number setting device that sets the task number to be measured using a lip switch (not shown); 8 is a comparator that compares the task number to be measured with the currently executing task and outputs an output if the two match; A counter 9 measures the execution time of the task being measured, which is activated by the output of the comparison 58 and counts the execution time only of the task being measured. IO is a comparator that determines the waiting state and execution of a task, and outputs a start signal when the task number output by the system program is other than O when the execution time of all tasks is counted t 6 f,-.

11は全タスクの実行時間をカウントするカウンタであ
り、比較器10の出力で起動され、全タスクの実行時間
を測定する。12は各カウンタ9,11に供給する基準
クロックを発生するクロック発生器である。
A counter 11 counts the execution time of all tasks, and is activated by the output of the comparator 10 to measure the execution time of all tasks. A clock generator 12 generates a reference clock to be supplied to each counter 9,11.

第2図及び第3図は第1図のプロセッサの負荷測定方式
の動作を説明するためのフローチャート、及び各部の動
作のタイミングを示す図である。
FIGS. 2 and 3 are flowcharts for explaining the operation of the processor load measurement method shown in FIG. 1, and diagrams showing the timing of the operations of each part.

欠番こ、上記第1図に示すこの発明の一実施例であるプ
ロセッサの負荷測定方式の動作について説明する。シス
テムプログラムで測定を開始する前に、CPUIの指令
によりリセット回路5は各カウンタ9.11にリセット
信号を送る。各カウンタ9.11はリセット信号によっ
て0に初期化される。
The operation of the processor load measuring method shown in FIG. 1, which is an embodiment of the present invention, will be described below. Before starting measurement with the system program, the reset circuit 5 sends a reset signal to each counter 9.11 according to a command from the CPUI. Each counter 9.11 is initialized to 0 by a reset signal.

次に、タイマ2にシステムプログラムより測定時間を設
定する。次に、システムプログラムがタスク起動時に、
起動タスク番号をタスク番号記憶レジスタ6に書き込む
。比較器8は測定すべきタスク番号と現在笑行中のタス
クを比較すべく、タスク番号設定器7とタスク番号記憶
レジスタ6の内容を比較し1両者が一致していれば出力
してカウンタ9を起動する。カウンタ9は測定中のタス
クの実行時間を測定する。比較610はタスク番号記憶
レジスタ6とOを比較し%θ以上であれば、すなわちシ
ステムプログラムが出力するタスク番号の0以外の時に
起動信号を出力してカウンタ11を起動する。システム
プログラムはタスクのスイッチングのつどタスク番号記
憶レジスタ6にタスク番号を齋き込み、また、システム
プログラムは起動タスクがない時はタスク番号記憶レジ
スタ6に0を書き込むものとする。測定時間の経過後に
、タイマ2よりの割り込みによりCPU 1は各カウン
タ9,11のカウント数を読み出し、一定時間内のCP
U 1の使用率と特定のタスクによるCP(Jlの使用
時間である測定タスクのCP[Jlの使用率をそれぞれ
計算する。
Next, a measurement time is set in timer 2 using the system program. Next, when the system program starts the task,
Write the activation task number to the task number storage register 6. A comparator 8 compares the contents of the task number setter 7 and the task number storage register 6 in order to compare the task number to be measured with the task currently in progress. If the two match, the comparator 8 outputs an output and sends an output to the counter 9. Start. A counter 9 measures the execution time of the task being measured. A comparison 610 compares the task number storage register 6 and O, and if it is greater than or equal to %θ, that is, when the task number output by the system program is other than 0, an activation signal is output and the counter 11 is activated. It is assumed that the system program writes a task number into the task number storage register 6 each time a task is switched, and also writes 0 to the task number storage register 6 when there is no activated task. After the measurement time has elapsed, CPU 1 reads the count numbers of each counter 9 and 11 by an interrupt from timer 2, and calculates the CPU count within a certain period of time.
Calculate the usage rate of U 1 and the usage rate of CP [Jl of the measurement task, which is the usage time of CP (Jl) by a specific task, respectively.

なお、上記災施例では、タスク番号設定器7を外部に設
定した場合を示したが、タスク番号設定器7を外部に設
定せずにCPU 1よりイき込むようにしても良い。
In the above embodiment, the task number setting device 7 is set externally, but the task number setting device 7 may not be set externally but may be input from the CPU 1.

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

この発明は以上説明したとおり、プロセッサの負荷測定
方式において、実行中のタスク番号を記憶するタスク番
号記憶レジスタと、タスク番号を判定して、一定時間の
CP[Jの使用時間を測定する第1のカウンタ、及び特
定のタスクによるCPUの使用時間を測定する第2のカ
ウンタを起動する装置を設けた構成としたので、この種
の従来例におけるように一定時間のサンプリングによっ
てタスクの動作回数を測定しているものに比べて。
As explained above, in the processor load measurement method, the present invention includes a task number storage register that stores the number of the task being executed, and a first register that determines the task number and measures the usage time of CP[J for a certain period of time. Since the configuration includes a device that starts a counter and a second counter that measures the CPU usage time for a specific task, it is not possible to measure the number of task operations by sampling over a fixed period of time, as in conventional examples of this type. Compared to what you are doing.

一定時間ごとの割込みも発生しないのでCP Uの負荷
を軽減でき、また、クロックの周波数をソフトウェアの
サンプリングの周期よりも高くできるので測定精度の向
上を図ることができるという優れた効果を奏するもので
ある。
It has the excellent effect of reducing the load on the CPU because no interrupts occur at regular intervals, and improving measurement accuracy because the clock frequency can be made higher than the software sampling period. be.

【図面の簡単な説明】 第1図はこの発明の一実施例であるプロセッサの負荷測
定方式の構成を示すプロ、り図、第2図及び第3図は第
1図のプロセッサの負荷f11定方式の動作を説明する
ためのフローチャート、及び各部の動作のタイミングを
示す図、$4図は従来のプロセ、すの負荷測定方式の構
成を示すブロック図、第5図は第4図のプロセッサの負
荷測定方式の動作を説明するためのフローチャートであ
る。 図において、1・・・CPLI (中央処理装り、 2
・・、タイマ(TIMER)、3・・・R,OM(読出
し専用メモリ)、4.、、RAM(ランダムアクセスメ
モリ)% 5・・・リセット回路% 6・・・タスク番
号記憶レジスタ、7・・・タスク番号設定6.s、to
・・・比較器、9.11・・・カウンタ、12・・・ク
ロック発生器である。 なお、各図中、同一符号は同一、又は相当部分を示す。
[BRIEF DESCRIPTION OF THE DRAWINGS] FIG. 1 is a schematic diagram showing the configuration of a processor load measurement method according to an embodiment of the present invention, and FIGS. 2 and 3 show the processor load f11 determination shown in FIG. A flowchart for explaining the operation of the system and a diagram showing the timing of the operation of each part, Figure 4 is a block diagram showing the configuration of the conventional process load measurement system, and Figure 5 is a diagram showing the configuration of the conventional process load measurement system. It is a flowchart for explaining the operation of the load measurement method. In the figure, 1...CPLI (central processing unit), 2
..., timer (TIMER), 3...R, OM (read-only memory), 4. ,,RAM (random access memory)% 5... Reset circuit% 6... Task number storage register, 7... Task number setting 6. s, to
. . . Comparator, 9.11 . . . Counter, 12 . . . Clock generator. In each figure, the same reference numerals indicate the same or equivalent parts.

Claims (1)

【特許請求の範囲】[Claims] 実行中のタスク番号を記憶するタスク番号記憶レジスタ
と、タスク番号を判定してカウンタを起動する装置を設
けると共に、システムプログラムによりタスク起動時に
、実行中のタスク番号を上記タスク番号記憶レジスタに
書込む機能を行う装置を備えたことを特徴とするプロセ
ッサの負荷測定方式。
A task number storage register that stores the number of the task being executed and a device that determines the task number and starts a counter are provided, and the system program writes the number of the task being executed to the task number storage register when the task is started. A processor load measuring method characterized by comprising a device for performing the function.
JP62105031A 1987-04-28 1987-04-28 Processor load measuring system Pending JPS63269239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62105031A JPS63269239A (en) 1987-04-28 1987-04-28 Processor load measuring system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62105031A JPS63269239A (en) 1987-04-28 1987-04-28 Processor load measuring system

Publications (1)

Publication Number Publication Date
JPS63269239A true JPS63269239A (en) 1988-11-07

Family

ID=14396650

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62105031A Pending JPS63269239A (en) 1987-04-28 1987-04-28 Processor load measuring system

Country Status (1)

Country Link
JP (1) JPS63269239A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6795797B2 (en) * 2001-09-06 2004-09-21 Lg Electronics Inc. Method and apparatus for measuring CPU task occupancy rate in a real-time system
KR100469406B1 (en) * 2000-12-18 2005-01-31 엘지전자 주식회사 Performance testing method using task of cpu
JP2008305238A (en) * 2007-06-08 2008-12-18 Denso Corp Measuring instrument

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100469406B1 (en) * 2000-12-18 2005-01-31 엘지전자 주식회사 Performance testing method using task of cpu
US6795797B2 (en) * 2001-09-06 2004-09-21 Lg Electronics Inc. Method and apparatus for measuring CPU task occupancy rate in a real-time system
JP2008305238A (en) * 2007-06-08 2008-12-18 Denso Corp Measuring instrument

Similar Documents

Publication Publication Date Title
US6480966B1 (en) Performance monitor synchronization in a multiprocessor system
JPS63269239A (en) Processor load measuring system
US5467463A (en) System independent timing reference for computer
JPH1011333A (en) Measuring instrument for cpu use rate by task
JP2737645B2 (en) Program debug device
JP2557785Y2 (en) Single chip microcomputer
JPS6128144A (en) Executing device of tracing
JPS63816B2 (en)
JP2005100017A (en) Processor simulator, interruption delay count program and simulation method of processor
JPH0251749A (en) Circuit for measuring processor application rate
JPS6263346A (en) Method for measuring idle time of processor
JPH0229457Y2 (en)
JPH0418619A (en) Information processor
JPH0357970A (en) Pulse input apparatus
JPH076062A (en) Method for measuring operation rate of cpu
JPH04255047A (en) Method for measuring data transfer rate of channel processor
JP3334613B2 (en) Speed control method, speed control device, and microprogram control device
JPS60138661A (en) Processor control system
JPH07260845A (en) Pulse period measuring circuit
JPH05177567A (en) Robot control device
JPH0296848A (en) Method for measuring execution time of instruction
JPH0485610A (en) Cyclic timer controller
JPH0462093B2 (en)
JPS6211748B2 (en)
JPH0451332A (en) Process/task execution time counting circuit