JP2013196241A - Information processor and log acquisition method - Google Patents

Information processor and log acquisition method Download PDF

Info

Publication number
JP2013196241A
JP2013196241A JP2012061424A JP2012061424A JP2013196241A JP 2013196241 A JP2013196241 A JP 2013196241A JP 2012061424 A JP2012061424 A JP 2012061424A JP 2012061424 A JP2012061424 A JP 2012061424A JP 2013196241 A JP2013196241 A JP 2013196241A
Authority
JP
Japan
Prior art keywords
virtual
memory
log
information
access 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
Application number
JP2012061424A
Other languages
Japanese (ja)
Inventor
Eiji Furukawa
英治 古川
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2012061424A priority Critical patent/JP2013196241A/en
Publication of JP2013196241A publication Critical patent/JP2013196241A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To easily determine the factor of memory breakdown.SOLUTION: A CPU interface 352 receives control information from a virtual CPU, and stores it in a monitor address leading register 353, a monitor size register 354, and a log output control flag register 355. A log output control circuit 356 receives memory access information from a virtual CPU, a virtual DMA (Direct Access Memory) controller and a virtual device, and when determining to output a log 401 in accordance with a control flag stored in the log output control flag register 355, acquires a monitor leading address and a monitor size from the monitor address leading register and the monitor size register, and when a write address included in the memory access information is included in a range (monitor area) of a value calculated by adding a monitor size to a monitor address from the monitor leading address, outputs the memory access information as the log 401.

Description

本発明は、情報処理装置およびログ取得方法に関する。   The present invention relates to an information processing apparatus and a log acquisition method.

プログラム開発において、調査・解析が長期化する障害の一つに不正なメモリ操作等によるデータの改変、いわゆるメモリ破壊がある。
監視するべきメモリアドレスが特定できるケースでは、そのアドレスに着目して動作ログを収集・蓄積して解析できるが、バッファのように動的にリソースを獲得して使用するようなメモリの場合は、メモリアドレスが特定できず、動的に使用するメモリリソースを使用する全てのプログラムを対象に調査する必要がある。また、ログ領域の制約があるため、調査対象をプログラム1つに絞って動作確認を繰り返し、原因元をつぶし込む調査方法を採っている。
In program development, one of the obstacles that makes investigation and analysis longer is data modification due to illegal memory operations, so-called memory destruction.
In the case where the memory address to be monitored can be identified, it is possible to analyze by collecting and accumulating the action log focusing on that address, but in the case of memory that dynamically acquires and uses resources like a buffer, It is necessary to investigate all programs that cannot use memory addresses and use dynamically used memory resources. In addition, since there is a restriction on the log area, an investigation method is adopted in which the investigation target is narrowed down to one program and the operation check is repeated to collapse the cause.

マルチプロセスや、マルチスレッド等、複数のプロセスを制御するようなプログラムでは、個々のプロセスでメモリ操作を行うため、一つのスレッドの中身を追いかけていても、問題(障害)を特定出来ないケースがあった。   In a program that controls multiple processes, such as multi-processes and multi-threads, memory operations are performed by individual processes, so it may not be possible to identify the problem (failure) even if you follow the contents of a single thread. there were.

また、Central Processing Unit(CPU)以外にもメモリ操作が出来るデバイス、例えばDirect Memory Access(DMA)コントローラ等が存在するため、調査する範囲が広域化し、原因を特定する有効な手段が存在しない。   In addition to the Central Processing Unit (CPU), there are devices that can perform memory operations, such as a Direct Memory Access (DMA) controller, so that the range to be investigated is widened and there is no effective means for identifying the cause.

特開2007−199845号公報JP 2007-199845 A 特開2007−272303号公報JP 2007-272303 A

1つの側面では、本発明は、メモリ破壊の原因を容易に判断可能とすることを目的とする。   In one aspect, an object of the present invention is to make it possible to easily determine the cause of memory corruption.

実施の形態の情報処理装置は、処理装置と、仮想マシンに割り当てられた仮想メモリを含むメモリと、を備える。
前記処理装置は、仮想処理部と、仮想デバイス部と、ログ出力制御部と、を備える。
An information processing apparatus according to an embodiment includes a processing device and a memory including a virtual memory allocated to a virtual machine.
The processing apparatus includes a virtual processing unit, a virtual device unit, and a log output control unit.

仮想処理部は、プログラムを実行し、前記仮想メモリに対して書き込みを行い、前記仮想メモリに対する書き込みに関する第1のメモリアクセス情報を出力する。
仮想デバイス部は、前記処理部から書き込み命令を受信し、前記仮想メモリに対して書き込みを行い、前記仮想メモリに対する書き込みに関する第2のメモリアクセス情報を出力する。
The virtual processing unit executes a program, writes to the virtual memory, and outputs first memory access information related to writing to the virtual memory.
The virtual device unit receives a write command from the processing unit, writes to the virtual memory, and outputs second memory access information related to writing to the virtual memory.

ログ出力制御部は、前記第1および前記第2のメモリアクセス情報を受信し、前記第1および前記第2のメモリアクセス情報をログとして出力する。   The log output control unit receives the first and second memory access information, and outputs the first and second memory access information as a log.

実施の形態の情報処理装置によれば、メモリ破壊の原因を容易に判断することが出来る。   According to the information processing apparatus of the embodiment, the cause of memory destruction can be easily determined.

実施の形態に係る情報処理装置の構成図である。It is a block diagram of the information processing apparatus which concerns on embodiment. 実施の形態に係るログ出力制御部の構成図である。It is a block diagram of the log output control part which concerns on embodiment. ログの例を示す図である。It is a figure which shows the example of a log. 出力制御指示のライブラリを示す図である。It is a figure which shows the library of an output control instruction | indication. 仮想CPUの処理のフローチャートである。It is a flowchart of processing of a virtual CPU. 仮想DMAコントローラの処理のフローチャートである。It is a flowchart of a process of a virtual DMA controller. 仮想デバイスの処理のフローチャートである。It is a flowchart of a process of a virtual device. 実施の形態に係るログ出力制御部の処理のフローチャートである。It is a flowchart of the process of the log output control part which concerns on embodiment. 情報処理装置(コンピュータ)の構成図である。It is a block diagram of information processing apparatus (computer).

以下、図面を参照しながら実施の形態について説明する。
図1は、実施の形態に係る情報処理装置の構成図である。
情報処理装置101は、ホストOperating System(OS)201、仮想マシン301を備える。
Hereinafter, embodiments will be described with reference to the drawings.
FIG. 1 is a configuration diagram of an information processing apparatus according to an embodiment.
The information processing apparatus 101 includes a host operating system (OS) 201 and a virtual machine 301.

情報処理装置101は、例えば、パーソナルコンピュータ等のコンピュータである。
ホストOS201は、情報処理装置101にインストールされたOSである。
The information processing apparatus 101 is a computer such as a personal computer, for example.
The host OS 201 is an OS installed in the information processing apparatus 101.

仮想マシン301は、ホストOS201上で動作する仮想的なコンピュータであり、コンピュータをエミュレートするソフトウェアにより実現される。仮想マシン301は、情報処理装置101が備えるCentral Processing Unit(CPU)がコンピュータをエミュレートするソフトウェアを読み出して、実行することにより実現される。   The virtual machine 301 is a virtual computer that runs on the host OS 201, and is realized by software that emulates the computer. The virtual machine 301 is realized by reading and executing software that emulates a computer by a central processing unit (CPU) included in the information processing apparatus 101.

仮想マシン301は、仮想CPU311、仮想DMAコントローラ321、仮想デバイス331、仮想アービター341、ログ出力制御部351、仮想メモリ361、および仮想バス371を備える。   The virtual machine 301 includes a virtual CPU 311, a virtual DMA controller 321, a virtual device 331, a virtual arbiter 341, a log output control unit 351, a virtual memory 361, and a virtual bus 371.

仮想CPU311、仮想DMAコントローラ321、仮想デバイス331、仮想アービター341、ログ出力制御部351、および仮想メモリ361は、仮想バス371を介して接続されている。   The virtual CPU 311, virtual DMA controller 321, virtual device 331, virtual arbiter 341, log output control unit 351, and virtual memory 361 are connected via a virtual bus 371.

仮想CPU311は、プログラムを仮想メモリ361から読み出して実行し、仮想メモリへのアクセス(書き込みおよび読み出し)を行う。   The virtual CPU 311 reads out and executes the program from the virtual memory 361, and accesses (writes and reads) the virtual memory.

仮想CPU311は、仮想DMAコントローラ321および仮想デバイス331に仮想メモリ361へのアクセス命令を出力する。   The virtual CPU 311 outputs an access command to the virtual memory 361 to the virtual DMA controller 321 and the virtual device 331.

仮想CPU311は、ログ出力制御部351に制御情報を出力する。制御情報には、監視先頭アドレス、監視サイズ、制御フラグが含まれる。   The virtual CPU 311 outputs control information to the log output control unit 351. The control information includes a monitoring head address, a monitoring size, and a control flag.

仮想CPU311は、仮想メモリ361に対して書き込みを行う際の情報(メモリアクセス情報)を出力する。仮想CPU311が出力するメモリアクセス情報には、書込みが発生したときのプログラムカウンタ(PC)値、命令コード、ライトアドレス、およびライトデータが含まれる。   The virtual CPU 311 outputs information (memory access information) when writing to the virtual memory 361. The memory access information output from the virtual CPU 311 includes a program counter (PC) value, an instruction code, a write address, and write data when writing occurs.

PC値は、仮想CPU311が次に実行する命令が格納されたメモリのアドレスである。
命令コードは、仮想CPU311が実行した命令コードである。
The PC value is an address of a memory in which an instruction to be executed next by the virtual CPU 311 is stored.
The instruction code is an instruction code executed by the virtual CPU 311.

ライトアドレスは、書き込み先の仮想メモリ361のアドレスである。
ライトデータは、書き込んだデータの値である。
The write address is the address of the virtual memory 361 that is the write destination.
Write data is the value of the written data.

仮想DMAコントローラ321は、仮想CPU311から仮想メモリ361へのアクセス命令を受信し、仮想CPU311を介さずに仮想メモリ361へのアクセス(書き込みおよび読み出し)を行う。仮想DMAコントローラ321は、仮想メモリ361に対して書き込みを行う際の情報(メモリアクセス情報)を出力する。仮想DMAコントローラ321が出力するメモリアクセス情報には、ライトアドレス、ライトデータ、データサイズ、アクセス元情報、およびソースの行番号が含まれる。   The virtual DMA controller 321 receives an access command to the virtual memory 361 from the virtual CPU 311 and accesses (writes and reads) the virtual memory 361 without going through the virtual CPU 311. The virtual DMA controller 321 outputs information (memory access information) when writing to the virtual memory 361. The memory access information output by the virtual DMA controller 321 includes a write address, write data, data size, access source information, and source row number.

ライトアドレスは、書き込み先の仮想メモリ361のアドレスである。
ライトデータは、書き込んだデータの値である。
データサイズは、ライトデータのサイズである。
The write address is the address of the virtual memory 361 that is the write destination.
Write data is the value of the written data.
The data size is the size of the write data.

アクセス元情報は、例えば、デバイス名などの仮想DMAコントローラ321を示す情報である。
ソースの行番号は、仮想メモリ361への書き込み時において実行された仮想DMAコントローラ321をエミュレートしているプログラムの行番号である。
The access source information is information indicating the virtual DMA controller 321 such as a device name, for example.
The source line number is the line number of the program emulating the virtual DMA controller 321 executed at the time of writing to the virtual memory 361.

仮想デバイス331は、仮想マシン301が備える周辺デバイス(例えば、Serial Advanced Technology Attachment(SATA)コントローラ)である。仮想デバイス331は、仮想CPU311から仮想メモリ361へのアクセス命令を受信し、仮想CPU311を介さずに仮想メモリ361へのアクセス(書き込みおよび読み出し)を行う。   The virtual device 331 is a peripheral device (for example, a serial advanced technology attachment (SATA) controller) included in the virtual machine 301. The virtual device 331 receives an access command to the virtual memory 361 from the virtual CPU 311 and accesses (writes and reads) the virtual memory 361 without going through the virtual CPU 311.

仮想デバイス331は、仮想メモリ361に対して書き込みを行う際の情報(メモリアクセス情報)を出力する。   The virtual device 331 outputs information when writing to the virtual memory 361 (memory access information).

仮想デバイス331が出力するメモリアクセス情報には、ライトアドレス、ライトデータ、データサイズ、アクセス元情報(例えば、デバイス名などの仮想デバイス331を示す情報)、およびソースの行番号が含まれる。   The memory access information output by the virtual device 331 includes a write address, write data, data size, access source information (for example, information indicating the virtual device 331 such as a device name), and a source line number.

ライトアドレスは、書き込み先の仮想メモリ361のアドレスである。
ライトデータは、書き込んだデータの値である。
データサイズは、ライトデータのサイズである。
The write address is the address of the virtual memory 361 that is the write destination.
Write data is the value of the written data.
The data size is the size of the write data.

アクセス元情報は、例えば、デバイス名などの仮想デバイス331を示す情報である。
ソースの行番号は、仮想メモリ361への書き込み時において実行された仮想デバイス331をエミュレートしているプログラムの行番号である。
The access source information is information indicating the virtual device 331 such as a device name, for example.
The source line number is the line number of the program emulating the virtual device 331 executed at the time of writing to the virtual memory 361.

仮想アービター341は、仮想CPU311、仮想DMAコントローラ321、および仮想デバイス311に対する仮想メモリ361への書き込みの許可制御を行う。   The virtual arbiter 341 performs permission control of writing to the virtual memory 361 for the virtual CPU 311, the virtual DMA controller 321, and the virtual device 311.

ログ出力制御部351は、受信したメモリアクセス情報をログ401として出力する。出力されたログ401は、例えば、情報処理装置が備える記憶装置、例えば、磁気ディスク装置や半導体記憶装置に格納される。また、ログ401の内容は、以前に出力されたログに追加されていく。   The log output control unit 351 outputs the received memory access information as a log 401. The output log 401 is stored in, for example, a storage device included in the information processing apparatus, for example, a magnetic disk device or a semiconductor storage device. In addition, the contents of the log 401 are added to the previously output log.

情報処理装置101が備える記憶装置に格納されたログは、情報処理装置101が出力指示を受けたことを契機として、情報処理装置101が備えるディスプレイ装置等に表示される。   The log stored in the storage device included in the information processing apparatus 101 is displayed on a display device or the like included in the information processing apparatus 101 when the information processing apparatus 101 receives an output instruction.

仮想メモリ361は、仮想マシン301に割り当てられた仮想メモリである。仮想メモリ361は、情報処理装置101が備える(物理)メモリの一部である。   The virtual memory 361 is a virtual memory assigned to the virtual machine 301. The virtual memory 361 is a part of the (physical) memory included in the information processing apparatus 101.

図2は、実施の形態に係るログ出力制御部の構成図である。
ログ出力制御部351は、CPUインターフェース352、監視アドレス先頭レジスタ353、監視サイズレジスタ354、ログ出力制御フラグレジスタ355、およびログ出力制御回路356を備える。
FIG. 2 is a configuration diagram of a log output control unit according to the embodiment.
The log output control unit 351 includes a CPU interface 352, a monitoring address head register 353, a monitoring size register 354, a log output control flag register 355, and a log output control circuit 356.

CPUインターフェース352は、仮想CPU311から制御情報を受信する。制御情報には、監視先頭アドレス、監視サイズ、制御フラグが含まれる。   The CPU interface 352 receives control information from the virtual CPU 311. The control information includes a monitoring head address, a monitoring size, and a control flag.

監視アドレス先頭レジスタ353は、ログ出力制御回路356が監視する仮想メモリ361の領域の先頭のアドレス値(監視先頭アドレス)を格納する。   The monitoring address head register 353 stores the head address value (monitoring head address) of the area of the virtual memory 361 monitored by the log output control circuit 356.

監視サイズレジスタ354は、ログ出力制御回路356が監視する仮想メモリ361の領域のサイズ情報(監視サイズ)を格納する。   The monitor size register 354 stores size information (monitor size) of the area of the virtual memory 361 monitored by the log output control circuit 356.

ログ出力制御フラグレジスタ355は、ログ出力制御回路356の動作を制御する制御フラグを格納する。   The log output control flag register 355 stores a control flag for controlling the operation of the log output control circuit 356.

ログ出力制御回路356は、仮想CPU311、仮想DMAコントローラ321、および仮想デバイス331からメモリアクセス情報を受信する。   The log output control circuit 356 receives memory access information from the virtual CPU 311, the virtual DMA controller 321, and the virtual device 331.

ログ出力制御回路356は、ログ出力制御フラグレジスタ355を参照し、ログ出力制御フラグレジスタ355に格納された制御フラグに応じて、ログ401を出力するか否か判定する。例えば、ログ出力制御フラグレジスタ355に制御フラグとして“1”が格納されている場合、ログ出力制御回路356はログを出力すると判定し、“0”が格納されている場合、ログ出力制御回路356はログを出力しないと判定する。   The log output control circuit 356 refers to the log output control flag register 355 and determines whether to output the log 401 according to the control flag stored in the log output control flag register 355. For example, when “1” is stored as a control flag in the log output control flag register 355, the log output control circuit 356 determines to output a log, and when “0” is stored, the log output control circuit 356. Determines that no log is output.

ログ出力制御回路356は、ログを出力すると判定した場合、監視アドレス先頭レジスタ353および監視サイズレジスタ354を参照し、監視先頭アドレスおよび監視サイズを取得する。ログ出力制御回路356は、メモリアクセス情報に含まれるライトアドレスが監視先頭アドレスから監視アドレスに監視サイズを加算した値の範囲(監視領域)に含まれるか否か判定する。そして、ライトアドレスが監視領域に含まれている場合、メモリアクセス情報をログ401として出力する。尚、監視先頭アドレスおよび監視サイズがNULLの場合、すなわち監視領域が指定されていない場合、ログ出力制御回路356は、メモリアクセス情報をログ401として出力する。   When the log output control circuit 356 determines to output the log, the log output control circuit 356 refers to the monitoring address head register 353 and the monitoring size register 354 and acquires the monitoring head address and the monitoring size. The log output control circuit 356 determines whether or not the write address included in the memory access information is included in the range (monitoring area) of the value obtained by adding the monitoring size to the monitoring address from the monitoring head address. When the write address is included in the monitoring area, the memory access information is output as the log 401. When the monitoring head address and the monitoring size are NULL, that is, when the monitoring area is not designated, the log output control circuit 356 outputs the memory access information as the log 401.

図3は、ログの例を示す図である。
図3に示すログ401の1および2行目には仮想CPU311から受信したアクセス情報が記述され、3および4行目には仮想DMAコントローラ321から受信したアクセス情報が記述され、5〜7行目には仮想デバイス331から受信したアクセス情報が記述されている。
FIG. 3 is a diagram illustrating an example of a log.
The access information received from the virtual CPU 311 is described in the first and second lines of the log 401 shown in FIG. 3, the access information received from the virtual DMA controller 321 is described in the third and fourth lines, and the fifth to seventh lines. Describes the access information received from the virtual device 331.

ログ401の1および2行目には、プログラムカウンタ(PC)値、命令コード、ライトアドレス、およびライトデータが記述されている。PC、op_code、addr、およびvalは、それぞれ、PC値、命令コード、ライトアドレス、およびライトデータを示す。   In the first and second lines of the log 401, a program counter (PC) value, an instruction code, a write address, and write data are described. PC, op_code, addr, and val indicate a PC value, an instruction code, a write address, and write data, respectively.

ログ401の3〜7行目には、ライトアドレス、ライトデータ、データサイズ、アクセス元情報、およびソースの行番号が記述されている。addr、val、およびlenは、それぞれ、ライトアドレス、ライトデータ、およびデータサイズを示す。   In lines 3 to 7 of the log 401, the write address, write data, data size, access source information, and source line number are described. addr, val, and len indicate a write address, write data, and a data size, respectively.

尚、アクセス元情報として記述されているdev.cは、仮想デバイス331を示し、dma.cは仮想DMAコントローラ321を示している。   Note that dev.c described as access source information indicates a virtual device 331, and dma.c indicates a virtual DMA controller 321.

次に、仮想マシン301で実行する検証対象となるプログラム(被検証対象プログラム)について説明する。   Next, a verification target program (program to be verified) executed by the virtual machine 301 will be described.

被検証対象プログラムには、ログ出力制御部351へ制御情報を出力する出力制御指示が含まれている。   The program to be verified includes an output control instruction for outputting control information to the log output control unit 351.

図4は、出力制御指示のライブラリを示す図である。
出力制御指示(log_ctl)には、引数として、監視先頭アドレス(start_addr)、監視サイズ(size)、制御フラグ(trace_flag)が与えられる。
FIG. 4 is a diagram showing a library of output control instructions.
In the output control instruction (log_ctl), a monitoring head address (start_addr), a monitoring size (size), and a control flag (trace_flag) are given as arguments.

監視先頭アドレスは、ログ出力制御回路356が監視する仮想メモリ361の領域の先頭のアドレス値である。   The monitoring head address is the head address value of the area of the virtual memory 361 monitored by the log output control circuit 356.

監視サイズは、ログ出力制御回路356が監視する仮想メモリ361の領域のサイズである。
制御フラグは、ログ出力制御回路356の動作を制御するフラグである。
The monitoring size is the size of the area of the virtual memory 361 monitored by the log output control circuit 356.
The control flag is a flag that controls the operation of the log output control circuit 356.

log_ctlは、以下の3つのステップを実行する。
(1)ログ出力制御部351の監視アドレス先頭レジスタ353に監視先頭アドレス(start_addr)を書き込む。
(2)ログ出力制御部351の監視サイズレジスタ354に監視サイズ(size)を書き込む。
(3)ログ出力制御部351のログ出力制御フラグレジスタ355に制御フラグ(trace_flag)を書き込む。
log_ctl performs the following three steps:
(1) Write the monitoring head address (start_addr) to the monitoring address head register 353 of the log output control unit 351.
(2) The monitoring size (size) is written in the monitoring size register 354 of the log output control unit 351.
(3) Write a control flag (trace_flag) to the log output control flag register 355 of the log output control unit 351.

出力制御指示(log_ctl)を用いた実施の形態に係るログ取得の方法について説明する。ユーザは、log_ctlを呼び出す関数を被検証プログラムに追加する。   A log acquisition method according to the embodiment using the output control instruction (log_ctl) will be described. The user adds a function that calls log_ctl to the program to be verified.

ログ出力制御回路356にログの出力を開始させたい場合、すなわちログ出力開始指示を行いたい場合、log_ctlの引数の制御フラグに“1”を与える。   When the log output control circuit 356 wants to start outputting the log, that is, when the log output start instruction is to be given, “1” is given to the control flag of the argument of log_ctl.

ログ出力制御回路356にログの出力を終了させたい場合、すなわち、ログ出力終了指示を行いたい場合、log_ctlの引数の制御フラグに“0”を与える。
ユーザは、被検証対象プログラムの調査対象箇所(例えば、メモリ破壊の被疑箇所)の開始ステップの前に、「ログ出力開始指示」を予め記述しておく。
When it is desired to end the log output to the log output control circuit 356, that is, when a log output end instruction is to be issued, “0” is given to the control flag of the argument of log_ctl.
The user describes a “log output start instruction” in advance before the start step of the investigation target portion (for example, the suspected portion of memory corruption) of the program to be verified.

また、ユーザは、被検証対象プログラムの調査対象箇所(例えば、メモリ破壊の被疑箇所)の終了ステップの前に、「ログ出力終了指示」を予め記述しておく。   In addition, the user describes in advance a “log output end instruction” before the end step of the investigation target portion (for example, the suspected portion of memory destruction) of the program to be verified.

「ログ出力開始指示」および「ログ出力終了指示」では、監視先頭アドレス(start_addr)として、動的に獲得して使用するメモリリソースを特定する変数を与え、監視サイズ(size)として、監視したい領域のサイズを与える。   In "Log output start instruction" and "Log output end instruction", the monitoring start address (start_addr) is given a variable that specifies the memory resource to be dynamically acquired and used, and the monitoring size (size) is the area to be monitored Give the size.

例えば、「ログ出力開始指示」を実行させたい場合、被検証対象プログラムの調査対象箇所の開始ステップの前に、下記命令を記述する。
log_ctl(&variable, size, 1)
For example, when it is desired to execute “log output start instruction”, the following command is described before the start step of the investigation target portion of the program to be verified.
log_ctl (& variable, size, 1)

“&variable”は監視先頭アドレス、 “size”は監視サイズ、 “1”は制御フラグを示す。“&variable”は、被検証プログラムで確保された仮想メモリ361の領域の先頭のアドレスを示す。   “& Variable” indicates the monitoring start address, “size” indicates the monitoring size, and “1” indicates the control flag. “& Variable” indicates the head address of the area of the virtual memory 361 secured by the program to be verified.

また、監視する領域が特定できていない場合、ユーザは被検証プログラムに「ログ出力開始指示」として
log_ctl(NULL, NULL, 1)
を記述し、
「ログ出力終了指示」として
log_ctl(NULL, NULL, 0)
を記述する。
In addition, when the area to be monitored cannot be specified, the user gives a “log output start instruction” to the program to be verified.
log_ctl (NULL, NULL, 1)
And write
As "log output end instruction"
log_ctl (NULL, NULL, 0)
Is described.

このように、監視先頭アドレス(start_addr)および監視サイズ(size)にNULLを指定することで、ログ出力制御回路356は、受信した全てのメモリアクセス情報をログ401として出力する。   Thus, by specifying NULL for the monitoring head address (start_addr) and the monitoring size (size), the log output control circuit 356 outputs all the received memory access information as the log 401.

また、被検証プログラムにおいて、「malloc」や「free」等の関数を用いて動的にメモリ領域の確保および解放された領域に対するログをログ出力制御回路356に出力させたい場合、下記のような命令を被検証プログラムに追加する。
ptr = malloc(SIZE);
log_ctl( ptr, SIZE, 1)


log_ctl( ptr, SIZE, 0)
free(ptr)
Further, in the program to be verified, when it is desired that the log output control circuit 356 output a log for a memory area that has been dynamically secured and released using a function such as “malloc” or “free”, as follows: Add instructions to the program to be verified.
ptr = malloc (SIZE);
log_ctl (ptr, SIZE, 1)
...
...
log_ctl (ptr, SIZE, 0)
free (ptr)

上記命令について説明すると、先ずmalloc(SIZE)により、サイズが“SIZE”である領域が確保され、該領域の先頭のアドレスを示すポインタがptrに格納される。   The above instruction will be described. First, an area having a size of “SIZE” is secured by malloc (SIZE), and a pointer indicating the head address of the area is stored in ptr.

log_ctl( ptr, SIZE, 1)により、「ログ出力開始指示」が行われ、ログ出力制御回路356は、ptrからSIZE分の領域に対するメモリアクセス情報をログとして出力する。   “Log output start instruction” is performed by log_ctl (ptr, SIZE, 1), and the log output control circuit 356 outputs memory access information for an area of SIZE from ptr as a log.

log_ctl( ptr, SIZE, 0)により、「ログ出力終了指示」が行われ、ログ出力制御回路356は、ptrからSIZE分の領域に対するメモリアクセス情報の出力を停止する。   “Log output end instruction” is performed by log_ctl (ptr, SIZE, 0), and the log output control circuit 356 stops outputting the memory access information for the area of SIZE from ptr.

free(ptr)により、ptrで示される領域が解放される。
上記のような、出力制御指示(log_ctl)を被検証プログラムに記述することで、動的に確保された領域に対する監視を行うことが出来る。
The area indicated by ptr is released by free (ptr).
By describing the output control instruction (log_ctl) in the program to be verified as described above, it is possible to monitor the dynamically secured area.

図5Aは、仮想CPUの処理のフローチャートである。
仮想CPU311は、被検証対象プログラムに記述された命令をリードし、該命令を実行する(ステップS601)。命令としては、例えば、上述の出力制御指示、仮想メモリ361に対するデータの書き込み、仮想DMAコントローラ321または仮想デバイス331へ仮想メモリ361へのアクセス命令がある。尚、仮想CPU311は、仮想メモリ361に対して書き込みを行う場合、メモリアクセス情報を出力する。
FIG. 5A is a flowchart of processing of the virtual CPU.
The virtual CPU 311 reads an instruction described in the program to be verified and executes the instruction (step S601). Examples of the instruction include the above-described output control instruction, data writing to the virtual memory 361, and an instruction to access the virtual memory 361 to the virtual DMA controller 321 or the virtual device 331. The virtual CPU 311 outputs memory access information when writing to the virtual memory 361.

仮想CPU311は、割り込み処理等を行い(ステップS602)、ディスパッチ処理(ステップS603)を行う。   The virtual CPU 311 performs interrupt processing and the like (step S602), and performs dispatch processing (step S603).

図5Bは、仮想DMAコントローラの処理のフローチャートである。
仮想DMAコントローラ321は、仮想CPU311から仮想メモリ361へのアクセス命令を受信し、転送元の仮想メモリ361からデータをリードし、転送先の仮想メモリ361へデータを書き込む。尚、仮想DMAコントローラ321は、仮想メモリ361に対して書き込みを行う場合、メモリアクセス情報を出力する。仮想DMAコントローラ321は、割り込み処理等を行う(ステップS611)。
FIG. 5B is a flowchart of processing of the virtual DMA controller.
The virtual DMA controller 321 receives an access command to the virtual memory 361 from the virtual CPU 311, reads data from the transfer source virtual memory 361, and writes the data to the transfer destination virtual memory 361. The virtual DMA controller 321 outputs memory access information when writing to the virtual memory 361. The virtual DMA controller 321 performs an interrupt process or the like (step S611).

図5Cは、仮想デバイスの処理のフローチャートである。
仮想デバイス331は、仮想CPU311から仮想メモリ361へのアクセス命令を受信し、転送先の仮想メモリ361へデータを書き込み、割り込み処理等を行う(ステップS621)。尚、仮想デバイス331は、仮想メモリ361に対して書き込みを行う場合、メモリアクセス情報を出力する。
FIG. 5C is a flowchart of virtual device processing.
The virtual device 331 receives an access command to the virtual memory 361 from the virtual CPU 311, writes data to the destination virtual memory 361, and performs an interrupt process or the like (step S 621). The virtual device 331 outputs memory access information when writing to the virtual memory 361.

図6は、実施の形態に係るログ出力制御部の処理のフローチャートである。
ステップS501において、ログ出力制御回路356は、仮想CPU311、仮想DMAコントローラ321、または仮想デバイス311からメモリアクセス情報を受信する。
FIG. 6 is a flowchart of processing of the log output control unit according to the embodiment.
In step S <b> 501, the log output control circuit 356 receives memory access information from the virtual CPU 311, the virtual DMA controller 321, or the virtual device 311.

ステップS502において、ログ出力制御回路356は、ログ出力制御フラグ355に格納されている制御フラグが“1”であるか否かチェックする。制御フラグが“1”である場合、制御はステップS503に進み、制御フラグが“0”である場合、制御はステップS501に戻る。また、制御フラグが“0”である場合、ログ出力制御回路356は、受信したアクセス情報を破棄する。   In step S502, the log output control circuit 356 checks whether or not the control flag stored in the log output control flag 355 is “1”. If the control flag is “1”, the control proceeds to step S503, and if the control flag is “0”, the control returns to step S501. When the control flag is “0”, the log output control circuit 356 discards the received access information.

ステップS503において、ログ出力制御回路356は、メモリアクセス情報に含まれるライトアドレスを参照する。   In step S503, the log output control circuit 356 refers to the write address included in the memory access information.

ステップS504において、ログ出力制御回路356は、監視アドレス先頭レジスタ353および監視サイズレジスタ354を参照し、監視先頭アドレスおよび監視サイズを取得する。そして、ログ出力制御回路356は、メモリアクセス情報に含まれるライトアドレスが監視先頭アドレスから監視アドレスに監視サイズを加算した値の範囲(監視領域)に含まれるか否か判定する。   In step S504, the log output control circuit 356 refers to the monitoring address head register 353 and the monitoring size register 354, and acquires the monitoring head address and the monitoring size. Then, the log output control circuit 356 determines whether or not the write address included in the memory access information is included in the range (monitoring area) of the value obtained by adding the monitoring size to the monitoring address from the monitoring head address.

ライトアドレスが監視領域に含まれている場合、制御はステップS505に進み、ライトアドレスが監視領域外の場合、制御はステップS501に戻る。また、監視先頭アドレスおよび監視サイズがNULLの場合、すなわち監視領域が指定されていない場合、制御はステップS505に進む。   If the write address is included in the monitoring area, control proceeds to step S505, and if the write address is outside the monitoring area, control returns to step S501. If the monitoring head address and the monitoring size are NULL, that is, if the monitoring area is not specified, the control proceeds to step S505.

ステップS505において、ログ出力制御回路356は、メモリアクセス情報をログ401として出力する。   In step S505, the log output control circuit 356 outputs the memory access information as the log 401.

実施の形態の情報処理装置によれば、メモリにアクセスする全てのデバイス(CPU、DMAコントローラ等)をトレースし、1つのログファイルに出力している。ユーザは、該ログファイルを検証することで破壊元を容易に判断することが出来、障害解析時間を短縮することが出来る。   According to the information processing apparatus of the embodiment, all devices (CPU, DMA controller, etc.) that access the memory are traced and output to one log file. The user can easily determine the destruction source by verifying the log file, and the failure analysis time can be shortened.

実施の形態の情報処理装置によれば、ログ出力制御部への制御情報で仮想メモリの監視領域を限定することで、ログ出力制御部が出力するログのサイズが小さくなる。また、ログ出力制御部の処理が限定化するので、情報処理装置101の負荷が小さくなり、エミュレーション時間が大きく増えないという効果がある。   According to the information processing apparatus of the embodiment, the size of the log output by the log output control unit is reduced by limiting the monitoring area of the virtual memory with the control information to the log output control unit. In addition, since the processing of the log output control unit is limited, there is an effect that the load on the information processing apparatus 101 is reduced and the emulation time is not greatly increased.

図7は、情報処理装置(コンピュータ)の構成図である。
実施の形態の情報処理装置101は、例えば、図7に示すような情報処理装置1によって実現される。
FIG. 7 is a configuration diagram of the information processing apparatus (computer).
The information processing apparatus 101 according to the embodiment is realized by an information processing apparatus 1 as illustrated in FIG. 7, for example.

情報処理装置1は、CPU2、メモリ3、入力部4、出力部5、記憶部6、記録媒体駆動部7、およびネットワーク接続部8を備え、それらはバス9により互いに接続されている。   The information processing apparatus 1 includes a CPU 2, a memory 3, an input unit 4, an output unit 5, a storage unit 6, a recording medium drive unit 7, and a network connection unit 8, which are connected to each other by a bus 9.

CPU2は、情報処理装置1全体を制御する中央処理装置である。CPU2は、仮想CPU311、仮想DMAコントローラ321、仮想デバイス331、仮想アービター341、ログ出力制御部351に対応する。   The CPU 2 is a central processing unit that controls the entire information processing apparatus 1. The CPU 2 corresponds to the virtual CPU 311, the virtual DMA controller 321, the virtual device 331, the virtual arbiter 341, and the log output control unit 351.

メモリ3は、プログラム実行の際に、記憶部6(あるいは可搬記録媒体10)に記憶されているプログラムあるいはデータを一時的に格納するRead Only Memory(ROM)やRandom Access Memory(RAM)等のメモリである。CPU2は、メモリ3を利用してプログラムを実行することにより、上述した各種処理を実行する。   The memory 3 is a Read Only Memory (ROM) or Random Access Memory (RAM) that temporarily stores a program or data stored in the storage unit 6 (or the portable recording medium 10) during program execution. It is memory. The CPU 2 executes the various processes described above by executing a program using the memory 3.

この場合、可搬記録媒体10等から読み出されたプログラムコード自体が実施の形態の機能を実現する。   In this case, the program code itself read from the portable recording medium 10 or the like realizes the functions of the embodiment.

入力部4は、例えば、キーボード、マウス、タッチパネル等である。
出力部5は、例えば、ディスプレイ、プリンタ等である。
記憶部6は、例えば、磁気ディスク装置、光ディスク装置、テープ装置等である。情報処理装置1は、記憶部6に、上述のプログラムとデータを保存しておき、必要に応じて、それらをメモリ3に読み出して使用する。
The input unit 4 is, for example, a keyboard, a mouse, a touch panel, or the like.
The output unit 5 is, for example, a display, a printer, or the like.
The storage unit 6 is, for example, a magnetic disk device, an optical disk device, a tape device, or the like. The information processing apparatus 1 stores the above-described program and data in the storage unit 6 and reads them into the memory 3 and uses them as necessary.

メモリ3は、仮想メモリ361の領域を含む。
記録媒体駆動部7は、可搬記録媒体10を駆動し、その記録内容にアクセスする。可搬記録媒体としては、メモリカード、フレキシブルディスク、Compact Disk Read Only Memory(CD-ROM)、光ディスク、光磁気ディスク等、任意のコンピュータ読み取り可能な記録媒体が用いられる。ユーザは、この可搬記録媒体10に上述のプログラムとデータを格納しておき、必要に応じて、それらをメモリ3に読み出して使用する。
The memory 3 includes an area of the virtual memory 361.
The recording medium driving unit 7 drives the portable recording medium 10 and accesses the recorded contents. As the portable recording medium, any computer-readable recording medium such as a memory card, a flexible disk, a compact disk read only memory (CD-ROM), an optical disk, and a magneto-optical disk is used. The user stores the above-described program and data in the portable recording medium 10 and reads them into the memory 3 and uses them as necessary.

ネットワーク接続部8は、LAN等の任意の通信ネットワークに接続され、通信に伴うデータ変換を行う。   The network connection unit 8 is connected to an arbitrary communication network such as a LAN, and performs data conversion accompanying communication.

101 情報処理装置
201 ホストOS
301 仮想マシン
311 仮想CPU
321 仮想DMA
331 仮想デバイス
341 仮想アービター
351 ログ出力制御部
352 CPUインターフェース
353 監視アドレス先頭レジスタ
354 監視サイズレジスタ
355 ログ出力制御フラグレジスタ
356 ログ出力制御回路
361 仮想メモリ
371 仮想バス
101 Information processing apparatus 201 Host OS
301 virtual machine 311 virtual CPU
321 Virtual DMA
331 Virtual device 341 Virtual arbiter 351 Log output control unit 352 CPU interface 353 Monitor address start register 354 Monitor size register 355 Log output control flag register 356 Log output control circuit 361 Virtual memory 371 Virtual bus

Claims (6)

処理装置と、仮想マシンに割り当てられた仮想メモリを含むメモリと、を備える情報処理装置であって、
前記処理装置は、
プログラムを実行し、前記仮想メモリに対して書き込みを行い、前記仮想メモリに対する書き込みに関する第1のメモリアクセス情報を出力する仮想処理部と、
前記仮想処理部から書き込み命令を受信し、前記仮想メモリに対して書き込みを行い、前記仮想メモリに対する書き込みに関する第2のメモリアクセス情報を出力する仮想デバイス部と、
前記第1および前記第2のメモリアクセス情報を受信し、前記第1および前記第2のメモリアクセス情報をログとして出力するログ出力制御部と、
を備えることを特徴とする情報処理装置。
An information processing apparatus comprising: a processing device; and a memory including a virtual memory allocated to a virtual machine,
The processor is
A virtual processing unit that executes a program, writes to the virtual memory, and outputs first memory access information related to writing to the virtual memory;
A virtual device unit that receives a write command from the virtual processing unit, writes to the virtual memory, and outputs second memory access information related to writing to the virtual memory;
A log output control unit that receives the first and second memory access information and outputs the first and second memory access information as a log;
An information processing apparatus comprising:
前記第1および前記第2のメモリアクセス情報は、前記仮想メモリに対する書き込みのライトアドレスを含み、
前記仮想処理部は、前記ログ出力制御部が監視する仮想メモリの領域を示す領域情報を出力し、
前記ログ出力制御部は、前記領域情報を格納し、前記ライトアドレスが前記領域情報で示される領域内である場合に、前記1および前記第2のメモリアクセス情報を出力することを特徴とする請求項1記載の情報処理装置。
The first and second memory access information includes a write address for writing to the virtual memory,
The virtual processing unit outputs area information indicating a virtual memory area monitored by the log output control unit,
The log output control unit stores the area information, and outputs the first and second memory access information when the write address is within an area indicated by the area information. Item 6. The information processing apparatus according to Item 1.
前記仮想処理部は、前記プログラムが動的に確保した領域を示す情報を前記領域情報として出力することを特徴とする請求項1または2記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the virtual processing unit outputs information indicating an area dynamically secured by the program as the area information. 前記第1のメモリアクセス情報は、プログラムカウンタ値、命令コード、およびライトデータをさらに含み、
前記第2のメモリアクセス情報は、ライトデータ、該ライトデータのサイズ、および前記仮想デバイスを示す情報をさらに含むことを特徴とする請求項2または3記載の情報処理装置。
The first memory access information further includes a program counter value, an instruction code, and write data,
The information processing apparatus according to claim 2, wherein the second memory access information further includes information indicating write data, a size of the write data, and the virtual device.
仮想マシンに割り当てられた仮想メモリを含むメモリを備える情報処理装置が実行するログ取得方法であって、
プログラムを実行し、前記仮想メモリに対して書き込みを行い、前記仮想メモリに対する書き込みに関する第1のメモリアクセス情報を出力し、
前記仮想メモリに対して書き込みを行い、前記仮想メモリに対する書き込みに関する第2のメモリアクセス情報を出力し、
前記第1および前記第2のメモリアクセス情報を受信し、前記第1および前記第2のメモリアクセス情報をログとして出力する
ことを特徴とするログ取得方法。
A log acquisition method executed by an information processing apparatus including a memory including a virtual memory allocated to a virtual machine,
Executing a program, writing to the virtual memory, outputting first memory access information relating to writing to the virtual memory;
Writing to the virtual memory, and outputting second memory access information related to writing to the virtual memory;
A log acquisition method comprising: receiving the first and second memory access information and outputting the first and second memory access information as a log.
前記第1および前記第2のメモリアクセス情報は、前記仮想メモリに対する書き込みのライトアドレスを含み、
前記第1および前記第2のメモリアクセス情報をログとして出力する処理において、監視する仮想メモリの領域を示す領域情報を参照し、前記ライトアドレスが前記領域情報で示される領域内である場合に、前記1および前記第2のメモリアクセス情報を出力することを特徴とする請求項5記載のログ取得方法。
The first and second memory access information includes a write address for writing to the virtual memory,
In the process of outputting the first and second memory access information as a log, referring to area information indicating a virtual memory area to be monitored, and when the write address is within the area indicated by the area information, 6. The log acquisition method according to claim 5, wherein the first and second memory access information are output.
JP2012061424A 2012-03-19 2012-03-19 Information processor and log acquisition method Pending JP2013196241A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012061424A JP2013196241A (en) 2012-03-19 2012-03-19 Information processor and log acquisition method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012061424A JP2013196241A (en) 2012-03-19 2012-03-19 Information processor and log acquisition method

Publications (1)

Publication Number Publication Date
JP2013196241A true JP2013196241A (en) 2013-09-30

Family

ID=49395144

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012061424A Pending JP2013196241A (en) 2012-03-19 2012-03-19 Information processor and log acquisition method

Country Status (1)

Country Link
JP (1) JP2013196241A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105512010A (en) * 2014-09-22 2016-04-20 苏宁云商集团股份有限公司 Virtual machine user log information acquisition method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03252746A (en) * 1990-03-02 1991-11-12 Nippon Telegr & Teleph Corp <Ntt> Memory access history preserving system
JP2002132743A (en) * 2000-10-27 2002-05-10 Nec Corp Device and method for monitoring memory access and recording medium recording program for memory access monitor
JP2007199845A (en) * 2006-01-24 2007-08-09 Matsushita Electric Ind Co Ltd Method and device for detecting memory c0rruption
JP2007272303A (en) * 2006-03-30 2007-10-18 Matsushita Electric Ind Co Ltd Simulator with memory breakage detecting function
JP2009032197A (en) * 2007-07-30 2009-02-12 Fujitsu Microelectronics Ltd Software simulation method, program for software simulation, and software simulation device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03252746A (en) * 1990-03-02 1991-11-12 Nippon Telegr & Teleph Corp <Ntt> Memory access history preserving system
JP2002132743A (en) * 2000-10-27 2002-05-10 Nec Corp Device and method for monitoring memory access and recording medium recording program for memory access monitor
JP2007199845A (en) * 2006-01-24 2007-08-09 Matsushita Electric Ind Co Ltd Method and device for detecting memory c0rruption
JP2007272303A (en) * 2006-03-30 2007-10-18 Matsushita Electric Ind Co Ltd Simulator with memory breakage detecting function
JP2009032197A (en) * 2007-07-30 2009-02-12 Fujitsu Microelectronics Ltd Software simulation method, program for software simulation, and software simulation device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JPN6015034944; 近藤 拓也 外2名: '組込み計算機システム開発に向けたメモリ破壊系不具合検出機能の開発' 情報処理学会研究報告 第2007巻 第4号, 20070123, pp.87-92, 社団法人情報処理学会 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105512010A (en) * 2014-09-22 2016-04-20 苏宁云商集团股份有限公司 Virtual machine user log information acquisition method and system

Similar Documents

Publication Publication Date Title
US10089212B2 (en) Memory system, information processing system, and host device outputting debugging information through a host interface
US8612937B2 (en) Synchronously debugging a software program using a plurality of virtual machines
TWI410864B (en) Controlling instruction execution in a processing environment
EP2787444A2 (en) Central processing unit, information processing apparatus, and intra-virtual-core register value acquisition method
US10067813B2 (en) Method of analyzing a fault of an electronic system
US8607098B2 (en) Generating appropriately sized core files used in diagnosing application crashes
US8166349B2 (en) Communicating with USB devices after a computer system crash
KR102307364B1 (en) A vulnerability driven hybrid test system for application programs
US8887139B2 (en) Virtual system and method of analyzing operation of virtual system
CN107003828B (en) Instrumentization of graphics instructions
US9699093B2 (en) Migration of virtual machine based on proximity to peripheral device in NUMA environment
WO2014185165A1 (en) Information processing device, and information processing method
US11010280B1 (en) System and method for virtualization-assisted debugging
JP2009134565A (en) Virtual machine system and method for controlling virtual machine system
JP6920286B2 (en) Exception handling
US7302514B2 (en) Device, system, and method of virtual machine memory mapping
JP5452336B2 (en) Peripheral device failure simulation system, peripheral device failure simulation method, and peripheral device failure simulation program
US8312433B2 (en) Operating system aided code coverage
JP2018531462A6 (en) Exception handling
US11106478B2 (en) Simulation device, simulation method, and computer readable medium
JP2013196241A (en) Information processor and log acquisition method
US9384015B2 (en) Techniques for dynamically redirecting device driver operations to user space
US10176112B2 (en) Information processing device, method, and non-transitory computer-readable recording medium storing information processing program for loading code into reconfigurable integrated circuit
US20120216189A1 (en) Methods, Devices and Computer Program Products for Emulating a Physical Hard Drive as Multiple Virtual Hard Drives
TWI417786B (en) Method,system,and program product of facilitating instruction execution in a processing environment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150825

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150901

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151102

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20160322