JP3506920B2 - Method for preventing contention of storage of all instruction trace data in secondary storage device - Google Patents

Method for preventing contention of storage of all instruction trace data in secondary storage device

Info

Publication number
JP3506920B2
JP3506920B2 JP23925698A JP23925698A JP3506920B2 JP 3506920 B2 JP3506920 B2 JP 3506920B2 JP 23925698 A JP23925698 A JP 23925698A JP 23925698 A JP23925698 A JP 23925698A JP 3506920 B2 JP3506920 B2 JP 3506920B2
Authority
JP
Japan
Prior art keywords
secondary storage
instruction
storage device
interrupt
output
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
JP23925698A
Other languages
Japanese (ja)
Other versions
JP2000066922A (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 JP23925698A priority Critical patent/JP3506920B2/en
Publication of JP2000066922A publication Critical patent/JP2000066922A/en
Application granted granted Critical
Publication of JP3506920B2 publication Critical patent/JP3506920B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 【0001】 【発明の属する技術分野】本発明は、電子計算機、ワー
ドプロセッサ、電子交換機、ワークステーション等の情
報処理装置内の中央演算ユニット(以下、CPUと略記
する)の全命令トレースデータの2次記憶装置への格納
とトレース対象のオペレーティングシステムによる2次
記憶装置への格納の競合を防止する全命令トレースデー
タの2次記憶装置への格納競合防止方法に関する。 【0002】 【従来の技術】一般に、性能評価等の目的のため、評価
対象のオペレーティングシステムのプログラム(該オペ
レーティングシステム上で動作するすべてのアプリケー
ションプログラムを含み、全命令トレースを行うための
プログラムを除く、以下省略)の命令群の内、CPUが
実行するすべての命令に関する情報(実行された命令の
内容、命令の長さ、レジスタの変化状況、変化したレジ
スタの内容、その他必要に応じてプログラムの管理単位
であるスレッドの情報等の情報)を1命令の実行直前毎
に収集することを、全命令トレースと言い、その全命令
トレースによって収集された情報を全命令トレースデー
タと言う。上記のプログラムは、関数(プログラムから
コールされ、入り口が1つであるプログラム)並びに割
り込み処理プログラム(割り込み等を契機としてコール
されるプログラムであり、通常はプログラムからはコー
ルされないプログラム)からなり、全命令トレースにお
いてはそれらのすべてがトレース対象である(関数のみ
のトレースしか行わないものは、全命令トレースとは言
わない)。 【0003】シングルステップ割り込み機能を持つCP
Uの元での全命令トレースにおいては、関数に関しては
予めCPUのトレースフラグをONとしておき、割り込
み処理に関しては、その先頭でCPUのトレースフラグ
をONとする等によって、CPUに1命令の実行直前毎
にシングルステップ割り込みを起こさせることが一般的
に行われている。CPUが評価対象のオペレーティング
システムの1命令を実行する直前毎に、CPU自身に起
こさせるシングルステップ割り込みを利用して、CPU
は全命令トレース用シングルステップ割り込み処理プロ
グラムに制御を渡し、そのプログラムが全命令トレース
データを収集し、一旦全命令トレースデータバッファと
いうメモリ上のエリアに格納して、上記割り込み元にリ
ターンし、リターン後にCPUは、割り込まれた命令を
1命令実行し、その実行が終わって、次の1命令を実行
する直前に、上記と同様にシングルステップ割り込みを
起こさせることにより、評価対象のオペレーティングシ
ステムのプログラムの命令群の内、実行されるすべての
命令の全命令トレースが行われる。その際に全命令トレ
ースデータバッファは限定された固定の大きさを有する
が、全命令トレースデータの全量は、評価対象のオペレ
ーティングシステムの動作ロジックに依存し、数10メ
ガバイト〜数Gバイトに達するのが普通であるので、該
バッファ上のデータを適宜上記全命令トレース割り込み
処理プログラムが2次記憶装置へ格納することにより、
バッファがオーバフローしないようにする。 【0004】その2次記憶装置は、一般に高速性が要求
されるため、磁気テープ装置、またはハードディスク装
置である。一方、評価対象のオペレーティングシステム
も、一般に全命令トレース用シングルステップ割り込み
処理プログラムが使用する2次記憶装置と同種類の2次
記憶装置を1台以上使用し、オペレーティングシステム
が該2次記憶装置への入出力を行う命令を実行している
時にも、全命令トレース用シングルステップ割り込み処
理プログラムは、それらの全命令トレースを実施しなけ
ればならない(それを行わないトレースは、全命令トレ
ースとは言わない)。その場合、オペレーティングシス
テムが行う入出力処理は、以下のように、全命令レース
用シングルステップ割り込み処理プログラムの入出力処
理とは処理が異なる。 【0005】(A) オペレーティングシステムは、入出力
が行われている間は、CPUをオペレーティングシステ
ムの他の処理で有効利用するために、その入出力を依頼
したオペレーティングシステムのプログラムの動作を一
旦中止して、他にCPUを使用したいオペレーティング
システムのプログラムがあれば、そのプログラムの命令
を実行しなければならない(そうしなければ、入出力が
行われている間、CPUは有効に利用されない)。その
ため入出力の命令を発行する処理と、その入出力の完了
処理を行う処理は、別々の処理であり、後者は、一般に
割り込みを契機に走行する割り込み処理によって実現さ
れる。 【0006】(B) 一方、全命令トレース用シングルステ
ップ割り込み処理プログラムの入出力処理では、その入
出力が行われている間は、CPUは、その入出力の完了
があるまで、オペレーティングシステムの別のプログラ
ムの命令を実行してはならない。なぜならば、オペレー
ティングシステムが実行するプログラムの命令はすべて
トレースされなければならず、全命令トレース用シング
ルステップ割り込み処理プログラムが入出力を行ってい
る間に、オペレーティングシステムの命令が実行される
と、その命令の実行によってシングルステップ割り込み
が発生する場合は、全命令トレース用シングルステップ
割り込み処理プログラムは、自分の処理が終わっていな
いのに、再びオペレーティングシステムの命令の実行に
よって、コールされることになり、以降の処理を正常に
行うことができなくなり、その命令の実行によってシン
グルステップ割り込みが発生しないなら、それらの命令
は、全命令トレースデータとして収集されないからであ
る。従って、全命令トレース用シングルステップ割り込
み処理プログラムの入出力処理は、2次記憶装置へ入出
力命令を発行した場合は、その入出力が完了するまで、
内部でループ等を行い、その完了を待ち合わせる。その
入出力が完了するまでは、全命令トレース用シングルス
テップ割り込み処理プログラムは割り込み元にリターン
しないし、(緊急を要する異常処理を除く通常の)割り
込みも禁止である。 【0007】このことは、全命令トレース用シングルス
テップ割り込み処理プログラムが2次記憶装置へ入出力
している間には、オペレーティングシステムが2次記憶
装置へ新たな入出力の命令を発行することはないことを
意味するが、オペレーティングシステムが2次記憶装置
へ入出力をしている間に、全命令トレース用シングルス
テップ割り込み処理プログラムが2次記憶装置への入出
力を行うことが有り得る。 【0008】従って、全命令トレース用シングルステッ
プ割り込み処理プログラムが2次記憶装置への入出力完
了をループで待ち合わせている時に、オペレーティング
システム用の入出力が完了することが有り得る。その場
合は、全命令トレース用シングルステップ割り込み処理
プログラムは、その完了を処理しなければ、自分が発行
した入出力の完了を受け取ることができない(ハードウ
ェアは、先に完了したものを処理しない限り、後で完了
したものを入出力装置内等に保留して、CPUに報告し
ない)。その完了を処理するということは、全命令トレ
ース用シングルステップ割り込み処理プログラムがオペ
レーティングシステムの2次記憶装置の処理を行わなけ
ればならないことを意味する。それは上記(B)に反す
る。従って、従来の技術においては、それらを回避する
ために下記のいずれかの方法をとっていた。 【0009】(1)全命令トレースを完全に行うが、オ
ペレーティングシステムが使用する2次記憶装置のIR
Q番号(実施例より大型の計算機ではチャネル番号とい
う以下省略)と全命令トレース用シングルステップ割り
込み処理プログラムが使用する2次記憶装置のIRQ番
号とは別々の物を使用することにより、全命令トレース
用シングルステップ割り込み処理プログラムが2次記憶
装置に入出力を行っている間に同一のIRQ番号にオペ
レーティングシステムの2次記憶装置の入出力の完了が
発生することは有り得ないようにする。 【0010】(2)入出力割り込み処理等は、全命令ト
レースしない。これにより、全命令トレース用シングル
ステップ割り込み処理プログラムがオペレーティングシ
ステム用の入出力処理を行っても支障がないようにする
(これは、全命令トレースを行わないことに等しい)。 【0011】 【発明が解決しようとする課題】しかしながら、上記
(2)においては、実行された評価対象のすべての命令
をトレースできないので正確な性能評価を行うことがで
きない。 【0012】また、上記(1)においては、以下の問題
があった。 【0013】例えば、IBM互換パソコンのように、シ
ステム自体のコストを低く抑える必要がある場合等で
は、2次記憶装置が2台しかなく、それらが同一のIR
Q番号配下に接続されていることは、別にめずらしいこ
とではなく、その場合オペレーティングシステムと全命
令トレース用シングルステップ割り込み処理プログラム
は、同一のIRQ番号を使用しなければならない。その
場合、従来の技術では、オペレーティングシステムによ
る2次記憶装置へのアクセスを含んだ全命令トレースを
行うことができない。 【0014】本発明は、上記に鑑みてなされたもので、
その目的とするところは、オペレーティングシステムが
使用する2次記憶装置と全命令トレース用シングルステ
ップ割り込み処理プログラムが使用する2次記憶装置と
が同一IRQ番号配下に存在しても全命令トレースを矛
盾なく実行することができる全命令トレースデータの2
次記憶装置への格納競合防止方法を提供することにあ
る。 【0015】 【課題を解決するための手段】上記目的を達成するた
め、請求項1記載の本発明は、情報処理装置内の中央演
算ユニットが全命令トレースを行い、その全命令トレー
スデータがすべて第一の2次記憶装置に格納される場合
において、トレース対象のオペレーティングシステムも
上記と同種の第二の2次記憶装置を使用する場合、それ
らの2次記憶装置が同一IRQ番号配下にあっても、支
障なく、それらの2次記憶装置への格納が行われること
を実現するために、オペレーティングシステムが第二の
2次記憶装置に入出力を行っている間は、全命令トレー
スシングルステップ割り込み処理プログラムにより前記
中央演算ユニットが、全命令トレースデータの第一の
次記憶装置への出力を抑止すること、出力を抑止してい
期間には、前記全命令トレースシングルステップ割り
込み処理プログラムにより前記中央演算ユニットが、割
り込み禁止状態での割り込み発生を表す割り込み保留ビ
ットが立つまでループしてオペレーティングシステムの
前記入出力に関する命令以外を実行させないこと、およ
びオペレーティングシステムの入出力の完了処理の完了
を検出し、この検出時に全命令トレースデータの第一の
2次記憶装置への出力を開始することを要旨とする。 【0016】 請求項1記載の本発明にあっては、オペ
レーティングシステムが第二の2次記憶装置に入出力を
行っている間は、全命令トレースシングルステップ割り
込み処理プログラムにより中央演算ユニットが、全命令
トレースデータの第一の2次記憶装置への出力を抑止す
ること、出力を抑止している期間には、全命令トレース
シングルステップ割り込み処理プログラムにより中央演
算ユニットが、割り込み禁止状態での割り込み発生を表
す割り込み保留ビットが立つまでループしてオペレーテ
ィングシステムの前記入出力に関する命令以外を実行さ
せないこと、およびオペレーティングシステムの入出力
の完了処理の完了を検出し、この検出時に全命令トレー
スデータの第一の2次記憶装置への出力を開始するの
で、2次記憶装置が同一IRQ番号配下にあっても、支
障なく、2次記憶装置への格納が行われることを実現で
きる。 【0017】 【発明の実施の形態】本発明の実施の形態を説明する前
に、まず本発明の考え方および概要について説明する。 【0018】上記の従来の技術における問題点の根本原
因は、オペレーティングシステムが入出力を実行中であ
るところの2次記憶装置のIRQ番号と同じIRQ番号
で、全命令トレース用シングルステップ割り込み処理プ
ログラムが2次記憶装置の入出力を開始してしまう点に
ある。従って、全命令トレース用シングルステップ割り
込み処理プログラムが使用するIRQ番号配下の2次記
憶装置にオペレーティングシステムが入出力を実行中の
場合、全命令トレース用シングルステップ割り込み処理
プログラムは、2次記憶装置への入出力命令の発行を抑
止し、実行中のI/Oが完了し、その割り込み処理が終
わった時点で、抑止した入出力命令の発行を行えばよ
い。 【0019】その場合、実行中のI/Oの完了の割り込
み処理の全命令トレースデータは、そのI/Oが完了す
るまで2次記憶装置に出力できないので、すべて、該バ
ッファ上に格納できなければならない。従って、該バッ
ファの大きさ十分に大きいものにしなければならない。
なお、本発明の実施形態においては、バッファの大きさ
は5MBであり、1命令当たりの全命令トレースデータ
は平均で50バイトであるので、100Kstep の割り込
み処理の全命令トレースデータの格納が可能であり、問
題はない。 【0020】また、そのI/Oの抑止中においては、オ
ペレーティングシステムの該当の2次記憶装置の入出力
処理以外の他のプログラムが動作すると、バッファが直
ぐ足らなくなるので、全命令トレース用シングルステッ
プ割り込み処理プログラムは、ループして、オペレーテ
ィングシステムの入出力の完了を待ち合わせ、その後、
オペレーティングシステムにリターンして、オペレーテ
ィングシステムが割り込み処理を完了するまで、2次記
憶装置への出力を開始せず、オペレーティングシステム
の割り込み処理の完了を検知した時点で2次記憶装置す
べてへの出力を開始する。 【0021】なお、高性能な情報処理システム等におい
ては、そのシステムの性能限界はCPUがネックになる
ように設計され、決して、オペレーティングシステムが
使用する2次記憶装置への入出力がネックとなるように
は設計されない。その場合、全命令トレースルーチンに
より使用される2次記憶装置が接続されているIRQ番
号配下内における「オペレーティングシステムが使用す
る2次記憶装置と、その入出力によるIRQの使用率」
は、通常30%以下の低使用率となるように設計され
る。そのような高性能な設計のシステムにおいては、上
記2次記憶装置への1回の入出力処理において実行され
る命令の数は、高々数キロステップであり、それらの最
大多重入出力数は、高々数入出力である。従って、上記
のように、オペレーティングシステムが入出力を行って
いる間、全命令トレース用シングルステップ割り込み処
理プログラムが、2次記憶装置への入出力を抑止して
も、その間に、オペレーティングシステムの該2次記憶
装置に関する処理以外の処理を走行させない限り、また
バッファの大きさを実施形態のように5メガバイト以上
としておく限り、支障はない(バッファがオーバフロー
して動作不能になることはない)。 【0022】本発明においては、上述したように、全命
令トレース用シングルステップ割り込み処理プログラム
が使用する2次記憶装置のIRQ番号と同じIRQ番号
配下の2次記憶装置へのオペレーティングシステムの入
出力を許容するが、そのオペレーティングシステムの入
出力を行っている間は、全命令トレース用シングルステ
ップ割り込み処理プログラムが2次記憶装置への入出力
命令の発行を抑止し、その抑止中にオペレーティングシ
ステムのその入出力に関連する処理以外の処理を動作さ
せず、且つ、その入出力の完了処理をオペレーティング
システムが行った直後に全命令トレースの2次記憶装置
への入出力を開始することにより、全命令トレース用シ
ングルステップ割り込み処理プログラムが2次記憶装置
への入出力を実行している時に、該IRQ番号に対し
て、「その実行中の入出力」以外の入出力の完了が報告
されることがないことを実現し、且つ、全命令トレース
がバッファオーバフローを起こすことなく実施されるこ
とを可能とする。 【0023】次に、図面を用いて、本発明の実施形態に
ついて説明する。図1は、本発明の一実施形態に係る全
命令トレースデータの2次記憶装置への格納競合防止方
法を実施する装置の構成を示すブロック図である。同図
に示す実施形態は、シングルステップ割り込み機能を有
するCPU1(例えば、INTEL Pentium )、割り込み制
御チップ2(例えば、INTEL 8259)、オペレーティング
システム用の2次記憶装置3(例えば、IDEプライマ
リーHD、装置番号0、IRQ番号14配下)、全命令
トレースデータ用の2次記憶装置4(例えば、IDEセ
カンダリーHD、装置番号1、IRQ番号14配下)、
およびメモリ5を有する。メモリ5は、オペレーティン
グシステム用2次記憶装置の割り込み処理プログラム5
0、オペレーティングシステム用2次記憶装置の入出力
関数51、オペレーティングシステム用のその他の情報
52、全命令トレース用シングルステップ割り込み処理
プログラム53、全命令トレース用2次記憶装置の出力
関数54、全命令トレース用2次記憶装置のバッファ5
5、および全命令トレース用のその他の情報56を記憶
している。 【0024】まず、シングルステップ割り込み機能を有
するCPU1は、割り込み制御チップ2と信号線によっ
て接続されており、該チップからの割り込みの有無や該
チップの状態の情報等を受け取ることができ、また、該
チップへの割り込み受け取り完了の通知等の情報を出力
できる。CPU1は、オペレーティングシステム用の2
次記憶装置3、全命令トレースデータ用の2次記憶装置
4およびメモリ5とバスによって接続されており、それ
らの装置並びにメモリと情報のリードおよびライトが可
能である。 【0025】次に、図2〜図6に示すフローチャートを
参照して、図1に示す実施形態の作用について説明す
る。図2はオペレーティングシステム用の2次記憶装置
の入出力関数51の手順を示すフローチャートであり、
図3はオペレーティングシステム用の2次記憶装置の割
り込み処理プログラム50の手順を示すフローチャート
であり、図4は全命令トレース用シングルステップ割り
込み処理プログラム53の一部の手順を示すフローチャ
ートであり、図5は全命令トレース用シングルステップ
割り込み処理プログラム53の図4に続く一部の手順を
示すフローチャートであり、図6は全命令トレース用の
2次記憶装置の出力関数54の手順を示すフローチャー
トである。 【0026】今、オペレーティングシステム用のその他
の情報52の中のプログラムが、オペレーティングシス
テム用の2次記憶装置3にデータを書き込むためのI/
Oイベント(処理を依頼するためのデータの集合)を作
成し、それをパラメータとして、オペレーティングシス
テム用の2次記憶装置の入出力関数51をコールし、そ
の時にオペレーティングシステム用の2次記憶装置3に
対する実行中のI/Oイベントはない場合を例に取って
説明する。その時、システムは全命令トレース実施中の
状態[CPUのトレースフラグはON、全命令トレース
用の外部変数「全命令トレース実行中」がON(外部変
数はどこからでも可視であるので、どこに存在してもか
まわないが、本実施形態では、外部変数は、すべて全命
令トレース用のその他の情報56内にある)]で、全命
令トレース用のその他の情報56内にある全命令トレー
ス用のすべての内部カウンタは0である。 【0027】オペレーティングシステム用の2次記憶装
置の入出力関数51は、コールされると、シングルステ
ップ割り込み機能を有するCPU1は、図2のステップ
S100の命令を実行しようとする(*1)。この時、
CPU1はトレースフラグがONであるので、シングル
ステップ割り込みが発生し、その時に実行されようとし
た命令のアドレスが、オペレーティングシステム用のそ
の他の情報52の中のスタックエリア(以下、スタック
エリアと略記する)に設定され、CPU1のトレースフ
ラグがOFFに設定された後(以上の処理は、一般的
な”シングルステップ割り込み機能を有するCPU1”
のシングルステップ割り込みに対するCPUの機能であ
る)、図4の全命令トレース用シングルステップ割り込
み処理プログラムに制御が渡る。 【0028】図4においては、ステップS300でレジ
スタ等をスタックエリアに退避し、ステップS301の
全命令トレース実行中のチェックで、YESであるの
で、ステップS303で全命令トレース用バッファが満
杯かをチェックし、ここでは、システムにバグがない限
りNOであるので、ステップS305で全命令トレース
データを収集して、全命令トレース用2次記憶装置のバ
ッファ55に格納し、ステップS306で、バッファ5
5に格納されている全命令トレースデータが512バイ
ト(2次記憶装置の1ブロック)以上であるかをチェッ
クする。 【0029】全命令トレースデータは、1命令平均で、
およそ50バイトの情報であるので、ステップS306
でYESとなる確率は、10分の1未満であるので、大
多数の場合、該ステップは、NOとなる。NOの場合
は、図5のステップS400,S402,S404およ
びS406のチェックが実施される。今回の場合、それ
らのシングルステップ割り込み処理で割り込まれた命令
のアドレスは、上記(*1)であり、フローチャートの
ステップS100の命令であるので、ステップS40
0,S402,S404およびS406のチェックの
内、ステップS400のみがYESとなり、ステップS
401において、全命令トレース用のその他の情報56
内にある外部変数「2次記憶装置書き込み禁止カウン
タ」に1が加算され、その結果1になる。その後、ステ
ップS408でレジスタ等の回復が行われ、ステップS
409でIRET命令が発行されることにより、上記
(*1)の割り込み元に戻る(その際、CPUによっ
て、トレースフラグが、割り込みの直前の状態に戻され
る。この場合ONに戻る)。 【0030】この「2次記憶装置書き込み禁止カウン
タ」は、オペレーティングシステム用の2次記憶装置の
割り込み処理プログラム50、オペレーティングシステ
ム用のその他の情報52内にあるその他の割り込み処理
プログラムや入出力関数およびオペレーティングシステ
ム用の2次記憶装置の入出力関数51が2次記憶装置ま
たはその他の装置(図1内では省略)に入出力を行う場
合に、0以外に設定するもので、オペレーティングシス
テム用の装置への一連の入出力命令の発行が(途中で、
全命令トレースデータ用の2次記憶装置への出力処理に
よって中断することによる)オーバランを起こさないた
めに存在し、0以外の場合には、全命令トレースデータ
の2次記憶装置への出力が抑止される。 【0031】上記(*1)の割り込み元に戻ると、CP
Uは、図2のステップS100の命令を1つだけ実行す
る。ここでは、ステップS100において、指定のIR
Q番号の指定の装置番号(本実施形態では、オペレーテ
ィングシステム用の2次記憶装置は、1つしかなく、I
RQ=14、装置番号=0に固定)のキュー(オペレー
ティングシステム用のその他の情報52内にある)にI
/Oイベントがあるかをチェックする。ここでは、無い
ので次のステップS103に進み、CPUは、ステップ
S103の命令を実行しようとする(*2)が、CPU
のトレースフラグがONであるので、再び、シングルス
テップ割り込みが発生し、図4の全命令トレース用シン
グルステップ割り込み処理のステップS300以降が実
行される。この場合、2次記憶装置書き込み禁止カウン
タは1に設定されているので、上記と同様に、ステップ
S300,S301,S303,S305を実行した
後、ステップS306で、バッファに512バイト以上
の全命令トレースデータがもしあっても、ステップS3
07がNOとなるので、ステップS308が実行される
(全命令トレース用の2次記憶装置の出力関数がコール
される)ことはない。また、ステップS400,S40
2,S404およびS406のチェックでも、上記(*
2)のアドレスは、すべてNOなるので、全命令トレー
ス用シングルステップ割り込み処理プログラムは、ステ
ップS305で、全命令トレースデータを収集して、バ
ッファに格納するだけで、2次記憶装置には出力するこ
となく、ステップS408でレジスタ等の回復を行い、
ステップS409でIRET命令で割り込み元(*2)
へ戻る。 【0032】割り込み元に戻ると、ステップS103に
ある処理のために、複数の命令が実行され、それぞれの
命令に対して、シングルステップ割り込みが発生する
(*3)が、上記(*2)と同様に、ステップS305
で、全命令トレースデータを収集して、バッファに格納
するだけで、2次記憶装置には出力することなく、ステ
ップS408でレジスタ等の回復を行い、ステップS4
09でIRET命令で割り込み元(*3)へ戻る。 【0033】次に、CPU1は、ステップS104で命
令を実行しようとし(*4)、その際に、同様にシング
ルステップ割り込みが生じ、上記と同様にステップS3
05で全命令トレースデータを収集してステップS30
6でYESとなり、ステップS307でNOとなり、ス
テップS400でNOとなり、ステップS402でNO
となるが、ステップS404においてフローチャートの
ステップS104の命令に該当するのでYESとなり、
ステップS405において、外部変数「2次記憶装置状
態」に1が設定され(*10)、ステップS406はN
Oで、ステップS408、ステップS409が実行され
て、割り込み元(*4)に戻ることになる。 【0034】割り込み元(*4)では、ステップS10
4にある複数の命令が実行されて、オペレーティングシ
ステム用に2次記憶装置への入出力命令が発行される
が、それらのシングルステップ割り込みにおいては、上
記(*2)の場合と同様に、ステップS305で、全命
令トレースデータを収集して、バッファに格納するだけ
で、2次記憶装置の出力関数をコールすることなく、ス
テップS408でレジスタ等の回復を行い、ステップS
409でIRET命令で割り込み元(*4)へ戻る。 【0035】次に、図2のステップS105のリターン
命令が実行されようとする時のシングルステップ割り込
みにおいては、ステップS305で、全命令トレースデ
ータを収集して、バッファに格納するだけで、2次記憶
装置の出力関数をコールすることなく、ステップS40
2まで進むが、ステップS402で、割り込まれた命令
のアドレスがフローチャートのステップS105に一致
するので、ステップS403で、2次記憶装置書き込み
禁止カウンタが1減算され、0に戻る。従って、ステッ
プS409を経て、割り込み元のステップS105のR
ETURN命令が実行された後、「図2のオペレーティ
ングシステム用の2次記憶装置の入出力関数のコール元
であるオペレーティングシステムのプログラムにリター
ンした時に実行されるべき命令」が実行される直前(*
5)に発生するシングルステップ割り込みにおいて、ス
テップS300,S301,S303,S305,S3
06,S307と順次実行された時、ステップS307
の”2次記憶装置書き込み禁止カウンタ”は零か否かの
チェックで、YESとなり、ステップS308で、全命
令トレース用の2次記憶装置の出力関数(図6)がコー
ルされる。 【0036】全命令トレース用の2次記憶装置の出力関
数(図6)は、ステップS500において、2次記憶装
置状態が0かどうかをチェックし、該値は、上記(*1
0)で1に設定されているので、NOとなり、ステップ
S509へ行き、ステップS509のチェックで、YE
Sとなる。従って、ステップS510へ行き、該ステッ
プでは、割り込み制御チップ2に対して割り込み保留ビ
ットを読み出す命令を発行し、IRQ14の割り込み保
留ビットが立っているかどうかをチェックすることによ
り、オペレーティングシステム用の2次記憶装置の入出
力が完了したかどうかをチェックする。なお、当関数
は、シングルステップ割り込み処理の延長として走行し
ており、シングルステップ割り込み処理は、割り込み禁
止で走行するので、2次記憶装置の動作が完了した場
合、割り込みは発生せず、代わりに上記の割り込み保留
ビットが立つ。その割り込みが発生するのは、シングル
ステップ割り込み処理がリターンし、リターン元で、割
り込み禁止でないプログラムの命令が実行された時であ
る。これらは、割り込み処理に関する一般的な基本的処
理概念(常識)である。 【0037】前記割り込み保留ビットが立っていなけれ
ば、オペレーティングシステム用の2次記憶装置の入出
力は完了していないので、再びステップS510を実行
し、該割り込み保留ビットが立つまで(オペレーティン
グシステム用の2次記憶装置の入出力が完了するまで)
ループする。オペレーティングシステム用の2次記憶装
置の入出力が完了すると、該割り込み保留ビットが立つ
ので、ステップS510でYESとなり、ステップS5
11に進み、ステップS511では、オペレーティング
システムに該入出力の完了処理を行わせるために、2次
記憶装置状態を2に設定し、ステップS507へ行って
RETURN命令を実行することによりリターンして図
4のステップS400へ行く。ステップS400,S4
02,S404,S406では、すべてNOであるの
で、ステップS408,S409を経て、上記(*5)
の割り込み元に戻る。ここで、オペレーティングシステ
ムは、図2のオペレーティングシステム用の2次記憶装
置の入出力関数からリターンした直後であり、該関数は
通常割り込み禁止で走行する必要があるため、しばらく
(数10ステップ)の間、割り込み禁止状態で走行した
後、割り込み禁止を解除する。 【0038】従って、上記の割り込み禁止状態で走行し
ている間は、そのシングルステップの割り込みにおいて
は、ステップS305において全命令トレースデータを
収集してバッファに格納した後、ステップS308で、
全命令トレース用の2次記憶装置の出力関数(図6)が
コールされるが、該関数は、2次記憶装置状態が2の状
態であるので、ステップS500,S509,S512
が実行され、ステップS512において、YESとな
り、何もしないでリターンする(*11)。従って、そ
のシングルステップの割り込み処理においては、ステッ
プS305において全命令トレースデータを収集してバ
ッファに格納するだけの処理を行う。 【0039】上記で、オペレーティングシステムによっ
て割り込み禁止が解除されると、オペレーティングシス
テム用の2次記憶装置の入出力は割り込み保留状態にな
っているので、その完了の割り込みが発生し、CPUは
(一般的なCPU1の機能によって)CPUのトレース
フラグをOFFに設定し、図3のオペレーティングシス
テムの2次記憶装置の割り込み処理プログラムのステッ
プS200に制御を渡す。 【0040】ステップS200においては、レジスタ等
の退避を行い、ステップS201で全命令トレースが実
行中であるかをチェックする。ここでは、YESである
ので、ステップS202が実行され、ステップS203
以降の命令でシングルステップ割り込みが生じるよう
に、CPUのトレースフラグをONとする。なお、この
ステップS200〜ステップS202の命令は、全命令
トレース機能がないオペレーティングシステムには存在
しない。従って、該命令は、オペレーティングシステム
の割り込み処理の中にあるが、機能的には、全命令トレ
ース用のプログラムであり、全命令トレースの対象では
なく、トレースされなくても性能評価には、全く影響を
与えない。 【0041】次に、ステップS203の命令が実行され
る直前(*12)に、シングルステップ割り込み処理が
発生し、図4の全命令トレース用シングルステップ割り
込み処理プログラムに制御が渡る。該プログラムでは、
上記(*11)と同様に、ステップS301,S303
を実行して、ステップS305で全命令トレースデータ
を収集してバッファに格納し、ステップS306,S3
07,S308を実行し、ステップS308でコールさ
れた全命令トレース用の2次記憶装置の出力関数は(2
次記憶装置状態が2であるので)何もしないでリターン
するが、ステップS400〜ステップS406の処理
で、ステップS400だけが、フローチャートのステッ
プS203の命令を検出するので、YESとなり、ステ
ップS401で、2次記憶装置書き込み禁止カウンタに
1を加算し、該カウンタの値は1になり、ステップS4
08,S409を経て割り込み元(*12)にリターン
する。リターンすると、図3のオペレーティングシステ
ム用の2次記憶装置の割り込み処理プログラムは、ステ
ップS203,S204,S205,S206,S20
7,S209の命令を実行し、ステップS204〜ステ
ップS209のそれぞれの命令を実行する直前にシング
ルステップ割り込みが発生するが、その時は、2次記憶
装置書き込み禁止カウンタが1であり、該当の命令のア
ドレスは、ステップS400〜ステップS406のチェ
ックに一致しないので、図4、図5の全命令トレース用
シングルステップ割り込み処理プログラムは、ステップ
S300,S301,S303,S305,S306,
S307,S400,S402,S404,S406,
S408,S409の順で動作し、実質、ステップS3
05で全命令トレースデータを収集してバッファに格納
する処理のみを行う(*13)。 【0042】次に、ステップS210の命令の実行を行
う直前のシングルステップ割り込みにおいては、図4、
図5の全命令トレース用シングルステップ割り込み処理
プログラムは、ステップS300,S301,S30
3,S305,S306,S307,S400,S40
2,S404までの処理が上記(*13)と同様である
が、ステップS406において、命令のアドレスがフロ
ーチャートのステップS210の命令(オペレーティン
グシステムの2次記憶装置への入出力の完了処理の完了
の検出)であって、2次記憶装置状態=2であるので、
YESとなり、ステップS407へ行って、2次記憶装
置状態に3を設定して、全命令トレース用の2次記憶装
置の出力関数(図6)をコールする。 【0043】全命令トレース用の2次記憶装置の出力関
数は、制御が渡されると、2次記憶装置状態が3である
ので、ステップS500,S509,S512,S51
3を実行し、ステップS513は、2次記憶装置状態に
0を設定した後、ステップS501へ行き、ステップS
501は、全命令トレースバッファに書かれている内容
の内、512バイトの部分を(全命令トレース用の)2
次記憶装置(装置番号=1)に出力する入出力命令を発
行し、ステップS502で、その入出力が完了する(該
装置の状態の入力のための入力命令の発行を行い、該装
置の状態がビジー状態でなく、且つ、IRQ番号=14
に割り込み保留ビットが立っていない状態になる)のを
ループで待ち合わせ、その後、ステップS503,S5
05,S506を実施する。なお、ステップS506
で、バッファ内に未だデータが残っていれば、ステップ
S501,S502,S503,S505,S506を
繰り返して実行する。また、ステップS504とステッ
プS508は、異常処理であり、通常は実行されること
はない。 【0044】 【発明の効果】以上説明したように、本発明によれば、
オペレーティングシステムが使用する2次記憶装置と全
命令トレース用シングルステップ割り込み処理プログラ
ムが使用する2次記憶装置とが同一IRQ番号配下に存
在しても、前者への入出力が実行中には、後者への入出
力の開始が抑止され、且つ、その抑止中には、オペレー
ティングシステムの入出力関連のプログラム以外のオペ
レーティングシステムのプログラムが実行されず、且つ
上記実行中のオペレーティングシステムの入力が完了し
た時に、その完了を検出して、全命令トレース用の2次
記憶装置への入力を開始するので、バッファをオーバフ
ローさせることなく、上記の両者の入出力を矛盾なく実
行させ、且つ、全命令トレースの実行を、オペレーティ
ングシステム上で実行される割り込み処理を含んだすべ
ての命令について行うことが可能となる。
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)
All instruction trace data stored in the secondary storage device
And secondary depending on the operating system being traced
All instruction trace data to prevent contention for storage
The present invention relates to a method for preventing contention of data in a secondary storage device. [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. CPU is the operating system to be evaluated
Every time immediately before executing one instruction of the system, the CPU wakes up.
Using a single-step interrupt
Is a single-step interrupt handler for all instruction traces
Control to the program and the program traces all instructions
Collects data and temporarily stores it in all instruction trace data buffers.
To the interrupt source.
Turn, and after returning, the CPU executes the interrupted instruction.
Executes one instruction, and after the execution, executes the next instruction
Just before, a single-step interrupt
The operating system to be evaluated.
All of the instructions executed in the system
A full instruction trace of the instruction is performed. At that time all instruction tray
Source data buffer has a limited fixed size
However, the total amount of all instruction trace data is
Tens of memory depending on the operating logic of the
Since it usually reaches several gigabytes to several gigabytes,
All the instruction trace interrupts described above can be performed on the data in the buffer as appropriate.
By storing the processing program in the secondary storage device,
Avoid buffer overflow. The secondary storage device generally requires high speed.
The tape drive or hard disk drive.
Place. Meanwhile, the operating system being evaluated
Also generally a single step interrupt for all instruction traces
Secondary of the same type as the secondary storage used by the processing program
An operating system that uses one or more storage devices
Is executing an instruction to input / output to / from the secondary storage device
Sometimes, single-step interrupt processing for all instruction traces
Management program must perform all these instruction traces.
(Traces that do not do this are all instruction traces.
Do not call it a source). In that case, the operating system
The input / output processing performed by the system is as follows:
Processing of single-step interrupt processing program
The processing is different from the processing. (A) The operating system has input and output
CPU is operating system while
Request input / output for effective use in other processes
Operation of the operating system programs
Any other operating that wants to stop and use the CPU
Instructions for the system program, if any
(Otherwise I / O is
During this time, the CPU is not used effectively). That
Issue I / O instructions and complete the I / O
The processing that performs the processing is a separate processing, and the latter is generally
Realized by interrupt processing that runs when an interrupt occurs
It is. (B) On the other hand, a single step
In the input / output processing of the
While output is being performed, the CPU completes its input / output.
Until another program in the operating system
System instructions must not be executed. Because the operation
All the instructions of the program executed by the operating system
Must be traced, single for all instruction trace
The step interrupt processing program is performing input / output.
Operating system instructions are executed during
And the execution of that instruction causes a single-step interrupt
Occurs, a single step for all instruction traces
The interrupt processing program has not completed its own processing.
Nevertheless, once again to execute operating system instructions
Therefore, it will be called, and the subsequent processing will be performed normally.
And the execution of the instruction
If a single-step interrupt does not occur,
Is not collected as all instruction trace data.
You. Therefore, a single step interrupt for all instruction traces
I / O processing of the data processing program enters and exits the secondary storage device
If you issue a force command,
Perform a loop inside and wait for its completion. That
Until I / O is completed, single instruction trace for all instructions
Step interrupt processing program returns to interrupt source
No, and normal (except for emergency processing that is urgent)
Is also prohibited. This is because the singles for all instruction traces
Step interrupt processing program inputs / outputs to / from secondary storage device
While the operating system is in secondary storage
That no new I / O commands are issued to the device.
Means that the operating system is secondary storage
Singles for all instruction traces while
Step interrupt processing program enters / exits to secondary storage
It is possible to do force. Accordingly, a single step for tracing all instructions is
Interrupt processing program completes I / O to secondary storage
While waiting in a loop for
Input and output for the system may be completed. On the spot
Single-step interrupt processing for all instruction traces
The program will issue itself if it does not handle its completion
Cannot receive completion of input / output (hardware
Unless a previously completed one is processed,
Hold the data in the input / output device and report it to the CPU.
Absent). Processing its completion means that all instruction
Source single-step interrupt processing program
The secondary storage device of the rating system must be processed.
Means you have to. It goes against (B) above
You. Therefore, in the prior art, they are avoided.
To do so, one of the following methods was used. (1) Although all instruction tracing is performed completely,
IR of secondary storage used by operating system
Q number (channel number for computers larger than the embodiment)
Below) and single step division for all instruction traces
Number of the secondary storage device used by the embedded processing program
All instruction traces by using a separate object
Single-step interrupt processing program for secondary storage
Operate to the same IRQ number while inputting / outputting to / from the device.
Completion of input / output of the secondary storage device of the rating system
Make it impossible to happen. (2) I / O interrupt processing and the like
Do not race. This allows a single instruction trace for all instructions
The step interrupt processing program is
Ensure that I / O processing for the stem does not interfere
(This is equivalent to not doing a full instruction trace). [0011] SUMMARY OF THE INVENTION
In (2), all executed instructions to be evaluated
Cannot be traced for accurate performance evaluation.
I can't. Further, in the above (1), the following problem is encountered.
was there. For example, as in an IBM compatible personal computer,
When it is necessary to keep the cost of the stem itself low
Means that there are only two secondary storage devices and they are the same IR
Being connected under the Q number is a rare
And not in that case the operating system and the whole life
Instruction trace single-step interrupt processing program
Must use the same IRQ number. That
In some cases, the conventional technology depends on the operating system.
Traces all instructions, including access to secondary storage
Can't do it. The present invention has been made in view of the above,
The goal is that the operating system
Secondary storage to be used and single instruction for all instruction traces
Secondary storage used by the interrupt processing program
Traces all instructions even if they exist under the same IRQ number
2 of all instruction trace data that can be executed without shield
To provide a storage contention prevention method for secondary storage
You. [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 arithmetic unit traces all instructions and traces all instructions.
Data is everythingFirstWhen stored in secondary storage
The operating system being traced
Same as aboveSecondIf using secondary storage,
Even if these secondary storage devices are under the same IRQ number,
Without troubleTheir secondaryStorage in the storage device is performed
Operating system to achieveSecond
During input / output to / from the secondary storage device,All instruction tray
The single-step interrupt processing program
The central processing unitOf all instruction trace dataFirst2
Suppressing output to the secondary storage device;Output is suppressed
ToDuring the period, All instruction trace single step division
The central processing unit is assigned by the
Interrupt pending display indicating that an interrupt has occurred in the interrupt disabled state.
Loop until you standOperating system
Not to execute instructions other than the input / output instructions; and
BCompletion of operating system input / output completion processing
Is detected, and when this is detected, all instruction trace dataFirst
The gist is to start output to the secondary storage device. In the first aspect of the present invention, the operation
Rating systemSecondI / O to secondary storage
While you go,All instruction trace single step division
The central processing unit isAll instructions
Trace dataFirstSuppress output to secondary storage
ThatOutput is suppressedDuring the period, Trace all instructions
Central performance with single-step interrupt processing program
The arithmetic unit indicates that an interrupt has occurred while interrupts are disabled.
Loop until the interrupt pending bit is setOperate
Command other than the input / output instructions of the
Not toBOperating system input and output
Completion processing completion is detected.
DataFirstStarting output to secondary storage
Even if the secondary storage device is under the same IRQ number,
Without troubleSecondaryCan be stored in a storage device.
Wear. [0017] DESCRIPTION OF THE PREFERRED EMBODIMENTS Before describing an embodiment of the present invention.
First, the concept and outline of the present invention will be described. [0018] At the root of the above problems in the prior art
This is because the operating system is performing I / O.
IRQ number that is the same as the IRQ number of the secondary storage device
Is a single-step interrupt processing program for tracing all instructions.
The point where the program starts I / O to the secondary storage device
is there. Therefore, single step split for all instruction traces
Description under the IRQ number used by the embedded processing program
Operating system is performing I / O to storage
Single step interrupt processing for all instruction traces
The program suppresses the issue of I / O instructions to the secondary storage device.
Stops, the I / O being executed is completed, and the interrupt processing ends.
At that point, issue the suppressed I / O instruction.
No. In this case, the completion interrupt of the I / O being executed is interrupted.
All the instruction trace data of the processing
Cannot be output to the secondary storage device until the
Must be able to be stored on the buffer. Therefore, the battery
The size of the web must be large enough.
In the embodiment of the present invention, the size of the buffer
Is 5MB, all instruction trace data per instruction
Is 50 bytes on average, so 100Kstep interrupt
Can store trace data for all instructions in the
There is no title. During the suppression of the I / O, the
Input / output of the corresponding secondary storage device of the operating system
When another program other than the processing runs, the buffer is
Single step for all instruction traces.
The interrupt processing program loops and operates
Waiting for the input and output of the
Return to the operating system and
Until the operating system completes the interrupt processing.
Operating system without starting output to storage device
When the completion of the interrupt processing of the secondary storage device is detected,
Start output to all. Incidentally, in a high-performance information processing system, etc.
The CPU is the bottleneck for the performance limit of the system
Never been designed so that the operating system
I / O to the secondary storage device used will be a bottleneck
Is not designed. In that case, all instruction trace routines
IRQ number to which the secondary storage device to be used is connected
Under the operating system
Secondary storage device and IRQ usage by its input / output "
Is designed to have a low usage rate, usually less than 30%
You. In systems with such high performance designs,
Is executed in one input / output processing to the secondary storage device.
The number of instructions is at most a few kilosteps,
The large multiplex input / output number is a number input / output at most. Therefore,
The operating system performs input and output, as in
During execution, single-step interrupt processing for all instruction traces
Management program inhibits I / O to secondary storage device
In the meantime, the secondary storage of the operating system
Unless running processes other than those related to the device,
Buffer size must be 5 MB or more as in the embodiment
No problem as long as the buffer overflows
Will not be disabled). In the present invention, as described above,
Instruction trace single-step interrupt processing program
IRQ number that is the same as the IRQ number of the secondary storage device used by
Entering the operating system into the secondary storage device
Allow output, but enter the operating system
During output, a single step for all instruction traces is performed.
Input / output to the secondary storage device
Instruction issuance, and the operating system
Other than those associated with that input / output of the system.
Do not perform the input / output completion processing
Secondary storage of all instruction traces immediately after system execution
By starting input / output to the
Single step interrupt processing program is secondary storage device
When executing I / O to the IRQ number,
Reports the completion of an I / O other than the "I / O being executed"
And trace all instructions
Is implemented without buffer overflow.
And enable. Next, an embodiment of the present invention will be described with reference to the drawings.
explain about. FIG. 1 is a perspective view of an embodiment of the present invention.
Prevention of contention for storing instruction trace data in secondary storage
It is a block diagram showing composition of a device which performs a method. Same figure
The embodiment shown in the figure has a single-step interrupt function.
CPU 1 (for example, INTEL Pentium), interrupt system
Your chip 2 (eg INTEL 8259), operating
Secondary storage device 3 for the system (for example, IDE primer
Lee HD, device number 0, IRQ number 14), all instructions
Secondary storage device 4 for trace data (for example, IDE
Candiary HD, device number 1, IRQ number 14),
And a memory 5. Memory 5 is an operating
Processing program 5 for secondary storage device for storage system
0, input / output of secondary storage device for operating system
Function 51, Other Information for Operating System
52, single-step interrupt processing for all instruction traces
Output of secondary storage for program 53, trace of all instructions
Function 54, buffer 5 of secondary storage for all instruction traces
5 and other information 56 for full instruction tracing
are doing. 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.
Outputs information such as notification of completion of interrupt reception to the chip
it can. The CPU 1 has 2 for the operating system.
Secondary storage 3, secondary storage for all instruction trace data
4 and a memory 5 connected by a bus.
Read and write information to and from these devices and memories
Noh. Next, the flowcharts shown in FIGS.
The operation of the embodiment shown in FIG. 1 will be described with reference to FIG.
You. FIG. 2 shows a secondary storage device for an operating system.
Is a flowchart showing the procedure of the input / output function 51 of FIG.
FIG. 3 shows the allocation of the secondary storage device for the operating system.
Flowchart showing the procedure of the embedding processing program 50
Figure 4 shows a single step split for all instruction traces.
Showing a partial procedure of the embedded processing program 53
Figure 5 shows a single step for tracing all instructions.
A part of the procedure of the interrupt processing program 53 following FIG.
FIG. 6 is a flowchart showing the procedure for tracing all instructions.
Flowchart showing the procedure of the output function 54 of the secondary storage device
It is. Now, the other for the operating system
The program in the information 52 of the
I / O for writing data to the secondary storage device 3 for the system
O event (set of data to request processing)
Operating system as parameters.
Calls the input / output function 51 of the secondary storage device for the
At the time of the secondary storage device 3 for the operating system
For example, there is no running I / O event for
explain. At that time, the system
Status [CPU trace flag is ON, all instruction traces
External variable for all instructions is in execution (ON)
Numbers are visible from everywhere, so where they exist
In this embodiment, all of the external variables
Other information 56 for the command trace)]]
All instruction trays in other information 56 for instruction trace
All internal counters for the Secondary storage for operating system
When called, the input / output function 51
CPU 1 having a step-up interrupt function performs the steps shown in FIG.
Attempt to execute the instruction of S100 (* 1). At this time,
Since the trace flag is ON, the CPU 1
A step interrupt has occurred and is about to be executed at that time.
The address of the instruction that was
Stack area in other information 52 (hereinafter referred to as stack
Area (abbreviated as area)
After the lag is set to OFF (the above processing is a general
"CPU1 with single-step interrupt function"
CPU function for single-step interrupts
4), single-step interrupt for all instruction traces in FIG.
Control is passed to the processing program. In FIG. 4, at step S300, the cash register
The stacker is evacuated to the stack area, and the
Check during execution of all instruction traces, YES
In step S303, all the instruction trace buffers are full.
Check if there is a bug, here, unless there is a bug in the system
No, all instruction traces are executed in step S305.
Data is collected and stored in the secondary storage for all instruction traces.
The buffer 5 is stored in the buffer 5 in step S306.
5 instruction data is stored in 512 bytes
Check that the size is equal to or larger than
Click. The trace data of all instructions is, on average, one instruction.
Since the information is about 50 bytes, step S306
Is less than one-tenth, so
In many cases, the step will be NO. In case of NO
Correspond to steps S400, S402, S404 and FIG.
And the checks in S406 are performed. In this case, it
Instructions interrupted by single-step interrupt processing
Is the above (* 1), and in the flowchart,
Since it is the instruction of step S100, step S40
0, S402, S404 and S406
Of these, only step S400 is YES, and step S400
At 401, other information 56 for tracing all instructions
External variable “Secondary storage device write-protection count”
Is added to "1", resulting in 1. Then,
In step S408, the registers and the like are restored, and step S408 is executed.
By issuing an IRET instruction at 409,
Return to the interrupt source of (* 1).
Trace flag is restored to the state just before the interrupt.
You. In this case, return to ON). This "secondary storage device write inhibit count"
Is a secondary storage device for the operating system.
Interrupt processing program 50, operating system
Other interrupt handling in other information 52 for the system
Programs, input / output functions and operating systems
The input / output function 51 of the secondary storage device for the
Or input / output to / from other devices (omitted in FIG. 1)
Is set to a value other than 0.
Issuance of a series of I / O instructions to the system device (on the way,
For output processing to secondary storage device for all instruction trace data
So no overruns occur
Exists, and if not 0, all instruction trace data
Is suppressed from being output to the secondary storage device. Returning to the interrupt source of (* 1), the CP
U executes only one instruction in step S100 of FIG.
You. Here, in step S100, the designated IR
Q number designated device number (in this embodiment, the operating
There is only one secondary storage device for the
Queue = fixed (RQ = 14, device number = 0)
(In other information 52 for the operating system)
Check if there is an / O event. Not here
Therefore, the process proceeds to the next step S103, where the CPU
Attempting to execute the instruction of S103 (* 2)
Since the trace flag is ON,
A step interrupt is generated and all instruction trace
The steps after step S300 of the single-step interrupt processing are executed.
Is performed. In this case, the secondary storage device write inhibit count
Is set to 1, so the step
S300, S301, S303, S305 were executed
Then, in step S306, the buffer has 512 bytes or more.
If all the instruction trace data of
Since 07 is NO, step S308 is executed.
(The output function of the secondary storage device for all instruction traces calls
Will not be). Steps S400 and S40
2, (S404 and S406) also check (*
Since the addresses of 2) are all NO, all instruction trays
The single-step interrupt processing program for
In step S305, all instruction trace data are collected and
Output to the secondary storage device just by storing it in the
In step S408, the registers and the like are recovered, and
Interrupt source (* 2) by IRET instruction in step S409
Return to When returning to the interrupt source, the process proceeds to step S103.
For certain operations, multiple instructions are executed,
Single-step interrupt occurs for instruction
(* 3) is the same as (* 2) above, in step S305.
Collect all instruction trace data and store in buffer
And output to the secondary storage device.
In step S408, the registers and the like are recovered, and in step S4
At 09, the process returns to the interrupt source (* 3) by the IRET instruction. Next, the CPU 1 issues a command in step S104.
Attempt to execute the order (* 4)
Step interrupt occurs, and step S3
05, all the instruction trace data are collected and step S30
6 is YES, NO in step S307, and
No in step S400 and no in step S402
However, in step S404,
YES because it corresponds to the instruction of step S104,
In step S405, the external variable “secondary storage device state
The state is set to 1 (* 10), and step S406 is N
In step S408, steps S408 and S409 are executed.
Then, it returns to the interrupt source (* 4). At the interrupt source (* 4), step S10
4 are executed and the operating system is executed.
I / O instruction to secondary storage device is issued for stem
However, in those single-step interrupts,
As in the case of (* 2), in step S305,
Just collect trace data and store it in buffer
Without calling the output function of the secondary storage device.
At step S408, the registers and the like are recovered, and the process proceeds to step S408.
At 409, the process returns to the interrupt source (* 4) by the IRET instruction. Next, the return of step S105 of FIG.
Single step interrupt when an instruction is about to be executed
In step S305, all the instruction trace data
Just collect data and store it in the buffer, and secondary storage
Step S40 without calling the output function of the device.
2, but in step S402, the interrupted instruction
Address matches step S105 in the flowchart.
Therefore, in step S403, writing to the secondary storage device is performed.
The prohibition counter is decremented by one and returns to zero. Therefore, step
After step S409, the interrupt source R in step S105
After the ETURN instruction is executed, the operation shown in FIG.
Of input / output function of secondary storage device for operating system
Operating system programs that are
Immediately before the “instruction to be executed when executed” (*
In the single step interrupt generated in 5),
Steps S300, S301, S303, S305, S3
When steps S06 and S307 are sequentially executed, step S307 is executed.
Of the "secondary storage device write inhibit counter" is zero
If the check is YES, the entire life is determined in step S308.
The output function (Fig. 6) of the secondary storage device for
Will be The output relation of the secondary storage device for tracing all instructions
The number (FIG. 6) is stored in the secondary storage device in step S500.
It is checked whether the position is 0 or not.
0) is set to 1 so that the answer is NO and the step
Go to S509, check in step S509, YE
It becomes S. Therefore, the process goes to step S510,
The interrupt pending chip for the interrupt control chip 2
Issue an instruction to read the IRQ14
By checking if the reservation bit is set
Access to the secondary storage for the operating system
Check if the force is completed. Note that this function
Runs as an extension of single-step interrupt processing
Single-step interrupt processing is disabled
When the operation of the secondary storage device is completed,
If no interrupt occurs, the above interrupt is suspended instead.
A bit stands. The interrupt occurs only for a single
Step interrupt processing returns, and the return source
When a program instruction that is not
You. These are general basic processing related to interrupt processing.
It is a logical concept (common sense). The interrupt pending bit must be set
Entering and exiting secondary storage for operating system
Since the force has not been completed, execute step S510 again.
Until the interrupt pending bit is set (operating
Until the input / output of the secondary storage device for the storage system is completed)
Loop. Secondary storage for operating system
When the input / output of the device is completed, the interrupt pending bit is set.
Therefore, the determination in step S510 becomes YES, and the processing in step S5
Then, in step S511, the operating
In order for the system to complete the I / O,
Set the storage device state to 2 and go to step S507
Return by executing RETURN instruction.
Go to Step S400 of Step 4. Step S400, S4
02, S404 and S406 are all NO
Then, after steps S408 and S409, the above (* 5)
Return to the interrupt source. Here, the operating system
The secondary storage for the operating system of FIG.
Immediately after returning from the input / output function
Normally it is necessary to drive with interrupts disabled, so for a while
Driving in interrupt disabled state during (several tens steps)
Then, release the interrupt prohibition. Therefore, when the vehicle is driven in the interrupt disabled state,
While the single-step interrupt
Returns all instruction trace data in step S305.
After collecting and storing in the buffer, in step S308,
The output function of the secondary storage device for tracing all instructions (Fig. 6)
The function is called, but the state of the secondary storage device is 2.
State, so that steps S500, S509, S512
Is executed, and YES is determined in the step S512.
Return without doing anything (* 11). Therefore,
In single-step interrupt processing of
In step S305, all the instruction trace data are collected and
Perform processing only to store in the buffer. In the above, depending on the operating system,
The interrupt system is disabled, the operating system
I / O of the secondary storage device for the system is in the interrupt pending state.
Interrupt, a completion interrupt occurs, and the CPU
CPU trace (by general CPU1 function)
The flag is set to OFF, and the operating system shown in FIG.
Of the interrupt processing program for the secondary storage device of the system
The control is passed to step S200. In step S200, a register or the like is used.
And all instruction traces are executed in step S201.
Check if it is running. Here, it is YES
Therefore, step S202 is executed, and step S203
Subsequent instructions may cause a single-step interrupt
Then, the trace flag of the CPU is turned ON. Note that this
The instructions of steps S200 to S202 are all instructions
Present on operating systems without tracing
do not do. Therefore, the instructions are
Although it is in the interrupt processing of
Source program, and the target of all instruction traces
No effect on performance evaluation even if traced
Do not give. Next, the instruction of step S203 is executed.
Shortly before (* 12), a single-step interrupt
Occurs and a single step split for all instruction traces in Figure 4
Control passes to the embedded processing program. In the program,
Steps S301 and S303, similarly to the above (* 11).
Is executed, and in step S305, all the instruction trace data
Are collected and stored in a buffer, and steps S306, S3
07 and S308, and called in step S308.
The output function of the secondary storage device for all instruction traces is (2
Return without doing anything (because the secondary storage device status is 2)
However, the processing of steps S400 to S406
Thus, only step S400 is a step in the flowchart.
Since the instruction in step S203 is detected,
In step S401, the secondary storage device write inhibit counter
1 is added, the value of the counter becomes 1, and step S4
08, return to interrupt source (* 12) via S409
I do. Upon return, the operating system
The interrupt processing program of the secondary storage device for the system
Steps S203, S204, S205, S206, S20
7, the instructions of S209 are executed, and steps S204 to S209 are executed.
Immediately before executing each instruction in step S209.
Step interrupt occurs, at which time the secondary storage
The device write inhibit counter is 1, and the
The dress is checked in steps S400 to S406.
Because it does not match with the
Single-step interrupt processing program
S300, S301, S303, S305, S306,
S307, S400, S402, S404, S406,
The operation is performed in the order of S408 and S409, and substantially, step S3
05 collects all instruction trace data and stores in buffer
(* 13). Next, the execution of the instruction in step S210 is performed.
In the single step interrupt just before
Single-step interrupt processing for all instruction traces in Figure 5
The program includes steps S300, S301, S30
3, S305, S306, S307, S400, S40
The processing up to S404 is the same as (* 13) above.
However, in step S406, the address of the instruction
-Instruction in step S210 of the chart (operating
Of I / O completion processing to / from the secondary storage device of the storage system
Detection), and since the secondary storage device state = 2,
If the answer is YES, the process proceeds to step S407 and the secondary storage
Is set to 3 and the secondary storage for all instruction traces is set.
Call the output function (FIG. 6). Output relation of the secondary storage device for all instruction traces
The number is 2 when the control is passed and the secondary storage state is 3.
Therefore, steps S500, S509, S512, S51
Step 3 is executed, and the step S513 switches to the secondary storage device state.
After setting 0, go to step S501,
501 is the content written in all instruction trace buffers
Of the 512 bytes part (for all instruction tracing)
Issue an I / O command to output to the next storage device (device number = 1)
And the input / output is completed in step S502 (the
Issue an input command for inputting the status of the device, and
Is not busy and IRQ number = 14
Interrupt pending bit is not set)
Wait in a loop, and then go to steps S503 and S5
05 and S506 are performed. Step S506
If there is still data in the buffer,
S501, S502, S503, S505, S506
Execute repeatedly. Step S504 and step S504
Step S508 is an abnormal process, which is normally executed.
There is no. [0044] As described above, according to the present invention,
Secondary storage used by the operating system and all
Single-step interrupt processing program for instruction trace
The secondary storage device used by the system is under the same IRQ number.
If the input / output to the former is in progress,
The start of force is deterred and during the deterrence
Other than operating system related programs
The rating system program is not executed, and
The above input of the running operating system is completed.
At the time of its completion, the secondary
Input to the storage device starts, so the buffer overflows.
The input and output of both above are executed without inconsistency
Execution and execution of all instruction traces
Should include any interrupt handling performed on the
Can be performed for all instructions.

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

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 11/28 - 11/34 G06F 13/10 - 13/14 JSTPLUSファイル(JOIS)────────────────────────────────────────────────── ─── Continued on the front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 11/28-11/34 G06F 13/10-13/14 JSTPLUS file (JOIS)

Claims (1)

(57)【特許請求の範囲】 【請求項1】 情報処理装置内の中央演算ユニットが全
命令トレースを行い、その全命令トレースデータがすべ
第一の2次記憶装置に格納される場合において、トレ
ース対象のオペレーティングシステムも上記と同種の
二の2次記憶装置を使用する場合、それらの2次記憶装
置が同一IRQ番号配下にあっても、支障なく、それら
の2次記憶装置への格納が行われることを実現するため
に、オペレーティングシステムが第二の2次記憶装置に
入出力を行っている間は、全命令トレースシングルステ
ップ割り込み処理プログラムにより前記中央演算ユニッ
トが、全命令トレースデータの第一の2次記憶装置への
出力を抑止すること、出力を抑止している期間には、前
記全命令トレースシングルステップ割り込み処理プログ
ラムにより前記中央演算ユニットが、割り込み禁止状態
での割り込み発生を表す割り込み保留ビットが立つまで
ループしてオペレーティングシステムの前記入出力に関
する命令以外を実行させないこと、およびオペレーティ
ングシステムの入出力の完了処理の完了を検出し、この
検出時に全命令トレースデータの第一の2次記憶装置へ
の出力を開始することを特徴とする全命令トレースデー
タの2次記憶装置への格納競合防止方法。
(57) [Claim 1] When a central processing unit in an information processing apparatus traces all instructions and all the instruction trace data are stored in a first secondary storage device, the traced operating systems of the same type
When using the second secondary storage device, also their secondary storage device is in a subordinate same IRQ number, without any trouble, they
While the operating system is performing input / output to / from the second secondary storage device, all instruction trace
The central processing unit is
DOO is, arresting the output to the first secondary storage of all instruction trace data, the period during which suppresses output, before
All instruction trace single step interrupt processing program
The CPU causes the central processing unit to disable interrupts.
Until the interrupt pending bit indicating that an interrupt has occurred
Loop that does not run any other instructions for the input and output of the operating system, and detects the completion of the completion process input and output in O Pereti <br/> ring system, first of all the instruction trace data on the detected time All instructions stored conflict prevention method of the secondary storage device of the trace data, characterized in that to start the output of the secondary storage device.
JP23925698A 1998-08-25 1998-08-25 Method for preventing contention of storage of all instruction trace data in secondary storage device Expired - Lifetime JP3506920B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23925698A JP3506920B2 (en) 1998-08-25 1998-08-25 Method for preventing contention of storage of all instruction trace data in secondary storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23925698A JP3506920B2 (en) 1998-08-25 1998-08-25 Method for preventing contention of storage of all instruction trace data in secondary storage device

Publications (2)

Publication Number Publication Date
JP2000066922A JP2000066922A (en) 2000-03-03
JP3506920B2 true JP3506920B2 (en) 2004-03-15

Family

ID=17042067

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23925698A Expired - Lifetime JP3506920B2 (en) 1998-08-25 1998-08-25 Method for preventing contention of storage of all instruction trace data in secondary storage device

Country Status (1)

Country Link
JP (1) JP3506920B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8631277B2 (en) * 2010-12-10 2014-01-14 Microsoft Corporation Providing transparent failover in a file system
US9331955B2 (en) 2011-06-29 2016-05-03 Microsoft Technology Licensing, Llc Transporting operations of arbitrary size over remote direct memory access
US8856582B2 (en) 2011-06-30 2014-10-07 Microsoft Corporation Transparent failover
US20130067095A1 (en) 2011-09-09 2013-03-14 Microsoft Corporation Smb2 scaleout

Also Published As

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

Similar Documents

Publication Publication Date Title
US6539500B1 (en) System and method for tracing
US5557766A (en) High-speed processor for handling multiple interrupts utilizing an exclusive-use bus and current and previous bank pointers to specify a return bank
US4214305A (en) Multi-processor data processing system
US7734881B2 (en) Adapting RCU for real-time operating system usage
CN101114235B (en) Multi processor and multi thread safe message queue with hardware assistance
US5437047A (en) System for gathering and safeguarding program run information of each individual processor by transferring information to an external storage
US8255673B2 (en) Monitoring transactions in a data processing apparatus
US20020099893A1 (en) System and method for the handling of system management interrupts in a multiprocessor computer system
US6654837B1 (en) Dynamic priority external transaction system
JP3590075B2 (en) Virtual storage data processing apparatus and method
CN102207913A (en) Write protection control method and device in embedded system
US20060005199A1 (en) Adaptive algorithm for selecting a virtualization algorithm in virtual machine environments
JP3506920B2 (en) Method for preventing contention of storage of all instruction trace data in secondary storage device
US20080127187A1 (en) Trace buffer with a processor
US4409653A (en) Method of performing a clear and wait operation with a single instruction
CN112767978A (en) DDR command scheduling method, device, equipment and medium
JPS6049352B2 (en) data processing equipment
US11620134B2 (en) Constrained carries on speculative counters
JP3506919B2 (en) Timer control method when tracing all instructions
GB2027238A (en) Clear and wait instruction means and method
JP4755232B2 (en) compiler
JPH04232559A (en) Method of conversation between processors of system, system for conducting this method and use for dispatching
GB2261537A (en) Computer
JP4370227B2 (en) Processor
JPH05324871A (en) Microcomputer

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