JP3506919B2 - Timer control method when tracing all instructions - Google Patents

Timer control method when tracing all instructions

Info

Publication number
JP3506919B2
JP3506919B2 JP23925398A JP23925398A JP3506919B2 JP 3506919 B2 JP3506919 B2 JP 3506919B2 JP 23925398 A JP23925398 A JP 23925398A JP 23925398 A JP23925398 A JP 23925398A JP 3506919 B2 JP3506919 B2 JP 3506919B2
Authority
JP
Japan
Prior art keywords
timer
interrupt
instruction
instructions
tracing
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 - Lifetime
Application number
JP23925398A
Other languages
Japanese (ja)
Other versions
JP2000066921A (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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP23925398A priority Critical patent/JP3506919B2/en
Publication of JP2000066921A publication Critical patent/JP2000066921A/en
Application granted granted Critical
Publication of JP3506919B2 publication Critical patent/JP3506919B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 【0001】 【発明の属する技術分野】本発明は、電子計算機、ワー
ドプロセッサ、電子交換機、ワークステーション等の情
報処理装置内の中央演算ユニット(以下、CPUと略称
する)が行う全命令トレース時のタイマー制御方法に関
する。 【0002】 【従来の技術】一般に、性能評価等の目的のため、評価
対象のオペレーティングシステムのプログラム(該オペ
レーティングシステム上で動作するすべてのアプリケー
ションプログラムを含み、全命令トレースを行うための
プログラムを除く、以下省略)の命令群の内、CPUが
実行するすべての命令に関する情報(実行された命令の
内容、命令の長さ、レジスタの変化状況、変化したレジ
スタの内容、その他必要に応じてプログラムの管理単位
であるスレッドの情報等の情報)を1命令の実行直前毎
に収集することを、全命令トレースと言い、その全命令
トレースによって収集された情報を全命令トレースデー
タと言う。上記のプログラムは、関数(プログラムから
コールされ、入り口が1つであるプログラム)並びに割
り込み処理プログラム(割り込み等を契機としてコール
されるプログラムであり、通常はプログラムからはコー
ルされないプログラム)からなり、全命令トレースにお
いてはそれらのすべてがトレース対象である(関数のみ
のトレースしか行わないものは、全命令トレースとは言
わない)。 【0003】シングルステップ割り込み機能を持つCP
Uの元での全命令トレースにおいては、関数に関しては
予めCPUのトレースフラグをONとしておき、割り込
み処理に関しては、その先頭でCPUのトレースフラグ
をONとする等によって、CPUに1命令の実行直前毎
にシングルステップ割り込みを起こさせることが一般的
に行われている。 【0004】CPUが評価対象のオペレーティングシス
テムの1命令を実行する直前毎に、CPU自身に起こさ
せるシングルステップ割り込みを利用して、CPUは全
命令トレース用シングルステップ割り込み処理プログラ
ムに制御を渡し、そのプログラムが全命令トレースデー
タを収集し、一旦全命令トレースデータバッファという
メモリ上のエリアに格納して、上記割り込み元にリター
ンし、リターン後にCPUは、割り込まれた命令を1命
令実行し、その実行が終わって、次の1命令を実行する
直前に、上記と同様にシングルステップ割り込みを起こ
させることにより、評価対象のオペレーティングシステ
ムのプログラムの命令群の内、実行されるすべての命令
の全命令トレースが行われる。その際に全命令トレース
データバッファは限定された固定の大きさを有するが、
全命令トレースデータの全量は、評価対象のオペレーテ
ィングシステムの動作ロジックに依存し、数10メガバ
イト〜数Gバイトに達するのが普通であるので、該バッ
ファ上のデータを適宜上記全命令トレース割り込み処理
プログラムが2次記憶装置へ格納することにより、バッ
ファがオーバフローしないようにする。その2次記憶装
置は、一般に高速性が要求されるため、磁気テープ装
置、またはハードディスク装置である。 【0005】一方、オペレーティングシステムは、オペ
レーティングシステム上で動作するプログラムのため
に、タイマー制御機能を提供する。そのタイマー制御機
能はハードウェアのタイマー(例えば、INTEL 82378 の
中にあるシステムタイマー)を利用する。具体的には、
上記タイマーは、定期的に割り込みをCPUに上げ、そ
の割り込み処理プログラムは、その割り込みを契機とし
て、タイマー処理ルーチンをコールし、そのルーチンの
中で、オペレーティングシステム内にあるソフトウェア
タイマーの値を更新し、その更新結果に基づき、各種の
タイマー関連処理を行う。 【0006】ところが、上記の全命令トレースを実施す
ると、オペレーティングシステムの1命令を実行する毎
に全トレースデータを収集し、且つ適宜収集した全命令
トレースデータを2次記憶装置へ出力しなければならな
いとともに、且つ、それらの間は割り込み禁止である。
そのために、全命令トレースを実施している間は、オペ
レーティングシステムは、全命令トレースが実施されて
いない場合に較べて、凡そ5000分の1の速度で動作
する結果となる。 【0007】その結果、何も対処しないと、オペレーテ
ィングシステムから見た場合、タイマーが相対的に50
00倍分高速に動作しているように見え、結果的に、全
命令トレースデータは、殆どタイマー処理のトレースデ
ータで占められてしまうことになり、目的の全命令トレ
ースデータが得られない。 【0008】その対策として、システムタイマーの定期
的な割り込み間隔を、5000倍にできればよいが、通
常システムタイマーの定期的な割り込み間隔は、10ms
ec程度であり、且つ、タイマーの仕様は、その値の50
00倍に設定することを許容していない。例えば、現在
もっとも使用されているタイマーは、INTEL 82378 の中
にあるシステムタイマーであるが、これは、設定できる
間隔の最大値は54.924msecである。 【0009】従って従来の技術においては、それらの問
題を回避するために以下の方法をとっていた。 【0010】(1)タイマー割り込み処理プログラム、
およびその延長で動作する(該割り込み処理プログラム
からコールされて動作する)プログラムは、全命令トレ
ースの対象としない(全命令トレースデータを収集しな
い)。具体的には、割り込みが発生した場合、CPU
は、CPUのトレースフラグをOFFにして、割り込み
処理プログラムに制御を渡し、タイマー割り込み以外の
割り込み処理プログラムは、その先頭で、[全命令トレ
ース中(外部変数)がONの場合]CPUのトレースフ
ラグをONに設定することによって、全トレースを継続
させるが、タイマー割り込み処理プログラムでは、その
先頭でCPUのトレースフラグをONにしないことによ
り、その割り込み処理プログラム、並びに、その延長で
走行するルーチンの全命令トレースデータを収集しな
い。 【0011】(2)オペレーティングシステム内でタイ
マー機能を使用する全プログラムにおいては、そのタイ
マー機能の使用を停止するか、そのタイマー機能に要求
する値を5000倍となるように変更する。 【0012】以上の方法は、従来においては、そのシス
テムにおいて、タイマーが、システムの負荷が低い場合
およびシステムの異常処理の場合にのみ使用されていた
ので(全命令トレースは性能評価を目的として行い、性
能評価においては、高負荷時の正常処理の評価が中心で
あるが故に)理にかなった方法であり、何ら問題はなか
った。 【0013】 【発明が解決しようとする課題】しかしながら、最近に
おいては、種々のオペレーティングシステムで、タイマ
ーを高負荷時の正常処理に使用するシステムが出現して
いる。そのようなシステムの性能評価においては、タイ
マー処理自体の全命令トレースデータを含めた全トレー
スデータの取得が不可欠であり、従来の方法では、それ
らを実現することができないという問題がある。 【0014】本発明は、上記に鑑みてなされたもので、
その目的とするところは、オペレーティングシステムの
タイマー処理機能が外部変数「タイマー走行頻度」で指
定した頻度で走行することを可能とし、その頻度のタイ
マー割り込み処理の実施を含めた全トレースデータを収
集可能とする全命令トレース時のタイマー制御方法を提
供することにある。 【0015】 【課題を解決するための手段】上記目的を達成するた
め、請求項1記載の本発明は、情報処理装置内の中央演
算ユニットが全命令トレースを行い、このトレース対象
のオペレーティングシステムが、定期的に割り込みを起
こすタイマーを使用し、該タイマーに対するオペレーテ
ィングシステムの処理も全命令トレースの対象である場
合に、この定期的な割り込みの際に、タイマー割り込み
処理が外部変数であるタイマーカウンタに1を加算し、
この割り込みに対して割り込み処理の完了をタイマーに
通知するが、実際のタイマー処理ルーチンのコール、タ
イマー割り込みに対する全命令トレースの実施、および
該カウンタの0クリアを該カウンタの値が外部変数であ
るタイマー走行頻度の値に達している時にのみ行い、該
タイマーの割り込みが、割り込み禁止状態での割り込み
発生を表す割り込み保留状態の場合は、全命令トレース
データをバッファのみに格納し、全命令トレース用の2
次記憶装置への出力を抑止することを要旨とする。 【0016】請求項1記載の本発明にあっては、オペレ
ーティングシステムのタイマー処理機能が外部変数「タ
イマー走行頻度」の値分の1の頻度で走行することを可
能とし、その頻度のタイマー割り込み処理の実施を含め
た全トレースデータを収集することを可能とする。 【0017】 【発明の実施の形態】本発明の実施形態を説明する前
に、まず本発明の全命令トレース時のタイマー制御方法
の概要について説明する。 【0018】(1)全命令トレース用の外部変数として
タイマー走行頻度という変数を設け、そこに、必要な頻
度(実施形態では5000;5000分の1の確率を表
す)を予め設定しておく(その設定手段は定めない;外
部定数として持っておいてもよいし、新たなコマンドを
設けて、その内部で、該変数に設定してもよい)。 【0019】(2)全命令トレース用の外部変数とし
て、タイマーカウンタという変数を設け、予め0に設定
して置く(その設定手段は定めない)。 【0020】(3)タイマー割り込みが発生した時に制
御が渡されるタイマー割り込み処理プログラムの先頭
で、上記タイマーカウンタに1を加算し、その結果が上
記タイマー走行頻度以上であるかどうかをチェックし、
(A) チェック結果がNOであれば、タイマーに対してE
OI(割り込み終了)を送出する入出力命令を発行した
後、IRET命令を発行することにより、該割り込み処
理を終了する(割り込み元に戻る。この場合タイマー処
理ルーチンはコールされないし、タイマー割り込みプロ
グラムは全トレースされない。)(EOIの送出は、実
施形態では必要であるが、接続されている割り込み制御
装置が高機能なものである場合は不要な場合がある。以
下省略)。(B) チェック結果がYESであれば、タイマ
ーカウンタを0クリアし、CPUのトレースフラグをO
Nとした後、従来のタイマー割り込みプログラムと同様
に、タイマーに対してEOI(割り込み終了)を送出
し、タイマー処理ルーチンをコールし、該ルーチンがリ
ターンしてきた時点で、IRET命令を発行することに
より、該割り込み処理を終了する(従来のタイマー割り
込み処理プログラム相当、およびその延長で動作するプ
ログラムのすべてが、タイマー走行頻度の確率で、走行
し、且つ全命令トレースされる)。 【0021】(4)全命令トレース用シングルステップ
割り込み処理プログラムは、全命令トレース用バッファ
内のデータを適宜、全命令トレース用2次記憶装置に、
1ブロック(実施形態では512バイト)を単位として
出力するが、該各ブロックを書き込む直前毎に、タイマ
ーの割り込み保留がないかどうかをチェックし、割り込
み保留がある場合は、該出力ルーチンの後の処理を省略
して、リターンするこことにより、該2次記憶装置への
出力を抑止する。これによって、タイマー割り込み処理
が全命令トレース用2次記憶装置への出力によって大幅
に遅らされることがないことを実現する。この場合、全
命令シングルステップ割り込み処理プログラムが割り込
み元にIRET命令でリターンした後であって、割り込
み可能な状態になった時、タイマー割り込みが発生す
る。また、この場合、上記によって2次記憶装置への出
力が抑止された部分は、タイマー割り込みが発生した時
点で、該割り込み保留ビットがOFFとなるので、該タ
イマー割り込み処理が完了した直後の全命令トレース用
シングルステップ割り込み処理プログラムの走行時に、
2次記憶装置に出力される。 【0022】バッファは、オーバフローしないように、
十分な大きさとする(実施形態では5MBで何ら支障は
なかった)。 【0023】(5)全命令シングルステップ割り込み処
理プログラムは、(ハードウェアのオーバラン等を防止
するため)従来より、割り込み処理の入り口と割り込み
処理の終了のアドレスの命令の実行の直前を検出し、そ
の間においては、全命令トレースデータを2次記憶装置
に出力しない(バッファ上にのみ格納する)ように制御
するが、タイマー割り込み処理においても、同様の制御
を行う(従来処理では、タイマー割り込みは全命令トレ
ースの対象で無かったので、タイマー割り込み関連のア
ドレスを全命令シングルステップ割り込み処理プログラ
ムは意識していないため)。 【0024】以上により、オペレーティングシステムの
タイマー処理ルーチンが、全命令トレースを行っている
時も、行っていない時も、他のプログラムの走行のタイ
ミングとほぼ近い相対時間関係で走行することを可能と
し、且つ、そのタイミングでタイマー割り込み処理およ
びその延長で走行するプログラムの全命令トレースデー
タを取得することを可能とする。 【0025】本発明においては、上述したように、タイ
マー走行頻度という外部変数とタイマーカウンタという
外部変数を設け、該タイマーカウンタをハードウェアの
タイマーが定期的に割り込みを上げた時にカウントアッ
プし、その結果がタイマー走行頻度以上である場合の
み、従来からあるタイマー割り込み処理およびその延長
で動作するプログラムをコールし、且つ、それらを全命
令トレースさせ、タイマー走行頻度未満である場合は、
従来からあるタイマー割り込み処理およびその延長で動
作するプログラムをコールせず、且つ、それらの全命令
トレースを行わず、並びに、全命令トレース用2次記憶
装置出力ルーチンの中で、タイマー割り込み保留を検出
して、適宜タイマー割り込み処理を実行させ、且つ、全
命令シングルステップ割り込み処理プログラムが、タイ
マー割り込みの入り口と出口のアドレスを意識して、全
命令トレースデータの出力を適宜抑止することにより、
従来のタイマーに関する処理の全命令トレースも可能と
するだけでなく、従来のタイマーに関する処理が、全命
令トレースが行われている場合に、全命令トレースが行
われていない場合の相対走行頻度と同じ頻度で走行する
ことを可能とする。 【0026】例えば、プログラムの実行時間を計測する
場合は、プログラムの先頭と最後でタイマー値を得て、
その差分により、実行時間を計測するが、上記手法によ
り、全命令トレースを行っていない時の計測値と、全命
令トレースを行っている時の計測値を得て、その値が同
じとなるように、「タイマー頻度」の値を調整すること
により、全命令トレースを行っている場合は、全命令ト
レースを行っていない場合に較べて「タイマー頻度」分
の1低速にシステムは動作し、タイマーの動作は全命令
トレースを行っていない時とほぼ同じ相対頻度で実行さ
せることが可能となり、且つ、その時の全命令トレース
データを収集することが可能となる。 【0027】次に、図面を用いて、本発明の一実施形態
に係る全命令トレース時のタイマー制御方法について説
明する。図1は、本発明の一実施形態に係る全命令トレ
ース時のタイマー制御方法を実施する装置の構成を示す
ブロック図である。同図に示す実施形態は、シングルス
テップ割り込み機能を有するCPU1(例えば、INTEL
Pentium )、割り込み制御チップ2(例えば、INTEL 82
59)、システムタイマー3(例えば、INTEL 82378 の中
にあるシステムタイマー)、全命令トレースデータ用の
2次記憶装置4(例えば、IDEセカンダリーHD、I
RQ番号15配下)、およびメモリ5を有する。メモリ
5は、オペレーティングシステム用タイマー割り込み処
理プログラム50、オペレーティングシステム用その他
の情報51、全命令トレース用シングルステップ割り込
み処理プログラム52、全命令トレース用2次記憶装置
の出力関数53、全命令トレース用2次記憶装置のバッ
ファ54、および全命令トレース用のその他の情報55
を記憶している。 【0028】まず、シングルステップ割り込み機能を有
するCPU1は、割り込み制御チップ2と信号線によっ
て接続されており、該チップからの割り込みの有無や該
チップの状態の情報等を受け取ることができ、また該チ
ップへの割り込み受け取り完了の通知等の情報を出力で
きる。更に、該CPU1は、システムタイマー3、全命
令トレースデータ用の2次記憶装置4およびメモリ5と
バスによって接続されており、それらの装置並びにメモ
リと、情報のリードおよびライトが可能である。メモリ
5内の情報は、オペレーティングシステム用タイマー割
り込み処理プログラム50、その他の情報51、および
全命令トレース用に使用されるシングルステップ割り込
み処理プログラム52、2次記憶装置の出力関数53、
2次記憶装置のバッファ54、およびその他の情報55
より構成される。 【0029】次に、図2〜図5に示すフローチャートを
参照して、図1に示す実施形態の作用について説明す
る。図2はオペレーティングシステム用のタイマー割り
込み処理プログラム50の手順を示すフローチャートで
あり、図3は全命令トレース用シングルステップ割り込
み処理プログラム52の一部の手順を示すフローチャー
トであり、図4は全命令トレース用シングルステップ割
り込み処理プログラム52の図3に続く一部の手順を示
すフローチャートであり、図5は全命令トレース用の2
次記憶装置の出力関数53の手順を示すフローチャート
である。 【0030】今、システムタイマー3が定期的な割り込
みを、割り込み制御チップ2のIRQ番号0を通じて、
シングルステップ割り込み機能を有するCPU1に上げ
る場合を例に取って説明する。その時、システムは全命
令トレース実施中の状態[CPUのトレースフラグはO
N(1)、全命令トレース用のその他の情報55内にあ
る全命令トレース用の外部変数「全命令トレース実行
中」がON]で、全命令トレース用のその他の情報55
内にある全命令トレース用の外部変数”タイマーカウン
タ”等のカウンタの内容は0、”タイマー走行頻度”は
5000である。これらの値は予め何らかの方法で設定
されている。 【0031】一般に、IRQ番号0からシステムタイマ
ー用の割り込み要求がシングルステップ割り込み機能を
有するCPU1(以下CPU1と略記)に上がり、その
時、CPU1が割り込み禁止状態でなければ(*0)、
CPU1は、CPU1内部のトレースフラグをOFFと
し、その時に実行されようとしていた命令のアドレス等
をスタックに格納し、CPU1は、図2のオペレーティ
ングシステム用のタイマー割り込み処理プログラム50
のステップS100の命令へ制御を渡す。 【0032】図2に示すように、オペレーティングシス
テム用のタイマー割り込み処理プログラム50は、制御
が渡されると、レジスタ等の退避1で、必要最低限のレ
ジスタ等をオペレーティングシステム用のその他の情報
51内にあるスタックエリア(以下スタックエリアと略
記)に退避し(ステップS100)、外部変数”全命令
トレース実行中”の内容がONであるかチェックする
(ステップS101)。この場合は、YESであるで
の、外部変数”タイマーカウンタ”に1を加算する(こ
の場合、その結果は1となる)(ステップS102)。
その結果が、外部変数”タイマー走行頻度”の内容(こ
の場合5000)以上であるかをチェックし(ステップ
S103)、その結果は殆どの場合NOであるので、こ
の場合、割り込み制御チップ2に割り込みの終了を通知
するために、EOIを送出し(ステップS104)、レ
ジスタ等の回復1で、レジスタ等の内容をスタックエリ
アより回復し(ステップS105)、IRET命令を発
行する(ステップS106)。この結果、割り込み処理
を終了し、割り込み元へ戻る(ステップS106)、そ
の時、一般に、CPU1のトレースフラグが割り込んだ
時の状態に、CPU1によって戻される。 【0033】以上のステップS100〜ステップS10
6の動作は、タイマー割り込みが生じた場合に、単に、
タイマーカウンタに1を加算するだけであり、それらの
全命令トレース等は一切行わない。この動作は、その
後、システムタイマーよりタイマー走行頻度の値(50
00)の回数分の割り込みが発生するまで、タイマー割
り込み発生毎に繰り返される。 【0034】ここで、今、タイマーカウンタの値が「タ
イマー走行頻度の値−1」(即ち4999)の値である
時に、タイマー割り込みが発生した時を想定すると、上
記とは違う以下の動作が行われる。 【0035】まず、ステップS100でレジスタ等の退
避1が行われ、ステップS101で全命令トレース実行
中かどうかをチェックし、結果はYESであるので、ス
テップS102でタイマーカウンタに1を加算し、ここ
では結果は5000となり、ステップS103で、タイ
マー走行頻度(5000)以上であるかどうかをチェッ
クし、その結果はYESであるので、ステップS107
に進み、タイマーカウンタを0に戻し、CPU1のトレ
ースフラグをONに設定し(ステップS108)、ステ
ップS109でレジスタ等の退避2を行うための命令を
実行しようとする(*1)。 【0036】この時、ステップS108で既にCPU1
のトレースフラグはONに設定されているので、シング
ルステップ割り込みが発生し、その時に実行されようと
した命令のアドレスが、オペレーティングシステム用の
その他の情報51の中のスタックエリア(以下スタック
エリアと略記する)に設定され、CPU1のトレースフ
ラグがOFFに設定された後、図3の全命令トレース用
シングルステップ割り込み処理プログラム52に制御が
渡る(以上の処理は、”シングルステップ割り込み機能
を有するCPU1”のシングルステップ割り込みに対す
るCPUの一般的な機能である)。 【0037】図3においては、ステップS200でレジ
スタ等をスタックエリアに退避し、ステップS201の
全命令トレース実行中のチェックで、YESであるの
で、ステップS203で全命令トレース用バッファが満
杯かをチェックし、ここでは、システムにバグがない限
りNOであるので、ステップS205で全命令トレース
データを収集して、全命令トレース2次記憶装置のバッ
ファ54に格納し、ステップS206でバッファ54に
格納されている全命令トレースデータが512バイト以
上であるかをチェックする。 【0038】全命令トレースデータは、1命令平均で、
およそ50バイトの情報であるので、ステップS206
でYESとなる確率は、10分の1未満であり、大多数
の場合、該ステップS206は、NOとなる。NOの場
合は、図4のステップS300およびステップS302
のチェックが実施される。今回の場合、それらのシング
ルステップ割り込み処理で割り込まれた命令のアドレス
は、上記(*1)であり、フローチャートのステップS
109の命令であるので、ステップS300およびステ
ップS302のチェックの内、ステップS300のみが
YESとなり、ステップS301において、全命令トレ
ース用のその他の情報55内にある外部変数「2次記憶
装置書き込み禁止カウンタ」に1が加算され、その結果
1になる。その後、ステップS304でレジスタ等の回
復が行われ、ステップS305でIRET命令が発行さ
れることにより、上記(*1)の割り込み元に戻る(そ
の際、CPUによって、トレースフラグが、割り込みの
直前の状態に戻される。この場合ONに戻る)。 【0039】この「2次記憶装置書き込み禁止カウン
タ」は、オペレーティングシステム用のタイマー割り込
み処理プログラム50、オペレーティングシステム用の
その他の情報51内にあるその他の割り込み処理プログ
ラムや入出力関数が2次記憶装置またはその他の装置
(図1内では省略)に入出力を行う場合に、0以外に設
定するもので、オペレーティングシステム用の装置への
一連の入出力命令の発行が(途中で、全命令トレースデ
ータ用の2次記憶装置への出力処理によって中断するこ
とによる)オーバランを起こさないために存在し、0以
外の時には、全命令トレースデータの2次記憶装置への
出力が抑止される。 【0040】上記(*1)の割り込み元に戻ると、CP
U1は、図2のステップS109の命令を1つだけ実行
し、CPUのトレースフラグがONであるので、その後
ステップS109内の次の命令からステップS112の
ステップの直前の命令までのそれぞれの命令を次々に実
行しようとし(*2)、各命令の実行の直前に、それぞ
れシングルステップ割り込みが発生し、それらのそれぞ
れにおいて、図3の全命令トレース用シングルステップ
割り込み処理のステップS200以降が実行される。こ
の場合、2次記憶装置書き込み禁止カウンタは1に設定
されているので、ステップS200,S201,S20
3,S205が実行された後ステップS206で、バッ
ファに512バイト以上の全命令トレースデータがあっ
ても、ステップS207がNOとなるので、ステップS
208が実行される(全命令トレース用の2次記憶装置
の出力関数がコールされる)ことはない。また、その
後、ステップS300およびステップS302のチェッ
クでも、上記(*2)のアドレスは、すべてNOとなる
ので、全命令トレース用シングルステップ割り込み処理
プログラムは、ステップS205で、全命令トレースデ
ータを収集して、バッファに格納するだけで、2次記憶
装置には出力することなく、ステップS304でレジス
タ等の回復を行い、ステップS305でIRET命令で
割り込み元(*2)へ戻る。 【0041】次に、CPU1は、ステップS112の直
前の命令を実行した後、ステップS112の命令を実行
しようとし(*3)、その際に、同様にシングルステッ
プ割り込みが生じ、上記と同様にステップS200,S
201,S203が実行されて、ステップS205で全
命令トレースデータを収集して、ステップS206でY
ESとなり、ステップS207でNOとなり、ステップ
S300でNOとなるが、ステップS302においてフ
ローチャートのステップS112の命令に該当するので
YESとなり、ステップS303において、2次記憶装
置書き込み禁止カウンタが1減算され、0に戻る。従っ
て、ステップS304,S305を経て、割り込み元の
ステップS112の命令が実行された後、その次の命令
が実行される直前(ステップS112は普通複数の命令
で構成されるので、ステップS112の2番目の命令が
実行される直前)(*4)に発生するシングルステップ
割り込みにおいて、ステップS200,S201,S2
03,S205,S206,S207と順次実行された
時、ステップS207の”2次記憶装置書き込み禁止カ
ウンタ”は零か否かのチェックで、YESとなり、ステ
ップS208で、全命令トレース用の2次記憶装置の出
力関数(図5)がコールされる(*5)。 【0042】全命令トレース用の2次記憶装置の出力関
数(図5)は、ステップS400においてIRQ番号0
に割り込み保留がある(次のタイマー割り込みが発生し
た)かどうかを、割り込み制御チップ2に対して、その
割り込み保留状態をリードする入出力命令を発行して、
その状態をチェックすることによって調べ、ここでは、
タイマー割り込みが発生した直後(本実施形態では、定
期割り込み間隔は10msec)であるので、該割り込み保
留は存在しないので、ステップS401へ進む。 【0043】ステップS401では、1ブロック(1ブ
ロックは512バイト)分の全命令トレースデータのバ
ッファの内容を2次記憶装置に出力する入出力命令を発
行する。この場合、バッファ内には、少なくとも1回分
のタイマー割り込みに関する全命令トレースデータが存
在し、その量は、平均して6ブロック程度(経験値)で
ある。その後、ステップS402で、そのライトが完了
する[該装置の状態の入力のための入出力命令の発行を
行い、該装置の状態がビジー状態(入出力中)でなく、
且つ、IRQ番号=15に割り込み保留ビットが立って
いない状態(上記入出力命令の発行によって完了割り込
みが正常に刈り取られた状態)になる]のをループで待
ち合わせ、ステップS403でそれが正常完了であるこ
とを確認して、バッファの管理情報を更新し(「全命令
トレースデータのバッファ内にあるデータの長さ」の情
報より出力完了した分を減算する等の処理を行い)(ス
テップS405)、ステップS407で、全命令トレー
スデータのバッファ内に、512バイト以上のデータが
あるかどうかをチェックする。 【0044】この場合、まだ少なくとも5ブロック分残
っているので、ステップS400に戻り、ステップS4
00〜S407を残りブロック分繰り返す。この場合、
2次記憶装置への出力はシーケンシャルアクセスである
[ヘッドの移動(シーク)を殆ど伴わない]ので、それ
らの6ブロックの出力の合計時間は、タイマーの定期割
り込み間隔(10msec)より小さいので、ステップS4
00においてYES(次のタイマー割り込みが発生し
て、割り込み保留あり)となることはない。その後、ス
テップS408へ行って、当関数のコール元にリターン
する。 【0045】リターンは、上記(*5)の次の命令とな
るので、ステップS300へ進み、ステップS300と
ステップS302は、NOとなるので、ステップS30
4,S305経由で、上記(*4)にIRET命令でリ
ターンする。このIRET命令により、CPUは、トレ
ースフラグを上記(*4)の状態に戻すので、ステップ
S112の2番目の命令以降が実行され、全命令トレー
スが継続される。 【0046】上記のタイマー割り込みから、タイマーの
定期割り込み間隔(10msec)の分の時間が経過した時
の動作は、以下の(A)(B)(C)のいずれかとな
る。 【0047】(A) 「その時、全命令トレース用シングル
ステップ割り込み処理プログラム以外の命令を実行中で
あって、割り込み禁止でない状態」である場合は、その
命令の実行完了時に、タイマー割り込みが発生し、上述
の(*0)以降と同じ処理が行われる。 【0048】(B) 「その時、全命令トレース用シングル
ステップ割り込み処理プログラム以外の命令を実行中で
あって、割り込み禁止である状態」である場合は、タイ
マー割り込みの割り込み保留ビット(割り込み制御チッ
プ2の内部情報であるIRQ0の割り込み保留ビット)
がONになり、その直後に「全命令トレース用シングル
ステップ割り込み処理プログラム」が走行するまで(次
の命令を実行しようとするまで)その割り込み保留は続
くので、その時の動作は、下記(C)「全命令トレース
用シングルステップ割り込み処理プログラムの命令を実
行中」の場合の動作と同じになる。 【0049】(C) 「その時、全命令トレース用シングル
ステップ割り込み処理プログラムの命令を実行中」であ
る場合は、全命令トレース用シングルステップ割り込み
処理プログラムは割り込み禁止で走行するので、タイマ
ー割り込みの割り込み保留ビットがONとなり、その場
合、例えば全命令トレース用の2次記憶装置の出力関数
がコールされても、ステップS400においてYESと
なるので、該関数は何もせずにリターンするので、全命
令トレース用2次記憶装置への出力は抑止される。従っ
て、全命令トレースの実施によって、上記(A)に該当
する命令が実行されるまで、その抑止は継続され、上記
(A)に至った時点で、タイマー割り込みが処理され、
上述したと同様に、該タイマー割り込み処理が完了した
時点で、全命令トレース用2次記憶装置への出力が再開
される。 【0050】以上により、全命令トレース用2次記憶装
置への出力によって、タイマー割り込み処理が抑止され
ることはなく、全命令トレースを実施した場合に、実施
しなかった場合と同じ相対頻度でタイマー割り込み処理
を実行し、且つ、そのタイマー割り込み処理を含めた全
命令トレースを行うことが可能である。 【0051】 【発明の効果】以上説明したように、本発明によれば、
ハードウェアを何ら変更することなく、オペレーティン
グシステムのタイマー処理機能が外部変数「タイマー頻
度」で指定した頻度で走行することを可能とし、且つそ
の頻度のタイマー割り込み処理の実施を含めた全命令ト
レースを行うことが可能となる。
DETAILED DESCRIPTION OF THE INVENTION [0001] BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer,
Processor, electronic exchange, workstation, etc.
Central processing unit (hereinafter abbreviated as CPU)
To control the timer when tracing all instructions.
I do. [0002] 2. Description of the Related Art Generally, evaluation is performed for the purpose of performance evaluation or the like.
The program of the target operating system (the operating
All applications running on the rating system
For tracing all instructions, including
Of the instruction group (excluding programs, omitted below), the CPU
Information about all the instructions to be executed (the
Contents, instruction length, register change status, changed register
The contents of the program and other management units for the program as needed
Information such as thread information) immediately before execution of one instruction
Is called an all-instruction trace.
Traces the information collected by the trace into all instruction trace data.
Say ta. The above program is a function (from the program
Called program with one entrance)
Program (call triggered by interrupt, etc.)
This is a program that is normally
Not executed), and all instruction traces
And all of them are traced (only functions
A trace that only traces all instructions is called an all-instruction trace.
I don't know). A CP having a single-step interrupt function
In the full instruction trace under U, the function
Set the trace flag of the CPU to ON in advance and interrupt
For processing only, the trace flag of the CPU
Is turned on, etc., the CPU is instructed immediately before the execution of one instruction.
Cause a single-step interrupt
Has been done. [0004] The CPU is the operating system to be evaluated.
Each time immediately before executing one instruction of the system,
CPU uses a single-step interrupt
Single-step interrupt processing program for instruction trace
Control to the program, and the program
Data and collectively call the all-instruction trace data buffer.
Store in the memory area and return to the interrupt source.
After returning, the CPU issues one instruction to the interrupted instruction.
Instruction, and after the execution, execute the next instruction
Immediately before, a single-step interrupt occurs as described above.
The operating system to be evaluated.
All the instructions to be executed in the instruction group of the system program
Are traced. Trace all instructions
The data buffer has a limited fixed size,
The total amount of all instruction trace data is the operating
Tens of megabytes depending on the operating logic of the
Since it is common for the size to reach several gigabytes,
All the instruction trace interrupt processing of the above data
By storing the program in the secondary storage device,
Make sure that the file does not overflow. The secondary storage
Since high speed is generally required for the
Or a hard disk drive. On the other hand, the operating system is
For programs that run on the rating system
Provides a timer control function. Its timer control machine
Noh is a hardware timer (for example, of INTEL 82378)
Use the system timer inside. In particular,
The timer periodically raises an interrupt to the CPU,
Interrupt processing program
Call the timer processing routine and
Inside the software in the operating system
Update the value of the timer, and based on the update result,
Performs timer-related processing. However, the above-mentioned all-instruction trace is executed.
Then, every time one instruction of the operating system is executed,
Collect all trace data and all instructions collected as appropriate
Trace data must be output to secondary storage
And interrupts are prohibited between them.
For this reason, while performing the full instruction trace,
The rating system ensures that all instruction traces are
Operates at about 1 / 5000th the speed of the case without
Result. As a result, if no action is taken, the operating
From the viewpoint of the switching system, the timer is relatively 50
It appears to be operating 00 times faster, and as a result
Instruction trace data is mostly trace data of timer processing.
Data is occupied by the
Source data cannot be obtained. As a countermeasure, a system timer is periodically set.
It is sufficient if the typical interrupt interval can be increased by 5000 times.
The regular interrupt interval of the system timer is 10ms
ec and the timer specification is 50
It does not allow setting to 00 times. For example, currently
The most used timer is in INTEL 82378
System timer, which can be set
The maximum value of the interval is 54.924 msec. Therefore, in the prior art, those problems are
The following method was used to avoid the problem. (1) Timer interrupt processing program,
And its extension (the interrupt processing program
The program that is called from the
Not be traced (do not collect all instruction trace data).
No). Specifically, when an interrupt occurs, the CPU
Turns off the trace flag of CPU and interrupts
Pass control to the processing program,
At the top of the interrupt processing program, [All instruction
Source (external variable) is ON] CPU trace file
Set the lag to ON to continue all traces
However, in the timer interrupt processing program,
By not turning on the CPU trace flag at the beginning
The interrupt handling program and its extensions
Do not collect trace data for all instructions of the running routine.
No. (2) Thailand in the operating system
For all programs that use the
Stop using the timer function or request the timer function
Is changed to be 5000 times. Conventionally, the above method is
System, when the timer is low on the system
And was used only for system error handling
(All instruction traces are performed for performance evaluation.
Performance evaluation focuses on the evaluation of normal processing under high load.
Is a reasonable method (because there is) and there are no problems
Was. [0013] However, in recent years,
In various operating systems, the timer
System that uses the
I have. In evaluating the performance of such systems,
All traces including all instruction trace data of
Data acquisition is essential, and traditional methods
There is a problem that they cannot be realized. The present invention has been made in view of the above,
The goal is to get the operating system
The timer processing function is controlled by the external variable
It is possible to drive at a specified frequency, and
All trace data including the execution of
Timer control method when tracing all instructions
To provide. [0015] Means for Solving the Problems To achieve the above object,
Therefore, the present invention described in claim 1 provides a central processing unit in an information processing apparatus.
The operation unit traces all instructions, and this trace target
Operating systems periodically interrupt
Use the rub timer and the operating
If the processing of the scanning system is also subject to
If this periodic interrupt occurs, a timer interrupt
The process adds 1 to the timer counter which is an external variable,
Completion of interrupt processing for this interrupt
Notify, but call, timer
Perform full instruction trace for immer interrupts, and
The counter is cleared to 0 when the value of the counter is an external variable.
Only when the timer running frequency value has been reached,
Timer interrupt, Interrupt in interrupt disabled state
Represent occurrenceIf the interrupt is pending, trace all instructions
Data is stored only in the buffer.
The gist is to suppress output to the next storage device. According to the first aspect of the present invention, the operation
The timer processing function of the
It is possible to drive at the frequency of 1 / min
And including the execution of timer interrupt processing at that frequency
All collected trace data. [0017] DESCRIPTION OF THE PREFERRED EMBODIMENTS Before describing an embodiment of the present invention.
First, a timer control method at the time of tracing all instructions according to the present invention
Will be described. (1) As an external variable for tracing all instructions
A variable called timer running frequency is set, and the necessary frequency
Degree (in the embodiment, 5000;
Is set in advance (the setting method is not specified; outside)
You can keep them as part constants,
And may be set internally to the variable). (2) External variables for tracing all instructions
And set a variable called timer counter and set it to 0 in advance
(The setting method is not specified.) (3) Control when a timer interrupt occurs
The top of the timer interrupt processing program to be passed
Then, 1 is added to the timer counter, and the result is
Check whether it is more than the timer running frequency,
(A) If the check result is NO, E
Issued an I / O instruction to send OI (interrupt end)
Then, by issuing an IRET instruction,
Processing ends (return to the interrupt source. In this case, the timer processing
Process routine is not called and the timer interrupt
Grams are not fully traced. (Emission of EOI is actually
Although it is necessary in the embodiment, the connected interrupt control
This may not be necessary if the device is sophisticated. Less than
Omitted below). (B) If the check result is YES, the timer
-Clear counter to 0 and set CPU trace flag to O
After setting to N, same as the conventional timer interrupt program
EOI (End of interrupt) sent to timer
Call the timer processing routine, and the routine
At the time of turn, issue IRET command
To end the interrupt processing (conventional timer allocation).
Program that operates as an extension program
All programs run with the probability of timer running frequency
And all instructions are traced). (4) Single step for tracing all instructions
The interrupt processing program is a buffer for all instruction traces.
Data in the instruction trace secondary storage device as appropriate,
In units of one block (512 bytes in the embodiment)
Output, each time immediately before writing each block, a timer
Check if there is an interrupt pending
If there is only a hold, skip the processing after the output routine.
Return to return to the secondary storage device.
Suppress output. This allows timer interrupt processing
Is greatly increased by output to the secondary storage device for all instruction traces
Realize that you will not be delayed. In this case,
Instruction single-step interrupt processing program interrupts
Interrupt after returning to the source with an IRET instruction
Timer interrupt occurs when the
You. In this case, the output to the secondary storage device is performed as described above.
The part where the force is suppressed is when the timer interrupt occurs
At this point, the interrupt pending bit is turned off,
For tracing all instructions immediately after completion of Immer interrupt processing
When running the single step interrupt processing program,
Output to the secondary storage device. The buffer should not overflow.
Make it large enough (in the embodiment, 5MB is no problem
Did not.) (5) All instructions single step interrupt processing
Management program (prevents hardware overrun, etc.
In the past, the entrance and interruption of interrupt processing
Detect immediately before the execution of the instruction at the end address of the processing, and
During the period, all instruction trace data is stored in the secondary storage device.
Is controlled not to be output to the buffer (only stored in the buffer)
However, the same control applies to timer interrupt processing.
(In the conventional processing, the timer interrupt
Was not the target of the
Dress all instructions single step interrupt processing program
Because he is not conscious). As described above, the operating system
Timer processing routine traces all instructions
Time when not running, when not running
It is possible to run with a relative time relationship almost close to
Timer interrupt processing and
Trace data of all instructions of the program
Data can be obtained. In the present invention, as described above,
External variable called timer driving frequency and timer counter
An external variable is provided, and the timer counter is
Counts up when the timer periodically raises an interrupt.
If the result is higher than the timer driving frequency,
The conventional timer interrupt processing and its extension
Call programs that run on and live them all
And if it is less than the timer driving frequency,
Operates with conventional timer interrupt processing and its extensions
Do not call the program to be made, and all the instructions
No tracing, and secondary storage for all instruction traces
Timer interrupt pending detected in device output routine
To appropriately execute the timer interrupt processing, and
Instruction single-step interrupt processing program
Be aware of the entrance and exit addresses of the
By appropriately suppressing the output of instruction trace data,
It is possible to trace all instructions of conventional timer processing.
In addition to the traditional timer related processing,
Instruction tracing is performed when all instruction tracing is performed.
Drive at the same frequency as the relative driving frequency when not
To make things possible. For example, measuring the execution time of a program
If you get the timer value at the beginning and end of the program,
The execution time is measured from the difference,
Measurement value when all instruction tracing is not performed,
Command, and obtain the measured value when the
Adjust the value of "Timer Frequency" so that
If all instruction traces are performed,
"Timer frequency" minutes compared to not racing
The system operates at the low speed of 1
Run at about the same relative frequency as when no tracing was done.
And trace all instructions at that time
Data can be collected. Next, an embodiment of the present invention will be described with reference to the drawings.
About timer control method when tracing all instructions
I will tell. FIG. 1 is a diagram illustrating an entire instruction tray according to an embodiment of the present invention.
Shows the configuration of the device that implements the timer control method at the time of
It is a block diagram. The embodiment shown in FIG.
CPU 1 having a step interrupt function (for example, INTEL
Pentium), interrupt control chip 2 (for example, INTEL 82
59), system timer 3 (for example, in INTEL 82378)
System timer), for all instruction trace data
Secondary storage device 4 (for example, IDE secondary HD, I
RQ number 15), and a memory 5. memory
5 is a timer interrupt processing for the operating system.
Management program 50, other for operating system
Information 51, single-step interrupt for all instruction traces
Processing program 52, secondary storage for all instruction traces
Output function 53, all instruction trace secondary storage device
File 54 and other information 55 for the full instruction trace.
I remember. First, a single-step interrupt function is provided.
The CPU 1 executes the interrupt control chip 2 and the signal line.
And whether or not there is an interrupt from the chip,
Chip status information, etc.
Output information such as notification of the completion of interrupt reception to the
Wear. Further, the CPU 1 has a system timer 3,
Storage device 4 and memory 5 for command trace data
Connected by a bus, and
And information can be read and written. memory
The information in 5 is the timer assignment for the operating system.
Embed processing program 50, other information 51, and
Single step interrupt used for all instruction traces
Processing program 52, an output function 53 of the secondary storage device,
Secondary storage buffer 54 and other information 55
It is composed of Next, the flowcharts shown in FIGS.
The operation of the embodiment shown in FIG. 1 will be described with reference to FIG.
You. Figure 2 shows the timer assignment for the operating system.
Is a flowchart showing the procedure of the embedding processing program 50.
Yes, Figure 3 shows a single step interrupt for all instruction traces
Showing a part of the procedure of the only processing program 52
Figure 4 shows a single step split for all instruction traces.
3 shows a part of the procedure of FIG.
FIG. 5 is a flow chart showing the procedure for tracing all instructions.
Flowchart showing the procedure of the output function 53 of the secondary storage device
It is. Now, the system timer 3 is periodically interrupted.
Through the IRQ number 0 of the interrupt control chip 2
Raised to CPU1 with single-step interrupt function
An example will be described. At that time, the system is alive
Command trace execution status [CPU trace flag is O
N (1), in other information 55 for tracing all instructions
The external variable for all instruction trace
"Medium" is ON] and other information 55 for tracing all instructions
Variable "timer count" for tracing all instructions in the
The contents of counters such as “Timer” are 0, and “Timer running frequency” is
5000. These values are set in advance by some method
Have been. In general, the system timer starts from IRQ number 0
Interrupt request for single-step interrupt function
CPU1 (hereinafter abbreviated as CPU1)
At this time, if the CPU 1 is not in the interrupt disabled state (* 0),
CPU1 turns off the trace flag inside CPU1.
And the address of the instruction that was about to be executed at that time
Is stored in the stack, and the CPU 1 executes the operation shown in FIG.
Interrupt processing program 50 for operating system
Is transferred to the instruction of step S100. As shown in FIG.
System timer interrupt processing program 50
Is passed, the minimum required level is saved in register 1
Additional information for operating systems, such as registers
Stack area 51 (hereinafter abbreviated as stack area).
(Step S100), and the external variables “all instructions”
Check whether the contents of "Trace in progress" is ON
(Step S101). In this case, YES
Add 1 to the external variable “timer counter” (this
In this case, the result is 1) (step S102).
The result is the content of the external variable “Timer running frequency” (this
Check if it is 5000 or more (step
S103), since the result is NO in most cases,
In the case of, the end of the interrupt is notified to the interrupt control chip 2.
EOI is sent (step S104), and
In recovery 1 of the register etc., the contents of the register etc.
(A) (Step S105), and issue an IRET instruction.
(Step S106). As a result, interrupt processing
And returns to the interrupt source (step S106).
In general, when the trace flag of CPU1 is interrupted
The state at the time is returned by the CPU 1. The above steps S100 to S10
The operation of 6 is that when a timer interrupt occurs,
Just add 1 to the timer counter and those
No trace of all instructions is performed. This behavior is
Then, the value of the timer running frequency (50
00) until the number of interrupts occurs
It is repeated every time a jam occurs. Here, the value of the timer counter is now
Value of the immersion driving frequency −1 ”(that is, 4999).
Sometimes, assuming that a timer interrupt occurs,
The following operations different from the above are performed. First, in step S100, a register or the like is deleted.
Evasion 1 is performed, and all instructions are traced in step S101.
Check whether it is in the middle and the result is YES.
In step S102, 1 is added to the timer counter.
In step S103, the result is 5000.
Check whether the running frequency is 5000 or more.
Step S107, since the result is YES.
To reset the timer counter to 0, and
The source flag is set to ON (step S108),
In step S109, an instruction for saving 2
Attempt to execute (* 1). At this time, the CPU 1
Trace flag is set to ON.
A step interrupt occurs and attempts to execute at that time.
The address of the instruction
The stack area in the other information 51 (hereinafter referred to as the stack area)
Area (abbreviated as area)
After lag is set to OFF, for all instruction traces in Figure 3
The control is controlled by the single-step interrupt processing program 52.
Cross (the above processing is a single step interrupt function
To single-step interrupt of CPU1 "having
This is a general function of a CPU that operates. In FIG. 3, at step S200, the cash register
The stacker is evacuated to the stack area, and the
Check during execution of all instruction traces, YES
In step S203, all the instruction trace buffers are full.
Check if there is a bug, here, unless there is a bug in the system
No, all instructions are traced in step S205.
Collect data and back up all instruction trace secondary storage
And stored in the buffer 54 in step S206.
All stored instruction trace data is 512 bytes or less
Check if it is above. The trace data of all instructions has an average of one instruction.
Since the information is about 50 bytes, step S206
Is less than one-tenth and the majority
In this case, step S206 is NO. NO place
In this case, step S300 and step S302 in FIG.
Is performed. In this case, those things
Of the instruction that was interrupted in the single-step interrupt processing
Is the above (* 1), and corresponds to step S in the flowchart.
Step S300 and step S300.
Of the check in step S302, only step S300
YES, and in step S301, all instruction
The external variable “secondary storage” in the other information 55 for the source
1 is added to the "device write inhibit counter" and the result is
Becomes 1. Thereafter, in step S304, the number of times the register
And an IRET instruction is issued in step S305.
By doing so, it returns to the interrupt source of (* 1) above (that
At this time, the trace flag is
Return to the previous state. In this case, return to ON). This "secondary storage device write inhibit count"
Is a timer interrupt for the operating system.
Processing program 50 for the operating system
Other interrupt processing programs in other information 51
RAM or I / O function is secondary storage or other device
(Omitted in FIG. 1)
To the device for the operating system.
Issuing a series of I / O instructions (on the way,
Data output to the secondary storage device for data
Exists to prevent overrun, and 0 or more
When it is outside, all instruction trace data is stored in the secondary storage device.
Output is suppressed. Returning to the interrupt source of (* 1), the CP
U1 executes only one instruction in step S109 of FIG.
Since the CPU trace flag is ON,
From the next instruction in step S109,
Each instruction up to the instruction immediately before the step is executed one after another.
To execute (* 2), just before the execution of each instruction,
A single-step interrupt occurs,
In this case, a single step for tracing all instructions in FIG.
Step S200 and subsequent steps of the interrupt processing are executed. This
In the case of, the secondary storage device write inhibit counter is set to 1.
Are performed, steps S200, S201, S20
After Steps S205 and S205 have been executed, in Step S206
All instruction trace data of 512 bytes or more
However, since step S207 is NO, step S207
208 (secondary storage for full instruction trace)
Output function is never called). Also,
Then, check in steps S300 and S302.
The addresses in (* 2) above are all NO
So single-step interrupt handling for all instruction traces
In step S205, the program executes the all instruction trace data.
Just collect data and store it in the buffer, and secondary storage
Without outputting to the device, the registration is performed in step S304.
Data, etc., and execute an IRET instruction in step S305.
Return to interrupt source (* 2). Next, the CPU 1 proceeds to step S112.
After executing the previous instruction, execute the instruction of step S112
(* 3), and at that time,
Step S200, S
Steps S201 and S203 are executed.
Instruction trace data is collected, and Y is determined in step S206.
ES, NO in step S207, and step
No is obtained in S300, but in step S302,
Since it corresponds to the instruction of step S112 in the flowchart,
YES, and in step S303, the secondary storage device
The write-inhibit counter is decremented by 1 and returns to 0. Follow
After steps S304 and S305, the interrupt source
After the instruction of step S112 is executed, the next instruction
(Step S112 is usually a plurality of instructions
Therefore, the second instruction in step S112 is
Single step that occurs at (* 4) just before execution
In the interruption, steps S200, S201, S2
03, S205, S206, S207
At the time, the “secondary storage device write inhibit
Is "0" in the check to see if it is zero.
In step S208, the secondary storage device for tracing all instructions is output.
The force function (FIG. 5) is called (* 5). The output relation of the secondary storage device for all instruction traces
The number (FIG. 5) is the IRQ number 0 in step S400.
Has an interrupt pending (the next timer interrupt occurs
Whether or not the interrupt control chip 2
Issue an I / O instruction to read the interrupt pending state,
Check by checking its status, here,
Immediately after a timer interrupt occurs (in this embodiment,
The interrupt interval is 10 msec),
Since there is no stay, the process proceeds to step S401. In step S401, one block (one block)
Lock is 512 bytes), and all instruction trace data
Issue an input / output command to output the contents of the buffer to the secondary storage device.
Run. In this case, the buffer contains at least one
All instruction trace data related to timer interrupts
The amount is about 6 blocks on average (experience value)
is there. Then, in step S402, the writing is completed.
[I / O command is issued to input the status of the device.
The status of the device is not busy (input / output),
And the interrupt pending bit is set at IRQ number = 15.
Status (Complete interrupt by issuing the above I / O instruction
In a loop).
Check that it is completed normally in step S403.
And update the buffer management information ("All instructions
Length of data in trace data buffer "
Perform processing such as subtracting the output completion from the information).
(Step S405) In step S407, all instruction trays
512 bytes or more data in the data buffer
Check if there is. In this case, at least five blocks remain.
Therefore, the process returns to step S400 and returns to step S4.
Steps S00 to S407 are repeated for the remaining blocks. in this case,
Output to secondary storage device is sequential access
[Almost no head movement (seek)]
The total time of the output of these six blocks is calculated by the timer
Since it is smaller than the insertion interval (10 msec), step S4
YES at 00 (the next timer interrupt occurs
Interrupt pending). Then
Go to step S408 and return to the caller of this function
I do. The return is the instruction next to the above (* 5).
Therefore, the process proceeds to step S300, and
Since step S302 is NO, step S30
4, via S305, the above (* 4) is
Turn. This IRET instruction causes the CPU to
Return to the state of (* 4) above.
The second and subsequent instructions of S112 are executed, and all instruction trays are executed.
Is continued. From the above timer interrupt, the timer
When the time of the periodic interrupt interval (10 msec) has elapsed
Is one of the following (A), (B) and (C).
You. (A) “At that time, a single
An instruction other than the step interrupt processing program is being executed.
And interrupts are not disabled ”,
When execution of the instruction is completed, a timer interrupt occurs and
The same processing as after (* 0) is performed. (B) "At that time, a single instruction for all instruction traces
An instruction other than the step interrupt processing program is being executed.
And interrupts are disabled,
Interrupt pending bit (interrupt control
Interrupt pending bit of IRQ0, which is the internal information of loop 2)
Is turned on, and immediately after that, "Single
Until the step interrupt processing program runs (next
Interrupt pending)
Therefore, the operation at that time is described in (C) “All instruction trace
Instruction of the single-step interrupt processing program for
The operation is the same as in the case of "in line". (C) "At that time, a single for all instruction traces
Executing instruction of step interrupt processing program "
Single step interrupt for all instruction traces
Since the processing program runs without interrupts, the timer
-The interrupt pending bit of the interrupt turns on and
For example, the output function of the secondary storage device for tracing all instructions
Is called, YES in step S400
, So the function returns without doing anything,
Output to the command trace secondary storage device is suppressed. Follow
Therefore, by executing all instruction traces,
Until the instruction to execute is executed, the suppression continues.
At time (A), the timer interrupt is processed,
As described above, the timer interrupt processing has been completed.
At this point, output to the secondary storage device for all instruction traces resumes
Is done. As described above, the secondary storage device for all instruction traces
Timer interrupt processing is suppressed by
Will be executed when all instruction traces are executed.
Timer interrupt processing with the same relative frequency as when not performed
And the entire timer including the timer interrupt processing
Instruction tracing can be performed. [0051] As described above, according to the present invention,
Operate without any hardware changes
The timer processing function of the
It is possible to drive at the frequency specified in
All instructions including timer interrupt processing
It will be possible to race.

【図面の簡単な説明】 【図1】本発明の一実施形態に係る全命令トレース時の
タイマー制御方法を実施する装置の構成を示すブロック
図である。 【図2】図1に示す実施形態におけるオペレーティング
システム用のタイマー割り込み処理プログラムの手順を
示すフローチャートである。 【図3】図1に示す実施形態における全命令トレース用
シングルステップ割り込み処理プログラムの一部の手順
を示すフローチャートである。 【図4】図1に示す実施形態における全命令トレース用
シングルステップ割り込み処理プログラムの図3に続く
一部の手順を示すフローチャートである。 【図5】図1に示す実施形態における全命令トレース用
の2次記憶装置の出力関数の手順を示すフローチャート
である。 【符号の説明】 1 シングルステップ割り込み機能を有するCPU 2 割り込み制御チップ 3 システムタイマー 4 全命令トレースデータ用の2次記憶装置 5 メモリ 50 オペレーティングシステム用タイマー割り込み処
理プログラム 51 オペレーティングシステム用のその他の情報 52 全命令トレース用シングルステップ割り込み処理
プログラム 53 全命令トレース用2次記憶装置の出力関数 54 全命令トレース用2次記憶装置のバッファ 55 全命令トレース用のその他の情報
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing a configuration of an apparatus for implementing a timer control method at the time of tracing all instructions according to an embodiment of the present invention. FIG. 2 is a flowchart showing a procedure of a timer interrupt processing program for an operating system in the embodiment shown in FIG. 1; FIG. 3 is a flowchart showing a part of a procedure of an all-instruction trace single-step interrupt processing program in the embodiment shown in FIG. 1; FIG. 4 is a flowchart showing a part of the single-step interrupt processing program for tracing all instructions in the embodiment shown in FIG. 1 subsequent to FIG. 3; FIG. 5 is a flowchart showing a procedure of an output function of a secondary storage device for tracing all instructions in the embodiment shown in FIG. 1; [Description of Signs] 1 CPU having single-step interrupt function 2 Interrupt control chip 3 System timer 4 Secondary storage device 5 for all instruction trace data 5 Memory 50 Timer interrupt processing program 51 for operating system 51 Other information 52 for operating system Single instruction interrupt processing program 53 for tracing all instructions Output function 54 for secondary storage for tracing all instructions Buffer 55 for secondary storage for tracing all instructions Other information for tracing all instructions

Claims (1)

(57)【特許請求の範囲】【請求項1】 情報処理装置内の中央演算ユニットが全
命令トレースを行い、このトレース対象のオペレーティ
ングシステムが、定期的に割り込みを起こすタイマーを
使用し、該タイマーに対するオペレーティングシステム
の処理も全命令トレースの対象である場合に、この定期
的な割り込みの際に、タイマー割り込み処理が外部変数
であるタイマーカウンタに1を加算し、この割り込みに
対して割り込み処理の完了をタイマーに通知するが、実
際のタイマー処理ルーチンのコール、タイマー割り込み
に対する全命令トレースの実施、および該カウンタの0
クリアを該カウンタの値が外部変数であるタイマー走行
頻度の値に達している時にのみ行い、該タイマーの割り
込みが、割り込み禁止状態での割り込み発生を表す割り
込み保留状態の場合は、全命令トレースデータをバッフ
ァのみに格納し、全命令トレース用の2次記憶装置への
出力を抑止することを特徴とする全命令トレース時のタ
イマー制御方法。
(57) [Claim 1] A central processing unit in an information processing apparatus traces all instructions, and the operating system to be traced uses a timer that periodically generates an interrupt. In the case of this periodic interrupt, the timer interrupt process adds 1 to the external variable, the timer counter, and completes the interrupt process for this interrupt when the operating system process for To the timer, call the actual timer processing routine, perform a full instruction trace for the timer interrupt, and set the counter to 0.
Clearing is performed only when the value of the counter reaches the value of the timer running frequency which is an external variable, and when the interrupt of the timer is in the interrupt pending state indicating the occurrence of an interrupt in the interrupt disabled state, A timer control method for tracing all instructions, wherein all instruction tracing data is stored only in a buffer and output to a secondary storage device for tracing all instructions is suppressed.
JP23925398A 1998-08-25 1998-08-25 Timer control method when tracing all instructions Expired - Lifetime JP3506919B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23925398A JP3506919B2 (en) 1998-08-25 1998-08-25 Timer control method when tracing all instructions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23925398A JP3506919B2 (en) 1998-08-25 1998-08-25 Timer control method when tracing all instructions

Publications (2)

Publication Number Publication Date
JP2000066921A JP2000066921A (en) 2000-03-03
JP3506919B2 true JP3506919B2 (en) 2004-03-15

Family

ID=17042021

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23925398A Expired - Lifetime JP3506919B2 (en) 1998-08-25 1998-08-25 Timer control method when tracing all instructions

Country Status (1)

Country Link
JP (1) JP3506919B2 (en)

Also Published As

Publication number Publication date
JP2000066921A (en) 2000-03-03

Similar Documents

Publication Publication Date Title
US8245002B2 (en) Call stack protection
JP2526352B2 (en) External interrupt prohibited time monitoring method and data processing device in computer system
US8898435B2 (en) Optimizing system throughput by automatically altering thread co-execution based on operating system directives
EP2772853B1 (en) Method and device for building memory access model
JPH02249055A (en) Multiprocessor system, multiprocessing method and work allocation method
US9047138B2 (en) Apparatus and method for thread scheduling and lock acquisition order control based on deterministic progress index
Lo et al. Slack-aware opportunistic monitoring for real-time systems
JP2009110156A (en) Log output device and log output program
CN109656895A (en) Distributed memory system, method for writing data, device and storage medium
US20060190686A1 (en) Cache circuit
KR20020039370A (en) Controlling instruction translation using dynamic feedback
US20060161755A1 (en) Systems and methods for evaluation and re-allocation of local memory space
CN102207913A (en) Write protection control method and device in embedded system
US7051177B2 (en) Method for measuring memory latency in a hierarchical memory system
KR101892273B1 (en) Apparatus and method for thread progress tracking
JP3506919B2 (en) Timer control method when tracing all instructions
JP3506920B2 (en) Method for preventing contention of storage of all instruction trace data in secondary storage device
CN211236890U (en) Detection apparatus for stack overflow and electronic equipment
US11620134B2 (en) Constrained carries on speculative counters
JP2004508607A5 (en)
WO1995034905A1 (en) Computer system with peripheral control functions integrated into host cpu
CN115794750B (en) Method, device and equipment for controlling file opening/closing of asynchronous I/O system
JP2783285B2 (en) Information processing device
JP4755232B2 (en) compiler
JP2007172519A (en) Information processor, link management method for software module, and program

Legal Events

Date Code Title Description
A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20031217

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071226

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081226

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091226

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101226

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101226

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111226

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111226

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121226

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121226

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131226

Year of fee payment: 10

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term