JPH06149615A - Event recording system - Google Patents

Event recording system

Info

Publication number
JPH06149615A
JPH06149615A JP4303963A JP30396392A JPH06149615A JP H06149615 A JPH06149615 A JP H06149615A JP 4303963 A JP4303963 A JP 4303963A JP 30396392 A JP30396392 A JP 30396392A JP H06149615 A JPH06149615 A JP H06149615A
Authority
JP
Japan
Prior art keywords
task
event
switching
task switching
recording device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP4303963A
Other languages
Japanese (ja)
Other versions
JP3207564B2 (en
Inventor
Katsuhiko Ueki
克彦 植木
Takeshi Yasuda
剛 安田
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP30396392A priority Critical patent/JP3207564B2/en
Publication of JPH06149615A publication Critical patent/JPH06149615A/en
Application granted granted Critical
Publication of JP3207564B2 publication Critical patent/JP3207564B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To simply and efficiently record task switching history and event generation history capable of accurately reproducing the operation of a multitask program. CONSTITUTION:Tasks A to C in a user program 2 are operated by a task control part 32 in accordance with the task scheduling of an operating, system and task scheduling obtained by simulating task switching algorithm, and at the time of generating task switching, task switching information including task switching generation time and its contents is sent and recorded to/in an event recording device control part 33. At the time of generating a system call or an external interruption, whether a factor generating the status is caused by the generation of an event determined by the control part 33 in accordance with an instruction generated from a terminal equipment 5 or not is inspected by an event detection inspected part 31, and when the inspected result is yes, event information including event generation time and its contents is acquired, sent and recorded to/in the control part 33.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、マルチタスクプログラ
ムの動作を再現・調査するデバッグ作業に好適なイベン
ト記録方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an event recording method suitable for debugging work for reproducing and investigating the operation of a multitask program.

【0002】[0002]

【従来の技術】一般に、マルチタスクのデバッグを行な
うためには、各タスクで発生するイベントの発生順序と
その内容を調べ保存し、また記録したイベント履歴を利
用してプログラムの動作を再現してプログラムの動作の
調査を行なう必要がある。従来、プログラムの動作を再
現するためにイベント履歴を記録するモニタをソフトウ
ェアによって実現する方式として、
2. Description of the Related Art Generally, in order to perform multi-task debugging, the order of occurrence of events in each task and their contents are investigated and saved, and the recorded event history is used to reproduce the operation of the program. It is necessary to investigate the behavior of the program. Conventionally, as a method to realize a monitor that records event history by software in order to reproduce the operation of the program,

【0003】(1)各タスクをモニタする専用のタスク
(イベント記録タスク)を用意し、各タスクで発生した
システムコールや割り込みによって発生するイベントを
集めてイベント履歴を記録する方式 (2)OSシミュレータにイベント調査機能を持たせて
イベント履歴を記録する方式 が知られている。
(1) A system in which a dedicated task (event recording task) for monitoring each task is prepared, and events generated by system calls and interrupts generated by each task are collected and an event history is recorded (2) OS simulator There is known a method of recording an event history by providing an event search function to the.

【0004】[0004]

【発明が解決しようとする課題】しかし、イベントを監
視・記録するタスク(イベント記録クタスク)を用意す
る上記(1)の方式は、イベント記録タスク自身もタス
クの一つとして制御されているため、タスク切替をイベ
ントとして認識し何時行なわれたかを調査記録するのが
困難であった。
However, in the above method (1) of preparing a task for monitoring / recording an event (event recording task), the event recording task itself is also controlled as one of the tasks. It was difficult to recognize the task switching as an event and record when it was performed.

【0005】つまり、タスクの実行順序をオペレーティ
ングシステムのスケジューリングに任せておいて、モニ
タがシステムコールや割り込みを監視することでイベン
トおよびタスク切替を調査する方式では、タスク切替が
何時行なわれたかを検出するためには、タスク切替が起
こり得るイベントや割り込みが発生する度に、イベント
記録タスクに制御を移して全タスクの状態の調査を行な
い、タスクが切り替わるか否かを予測しなくてはなら
ず、効率的ではなかった。
That is, in the method in which the execution order of tasks is left to the scheduling of the operating system and the monitor examines the event and the task switching by monitoring the system call and the interrupt, it is possible to detect when the task switching is performed. In order to do so, each time an event or interrupt in which task switching can occur occurs, control must be transferred to the event recording task to investigate the status of all tasks, and it must be predicted whether or not the task will switch. , Was not efficient.

【0006】また、イベントおよびタスク切替の発生時
間と内容を記録するために、オペレーティングシステム
上で動作するイベントおよびタスク切替の記録機能を持
ったOSシミュレータを用いる上記(2)の方式は、計
算機の資源を多く必要とし、実行速度が遅くまた実現も
困難であった。
In addition, in order to record the occurrence time and contents of the event and task switching, the above method (2) using an OS simulator having a function of recording the event and task switching operating on the operating system is It required a lot of resources, was slow in execution speed, and was difficult to realize.

【0007】即ち、イベント履歴を用いてプログラムの
動作を正確に再現するためには、オペレーティングシス
テムによるタスク切替のタイミングと実行されるタスク
名の履歴も必要であるにも拘らず、従来は、タスク切替
の記録をオペレーティングシステム上で動作するソフト
ウェアによるモニタを用いて行なうのは困難であった。
That is, in order to accurately reproduce the operation of a program by using the event history, the task switching timing by the operating system and the history of the task name to be executed are also required, but the conventional task It was difficult to record the switching using a software monitor running on the operating system.

【0008】本発明は上記事情を考慮してなされたもの
でその目的は、マルチプログラムの動作の正確な再現を
可能とするようなタスク切替の履歴とイベント発生の履
歴が、簡単に且つ効率的に記録できるイベント記録方式
を提供することにある。
The present invention has been made in consideration of the above circumstances, and an object thereof is to easily and efficiently record a task switching history and an event occurrence history that enable accurate reproduction of multi-program operation. It is to provide an event recording method that can record to.

【0009】[0009]

【課題を解決するための手段】本発明は、上記目的を達
成するために、イベント記録の対象プログラムの各タス
クを、オペレーティングシステムのタスクスケジューリ
ングおよびタスク切替アルゴリズムをシミュレートした
アルゴリズムに従って動作させ、タスク切替が発生した
ときに、タスク切替の発生時間とその切替内容を含むタ
スク切替情報を取得するタスク制御手段と、外部からの
割り込みまたはタスクが行なうシステムコール等を監視
してイベントの発生を検出し、発生したイベントを調査
して、イベント発生時間とそのイベントの内容を含むイ
ベント情報を取得するイベント検出調査手段と、上記タ
スク制御手段およびイベント検出調査手段を制御すると
共に、上記のイベント情報とタスク切替情報をもとに、
対象プログラムで発生したイベントとタスク切替の履歴
を作成して記録するイベント記録装置制御手段とを備え
たことを特徴とするものである。
In order to achieve the above object, the present invention operates each task of an event recording target program according to an algorithm that simulates a task scheduling and task switching algorithm of an operating system, When a switch occurs, the task control means that acquires the task switch information including the task switch occurrence time and the switch content, and the occurrence of the event are detected by monitoring external interrupts or system calls made by the task. , An event detection investigating means for investigating the occurred event and acquiring event information including the event occurrence time and the content of the event, and controlling the task control means and the event detection investigating means, and at the same time the event information and the task Based on the switching information
It is characterized by comprising an event recording device control means for creating and recording an event generated in the target program and a history of task switching.

【0010】[0010]

【作用】上記の構成において、オペレーティングシステ
ム上で動作する特定のタスク(イベント記録タスク)を
用いて実現されるモニタ(イベント記録装置)中のタス
ク制御手段は、オペレーティングシステムのタスクスケ
ジューリングとタスク切替のアルゴリズムをシミュレー
トしたタスクスケジューリングアルゴリズム、およびタ
スクスケジューリングに必要な情報を保持し、スケジュ
ーリングアルゴリズムに従ってタスクを動作させる時間
を決定し、その決定に従ってタスクを動作させるため
に、この動作させるタスクをオペレーティングシステム
に実行させ他のタスクを待機させる。タスク制御手段が
保持するタスクスケジューリングアルゴリズム、および
タスクスケジューリングに必要な情報は、イベント記録
装置制御手段から与えられる。
In the above structure, the task control means in the monitor (event recording device) realized by using a specific task (event recording task) operating on the operating system is used for task scheduling and task switching of the operating system. The task scheduling algorithm that simulates the algorithm, and the information necessary for the task scheduling are retained, the time to operate the task is determined according to the scheduling algorithm, and the task to operate is determined by the operating system in order to operate the task according to the determination. Let it run and wait for other tasks. The task recording algorithm held by the task control means and information necessary for task scheduling are given from the event recording device control means.

【0011】このように、イベント記録(調査)の対象
となるプログラムの各タスクのスケジューリングとタス
ク切替の時期の決定とが、オペレーティングシステムで
はなくて、同システム上で動作するモニタ中のタスク制
御手段により行なわれる。このため、タスク発生時間と
その切替内容を含むタスク切替情報が、モニタ中のタス
ク制御手段にて容易に取得できる。このタスク切替情報
はイベント記録装置制御手段に通知される。また、タス
クを動作させるためのタスクのスワッピング等の処理を
オペレーティングシステムに任せることで、モニタ(中
のタスク制御手段)の負担を軽くすることもできる。
As described above, the scheduling of each task of the program that is the target of event recording (investigation) and the determination of the timing of task switching are performed not by the operating system, but by the task control means in the monitor operating on the system. Performed by. Therefore, the task switching information including the task occurrence time and its switching content can be easily acquired by the task control means being monitored. This task switching information is notified to the event recording device control means. Further, by letting the operating system perform processing such as task swapping for operating the task, the load on the monitor (task control means therein) can be reduced.

【0012】一方、イベント検出調査手段は、実行中の
タスクを認識しながら、外部からの割り込みや実行中タ
スクが発行するシステムコール等を監視することで、イ
ベントの発生を検出する。このイベント検出調査手段に
よる検出対象となるイベントは、ユーザからの要求等に
従ってイベント記録装置制御手段により定められる。
On the other hand, the event detecting / inspecting means detects the occurrence of an event by recognizing the task being executed and observing an external interrupt or a system call issued by the task being executed. The event to be detected by the event detection / inspection means is determined by the event recording device control means in accordance with a request from the user.

【0013】イベント検出調査手段は、イベント発生を
検出した場合、発生したイベントを調査して、イベント
発生時間とそのイベントを発生したタスクに関する情報
を、そのタスクまたはオペレーティングシステムから取
得し、イベント情報としてイベント記録装置制御手段に
通知する。
When detecting the occurrence of an event, the event detecting / inspecting means investigates the occurring event, acquires the event occurrence time and the information about the task that caused the event from the task or the operating system, and as event information. Notify the event recording device control means.

【0014】イベント記録装置制御手段は、イベント検
出調査手段から通知されたイベント情報とタスク制御手
段から通知されたタスク切替情報をもとに、対象プログ
ラムで発生したイベントとタスク制御手段が行なったタ
スク切替の履歴を作成し、外部記録装置に記録・保存す
る。
The event recording device control means, based on the event information notified from the event detection investigation means and the task switching information notified from the task control means, the event generated in the target program and the task performed by the task control means. Create a switching history and record / save it in an external recording device.

【0015】[0015]

【実施例】図1は本発明の一実施例を示すブロック構成
図である。
FIG. 1 is a block diagram showing an embodiment of the present invention.

【0016】図1において、1はオペレーティングシス
テム(マルチタスク・オペレーティングシステム)、2
はオペレーティングシステム1上で動作するユーザプロ
グラム(利用者プログラム)である。ユーザプログラム
2は、イベント記録の対象となるプログラムであり、例
えばタスクA、タスクBおよびタスクCの3つのタスク
からなるものとする。このプログラム2のタスクA,
B,Cの内容例を、図2(a),(b),(c)に示
す。
In FIG. 1, 1 is an operating system (multitasking operating system), 2
Is a user program (user program) operating on the operating system 1. The user program 2 is a program that is a target of event recording, and is composed of, for example, three tasks, task A, task B, and task C. Task A of this program 2,
Examples of contents of B and C are shown in FIGS. 2 (a), 2 (b) and 2 (c).

【0017】上記3つのタスクA,B,Cの動作は本来
非決定的である。つまり、タスクA,B,Cのどのタス
クから実行が始まるか、タスク切替が何時行なわれるか
等によって、その振る舞いは変化する。例えば、ユーザ
がこの3つのタスクA,B,Cを“同時”に起動したも
のとする。このとき、オペレーティングシステムのスケ
ジューリングの結果、タスクBが先に動きメッセージを
送るかタスクCがメッセージを送るかで、異なった結果
振る舞いをする。
The operations of the above three tasks A, B and C are essentially non-deterministic. In other words, the behavior changes depending on which task of tasks A, B, and C starts execution, when task switching is performed, and the like. For example, it is assumed that the user activates these three tasks A, B, and C "simultaneously". At this time, as a result of the scheduling of the operating system, different behavior is performed depending on whether task B sends a motion message first or task C sends a message.

【0018】3はプログラム2を構成するタスクA,
B,Cの動作を調査し記録するためのイベント記録装
置、4はイベント記録装置3によって調査されたイベン
トとタスク切替の履歴の情報等を保存するため外部記録
装置、5は端末装置である。端末装置5は、ユーザの入
力操作に従い、イベント記録に必要な情報を入力してイ
ベント記録装置3(内の後述するイベント記録装置制御
部33)に伝える。
3 is a task A which constitutes the program 2,
An event recording device 4 for investigating and recording the operations of B and C, 4 is an external recording device for storing the information of the event investigated by the event recording device 3 and the history of task switching, and 5 is a terminal device. The terminal device 5 inputs the information required for event recording according to the input operation of the user, and transmits it to the event recording device 3 (in the event recording device control unit 33 described later).

【0019】イベント記録装置3は、オペレーティング
システム1上で動作する専用のイベント記録タスクを用
いて実現されるもので、イベント検出調査部31、タス
ク制御部32およびイベント記録装置制御部33から構
成される。
The event recording device 3 is realized by using a dedicated event recording task that operates on the operating system 1, and is composed of an event detection / inspection unit 31, a task control unit 32, and an event recording device control unit 33. It

【0020】イベント検出調査部31は、イベント記録
対象タスク(A,B,C)が発行するシステムコール、
外部からの割り込み、またはタスクの状態の変化等を検
出する機能と、その状態になった要因がイベント発生に
よるものであるかを調査し、イベントを発生したタスク
に関する情報をそのタスクまたはオペレーティングシス
テム1から取得する機能とを持つ。この例では、タスク
A,B,Cによるメッセージの交換をイベントとしてと
らえている。このイベント定義は、例えばユーザ操作に
従って端末装置5から行なわれ、イベント記録装置制御
部33によりイベント検出調査部31に通知される。
The event detection / inspection section 31 uses a system call issued by the event recording target task (A, B, C),
A function that detects an interrupt from the outside or a change in the status of a task, and investigates whether the cause of the status is the occurrence of an event, and obtains information about the task that generated the event from the task or operating system 1 With the function to get from. In this example, the exchange of messages by tasks A, B, and C is regarded as an event. This event definition is performed from the terminal device 5 according to a user operation, for example, and the event recording device control unit 33 notifies the event detection investigation unit 31.

【0021】イベント検出調査部31はまた、イベント
の発生時間とその内容を含むイベント情報をイベント記
録装置制御部33に通知する機能を持つ。このイベント
情報は、イベントの発生時間、そのイベントの内容、そ
のイベントを発生したタスクのタスク名(イベント発生
タスク名)、およびそのイベントを発生したアドレス
(イベント発生アドレス)からなる。
The event detection / inspection unit 31 also has a function of notifying the event recording device control unit 33 of event information including the event occurrence time and its content. This event information includes an event occurrence time, the content of the event, the task name of the task that generated the event (event generation task name), and the address that generated the event (event generation address).

【0022】タスク制御部32は、タスクスケジューリ
ングアルゴリズムに従ってイベント対象タスクの生成・
制御・終了をオペレーティングシステム1に要求する機
能と、タスクがシステムコールを発行した場合にそれを
調査する機能と、タスク切替が発生した場合にタスク切
替発生時間とその内容を含むタスク切替情報を取得して
イベント記録装置制御部33に通知する機能とを持つ。
The task control unit 32 generates / creates an event target task according to a task scheduling algorithm.
A function that requests control / termination to the operating system 1, a function that investigates when a task issues a system call, and a task switching information that includes the task switching occurrence time and its content when a task switching occurs And has a function of notifying the event recording device control unit 33.

【0023】この例でのタスクスケジューリングアルゴ
リズムには、オペレーティングシステム(OS)の時分
割方式のスケジューリングアルゴリズムをシミュレート
したものが適用されており、これにより各タスクは例え
ばタスクAから一定時間ずつ実行される。ここでは、タ
スク制御部32は、最初にタスクA,B,Cを生成し直
ちに停止してタスクのID(タスク名)を記録し、後に
タスクを1つずつ動作させ、タスクを切り替える毎に、
タスクスケジューリングの結果である、タスク切替発生
時間、実行終了タスク名(それまで実行されていたタス
クのタスク名)と実行終了アドレス、および次実行タス
ク名(次に実行されるタスクのタスク名)と次実行開始
アドレスを、タスク切替情報としてイベント記録装置制
御部33に送る。
As the task scheduling algorithm in this example, a simulation of a time-division scheduling algorithm of an operating system (OS) is applied, whereby each task is executed from task A for a fixed time, for example. It Here, the task control unit 32 first generates the tasks A, B, and C, immediately stops them, records the task IDs (task names), operates the tasks one by one, and switches the tasks each time.
As a result of task scheduling, the task switching occurrence time, the execution end task name (task name of the task that was being executed until then) and the execution end address, and the next execution task name (the task name of the next task to be executed) The next execution start address is sent to the event recording device controller 33 as task switching information.

【0024】なお、本実施例においてイベントとタスク
切替の発生時間の記録に用いる時計は、プログラムを1
ステップ実行すると“1”進み、最大値を越えると
“0”に戻る論理時計である。
In the present embodiment, the clock used for recording the occurrence time of the event and the task switching is the program 1
It is a logical timepiece that advances by "1" when step execution is performed, and returns to "0" when the maximum value is exceeded.

【0025】次にイベント記録装置制御部33は、端末
装置5からの入力に従い、イベント検出調査部31に対
し検出すべきイベントを定める(この例では、メッセー
ジの交換)機能と、タスク制御部32に対し調査すべき
プログラム(この例では、プログラム2)を与える機能
とを持つ。
Next, the event recording device control unit 33 determines the event to be detected in the event detection investigation unit 31 (message exchange in this example) according to the input from the terminal device 5, and the task control unit 32. With a function to give a program (in this example, program 2) to be investigated.

【0026】イベント記録装置制御部33はまた、イベ
ント検出調査部31から送られたイベント情報およびタ
スク制御部32から送られたタスク切替情報をもとに、
イベント記録の対象となるプログラム2で発生したイベ
ントとタスク制御部32が行なったタスク切替の履歴を
メモリ(図示せず)上に作成して格納した後に外部記録
装置4に保存する機能を持つ。この履歴の形式は、イベ
ント・タスク切替発生時間、イベント・タスク切替発生
タスク名、イベント・タスク切替発生アドレス、および
イベント・タスク切替の内容の4種の情報からなり、こ
の情報の並び順にメモリに格納される。次に、図1の構
成の動作を説明する。
The event recording device control unit 33 also, based on the event information sent from the event detection investigation unit 31 and the task switching information sent from the task control unit 32,
It has a function of creating and storing in the memory (not shown) an event that occurred in the program 2 that is the target of event recording and a task switching history performed by the task control unit 32, and then save it in the external recording device 4. The format of this history consists of four types of information: event / task switch occurrence time, event / task switch occurrence task name, event / task switch occurrence address, and event / task switch content. Is stored. Next, the operation of the configuration of FIG. 1 will be described.

【0027】まず、図1の構成においては、オペレーテ
ィングシステム1からは、プログラム2を構成するタス
クA,B,Cは、(イベント記録装置3を実現する)イ
ベント記録タスクの管理のもとで動作するサブタスクで
あるように見える。またイベント記録タスクは、オペレ
ーティングシステム1からは通常のタスクであるように
見える。
First, in the configuration of FIG. 1, from the operating system 1, the tasks A, B, and C constituting the program 2 operate under the management of the event recording task (which realizes the event recording device 3). Seems to be a subtask to do. Further, the event recording task appears to the operating system 1 as a normal task.

【0028】さて、本実施例において、タスクA,B,
Cの動作を調査するために、イベント記録装置3内のタ
スク制御部32によるタスクスケジューリングに、前記
したようにOSの時分割方式のスケジューリングアルゴ
リズムをシミュレートしたものを適用し、タスクA,タ
スクB,タスクCによるメッセージ交換をイベントとし
て扱ったところ、イベント記録装置3は以下のように振
る舞った。
Now, in this embodiment, tasks A, B,
In order to investigate the operation of C, the task scheduling by the task control unit 32 in the event recording device 3 is performed by applying the simulation of the time-division scheduling algorithm of the OS as described above, and When the message exchange by the task C is treated as an event, the event recording device 3 behaves as follows.

【0029】まず、イベント記録装置3のタスク制御部
32は、タスクAの0行目(A-0)を実行させる。この
場合、タスク制御部32は、最初はタスクAにタスク切
替が行なわれたと解釈し、このタスク切替をイベント記
録装置制御部33に通知する。即ちタスク制御部32
は、タスク切替発生時間、次実行タスク名、および次実
行開始アドレスからなるタスク切替情報をイベント記録
装置制御部33に通知する。ここでは最初であることか
ら、タスク切替情報中には実行終了タスク名と実行終了
アドレスはなく、またタスク切替発生時間(イベント・
タスク切替発生時間)は“0”とされ、次実行タスク名
は“A”、次実行開始アドレスは“0”とされる。
First, the task control section 32 of the event recording device 3 executes the 0th line (A-0) of the task A. In this case, the task control unit 32 first interprets that the task switching has been performed for the task A, and notifies the event recording device control unit 33 of this task switching. That is, the task control unit 32
Notifies the event recording device control unit 33 of task switching information including a task switching occurrence time, a next execution task name, and a next execution start address. Since it is the first time here, there is no execution end task name and execution end address in the task switch information, and the task switch time (event
The task switching occurrence time) is "0", the next execution task name is "A", and the next execution start address is "0".

【0030】イベント記録装置制御部33は、タスク制
御部32からの通知に従い、図3に示すように、イベン
ト・タスク切替発生時間として“0”を、イベント・タ
スク切替の内容として(タスク制御部32から通知され
た次実行タスク名“A”と次実行開始アドレス“0”を
もとに生成される)“A-0にタスク切替え”を、メモリ
内に格納する。以降、タスクが切り替えられる毎に、タ
スク切替情報がタスク制御部32からイベント記録装置
制御部33に通知される。
In response to the notification from the task control unit 32, the event recording device control unit 33 sets “0” as the event / task switching occurrence time and the event / task switching content (task control unit as shown in FIG. The "task switching to A-0" generated based on the next execution task name "A" and the next execution start address "0" notified from 32 is stored in the memory. Thereafter, every time the task is switched, the task switching information is notified from the task control unit 32 to the event recording device control unit 33.

【0031】さて、タスクAの4行目(A-4)が実行さ
れると、図2(a)からも明らかなように、タスクAか
ら[メイルボックスmを参照する]システムコールが発
行される。するとイベント検出調査部31は、このシス
テムコールを受けてタスクAを調査し、イベントである
ことを判別する。この結果、イベント検出調査部31
は、イベント記録装置制御部33に対して、[メイルボ
ックスmを参照する]イベントが発生したことと、その
イベント発生時間(イベント・タスク切替え発生時
間)、およびイベントを発生したタスクのタスク名
“A”とイベント発生アドレス“4”(4行目)を通知
するためのイベント情報をイベント記録装置制御部33
に送る。ここでは、イベントはタスクAにスケジューリ
ングしてイベントの記録を開始してから5ステップ目に
発生したことから、発生時間は5となる。
When the fourth line (A-4) of the task A is executed, the system call [refer to the mailbox m] is issued from the task A, as is clear from FIG. 2 (a). It Then, the event detection / inspection unit 31 receives this system call, investigates the task A, and determines that it is an event. As a result, the event detection investigation unit 31
Indicates to the event recording device control unit 33 that an event [referencing the mailbox m] has occurred, the event occurrence time (event / task switching occurrence time), and the task name of the task that generated the event. Event information for notifying A ”and the event occurrence address“ 4 ”(4th line) is recorded in the event recording device control unit 33.
Send to. Here, the event occurs at the fifth step after the event A is scheduled and the recording of the event is started, so the occurrence time is 5.

【0032】イベント記録装置制御部33は、イベント
検出調査部31からの通知に従い、図3に示すように、
イベント・タスク切替発生時間として“5”を、イベン
ト・タスク切替発生タスク(イベント発生タスク)とし
て“A”(タスクA)を、イベント・タスク切替発生ア
ドレス(イベント発生アドレス)として“4”を、イベ
ント・タスク切替の内容として“[メイルボックスmを
参照する]”を、メモリ内に格納する。
According to the notification from the event detection investigation unit 31, the event recording device control unit 33, as shown in FIG.
"5" as the event / task switching occurrence time, "A" (task A) as the event / task switching occurrence task (event occurrence task), and "4" as the event / task switching occurrence address (event occurrence address) “[Refer to mailbox m]” is stored in the memory as the content of event / task switching.

【0033】次に、タスクAの5行目(A-5)が実行さ
れたところでタスク切替が発生し、タスクBに切り替わ
ったものとする。このタスク切替は、タスクAに切り替
わってから6ステップ目に発生したことから、タスク切
替発生時間は“6”となる。この場合、タスク制御部3
2は、タスク切替発生時間“6”、実行終了タスク名
“A”と(タスクAの)実行終了アドレス“5”、およ
び次実行タスク名“B”と(タスクBの)次実行開始ア
ドレス“0”からなるタスク切替情報をイベント記録装
置制御部33に通知する。
Next, it is assumed that task switching occurs when the fifth line (A-5) of task A is executed and task B is switched to. Since this task switching has occurred at the sixth step after switching to task A, the task switching occurrence time is "6". In this case, the task control unit 3
2 is task switching occurrence time “6”, execution end task name “A” and execution end address “5” (for task A), next execution task name “B” and next execution start address “for task B” The event recording device control unit 33 is notified of task switching information consisting of 0 ″.

【0034】イベント記録装置制御部33は、タスク制
御部32からの通知に従い、図3に示すように、イベン
ト・タスク切替発生時間として“6”を、イベント・タ
スク切替発生タスクとして“A”(タスクA)を、イベ
ント・タスク切替発生アドレスとして“5”(タスクA
の実行終了アドレス)を、イベント・タスク切替の内容
として(タスク制御部32から通知された次実行タスク
名“B”と次実行開始アドレス“0”をもとに生成され
る)“B-0にタスク切替え”を、メモリ内に順に格納す
る。
According to the notification from the task control unit 32, the event recording device control unit 33, as shown in FIG. 3, has "6" as the event / task switching occurrence time and "A" (as the event / task switching occurrence task. "A" (task A) is used as the event / task switching occurrence address.
End execution address) of the event / task switching (generated based on the next execution task name “B” and the next execution start address “0” notified from the task control unit 32) “B-0 Task switching ”in the memory.

【0035】やがてタスクBの3行目(B-3) が実行さ
れると、図2(b)からも明らかなように、[タスクA
にメッセージを送る]イベントが発生する。この際のイ
ベントの発生時間は“9”となる。この場合、メモリ内
には、イベント・タスク切替発生時間として“9”が、
イベント・タスク切替発生タスクとして“B”(タスク
B)が、イベント・タスク切替発生アドレスとして
“3”(3行目)が、イベント・タスク切替の内容とし
て“[タスクAにメッセージを送る]”が、順に格納さ
れる(図3参照)。
When the third line (B-3) of task B is executed, as is clear from FIG. 2B, [task A
Send message to] event occurs. The event occurrence time at this time is "9". In this case, "9" is stored in the memory as the event / task switching occurrence time.
"B" (task B) as the event / task switching occurrence task, "3" (third line) as the event / task switching occurrence address, and "[Send message to task A]" as the event / task switching content. Are sequentially stored (see FIG. 3).

【0036】次に、タスクBの実行が進み、タスクBの
5行目(B-5)の実行の後、再びタスクBの2行目(B
-2)が実行されたところでタスクCに切り替わったもの
とする。この場合、タスク制御部32からイベント記録
装置制御部33に、タスク切替発生時間“13”、実行
終了タスク名“B”と(タスクBの)実行終了アドレス
“2”、および次実行タスク名“C”と(タスクCの)
次実行開始アドレス“0”が通知される。この場合、メ
モリ内には、イベント・タスク切替発生時間として“1
3”が、イベント・タスク切替発生タスクとして“B”
(タスクB)が、イベント・タスク切替発生アドレスと
して“2”(タスクBの実行終了アドレス)が、イベン
ト・タスク切替の内容として“C-0にタスク切替え”が
順に格納される(図3参照)。
Next, the execution of task B proceeds, and after the execution of the fifth line (B-5) of task B, the second line (B
-It is assumed that the task C is switched to when task 2) is executed. In this case, from the task control unit 32 to the event recording device control unit 33, the task switching occurrence time “13”, the execution end task name “B”, the execution end address (of the task B) “2”, and the next execution task name “ C "and (for task C)
The next execution start address “0” is notified. In this case, the event / task switching occurrence time is "1" in the memory.
3 "is" B "as the event / task switching occurrence task
(Task B) stores "2" (task B execution end address) as the event / task switch occurrence address and "task switch to C-0" as the event / task switch content (see FIG. 3). ).

【0037】次にタスクCの実行が進み、タスクCの3
行目(C-3)が実行されたところで[タスクAにメッセ
ージを送る]イベントが発生したものとする(図2
(c)参照)。この場合、メモリ内には、イベント・タ
スク切替発生時間として“16”が、イベント・タスク
切替発生タスクとして“C”(タスクC)が、イベント
・タスク切替発生アドレスとして“3”(3行目)が、
イベント・タスク切替の内容として“[タスクAにメッ
セージを送る]”が順に格納される(図3参照)。
Next, the execution of task C proceeds, and task C 3
It is assumed that the [send message to task A] event occurs when the line (C-3) is executed (Fig. 2).
(See (c)). In this case, in the memory, "16" is set as the event / task switching occurrence time, "C" (task C) is set as the event / task switching occurrence task, and "3" (3rd line as the event / task switching occurrence address). )But,
"[Send message to task A]" is sequentially stored as the content of the event / task switching (see FIG. 3).

【0038】その後、再度実行されたタスクCの2行目
(C-2)でタスク切替が発生し、タスクAに切り替わっ
たものとする。この場合、タスク切替の発生時間は“2
0”、実行終了タスク名は“C”、(タスクCの)実行
終了アドレスは“2”、次実行タスク名は“A”であ
る。また、(タスクAの)次実行開始アドレスは、前回
タスクAを実行したときに5行目(A-5)でメイルがな
かったものとすると、“3”(A-13 )となる(図2
(a)参照)。したがって、メモリ内には、イベント・
タスク切替発生時間として“20”が、イベント・タス
ク切替発生タスクとして“C”(タスクC)が、イベン
ト・タスク切替発生アドレスとして“2”(2行目)
が、イベント・タスク切替の内容として“A-13 にタス
ク切替え”が格納される(図3参照)。
After that, it is assumed that the task switching occurs in the second line (C-2) of the task C that is re-executed, and the task C is switched to the task A. In this case, the task switching time is "2".
0 ", the execution end task name is" C ", the execution end address (for task C) is" 2 ", and the next execution task name is" A ". The next execution start address (for task A) is the previous If there is no mail in the fifth line (A-5) when task A is executed, the result will be "3" (A-13) (Fig. 2).
(See (a)). Therefore, in memory
"20" as the task switching occurrence time, "C" (task C) as the event / task switching occurrence task, and "2" (second line) as the event / task switching occurrence address
However, "task switch to A-13" is stored as the content of the event / task switch (see FIG. 3).

【0039】イベント記録装置制御部33は、以上のよ
うにして図3に示すようにメモリ内に格納したイベント
発生とタスク切替の履歴(イベント・タスク切替履歴)
を外部記録装置4に保存する。この外部記録装置4に保
存されたイベント・タスク切替え履歴を、表形式で図4
に示す。
The event recording device control unit 33 stores the history of event occurrence and task switching (event / task switching history) stored in the memory as shown in FIG. 3 as described above.
Is stored in the external recording device 4. The event / task switching history stored in the external recording device 4 is shown in a table form in FIG.
Shown in.

【0040】次に、以上のイベント・タスク切替履歴を
得るためにイベント記録装置3内で行なわれる処理を、
準備段階と、タスクスケジューリングの1サイクルの様
子に分けて説明する。
Next, the processing performed in the event recording device 3 to obtain the above event / task switching history will be described.
Description will be given separately for the preparation stage and one cycle of task scheduling.

【0041】まず、準備段階では、イベント記録装置制
御部33が、端末装置5からの指示入力に従って、タス
クA,B,Cの生成とその停止(終了)をタスク制御部
32に要求する。イベント記録装置制御部33は、タス
ク制御部32に要求したタスクの生成および停止作業が
完了すると、イベント検出調査部31に対し、取得すべ
きイベントがメッセージの交換であることを知らせる。
First, in the preparation stage, the event recording device control unit 33 requests the task control unit 32 to generate tasks A, B, and C and stop them (end) in accordance with an instruction input from the terminal device 5. When the task control unit 32 completes the task generation and stop work requested, the event recording device control unit 33 notifies the event detection / inspection unit 31 that the event to be acquired is message exchange.

【0042】次にイベント記録装置制御部33は、タス
ク制御部32にスケジューリングアルゴリズムとして各
タスクをタスクAから順番に一定時間ずつ実行するとい
うアルゴリズムを渡す。
Next, the event recording device control unit 33 passes to the task control unit 32 an algorithm for executing each task in order from the task A for a fixed time as a scheduling algorithm.

【0043】ここまでが準備段階であり、以降は主とし
てタスク制御部32が行なうイベント記録装置3の処理
のサイクルが続く。この処理サイクルについて、図5に
示すフローチャートを参照して説明する。
The process up to this point is the preparation stage, and thereafter, the cycle of the processing of the event recording device 3 mainly performed by the task control unit 32 continues. This processing cycle will be described with reference to the flowchart shown in FIG.

【0044】このサイクルにおいて、まずタスク制御部
32は、次に実行するタスクをスケジューリングアルゴ
リズムに従って決定する(ステップS1)。そしてタス
ク制御部32は、スケジューリングの結果を、即ちタス
ク切替発生時間、実行終了タスク名、実行終了アドレ
ス、次実行タスク名、および次実行開始アドレスをイベ
ント記録装置制御部33に通知する(ステップS2)。
In this cycle, the task control section 32 first determines the task to be executed next according to the scheduling algorithm (step S1). Then, the task control unit 32 notifies the event recording device control unit 33 of the scheduling result, that is, the task switching occurrence time, the execution end task name, the execution end address, the next execution task name, and the next execution start address (step S2). ).

【0045】次にタスク制御部32は、タスクスケジュ
ーリングのアルゴリズムに従って選ばれたタスクをタス
ク切替のアルゴリズムに従って実行させる(ステップS
3)。
Next, the task control unit 32 executes the task selected according to the task scheduling algorithm according to the task switching algorithm (step S
3).

【0046】このタスク制御部32の制御によりタスク
が実行されている間に、システムコールまたは割り込み
が発生すると、イベント検出調査部31に制御が移る。
するとイベント検出調査部31はタスク制御部32に対
して実行中のタスクを止めるように要求すると共に、こ
の状態になった要因がイベント発生(この例ではメッセ
ージ交換)によるものであるかを調査し、イベント発生
によるものであるならば、そのイベントの内容をイベン
ト発生タスクから取得して、イベント発生時間、イベン
ト発生タスク名およびイベント発生アドレスと共に、イ
ベント記録装置制御部33に通知する(ステップS
4)。ここで、イベント発生タスク名およびイベント発
生アドレスはタスク制御部32から取得されるものであ
る。
When a system call or an interrupt occurs while the task is being executed under the control of the task control section 32, the control is transferred to the event detection investigation section 31.
Then, the event detection investigation unit 31 requests the task control unit 32 to stop the task being executed, and investigates whether the cause of this state is an event occurrence (message exchange in this example). If it is caused by an event occurrence, the content of the event is acquired from the event occurrence task and is notified to the event recording device control unit 33 together with the event occurrence time, the event occurrence task name and the event occurrence address (step S
4). Here, the event occurrence task name and the event occurrence address are acquired from the task control unit 32.

【0047】また、タスク制御部32の制御によりタス
クが実行されている間にタスク切替が発生すると、タス
ク制御部32は、イベント記録装置制御部33からの命
令(指示)の有無を確認してから(ステップS5)、次
のサイクルへと進む。
When task switching occurs while a task is being executed under the control of the task control unit 32, the task control unit 32 checks whether there is a command (instruction) from the event recording device control unit 33. From (step S5), the process proceeds to the next cycle.

【0048】以上の繰り返しにより、メモリ内に図3に
示すようなイベント・タスク切替履歴が格納され、この
メモリの内容から外部記録装置4内に図4に示すイベン
ト・タスク切替履歴表が生成される。
By repeating the above, the event / task switching history as shown in FIG. 3 is stored in the memory, and the event / task switching history table shown in FIG. 4 is generated in the external recording device 4 from the contents of this memory. It

【0049】なお、前記実施例では、メッセージ交換を
イベントとしてとらえる場合について説明したが、これ
に限るものではなく、端末装置5からの指示入力に従
い、ある変数がある値となっている場合や、システムコ
ールを呼び出す場合をイベントとしてとらえることも可
能である。後者の場合、イベントの内容は、タスクから
ではなく、オペレーティングシステム1から取得する必
要がある。
In the above embodiment, the case where the message exchange is regarded as an event has been described. However, the present invention is not limited to this, and a case where a variable has a certain value according to an instruction input from the terminal device 5, It is also possible to catch the event of calling a system call as an event. In the latter case, the content of the event needs to be obtained from the operating system 1, not from the task.

【0050】[0050]

【発明の効果】以上詳述したようにこの発明によれば、
イベント記録対象プログラムの各タスクを、オペレーテ
ィングシステムのタスクスケジューリングとタスク切替
アルゴリズムをシミュレートしたタスクスケジューリン
グに従ってタスク制御手段により動作させ、タスク切替
発生時には、このタスク制御手段がタスク切替の発生時
間とその切替内容を含むタスク切替情報を取得する構成
とすると共に、このタスク制御手段の制御により動かさ
れる対象プログラムをイベント検出調査手段が監視して
イベントの発生を検出し、イベント発生時間とそのイベ
ントの内容を含むイベント情報を取得する構成とし、上
記タスク切替情報およびイベント情報をもとにイベント
とタスク切替の履歴を作成するようにしたので、タスク
切替の発生を容易に検出し記録することができ、しかも
現在どのタスクが動作しているかを容易に知ることがで
きるため、対象プログラムで発生したイベントの調査・
記録が効率的に行なえる。また、このようにして得られ
たイベント記録(イベント・タスク切替履歴)を用いれ
ば、プログラムの動作の正確な再現が可能となり、これ
によってユーザプログラムのデバッグ時間を大幅に短縮
できる。
As described above in detail, according to the present invention,
Each task of the event recording target program is operated by the task control means according to the task scheduling of the operating system and the task scheduling simulating the task switching algorithm. When the task switching occurs, the task control means causes the task switching occurrence time and the switching. The task switching information including the content is configured to be acquired, and the target detection program operated by the control of the task control means is monitored by the event detection investigation means to detect the occurrence of the event, and the event occurrence time and the content of the event are displayed. Since it is configured to acquire the event information including the task switching information and the history of the event switching and the task switching based on the event information, the occurrence of the task switching can be easily detected and recorded. Which task is currently Because it can easily know whether you are work, investigation of the events that have occurred in the target program
Recording can be done efficiently. In addition, by using the event record (event / task switching history) obtained in this way, it is possible to accurately reproduce the operation of the program, which can significantly reduce the debugging time of the user program.

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

【図1】本発明の一実施例を示すブロック構成図。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】同実施例においてイベント記録の対象としてい
るプログラムを構成するタスクA,B,Cの内容例を示
す図。
FIG. 2 is a diagram showing an example of the contents of tasks A, B, and C that constitute a program targeted for event recording in the embodiment.

【図3】同実施例におけるイベント・タスク切替の履歴
のメモリ上での格納例を示す図。
FIG. 3 is a diagram showing an example of storing a history of event / task switching on a memory in the same embodiment.

【図4】図4のメモリ内容から外部記録装置4に記録さ
れたイベント・タスク切替履歴表を示す図。
FIG. 4 is a diagram showing an event / task switching history table recorded in an external recording device 4 from the memory contents of FIG. 4;

【図5】主としてタスク制御部32が行なうイベント記
録装置3の処理サイクルを説明するためのフローチャー
ト。
FIG. 5 is a flowchart mainly illustrating a processing cycle of the event recording device 3 performed by the task control unit 32.

【符号の説明】[Explanation of symbols]

1…オペレーティングシステム、2…ユーザプログラ
ム、3…イベント記録装置、4…外部記録装置、5…端
末装置、31…イベント検出調査部、32…タスク制御
部、33…イベント記録装置制御部。
1 ... Operating system, 2 ... User program, 3 ... Event recording device, 4 ... External recording device, 5 ... Terminal device, 31 ... Event detection investigation part, 32 ... Task control part, 33 ... Event recording device control part.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 マルチタスク・オペレーティングシステ
ム上で動作する複数のタスクからなる利用者プログラム
で発生するイベントを記録するイベント記録方式におい
て、 前記オペレーティングシステムのタスクスケジューリン
グ機能およびタスク切替のアルゴリズムをシミュレート
してそのスケジューリングに従って前記各タスクを動作
させ、タスク切替が発生したときに、タスク切替の発生
時間とその切替内容を含むタスク切替情報を取得するタ
スク制御手段と、 イベント記録の対象となる前記プログラムの実行状態を
監視してイベントの発生を検出し、イベント発生時間と
そのイベントの内容を含むイベント情報を取得するイベ
ント検出調査手段と、 前記タスク制御手段およびイベント検出調査手段を制御
すると共に、前記タスク制御手段により取得された前記
タスク切替情報および前記イベント検出調査手段により
取得された前記イベント情報をもとに、前記プログラム
で発生したイベントとタスク切替の履歴を作成するイベ
ント記録装置制御手段と、 を具備し、前記イベント記録装置制御手段により作成さ
れたイベントとタスクの履歴を記録装置に記録するよう
にしたことを特徴とするイベント記録方式。
1. An event recording method for recording an event occurring in a user program consisting of a plurality of tasks operating on a multitasking operating system, simulating a task scheduling function and a task switching algorithm of the operating system. The task control means for operating each of the tasks according to the scheduling, and acquiring the task switching information including the task switching occurrence time and the switching content when the task switching occurs, and the program of the event recording target. An event detection investigating unit that monitors an execution state to detect the occurrence of an event, and obtains event information including an event occurrence time and the content of the event; and the task control unit and the event detection investigating unit, and the task. control Event recording device control means for creating a history of events and task switching occurring in the program based on the task switching information acquired by the means and the event information acquired by the event detection and investigation means. The event recording method is characterized in that the history of events and tasks created by the event recording device control means is recorded in the recording device.
JP30396392A 1992-11-13 1992-11-13 Event recording method and device Expired - Fee Related JP3207564B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30396392A JP3207564B2 (en) 1992-11-13 1992-11-13 Event recording method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30396392A JP3207564B2 (en) 1992-11-13 1992-11-13 Event recording method and device

Publications (2)

Publication Number Publication Date
JPH06149615A true JPH06149615A (en) 1994-05-31
JP3207564B2 JP3207564B2 (en) 2001-09-10

Family

ID=17927386

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30396392A Expired - Fee Related JP3207564B2 (en) 1992-11-13 1992-11-13 Event recording method and device

Country Status (1)

Country Link
JP (1) JP3207564B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19534442A1 (en) * 1995-09-16 1997-03-27 Abb Research Ltd Over-current protection device for 11 to 17 kV networks
JP2009265823A (en) * 2008-04-23 2009-11-12 Yokogawa Digital Computer Corp Information terminal device and log data acquisition program
JP2010182237A (en) * 2009-02-09 2010-08-19 Nec Corp System, method and program for sampling stack trace
JP2014023120A (en) * 2012-07-23 2014-02-03 Toshiba Corp Information processing apparatus, method, and program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19534442A1 (en) * 1995-09-16 1997-03-27 Abb Research Ltd Over-current protection device for 11 to 17 kV networks
JP2009265823A (en) * 2008-04-23 2009-11-12 Yokogawa Digital Computer Corp Information terminal device and log data acquisition program
JP2010182237A (en) * 2009-02-09 2010-08-19 Nec Corp System, method and program for sampling stack trace
JP2014023120A (en) * 2012-07-23 2014-02-03 Toshiba Corp Information processing apparatus, method, and program

Also Published As

Publication number Publication date
JP3207564B2 (en) 2001-09-10

Similar Documents

Publication Publication Date Title
JP3339482B2 (en) Distributed debugging apparatus, debugging method, and recording medium recording control program
JP3832517B2 (en) Robot controller and control method thereof
US20010034751A1 (en) Real-time OS simulator
JP2006277115A (en) Abnormality detection program and abnormality detection method
US20010027387A1 (en) Debugging supporting apparatus, debugging supporting method and recording medium readable by computer with its programs recorded thereon
JP2000066904A (en) Method for controlling multitask and storage medium
US6131109A (en) Multitask processor, a multitask processing method, a multitask processing display method and a storage medium for processing by correlating task and object
JPH06149615A (en) Event recording system
JP3339708B2 (en) Event recording method
JPS6250933A (en) Job executing processsing system
JPS63177231A (en) Debug system for parallel program
JP2000250777A (en) Information processor, information processing method and storage medium
JPS6091452A (en) Task scheduling system of data processor
JP4192380B2 (en) PLC simulator apparatus, simulation program, and recording medium on which the program is recorded
JPH04314141A (en) Method and mechanism for controlling multi-task
KR100289039B1 (en) Method for executing control of process in cross debugging server
JPH0378034A (en) Program parallel execution device
JP2641919B2 (en) Job schedule stop device
JP2002007147A (en) Real time os simulator
JPH09297696A (en) Priority information display system
JPH02127732A (en) Job control system
JPH0363867A (en) Program synchronous processing system
JPH03144705A (en) Operation state monitor for programmable controller
JPH0340867B2 (en)
JP2000242522A (en) Device and method for debugging multitask

Legal Events

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