JP2015118493A - Trace device and trace program - Google Patents
Trace device and trace program Download PDFInfo
- Publication number
- JP2015118493A JP2015118493A JP2013260733A JP2013260733A JP2015118493A JP 2015118493 A JP2015118493 A JP 2015118493A JP 2013260733 A JP2013260733 A JP 2013260733A JP 2013260733 A JP2013260733 A JP 2013260733A JP 2015118493 A JP2015118493 A JP 2015118493A
- Authority
- JP
- Japan
- Prior art keywords
- program
- trace
- unit
- cpus
- operation information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、マルチコアプロセッサを搭載してトレース(プログラム動作情報)をするトレース装置に関するものである。 The present invention relates to a tracing device that mounts a multi-core processor and performs tracing (program operation information).
従来のプログラム動作情報(トレース)収集方法は、例えば計算機システムが動作中に、日付、時刻、動作内容などをUART(Universal Asynchronous Receiver Transmitter)に出力する方法や、前記プログラム動作情報をメモリに出力し、不揮発領域へ書き出し、プログラム動作情報を収集する方法が利用されている。しかし、UARTにプログラム動作情報を出力する方法ではUARTへ出力するためにCPU負荷が生じ、CPU(Central Processing Unit)の動作タイミングに影響を及ぼす。プログラム動作情報の出力量によっては、システムの動作に副作用が生じることがあるため、プログラム動作情報を出力する処理負荷を考慮した運用が必要である。また、プログラム動作情報を不揮発領域へ出力する方法は、例えばOS(オペレーティングシステム)を含むシステムがダウンした場合やハングアップした状態の場合は、収集したプログラム動作情報を収集できない状態に陥ることがある。 Conventional program operation information (trace) collection methods include, for example, a method of outputting the date, time, operation content, etc. to a UART (Universal Asynchronous Receiver Transmitter) while the computer system is operating, or outputting the program operation information to a memory. A method of writing to a nonvolatile area and collecting program operation information is used. However, in the method of outputting the program operation information to the UART, a CPU load is generated because the program operation information is output to the UART, which affects the operation timing of the CPU (Central Processing Unit). Depending on the output amount of the program operation information, side effects may occur in the operation of the system. Therefore, it is necessary to operate in consideration of the processing load for outputting the program operation information. Also, the method for outputting the program operation information to the non-volatile area may fall into a state where the collected program operation information cannot be collected, for example, when the system including the OS (operating system) is down or hung up. .
これらの課題を解決するために従来技術で次の特許文献1、特許文献2の技術が開示されている。特許文献1の技術は、CPUの動作タイミングに影響を与えることなく、プログラム動作情報を収集する技術として、専用のハードウェアを追加し、主記憶装置にプログラム動作情報を書き込み、専用ハードウェアから外部記憶装置にプログラム動作情報を転送し、CPUを介在させないことでCPU負荷を低減させる。また、専用ハードウェアを追加するため、システムがダウンした状況においても専用ハードウェアを経由してプログラム動作情報の収集を可能にしている。特許文献2の技術は、複数のCPUを持つ計算機において各CPUの負荷を監視し、CPU負荷が低いコアにトレーサを動作させるようにスケジュールするものである。それにより特定のCPU負荷が高くなることを防ぎ、システムに対する副作用を軽減できる技術が発明されている。
In order to solve these problems, the following
特許文献1は、専用のハードウェアを追加することで、システムに対する負荷の軽減、システムダウン時にもプログラム動作情報の収集を可能にしているが、計算機システムに専用ハードウェアを追加する必要がある。計算機システムへ専用ハードウェアを追加するため、コストおよびサイズが大きくなるという課題がある。 Japanese Patent Application Laid-Open No. 2004-228867 reduces the load on the system by adding dedicated hardware and enables collection of program operation information even when the system is down. However, it is necessary to add dedicated hardware to the computer system. Since dedicated hardware is added to the computer system, there is a problem that the cost and size increase.
特許文献2は、既存の計算機システムにリソース監視機構などをソフトウェアで実現し、専用のハードウェアは不要である。このため、コスト高、サイズ拡大の課題は発生しないが、システム全体がダウンした状況では、プログラム動作情報をUARTや不揮発領域へ書き出しができない状況に陥る場合がある。更にリソース監視機構をソフトウェアで実現する場合、それらを動作させるためのCPUリソースが必要であり、システムに対する副作用が発生しないように運用する必要がある。
In
この発明は、専用ハードウェアを追加することなくプログラム動作情報の出力処理におけるCPU負荷増大を抑制し、またシステムダウンの影響を受けずにプログラム動作情報の記録が可能なトレース装置の提供を目的とする。 An object of the present invention is to provide a trace device capable of suppressing an increase in CPU load in program operation information output processing without adding dedicated hardware and recording program operation information without being affected by a system down. To do.
この発明のトレース装置は、
複数のCPU(Central Processing Unit)を有するマルチコアプロセッサを搭載するトレース装置において、
前記マルチコアプロセッサの有する前記複数のCPUのうち、1以上の一部のCPUを用いてプログラムを実行し、前記プログラムの処理状況の履歴を示すプログラム動作情報を収集するシステム動作部と、
前記マルチコアプロセッサの有する前記複数のCPUのうち、前記システム動作部が使用するCPUとは異なる1以上のCPUを用いて前記システム動作部の稼働状況に影響されることなく前記システム動作部とは独立に稼働すると共に、前記システム動作部の収集した前記プログラム動作情報をIO(Input/Output)デバイスに出力するログ制御部と
を備えたことを特徴とする。
The tracing device of the present invention
In a trace device equipped with a multi-core processor having a plurality of CPUs (Central Processing Units),
A system operation unit that executes a program using one or more of the CPUs of the multi-core processor and collects program operation information indicating a history of the processing status of the program;
Of the plurality of CPUs of the multi-core processor, one or more CPUs different from the CPU used by the system operation unit are used and are independent of the system operation unit without being affected by the operating status of the system operation unit. And a log control unit that outputs the program operation information collected by the system operation unit to an IO (Input / Output) device.
この発明により、専用ハードウェアを追加することなくプログラム動作情報の出力処理におけるCPU負荷増大を抑制し、またシステムダウンの影響を受けずにプログラム動作情報の記録が可能なトレース装置を提供できる。 According to the present invention, it is possible to provide a tracing device that can suppress an increase in CPU load in the output processing of program operation information without adding dedicated hardware and can record program operation information without being affected by a system down.
実施の形態1.
図1〜図7を参照して実施の形態1のトレース装置1001を説明する。
図1は、実施の形態1のトレース装置1001のハードウェア構成及びソフトウェア構成を含む構成図である。図1に示すトレース装置1001は、4個のCPU(Central Processing Unit)であるCPU101−1、CPU101−2、CPU101−3,CPU201を備えたマルチコアプロセッサに、システム動作系100(システム動作部)とログ制御系200(ログ制御部)を構築する例である。
The trace apparatus 1001 according to the first embodiment will be described with reference to FIGS.
FIG. 1 is a configuration diagram including a hardware configuration and a software configuration of the trace apparatus 1001 according to the first embodiment. A trace apparatus 1001 shown in FIG. 1 includes a system operating system 100 (system operating unit) and a multi-core processor including CPUs 101-1, CPU 101-2, CPU 101-3, and
(システム動作系100)
システム動作系100は、CPU101−1〜101−3、OS(オペレーティングシステム)102、CPU間通信部103、アプリケーションプログラム104、IO(Input/Output)アクセス制御部105、異常検出処理部106、及びプログラム情報書込部107から構成される。プログラム情報書込部107は、プログラム動作情報を書き出すプログラムを有するプロセスをCPU101−1等が実行することで実現される。
ここで「プログラム動作情報」とは、プログラムの動作履歴の情報(トレース)である。
(System operation system 100)
The
Here, “program operation information” is information (trace) of program operation history.
(ログ制御系200)
ログ制御系200は、CPU201、CPU間通信部203、IOアクセス制御部205、異常検出処理部206及びプログラム情報読出部207から構成されている。
(Log control system 200)
The
また、トレース装置1001は、システム動作系100とログ制御系200とが共通して用いるIO(Input/Output)デバイス1、メモリ2(例えば主記憶装置)、通信路3を備えている。上記のシステム動作系100、ログ制御系200は、「〜部」の機能を有する各プログラム、OS102、「各プログラム及びOS102」を実行するCPU101−1〜101−3、201によって実現される。図1に示すように、トレース装置1001では、マルチコアプロセッサを複数の系(図1では2つ)に分割し、システム動作系100とログ制御系200とを構成する。システム動作系100にはCPUを3個、ログ制御系200にはCPUを1個割り当てる。CPU101−1〜101−3、CPU201の4つのCPUは、同一アーキテクチャを持つ。これら4つのCPUは、通信路3で接続され、CPU間、或いは同じく通信路3に接続される周辺ハードウェアであるIOデバイス1、メモリ2と互いに情報を伝達できるように構成されている。
The trace device 1001 includes an IO (Input / Output)
システム動作系100は、OS102を搭載する。また、システム動作系100は、CPU間通信部103,アプリケーションプログラム104,IOアクセス制御部105,異常検出処理部106、プログラム情報書込部107を搭載しシステム動作系を構築する。CPU間通信部103〜プログラム情報書込部107はOS102上で動作する。また、ログ制御系200にOSは搭載せず、単純な構成とする。ログ制御系200はCPU間通信部203,IOアクセス制御部205,異常検出処理部206、プログラム情報読出部207を搭載し、ログ制御系を構築する。システム動作系100とログ制御系200とで共用するIOデバイス1へのアクセスは、システム動作系100またはログ制御系200とのうちの、どちらか一方がアクセスすることとする。システム動作系100とログ制御系200とのIOデバイス1へのアクセスの競合を防ぐため、IOアクセス制御部105、205で排他制御を行う。
The
図1に示すように、メモリ2は、システム動作系100が使用するシステム動作系メモリ領域21と、ログ制御系200が使用するログ制御系メモリ領域22と、システム動作系100とログ制御系200との両者で使用する共有メモリ23に分割されている。
As shown in FIG. 1, the
システム動作系100は通常のシステムを動作させる系である。システム動作系100のプログラム情報書込部107は、システム動作系100で動作するアプリケーションプログラム104をはじめ、OS102を含むプログラム動作情報を収集し、収集したプログラム動作情報を共有メモリ23へ書き込む。
The
ログ制御系200のプログラム情報読出部207は、共有メモリ23から、プログラム情報書込部107が書き込んだプログラム動作情報を読み出し、IOデバイス1へ、読み出したプログラム動作情報を出力する。
The program
(システム動作系100の異常検出)
CPU間通信部103,203と、異常検出処理部106、206とによって、システム動作系100の稼働状態の監視を行い、システム動作系100の異常検出を行う。システム動作系100の異常が検出された場合は、ログ制御系200の異常検出処理部206は、システム動作系100のCPU101−1〜101−3を停止させると共に、共有メモリ23に格納されているプログラム動作情報をプログラム情報読出部207に、IOデバイス1へ出力させる。
(Abnormality detection of system operation system 100)
The
図2は共有メモリ23の使用領域を示す図である。共有メモリ23は、図2に示すように、プログラム動作情報を出力するIOデバイスの種別に応じてメモリ領域が分割される。システム動作系100は、プログラム動作情報を出力するIOデバイスの種別に応じた共有メモリ領域にプログラム動作情報の書き込みを行う。図2は2つのIOデバイスへプログラム動作情報を出力する場合の図である。例えばIOデバイスAの出力用領域231は、UARTへの出力領域であり、IOデバイスBの出力用領域232は、不揮発なストレージであるHDD(Hard Disk Drive)やSDメモリーカード(SD Memory Card(SDは登録商標))への出力領域として割り当てる。
FIG. 2 is a diagram showing a use area of the shared
<トレース装置1001の起動とプログラム動作情報収集>
次に、実施の形態1のトレース装置1001の動作について説明する。
図3は、システム動作系100のプログラム情報書込部107が、共有メモリ23にプログラム動作情報を書き込むフローチャートである。電源オンなど、システム起動トリガを検出すると、ログ制御系200が起動し、その後、システム動作系100が起動する。起動したシステム動作系100は通常の動作を行い、プログラム情報書込部107が動作内容をプログラム動作情報として共有メモリ23へ書き込む(ST1)。共有メモリ23のプログラム動作情報を格納する領域は、システム動作系100のみが書き込みを行うものとする。なお読み出しはプログラム情報読出部207のみが行う。このためアクセス競合が発生せず、図3に示す通り、判定処理なしで共有メモリ23へ書き込みができる。また、ログ制御系200起動後にシステム動作系100を起動させることで、システム動作系100の起動時からのプログラム動作情報を取得することができる。なお、システムの起動時間の短縮を目的とし、システム動作系100と、ログ制御系200とを並列で起動させてもよい。
<Activation of Trace Device 1001 and Collection of Program Operation Information>
Next, the operation of the trace device 1001 according to the first embodiment will be described.
FIG. 3 is a flowchart in which the program
<プログラム動作情報の出力>
図4は、プログラム情報読出部207が、共有メモリ23に格納されたプログラム動作情報を、IOデバイス1への出力するフローチャートである。出力先のIOデバイス1がシステム動作系100からもアクセスされる場合は、アクセス競合が発生するため、図4に示すように、IOアクセス制御部205で排他制御を行う。これについては後述する。
<Output of program operation information>
FIG. 4 is a flowchart in which the program
ログ制御系200のプログラム情報読出部207は、共有メモリ23に書き込まれたプログラム動作情報を出力先のIOデバイスの種別に応じた共有メモリ23の領域から読み出し(ST10)、プログラム動作情報が存在するか判定する(ST11)。IOデバイス1へ出力するプログラム動作情報が存在する場合、IOアクセス制御部205は、IOデバイス1へのアクセスが可能か判定する(ST12)。IOアクセス制御部205がアクセス可能と判定した場合、プログラム情報読出部207は、IOデバイス1へプログラム動作情報の出力処理を行う(ST13)。IOデバイス1への出力処理はシステム動作系100と共用する通信路3の効率を考慮し、プログラム情報読出部207は、プログラム動作情報が一定量、共有メモリ23に溜まるまで待ち、一定量溜まる毎にIOデバイス1へ出力する。IOデバイス1へのデータ転送は、ログ制御系200のCPU201による転送に加え、DMA(Direct Memory Access)を利用してもよい。
The program
<異常検出>
ログ制御系200の異常検出処理部206は、システム動作系100の稼働状態を監視し、システム動作系100の異常を検出する機能を有する。以下に具体的な検出方法を記載する。
図5は、ログ制御系200がシステム動作系100の稼働状態を監視するシーケンスの例である。通信路3を介したCPU101−1〜101―3と、CPU201との間で、CPU間通信部103,203と共有メモリ23とを利用し、システム動作系100は、周期的に共有メモリ23の稼働情報を更新する(ST100)。CPU間通信部103,203間の通信で、ログ制御系200へ稼働情報の更新通知を送出する(ST111)。ログ制御系200では、予めタイマ(図示していないがCPU201によって実現する)をセットし(ST112)、タイマカウントダウンを行っている(ST113)。ログ制御系200は、システム動作系100からの稼働情報の更新通知を受信し、更新通知を受信した場合、異常検出処理部206は共有メモリ23の稼働内容が期待する値に更新されているか確認する(ST114)。異常検出処理部206は、期待する値に更新されていることでシステム動作系100が正常動作を行っていると判断し、タイマ値をリセットし(ST115)、再度、タイマカウントダウンを行い(ST116)、以下同様に、異常検出処理部206はシステム動作系が正常に稼働しているかどうか監視を継続する。
<Abnormality detection>
The abnormality
FIG. 5 is an example of a sequence in which the
<ログ制御系200によるシステム動作系100の異常検出>
図6は、システム動作系100が正常に稼働できていない状態を、ログ制御系200が検出するシーケンスの例である。ログ制御系200によるシステム動作系100の稼働状態の監視方法は、図5で示した通りである。ログ制御系200は予めタイマをセットし(ST122)、タイマカウントダウン(ST123)を行っている。システム動作系100が共有メモリ23の内容を更新したが(ST120)、システム動作系100がダウンし、稼働情報の更新通知(ST121)が通知できない状態が発生する。ログ制御系200の異常検出処理部206は、稼働情報の更新通知(ST121)が通知されないため、タイマのタイムアウトを検出し(ST124)、システム動作系の稼働状態が異常と判定し、通信路3を介してシステム動作系100のCPU101の動作を停止ST125させる。その後、異常検出処理部206はプログラム情報読出部207に、プログラム動作情報の強制出力(ST126)、システム動作系100のキャッシュ情報出力(ST127)を行わせる。ST126のプログラム動作情報の強制出力、ST127のシステム動作系100のキャッシュ情報出力については後述する。
<Abnormality detection of
FIG. 6 is an example of a sequence in which the
システム動作系100からログ制御系200の稼働情報の更新通知は通知されたが、共有メモリ23の稼働内容が期待する値に更新されていない場合も、異常検出処理部206は、システム動作系100の稼働状態異常と判断する。
Even when the update information of the operation information of the
<システム動作系の自系の異常検出>
図7は、システム動作系100が自系の異常を検出する場合のシーケンスの例であるシステム動作系100の異常検出処理部106は、自身のシステム動作系内の異常を検出する機能を有し、異常検出処理ST130を行う。以下に具体的な検出方法を記載する。
(1)例外などCPU101−1〜101−3のエラー検出情報を取得する。
(2)チェックサムを利用したメモリ内容の監視を行い、メモリ破壊、データの書き込み失敗の検出を行う。
(3)アプリケーションプログラム104で周期的に動作する処理が一定周期以内に動作しているか監視し、処理遅延の検出を行う。
(4)システム動作系メモリ領域21の特定の領域に確認用データを格納し、その領域が期待しない値に書き換わらないか監視する。メモリ破壊、スタックオーバフローの検出を行う。
(5)OS102のスケジューリング情報を参照し、スケジューリングのキュー操作から一定時間以上同一キューがRUN状態になっていないか、周期動作する処理が周期的にRUN状態に遷移しているかを監視する。
上記(1)〜(5)のいずれかの方法で異常を検出した場合、システム動作系100の異常検出処理部106は、CPU間通信部103,203間の通信を介して、ログ制御系200に異常検出通知を送る(ST131)。ログ制御系200では異常検出通知を受信すると、異常検出処理部206が通信路3を介してシステム動作系100のCPU101−1〜101−3の動作を停止(ST132)させる。 その後、異常検出処理部206はプログラム情報読出部207に、プログラム動作情報の強制出力(ST133)、及びシステム動作系100のキャッシュ情報出力(ST134)を行わせる。
<Detection of abnormalities in the system operating system>
FIG. 7 shows an example of a sequence when the
(1) Acquire error detection information of the CPUs 101-1 to 101-3 such as exceptions.
(2) Monitor memory contents using a checksum and detect memory corruption and data write failure.
(3) Monitors whether processing that operates periodically by the
(4) The confirmation data is stored in a specific area of the system operation
(5) With reference to the scheduling information of the
When an abnormality is detected by any one of the methods (1) to (5), the abnormality
<プログラム動作情報の強制出力(ST126,ST133)>
ログ制御系200の異常検出処理部206は、共有メモリ23にシステム動作系100のプログラム情報書込部107が書き込んだプログラム動作情報を、プログラム情報読出部207により強制的にIOデバイス1へ出力させる。システム動作系100が通信路3および共有するIOデバイス1を使用中の状態でシステム動作系100がダウンした場合は、異常検出処理部206は通信路3のアクセス権または共有するIOデバイスのアクセス権を強制的にログ制御系200に割り当てる処理を行い、プログラム情報読出部207にIOデバイス1へプログラム動作情報を出力させる。
<Forced output of program operation information (ST126, ST133)>
The abnormality
強制出力することでシステム動作系100がダウンする直前のプログラム動作情報の取得が可能である。また、IOデバイス1への出力をログ制御系200で処理するため、システム動作系100がダウンしても、IOデバイス1への出力過程で出力処理が停止せず、プログラム動作情報を取得することができる。これに対して従来の技術ではシステム動作系でIOデバイス1への出力処理を行う場合、システム動作系がダウンするとIOデバイス1への出力過程で出力処理が停止し、最後までプログラム動作情報の取得ができないことがある。
By forcibly outputting, it is possible to acquire program operation information immediately before the
<システム動作系100のキャッシュ情報出力(ST127,ST134)>
ログ制御系200の異常検出処理部206は、プログラム情報読出部207に、システム動作系100のCPU101−1〜101−3の2次キャッシュの情報を取得させ、IOデバイス1へ出力させる。このようにST127,ST134では、プログラム動作情報に加え、異常が発生したシステム動作系100におけるCPU101−1〜101−3の2次キャッシュの情報をログ制御系200側からアクセスして異常発生時の状態を収集する。
また、ログ制御系200の異常検出処理部206は、プログラム情報読出部207によって、システム動作系100のCPU101−1〜101−3の1次キャッシュの情報を取得する。
ログ制御系200の異常検出処理部206は、停止させたCPU101−1〜101−3を再度、起動させ、1次キャッシュ読み出し要求を通信路3へ送出し、CPU101−1〜101−3が保持している1次キャッシュ情報をプログラム情報読出部207を介して取得し、異常発生時の状態を収集する。ログ制御系200では、CPU101−1〜101−3の1次キャッシュ情報を取得した後は必要に応じてCPU101−1〜101−3の動作を停止させる。ログ制御系200によるシステム動作系100のCPU101−1〜101−3の1次キャッシュ、2次キャッシュ情報の取得は、システム動作系100に異常が発生した時のみでなく、障害調査や動作内容の確認を行いたいタイミングで、異常検出処理部206がCPU101を停止し、実行する方法としてもよい。
<Cache information output of system operation system 100 (ST127, ST134)>
The abnormality
Further, the abnormality
The abnormality
<IOデバイスアクセス制御>
トレース装置1001を構築するマルチコアプロセッサのハードウェア構成によっては、システム動作系100とログ制御系200とが共通のIOデバイス1へアクセスする場合がある。また、マルチコアプロセッサを搭載したSocでは、IOデバイスは共通の構成が多く用いられる。この場合、共通で使用するIOデバイスへのアクセス競合を防ぐために、システム動作系100のIOアクセス制御部105とログ制御系200のIOアクセス制御部205とで排他制御を実施する。IOアクセス制御部105とIOアクセス制御部205とはそれぞれCPU間通信部103、CPU間通信部203で通信路3を介し、共通に使用するIOデバイス1へのアクセス開始と終了をお互いに通知し、排他制御を行う。共通に使用するIOデバイス1へのアクセス状況をシステム動作系100とログ制御系200とで共有し、IOデバイス1へアクセスする前に確認することで競合を防ぐことができる。
<IO device access control>
Depending on the hardware configuration of the multi-core processor that constructs the trace device 1001, the
<トレース装置1001のシャットダウン>
トレース装置1001のシャットダウンは、システム動作系100が終了した後、ログ制御系200を終了させる。システム動作系100はCPU間通信を使用しログ制御系200へシャットダウンを通知する。ログ制御系200は、システム動作系100のシャットダウンを受信後、共有メモリ23に格納されているプログラム動作情報を強制的にIOデバイス1へ出力し、ログ制御系200をシャットダウンする。
<Shutdown of trace device 1001>
The shutdown of the trace device 1001 terminates the
なお、上記の例ではCPU数が4個のマルチコアプロセッサの例を説明したが、CPU数はこの値に限定されるものではなく、2個以上のCPUを備えたマルチコアプロセッサであってもよい。すなわち、実施の形態1のトレース装置1001は、CPU数が2個以上のマルチコアプロセッサにおいてCPU数を任意の個数に分割し、システム動作系100とログ制御系200を構築するものである。あるいは複数のCPUを有するマルチコアプロセッサの、複数のCPUの一部を用いてシステム動作系100、ログ制御系200を構成しても構わない。例えば5個のCPUを備えたマルチコアプロセッサにおいて、トレース装置1001と同様に、システム動作系100に3個使用し、ログ制御系200に1個使用しても構わない。
また、この実施の形態1では、システム動作系100にOS102が搭載された場合を説明したが、システム動作系100にOS102を搭載しないシステムにおいてもこの実施の形態1の適用が可能である。
さらにログ制御系200は単純な構成とするためOSは搭載しないこととしたが、堅牢性の高いOSを搭載する構成も可能である。
さらにシステム動作系100はSMP構成だけでなく、AMP構成のマルチOS、およびマルチCPU構成も可能である。
In the above example, the example of the multi-core processor having four CPUs has been described. However, the number of CPUs is not limited to this value, and a multi-core processor having two or more CPUs may be used. That is, the trace apparatus 1001 according to the first embodiment divides the number of CPUs into an arbitrary number in a multi-core processor having two or more CPUs, and constructs the
In the first embodiment, the case where the
Further, since the
Furthermore, the
実施の形態2.
図8を参照して実施の形態2のトレース装置1002を説明する。
図8は実施の形態2のトレース装置1002の構成図である。図8のトレース装置1002では、実施の形態1で示したマルチコアプロセッサを用いてトレース装置を構築する例において、計算機の仮想化技術のひとつであるハイパーバイザを利用してトレース装置を構築する。トレース装置1002は、トレース装置1001に対して、ログ制御系200にOS202を搭載すると共に、IOデバイス1へのアクセス制御やCPU間通信部を、ハイパーバイザ110を介して実現する。つまりトレース装置1002では、さらにハイパーバイザ110も加えて、システム動作系100、ログ制御系200を構成する。
A
FIG. 8 is a configuration diagram of the
実施の形態1との違いは、上記のようにログ制御系200にOS202を搭載する点と、CPU間通信部とIOデバイスアクセス制御部との代わりにハイパーバイザ110を利用する点であり、運用方法は実施の形態1と同様である。また、ハイパーバイザ110でシステム動作系100とログ制御系200とからのIOデバイス1へのアクセスに優先度をつけ、システム動作系100からのIOデバイスアクセスを優先する方法としてもよい。優先度付きIOデバイスアクセスを行うことで、システム動作系100への影響、すなわちIOデバイスアクセス競合発生時の待ち時間を小さくすることができる。
The difference from the first embodiment is that the
実施の形態3.
図9、図10を参照して実施の形態3のトレース装置1003を説明する。
図9は実施の形態3による、トレース装置1003の構成図である。図9は、実施の形態1で示したマルチコアプロセッサ内にトレース装置を構築する例において、計算機の入出力を監視・制御するプログラムである、モニタプログラム120を利用し、プログラム動作情報を格納する共有メモリ23の領域を保護する構成である。図9のトレース装置1003は、実施の形態1の構成にモニタプログラム120を搭載する構成である。
図10は、システム動作系100のアプリケーションプログラム104が、共有メモリ23へアクセスするフローチャートの例である。モニタプログラム120は、共有メモリ23への不正なアクセスを防止する。共有メモリ23のプログラム動作情報の領域へアクセスするのは、プログラム動作情報を書き出すプログラムが入っているプロセス(プログラム情報書込部107)のみである。図10に示すように、モニタプログラム120は、共有メモリ23へのアクセスを監視し、プログラム動作情報を書き込むプロセスかどうか判定(ST20)する。つまり、モニタプログラム120は、ST20において、共有メモリ23へ書き込みを行うのがプログラム情報書込部107かどうかを判定する。モニタプログラム120は、プログラム動作情報を書き込むプロセス(プログラム情報書込部107)である場合、共有メモリ23へのアクセスを許可(ST21)し、プログラム動作情報を書き込むプロセス(プログラム情報書込部107)でない場合、共有メモリ23へのアクセスを禁止(ST22)する。
A
FIG. 9 is a configuration diagram of the
FIG. 10 is an example of a flowchart in which the
モニタプログラム120(監視プログラム)は、マルチコアプロセッサの有する複数のCPU101−1〜101−3及びCPU201のうち、少なくともいずれかのCPUを用いることにより、共有メモリ23への書き込みを監視して書込みプログラム以外のプログラムからの共有メモリ23への書き込みを禁止する。
The monitor program 120 (monitoring program) is a program other than a writing program that monitors writing to the shared
プログラム動作情報を書き込むプロセスかどうか判定する方法には、例えばプロセスIDを利用してもよい。モニタプログラム120によって、3rdPartyアプリケーションや、悪意のあるプログラムから共有メモリ23への不要なアクセスを防止でき、トレース装置の堅牢性が向上できる。
For example, a process ID may be used as a method for determining whether or not the process writes program operation information. The
実施の形態4.
図11を参照して実施の形態4のトレース装置1004を説明する。実施の形態1ではマルチコアプロセッサ内にトレース装置を構築する例を示したが、共有メモリ23へアクセス可能な別プロセッサにログ制御系を構築することも可能である。
図11は4個のCPU101−1〜101−4を備えたマルチコアプロセッサにシステム動作系100を構築する。また、通信路3を介して共有メモリ23へアクセス可能なCPU201を備えた別プロセッサに、ログ制御系200を構築する例である。ログ制御系200を構築する別プロセッサに専用のIOデバイス4が存在する場合、システム動作系100とログ制御系200とではIOデバイスへのアクセス競合は発生しないため、IOアクセス制御部は不要である。ログ制御系200を別プロセッサに構築する点と、IOデバイスへのアクセス競合が発生しないハードウェア構成においてIOアクセス制御部が不要であること以外は、実施の形態1と同様である。
Embodiment 4 FIG.
A
In FIG. 11, the
以上に説明した実施の形態1〜4のトレース装置1001〜1004は、以下の効果を有する。
(1)トレース装置1001〜1004は、CPUリソースや処理時間を要するIOデバイス1への出力処理を、システムが動作するCPUとは別の専用CPUで処理する。このため、システム側(システム動作系100)はプログラム動作情報の出力処理負荷の影響を受けず動作することが可能である。
(2)また、システム動作系100とログ制御系200とは異なるシステムで動作する。よって、プログラム動作情報の取得対象であるシステム動作系100がシステムダウンした状態においても、異なるシステムで動作するログ制御系200により共有メモリ2からプログラム動作情報を取得し、取得したプログラム動作情報をIOデバイス1へ出力することが可能である。
(3)また、ログ制御系200がシステム動作系100の稼働状態を監視し、システム動作系100の異常を検出した場合は、共有メモリ2に書き込まれたプログラム動作情報を強制的にIOデバイス1へ出力する。従って、プログラム動作情報が未出力のためプログラム動作情報を解析できないという事態を防ぐことが可能である。
(4)またシステム動作系100に異常発生時、ログ制御系200からシステム動作系100のCPUを停止さてキャッシュ情報を取得する。このため、異常状態に陥ったシステム動作系100の直前の原因解析が可能である。
(5)共有メモリ23のプログラム動作情報を格納する格納領域へのアクセスは、システム動作系100は書き込みのみ、ログ制御系200は読み込みのみ行う。このため、トレース装置1001〜1004の堅牢性を高めることができる。
(6)実施の形態1〜4のトレース装置では既存のマルチコア技術を使用し、トレース装置1001〜1004を実現しているため、システムのサイズや、部品点数への影響は無く、コストへの影響もない。そのため、マルチコアプロセッサを搭載した既存システムへの導入や、また近年組込み機器において用いられることが多いSoC(System−on−a−chip)やSiP(System In Package)を使用したシステムにも、ハードウェアを変更することなく、導入が可能である。
The tracing devices 1001 to 1004 according to the first to fourth embodiments described above have the following effects.
(1) The trace devices 1001 to 1004 process output processing to the
(2) The
(3) When the
(4) When an abnormality occurs in the
(5) Access to the storage area for storing program operation information in the shared
(6) Since the trace devices according to the first to fourth embodiments use the existing multi-core technology and realize the trace devices 1001 to 1004, the system size and the number of parts are not affected, and the cost is affected. Nor. Therefore, it can be introduced into an existing system equipped with a multi-core processor, or in a system using SoC (System-on-a-chip) or SiP (System In Package), which is often used in embedded devices in recent years. It can be introduced without changing.
以上の実施の形態の説明において、「〜部」として説明したものは、「〜手段」であってもよく、また、「〜ステップ」、「〜手順」、「〜処理」であってもよい。すなわち、「〜部」として説明したものは、ソフトウェアのみ、或いは、ソフトウェアとハードウェアとの組み合わせ、さらには、ファームウェアとの組み合わせで実施されても構わない。ファームウェアとソフトウェアは、プログラムとして、磁気ディスク等の記録媒体に記憶される。プログラムはCPUにより読み出され、CPUにより実行される。すなわちプログラムは、以上に述べた「〜部」としてコンピュータを機能させるものである。あるいは、以上に述べた「〜部」の手順や方法をコンピュータに実行させるものである。 In the above description of the embodiment, what has been described as “to part” may be “to means”, and may also be “to step”, “to procedure”, and “to process”. . That is, what has been described as “˜unit” may be implemented by software alone, a combination of software and hardware, or a combination of firmware. Firmware and software are stored in a recording medium such as a magnetic disk as a program. The program is read by the CPU and executed by the CPU. That is, the program causes the computer to function as the “to part” described above. Alternatively, the computer executes the procedure and method of “to part” described above.
以上の実施の形態ではトレース装置を説明したが、トレース装置の動作はコンピュータをトレース装置として機能させるためのプログラムとしても把握できることは以上の説明から当然である。また、トレース装置の各「〜部」の動作は、トレース方法としても把握できることは以上の説明により明らかである。 Although the tracing device has been described in the above embodiment, it is obvious from the above description that the operation of the tracing device can be grasped as a program for causing a computer to function as a tracing device. Further, it is apparent from the above description that the operation of each “˜unit” of the trace apparatus can be grasped as a trace method.
以上、実施の形態を説明したが、これらの実施の形態のうち、2つ以上を組み合わせて実施しても構わない。あるいは、これらの実施の形態のうち、1つを部分的に実施しても構わない。あるいは、これらの実施の形態のうち、2つ以上を部分的に組み合わせて実施しても構わない。なお、本発明はこれらの実施の形態に限定されるものではなく、必要に応じて種々の変形が可能である。 As mentioned above, although embodiment was described, you may implement combining 2 or more of these embodiments. Alternatively, one of these embodiments may be partially implemented. Alternatively, two or more of these embodiments may be partially combined. In addition, this invention is not limited to these embodiment, A various deformation | transformation is possible as needed.
1 IOデバイス、2 メモリ、3 通信路、21 システム動作系メモリ領域、22 ログ制御系メモリ領域、23 共有メモリ、101−1,101−2,101−3,201 マルチコアプロセッサのCPU、102 オペレーティングシステム、103,203 CPU間通信部、104 アプリケーションプログラム、105,205 IOアクセス制御部、106,206 異常検出処理部、100 システム動作系、200 ログ制御系、1001,1002,1003,1004 トレース装置。 1 IO device, 2 memory, 3 communication path, 21 system operation system memory area, 22 log control system memory area, 23 shared memory, 101-1, 101-2, 101-3, 201 CPU of multi-core processor, 102 operating system , 103, 203 CPU communication unit, 104 application program, 105, 205 IO access control unit, 106, 206 abnormality detection processing unit, 100 system operation system, 200 log control system, 1001, 1002, 1003, 1004 trace device.
Claims (9)
前記マルチコアプロセッサの有する前記複数のCPUのうち、1以上の一部のCPUを用いてプログラムを実行し、前記プログラムの動作履歴を示すプログラム動作情報を収集するシステム動作部と、
前記マルチコアプロセッサの有する前記複数のCPUのうち、前記システム動作部が使用するCPUとは異なる1以上のCPUを用いて前記システム動作部の稼働状況に影響されることなく前記システム動作部とは独立に稼働すると共に、前記システム動作部の収集した前記プログラム動作情報をIO(Input/Output)デバイスに出力するログ制御部と
を備えたことを特徴とするトレース装置。 In a trace device equipped with a multi-core processor having a plurality of CPUs (Central Processing Units),
A system operation unit that executes a program using one or more of the CPUs of the plurality of CPUs of the multi-core processor and collects program operation information indicating an operation history of the program;
Of the plurality of CPUs of the multi-core processor, one or more CPUs different from the CPU used by the system operation unit are used and are independent of the system operation unit without being affected by the operating status of the system operation unit. And a log control unit that outputs the program operation information collected by the system operation unit to an IO (Input / Output) device.
前記システム動作部は、
前記記憶装置に収集した前記プログラム動作情報を書き込み、
前記ログ制御部は、
前記システム動作部が書き込んだ前記プログラム動作情報を前記記憶装置から読み出し、読み出した前記プログラム動作情報を前記IOデバイスに出力することを特徴とする請求項1記載のトレース装置。 The trace device further includes a storage device,
The system operating unit is
Write the collected program operation information to the storage device,
The log control unit
2. The trace apparatus according to claim 1, wherein the program operation information written by the system operation unit is read from the storage device, and the read program operation information is output to the IO device.
前記システム動作部と前記ログ制御部とがいずれも使用する共有メモリであることを特徴とする請求項2記載のトレース装置。 The storage device
The trace apparatus according to claim 2, wherein the system operation unit and the log control unit are shared memories.
前記システム動作部のみが書き込みできることを特徴とする請求項3記載のトレース装置。 The area for writing the program operation information in the shared memory is
4. The trace apparatus according to claim 3, wherein only the system operation unit can write.
前記システム動作部の稼働状態を監視し、監視の結果、前記システム動作部に異常が発生したと判断した場合には、前記記憶装置に存在する前記プログラム動作情報を、前記IOデバイスに強制出力することを特徴とする請求項2〜4のいずれかに記載のトレース装置。 The log control unit
The operating state of the system operation unit is monitored, and if it is determined that an abnormality has occurred in the system operation unit as a result of monitoring, the program operation information existing in the storage device is forcibly output to the IO device. The trace device according to any one of claims 2 to 4, wherein
前記システム動作部の稼働状態を監視し、監視の結果、前記システム動作部に異常が発生したと判断した場合には、異常の発生を前記ログ制御部に通知し、
前記ログ制御部は、
前記システム動作部から異常の発生が通知された場合には、前記記憶装置に存在する前記プログラム動作情報を、前記IOデバイスに強制出力することを特徴とする請求項2〜5のいずれかに記載のトレース装置。 The system operating unit is
When monitoring the operating state of the system operation unit and, as a result of monitoring, determining that an abnormality has occurred in the system operation unit, notify the log control unit of the occurrence of the abnormality,
The log control unit
6. When the occurrence of an abnormality is notified from the system operation unit, the program operation information existing in the storage device is forcibly output to the IO device. Trace device.
前記記憶装置に存在する前記プログラム動作情報を、前記IOデバイスに強制出力する場合には、前記システム動作部の使用するCPUにキャッシュされているキャッシュ情報を取得し、取得した前記キャッシュ情報を前記記憶装置に格納することを特徴とする請求項5または6のいずれかに記載のトレース装置。 The log control unit
When the program operation information existing in the storage device is forcibly output to the IO device, the cache information cached in the CPU used by the system operation unit is acquired, and the acquired cache information is stored in the storage device. The trace device according to claim 5, wherein the trace device is stored in the device.
前記プログラム動作情報を前記共有メモリに書き込むプログラム情報書込み部を備え、
前記トレース装置は、さらに、
前記マルチコアプロセッサの有する前記複数のCPUの少なくともいずれかのCPUを用いることにより、共有メモリへの書き込みを監視して前記プログラム情報書込み部によらない前記共有メモリへの書き込みを禁止する書込監視部を備えたことを特徴とする請求項3または4のいずれかに記載のトレース装置。 The system operating unit is
A program information writing unit for writing the program operation information to the shared memory;
The trace device further comprises:
Write monitoring unit that monitors writing to shared memory and prohibits writing to shared memory without using program information writing unit by using at least one of the plurality of CPUs of the multi-core processor The trace apparatus according to claim 3, further comprising:
前記マルチコアプロセッサの有する前記複数のCPUのうち、1以上の一部のCPUを用いてプログラムを実行し、前記プログラムの処理状況の履歴を示すプログラム動作情報を収集する収集処理と、
前記マルチコアプロセッサの有する前記複数のCPUのうち、前記収集処理に使用されるCPUとは異なる1以上のCPUを用いて前記収集処理の稼働状況に影響されることなく前記収集処理とは独立に稼働すると共に、前記収集処理によって収集された前記プログラム動作情報をIO(Input/Output)デバイスに出力する出力処理と
を実行させるためのトレースプログラム。 In the trace device which is a computer equipped with a multi-core processor having a plurality of CPUs (Central Processing Units),
A collection process of executing a program using one or more CPUs of the plurality of CPUs of the multi-core processor and collecting program operation information indicating a history of a processing status of the program;
Of the plurality of CPUs of the multi-core processor, one or more CPUs different from the CPU used for the collection process are used, and the operation is independent of the collection process without being affected by the operation status of the collection process. And a trace program for executing an output process for outputting the program operation information collected by the collection process to an IO (Input / Output) device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013260733A JP2015118493A (en) | 2013-12-18 | 2013-12-18 | Trace device and trace program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013260733A JP2015118493A (en) | 2013-12-18 | 2013-12-18 | Trace device and trace program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2015118493A true JP2015118493A (en) | 2015-06-25 |
Family
ID=53531173
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013260733A Pending JP2015118493A (en) | 2013-12-18 | 2013-12-18 | Trace device and trace program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2015118493A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017058751A (en) * | 2015-09-14 | 2017-03-23 | Necプラットフォームズ株式会社 | Information processor, log acquisition method and log acquisition program |
KR20180028570A (en) * | 2016-09-08 | 2018-03-19 | 현대오트론 주식회사 | Multi core system and method of driving the same |
JP2019077078A (en) * | 2017-10-23 | 2019-05-23 | セイコーエプソン株式会社 | Printer and control method for printer |
-
2013
- 2013-12-18 JP JP2013260733A patent/JP2015118493A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017058751A (en) * | 2015-09-14 | 2017-03-23 | Necプラットフォームズ株式会社 | Information processor, log acquisition method and log acquisition program |
KR20180028570A (en) * | 2016-09-08 | 2018-03-19 | 현대오트론 주식회사 | Multi core system and method of driving the same |
JP2019077078A (en) * | 2017-10-23 | 2019-05-23 | セイコーエプソン株式会社 | Printer and control method for printer |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5423871B2 (en) | Information processing apparatus, information processing method, and program | |
JP4222370B2 (en) | Program for causing a computer to execute a debugging support apparatus and a debugging processing method | |
JP5430756B2 (en) | Providing state memory in the processor for system management mode | |
US8850262B2 (en) | Inter-processor failure detection and recovery | |
JP6399916B2 (en) | Information processing apparatus and control method thereof | |
US9229820B2 (en) | Information processing device with memory dump function, memory dump method, and recording medium | |
US9146818B2 (en) | Memory degeneracy method and information processing device | |
JP2010086364A (en) | Information processing device, operation state monitoring device and method | |
JP2015118493A (en) | Trace device and trace program | |
JP4322240B2 (en) | Reboot method, system and program | |
JP2007334403A (en) | System and method for supporting trouble of computer system | |
US20160283250A1 (en) | Boot controlling processing apparatus | |
CN115576734B (en) | Multi-core heterogeneous log storage method and system | |
JP5427814B2 (en) | Failure analysis information collection device | |
JP6645348B2 (en) | Information processing apparatus, information processing program, and information processing method | |
JP6632416B2 (en) | Shared memory control circuit and shared memory control method | |
JP4867896B2 (en) | Information processing system | |
JP5163128B2 (en) | Procedure calling method, procedure calling program, recording medium, and multiprocessor in shared memory multiprocessor | |
JP5877533B2 (en) | Computer apparatus and computer apparatus control method | |
JP4633553B2 (en) | Debug system, debugging method and program | |
US7877533B2 (en) | Bus system, bus slave and bus control method | |
JP2008287512A (en) | Computer, distributed data processing system, data processing method and program | |
JP2009223841A (en) | Instruction log acquisition program and virtual machine system | |
JP2017151511A (en) | Information processing device, operation log acquisition method and operation log acquisition program | |
JP2022107229A (en) | Information processing apparatus, control method, and control program |