JP2008123130A - Coverage measurement method and device and tracing method and device for module - Google Patents
Coverage measurement method and device and tracing method and device for module Download PDFInfo
- Publication number
- JP2008123130A JP2008123130A JP2006304497A JP2006304497A JP2008123130A JP 2008123130 A JP2008123130 A JP 2008123130A JP 2006304497 A JP2006304497 A JP 2006304497A JP 2006304497 A JP2006304497 A JP 2006304497A JP 2008123130 A JP2008123130 A JP 2008123130A
- Authority
- JP
- Japan
- Prior art keywords
- virtual address
- page
- page request
- memory management
- coverage
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims description 36
- 238000000691 measurement method Methods 0.000 title claims description 4
- 238000012360 testing method Methods 0.000 claims abstract description 23
- 238000013519 translation Methods 0.000 claims abstract description 11
- 238000006243 chemical reaction Methods 0.000 claims description 17
- 238000004458 analytical method Methods 0.000 claims description 15
- 238000005259 measurement Methods 0.000 claims description 7
- 230000005540 biological transmission Effects 0.000 claims description 3
- 230000006870 function Effects 0.000 abstract description 9
- 238000012545 processing Methods 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000015556 catabolic process Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、ソフトウェア開発のテストフェーズにおける、カバレッジ測定方法及び装置、モジュールのトレース方法及び装置に関する。 The present invention relates to a coverage measuring method and apparatus and a module tracing method and apparatus in a test phase of software development.
従来、電子計算機(コンピュータ)アーキテクチャの分野では、オペレーティングシステムによる主記憶管理の一方式として、仮想記憶方式が知られている。これは、論理上の主記憶を仮想して、中央演算装置(CPU)が主記憶を参照しようとすると、その論理上の主記憶の仮想アドレスと、仮想アドレスに対応する実アドレス(物理アドレス)とを自動的に変換して、実アドレスのデータを返すという方式である。 Conventionally, in the field of electronic computer (computer) architecture, a virtual storage system is known as a system for managing main memory by an operating system. When a central processing unit (CPU) tries to refer to the main memory by virtualizing the logical main memory, the logical address of the logical main memory and the real address (physical address) corresponding to the virtual address Is automatically converted and the data of the real address is returned.
実アドレスのデータの配置される部分は、主記憶装置に限られず、(磁気ディスクなどの)補助記憶装置にも配置可能である。したがって、電子計算機が仮想記憶方式を実装すると、単価が高く比較的大容量化の難しい主記憶装置(メモリ)の、容量上限を超えて、主記憶利用が可能になる。 The portion where the data of the real address is arranged is not limited to the main storage device but can be arranged in an auxiliary storage device (such as a magnetic disk). Accordingly, when the electronic computer implements the virtual storage system, the main memory can be used exceeding the capacity upper limit of the main storage device (memory) that has a high unit price and is relatively difficult to increase in capacity.
仮想記憶方式には、大きく分けてセグメント方式(アドレス単位で有するデータが可変長)とページング方式(アドレス単位で有するデータが固定長)の2種類があるが、以下ではページング方式を扱うこととする。
仮想記憶方式において中心的な役割を果たすのがMMU(メモリ管理ユニット)である。MMUは、仮想アドレスと実アドレスの変換を、主記憶装置上に構築されることの多いページテーブルを参照して、実行する。この行為をページングという。
There are two types of virtual storage methods: the segment method (data that has data in units of addresses has a variable length) and the paging method (data that has data in units of addresses has a fixed length). .
The MMU (memory management unit) plays a central role in the virtual storage system. The MMU performs the conversion between the virtual address and the real address with reference to a page table that is often constructed on the main storage device. This action is called paging.
また、ページングのためにMMUが逐一バスを介して主記憶装置にアクセスしていたのでは処理が遅くなるため、MMUは、TLB(Translation Look-aside Buffer、高速変換バッファ)という、ページング結果のキャッシュを有していることが多い。MMUが仮想アドレスの問い合わせをTLBに行い、キャッシュが存在していた場合のことをTLBヒット、存在していなかった場合のことをTLBミスと、一般に呼ぶ。このTLBミスのケースに、MMUが主記憶装置上のページングテーブルを参照する行為をページウォークという。 In addition, since the processing is slow if the MMU accesses the main storage device via the bus for paging, the MMU uses a paging result cache called TLB (Translation Look-aside Buffer). Often has When the MMU inquires of the virtual address to the TLB, the case where the cache exists is generally called a TLB hit, and the case where the cache does not exist is generally called a TLB miss. In this TLB miss case, an action in which the MMU refers to the paging table on the main storage device is called a page walk.
他方で、ソフトウェア開発のテストフェーズにおいて、テストの進捗度合いを「カバレッジ(Coverage、網羅率)」という言葉で表現することがある。このカバレッジは、ソフトウェアコード(ソフトウェアプログラム)の、すべての関数や宣言を一通り実行してエラーがないかチェックする、すべての分岐文を一通り実行してエラーがないかチェックする、など、いくつかのレベル・段階で捕らえられる。 On the other hand, in the test phase of software development, the degree of test progress may be expressed by the term “coverage”. This coverage is based on how many functions and declarations of software code (software program) are executed to check for errors, all branch statements are executed to check for errors, etc. Captured at some level / stage.
したがって、カバレッジを測定するには、従来、ソフトウェアコードの関数の入り口及び出口のすべてに又は分岐文すべてに記録用のフックを入れるといった方法がとられてきた(この方法は本発明の課題において後述するように問題点が存在する)。 Therefore, in order to measure the coverage, conventionally, a recording hook has been taken at all of the function code entry and exit or at all branch statements (this method will be described later in the subject of the present invention). There are problems to do).
また、同様にソフトウェアコードのテストにおいて、主記憶に残された障害やエラーの痕跡を手がかりにデバッグをするため、「モジュールのトレースを取る」という行為がなされることがある。モジュールのトレースとは、多くは一定のメモリをリカーシブルに使用するデータ領域(リング構造)のデータエリアに、動いたモジュール毎にその名前(記号)とリタンコードを順々に入れたものである。このようなトレースしたものをメモリダンプなどで取り出し、解析するのが従来なされている方法である(この方法も同様に、後述するように問題点が存在する)。 Similarly, in a software code test, an act of “taking a module trace” may be performed in order to debug a failure or error trace remaining in the main memory. In many cases, the module trace is a data area (ring structure) in which a certain memory is recursively used, and a name (symbol) and a return code are sequentially entered for each moved module. It is a conventional method to extract and analyze such traced data with a memory dump or the like (this method also has problems as described later).
さて、上述した仮想記憶方式をとる電子計算機アーキテクチャにおいて、仮想記憶方式に特有の機構を関連させて、上述のソフトウェアコードのテストを行うことを含んだ、従来の技術的思想としては、例えば下記の特許文献1から3があった。
また、ソフトウェアコードのテスト(特にカバレッジの測定方法)に関しては、例えば下記の特許文献4があった。
以下に、その特許文献1から4に記載の従来発明について、述べる。
In the above-described computer architecture that employs the virtual storage system, as a conventional technical idea including testing the above-mentioned software code in association with a mechanism specific to the virtual storage system, for example, the following There existed
Regarding software code testing (particularly, a method for measuring coverage), for example, there is Patent Document 4 below.
The conventional invention described in
特許文献1に記載の従来発明は、特に2頁右下18行目から3頁左下13行目までを参照すると、仮想記憶式計算機において、メモリ参照時にTLBの未登録の有無を検出し、検出された場合、論理アドレスをバッファや外部記憶装置に書き出すという構成を持つ、アドレス・トレース方式であると認められる。
The conventional invention described in
特許文献2に記載の従来発明は、特に3頁左上19行目から右上18行目までを参照すると、仮想記憶機構を有するマイクロプロセッサにおいて、TLBがhitしない場合、割り込みが発生し、仮想アドレス等の情報がメインメモリ上に格納される(ステップS2)という構成を持つ、トレース機能付マイクロプロセッサであると認められる。 In the conventional invention described in Patent Document 2, in particular, referring to page 3 from the upper left 19th line to the upper right 18th line, in a microprocessor having a virtual storage mechanism, if a TLB is not hit, an interrupt occurs, a virtual address, etc. This information is stored in the main memory (step S2), and is recognized as a microprocessor with a trace function.
特許文献3に記載の従来発明は、特に5頁左上2行目から右下20行目までと7頁左上18行目から右下2行目までとを参照すると、計算機システムにおいて、TLBのヒット有無を判断し(ステップS12)、ヒットしない場合、TLB上に利用状況情報を記録(ステップS13、ステップS14)する(なお、記録先は主メモリでもよい)という構成を持つアドレス変換バッファ利用状況モニタ方式であると認められる。 The conventional invention described in Patent Document 3 is a TLB hit in a computer system, particularly referring to page 5 from upper left line 2 to lower right line 20 and page 7 from upper left line 18 to lower right line 2. The presence / absence is judged (step S12), and if there is no hit, usage status information is recorded on the TLB (steps S13 and S14) (note that the recording destination may be the main memory). It is recognized as a method.
特許文献4に記載の従来発明は、プログラムのカバレージトレース方法に関し、オブジェクト指向プログラミング言語のソースプログラムを読み込み、クラスごとにメンバ関数や関数の型/因数を解析して、それを基に、カバレージ取得用命例を埋め込んだロードファイルを生成し、実行、クラス単位にカバレージを集計するという構成を持つことが認められる。
しかしながら、上述の従来技術には下記のような問題点が存在した。 However, the above-described prior art has the following problems.
プログラムの分岐を全て出力した場合、memcpyなどのループする処理があった場合に局所的に出力するデータが膨大となり、欠落のないデータの取り出し及び解析が困難な場合があった。 When all the branches of the program are output, there is a case where data to be locally output becomes enormous when there is a looping process such as memcpy, and it is difficult to extract and analyze data without missing.
また、関数の入り口及び全ての出口、場合によっては分岐文で、記録用のフックを入れた場合はプログラムの動作に影響を与えてしまう。 Also, function entry and all exits, and in some cases branch statements, and if a recording hook is inserted, it affects the operation of the program.
また、リアルタイムOSが動作している組込機器では、動作性能に影響があるような測定方法では、実動作に影響を与えてうまく動作しない場合がある。 In addition, in an embedded device in which a real-time OS is operating, a measurement method that affects the operation performance may affect the actual operation and may not operate properly.
そこで本発明は、上記従来技術の問題点に鑑みて、ソフトウェアコード(プログラム)のテストの進捗度を測るにあたって、プログラムの動作に全く影響を与えず、また、解析すべきデータ量を低減する。 In view of the above-described problems of the prior art, the present invention does not affect the operation of the program at the time of measuring the progress of the test of the software code (program), and reduces the amount of data to be analyzed.
上記の目的を達成するための請求項1に記載の発明は、メモリ管理ユニットと高速変換バッファとを具備して仮想記憶方式による主記憶管理を行う電子計算機によるカバレッジ測定方法であって、テスト対象のソフトウェアコードの実行中、前記メモリ管理ユニットが前記高速変換バッファを参照しても仮想アドレスに対応する物理アドレスが見つからずページテーブルを参照するページウォークが発生する場合ごとに、前記ページウォークが発生した仮想アドレスと、該仮想アドレスのデータとを記録するページ要求記録ステップを有し、解析手段が、前記ページ要求記録ステップが記録した前記仮想アドレスと前記データとに基づいて前記ソフトウェアコードの前記テストのカバレッジを測定するステップを行うことを特徴とするカバレッジ測定方法である。
In order to achieve the above object, the invention according to
請求項2に記載の発明は、メモリ管理ユニットと高速変換バッファとを具備して仮想記憶方式による主記憶管理を行う電子計算機によるモジュールのトレース方法であって、テスト対象のソフトウェアコードの実行中、前記メモリ管理ユニットが前記高速変換バッファを参照しても仮想アドレスに対応する物理アドレスが見つからずページテーブルを参照するページウォークが発生する場合ごとに、前記ページウォークが発生した仮想アドレスと、該仮想アドレスのデータとを記録するページ要求記録ステップを有し、解析手段が、前記ページ要求記録ステップが記録した前記仮想アドレスと前記データとに基づいて前記ソフトウェアコードのモジュールのトレースをするステップを行うことを特徴とするモジュールのトレース方法である。 The invention according to claim 2 is a module tracing method by an electronic computer having a memory management unit and a high-speed conversion buffer and performing main memory management by a virtual memory method, and executing software code to be tested. Even if the physical address corresponding to the virtual address is not found even when the memory management unit refers to the high-speed translation buffer, the virtual address where the page walk occurs and the virtual address each time the page walk refers to the page table occurs. A page request recording step for recording address data, and the analyzing means performs a step of tracing the module of the software code based on the virtual address and the data recorded by the page request recording step. This is a module tracing method characterized by the following.
請求項3に記載の発明は、請求項2に記載のモジュールのトレース方法であって、前記高速変換バッファは、保持可能なエントリ数を唯1つに設定されたことを特徴とするモジュールのトレース方法である。 A third aspect of the invention is the module tracing method according to the second aspect, wherein the high-speed conversion buffer is set to have only one entry that can be held. Is the method.
請求項4に記載の発明は、メモリ管理ユニットと高速変換バッファとを具備して仮想記憶方式による主記憶管理を行うカバレッジ測定装置であって、テスト対象のソフトウェアコードの実行中、前記メモリ管理ユニットが前記高速変換バッファを参照しても仮想アドレスに対応する物理アドレスが見つからずページテーブルを参照するページウォークが発生する場合ごとに、前記ページウォークが発生した仮想アドレスと、該仮想アドレスのデータとを記録するページ要求記録手段と、前記ページ要求記録手段が記録した前記仮想アドレスと前記データとに基づいて前記ソフトウェアコードの前記テストのカバレッジを測定する解析手段と、を有することを特徴とするカバレッジ測定装置である。 The invention according to claim 4 is a coverage measuring apparatus comprising a memory management unit and a high-speed conversion buffer and performing main memory management by a virtual memory method, wherein the memory management unit is running during execution of software code to be tested Each time a page walk that refers to a page table occurs even if a physical address corresponding to a virtual address is not found even if it refers to the fast translation buffer, the virtual address at which the page walk has occurred, the data of the virtual address, and A page request recording unit for recording the software code, and an analysis unit for measuring the test coverage of the software code based on the virtual address and the data recorded by the page request recording unit. It is a measuring device.
請求項5に記載の発明は、請求項4に記載のカバレッジ測定装置であって、前記ページ要求記録手段は、FIFO方式によって前記仮想アドレスとデータとを記録することを特徴とするカバレッジ測定装置である。 The invention according to claim 5 is the coverage measuring apparatus according to claim 4, wherein the page request recording means records the virtual address and data by a FIFO method. is there.
請求項6に記載の発明は、請求項4又は5に記載のカバレッジ測定装置であって、前記ページ要求記録手段は、実記憶領域内にあることを特徴とするカバレッジ測定装置である。 The invention according to claim 6 is the coverage measuring apparatus according to claim 4 or 5, wherein the page request recording means is in an actual storage area.
請求項7に記載の発明は、請求項4から6のいずれか1項に記載のカバレッジ測定装置であって、前記ページ要求記録手段が記録した前記仮想アドレスと前記データとを、前記解析手段に送信する送信手段を有することを特徴とするカバレッジ測定装置である。 A seventh aspect of the present invention is the coverage measuring apparatus according to any one of the fourth to sixth aspects, wherein the virtual address and the data recorded by the page request recording unit are stored in the analyzing unit. It is a coverage measuring apparatus characterized by having a transmission means to transmit.
請求項8に記載の発明は、メモリ管理ユニットと高速変換バッファとを具備して仮想記憶方式による主記憶管理を行うトレース装置であって、テスト対象のソフトウェアコードの実行中、前記メモリ管理ユニットが前記高速変換バッファを参照しても仮想アドレスに対応する物理アドレスが見つからずページテーブルを参照するページウォークが発生する場合ごとに、前記ページウォークが発生した仮想アドレスと、該仮想アドレスのデータとを記録するページ要求記録手段と、前記ページ要求記録手段が記録した前記仮想アドレスと前記データとに基づいて前記ソフトウェアコードのモジュールのトレースをする解析手段と、を有することを特徴とするトレース装置である。 The invention according to claim 8 is a tracing apparatus that includes a memory management unit and a high-speed conversion buffer and performs main storage management by a virtual storage method, and the memory management unit is in execution during execution of software code to be tested. Whenever a page walk that refers to a page table occurs because a physical address corresponding to a virtual address is not found even if the fast translation buffer is referenced, the virtual address at which the page walk has occurred and the data of the virtual address are obtained. A tracing apparatus comprising: a page request recording unit for recording; and an analysis unit for tracing the module of the software code based on the virtual address and the data recorded by the page request recording unit. .
請求項9に記載の発明は、請求項8に記載のトレース装置であって、前記ページ要求記録手段は、FIFO方式によって前記仮想アドレスとデータとを記録することを特徴とするトレース装置である。 A ninth aspect of the present invention is the trace apparatus according to the eighth aspect, wherein the page request recording means records the virtual address and data by a FIFO method.
請求項10に記載の発明は、請求項8又は9に記載のトレース装置であって、前記ページ要求記録手段は、実記憶領域内にあることを特徴とするトレース装置である。 A tenth aspect of the present invention is the tracing apparatus according to the eighth or ninth aspect, wherein the page request recording means is in a real storage area.
請求項11に記載の発明は、請求項8から10のいずれか1項に記載のトレース装置であって、前記ページ要求記録手段が記録した前記仮想アドレスと前記データとを、前記解析手段に送信する送信手段を有することを特徴とするトレース装置である。 The invention according to claim 11 is the trace apparatus according to any one of claims 8 to 10, wherein the virtual address and the data recorded by the page request recording means are transmitted to the analyzing means. A tracing device characterized in that it has a transmitting means.
請求項12に記載の発明は、請求項8から11のいずれか1項に記載のトレース装置であって、前記高速変換バッファは、保持可能なエントリ数を唯1つに設定されたことを特徴とするトレース装置である。 A twelfth aspect of the present invention is the trace apparatus according to any one of the eighth to eleventh aspects, wherein the high-speed conversion buffer is set to a single number of entries that can be held. It is a trace device.
本発明によれば、ソフトウェアコードのテストの進捗度を測るにあたって、プログラムの動作に全く影響を与えず、また、解析すべきデータ量を低減する。 According to the present invention, when measuring the progress of software code testing, the program operation is not affected at all, and the amount of data to be analyzed is reduced.
以下、本発明の好適な実施の形態について図面を参照して説明する。
〔第1の実施形態〕
図1は、本発明の第1の実施形態に該当する電子計算機100の構成を示すブロック図である。以下に、各ブロックの簡単な説明をする。
Preferred embodiments of the present invention will be described below with reference to the drawings.
[First Embodiment]
FIG. 1 is a block diagram showing a configuration of an
図1において、CPU(Central Processing Unit)101は中央演算ユニットであり、また、仮想記憶方式による主記憶管理をサポートする。CPU101のメモリ参照要求は、MMU103へと伝わる。
MMU(Memory Management Unit)103は、メモリ管理ユニットであり、また、仮想記憶方式による主記憶管理において中心的な役割を果たす。
In FIG. 1, a CPU (Central Processing Unit) 101 is a central processing unit and supports main memory management by a virtual memory system. A memory reference request from the
An MMU (Memory Management Unit) 103 is a memory management unit, and plays a central role in main memory management using a virtual memory system.
TLB102(Translation Look-aside Buffer)は、ページテーブル107による仮想アドレス(論理アドレス)と実アドレス(物理アドレス)の変換を行った結果をキャッシュとして保存し、処理の高速化を実現する。
メモリ106は、電子計算機100の主記憶装置であり、内部の記憶領域にページテーブル107を保持している。
A TLB 102 (Translation Look-aside Buffer) saves the result of conversion between a virtual address (logical address) and a real address (physical address) by the page table 107 as a cache, thereby realizing high-speed processing.
The
ページ要求記録手段104は、例えばFIFOバッファを有するUART(Universal Asynchronous Receiver Transmitter)などで実現される。MMU103から下記の所定の条件を満たした場合にパラレルバスを介して送られてくる仮想アドレス/物理アドレス及び内部のシンボル情報等を、バッファに記録し、外部インターフェース105へ送出する。
The page
外部インターフェース105は、例えばシリアルポートなどで実現される。上記のデータをページ要求記録手段104から受け取った後、接続される外部の解析手段(図1では図示しない)へと送出する。
The
なお、本実施形態(及び後述の実施例)では、解析手段を外部に設定するが、これはシステム全体の柔軟性や拡張性を高めるのに有利であるからである。本発明はこのような構成に限ると解すべきではなく、外部インターフェース105を構成に含めず内部に解析手段を設置する等の構成は、本発明の一変形例である。
以上で、本実施形態の概略構成の説明を終える。以下で、本実施形態の動作について述べる。
In the present embodiment (and the examples described later), the analysis means is set to the outside, which is advantageous for enhancing the flexibility and expandability of the entire system. The present invention should not be construed as being limited to such a configuration, and a configuration in which an analysis unit is installed inside without including the
Above, description of schematic structure of this embodiment is finished. The operation of this embodiment will be described below.
通常、仮想メモリをサポートしたCPU101は、MMU103を介してメモリ106にアクセスする。MMU103はメモリ106上のページテーブル107を検索して仮想アドレスと実アドレスの変換を行う。このMMU103が行う検索処理をページウォークという。
Normally, the
ところが、毎回ページウォークを行うと性能が劣化するため、TLB102において、変換結果をキャッシュして、ページウォークの発生を抑制している。
However, since the performance deteriorates every time the page walk is performed, the
本実施形態では、図1に示した構成の装置をソフトウェアコードのテストに用い、MMU103で発生したすべてのページウォークをページ要求記録手段104にて記録し、外部インターフェース105を経由してデータを取り出し、図示しない外部の電子計算機などが解析し、ページ単位でのカバレッジの測定を可能とする。
In this embodiment, the apparatus having the configuration shown in FIG. 1 is used for software code testing, all page walks generated in the
解析手段は、少なくとも仮想アドレスと内部のシンボル情報を含む上記のデータに基づいて、ソフトウェアコード(パス)のパス・カバレッジの大まかな測定をしたり、ソフトウェアコードの有するモジュールのトレースをしたりする。 The analysis means roughly measures the path coverage of the software code (path) based on the above data including at least the virtual address and the internal symbol information, and traces the module included in the software code.
上記の実施形態によれば、測定のためにページフォルトを発生させるような性能劣化となる処理が一切不要なので、実動作の性能に影響を全く与えず、MMUのページウォーク処理を外部へログ出力するので、大まかな網羅率(カバレッジ)が測定可能であるという効果を奏する。
また、上記の実施形態は、TLBミスヒットのときのみデータが出力されるため、解析すべきデータ量が非常に少ない。
According to the above-described embodiment, processing that causes performance degradation that generates a page fault for measurement is unnecessary, so the performance of the actual operation is not affected at all, and the MMU page walk processing is output to the outside as a log. Therefore, there is an effect that a rough coverage rate (coverage) can be measured.
In the above embodiment, data is output only when a TLB miss occurs, so the amount of data to be analyzed is very small.
〔他の実施形態〕
本発明は、次に述べる態様でも実施可能である。
第1の実施形態において、TLBに対して、唯一つのみバッファを持つように設定する。このように構成することによって、ページの範囲を超えた分岐をすべて出力可能となる。よって、ページ単位でのトレース機能が実現可能となる。
[Other Embodiments]
The present invention can also be implemented in the modes described below.
In the first embodiment, the TLB is set to have only one buffer. With this configuration, all branches exceeding the page range can be output. Therefore, a trace function in units of pages can be realized.
上記の設定は、MMUの管理をするためのソフトウェアプログラム、すなわち、オペレーティングシステムのカーネルドライバなどで設定する。 The above setting is set by a software program for managing the MMU, that is, a kernel driver of the operating system.
上記のオペレーティングシステムのカーネルドライバ等は、磁気又は光ディスク等を含む、人間の知覚によって読み取りが不可能であってもコンピュータによる読み取りが可能である記録媒体によって提供される。 The kernel driver or the like of the above operating system is provided by a recording medium that can be read by a computer even if it cannot be read by human perception, such as a magnetic or optical disk.
また、本発明は、次に述べる態様でも実施可能である。
第1の実施形態において、図1のページ要求記録手段104内部のバッファを、大容量の内蔵メモリとなるよう構成する(なお、下記の実施例ではFIFOとする)。このように構成することによって、ソフトウェアコードのテストのカバレッジ(進捗度合い)測定及びモジュールのトレースが欠落することなく実行できる。
The present invention can also be implemented in the following modes.
In the first embodiment, the buffer in the page
また、本発明は、次に述べる態様でも実施可能である。
第1の実施形態において、図1のページ要求記録手段104内部のバッファを、電子計算機100の主記憶であるメモリ106の記憶領域の一部に割り当てるよう、構成する。すなわち、メモリ106と共用とするのである。このように構成することによって、ソフトウェアコードのテストのカバレッジ(進捗度合い)測定及びモジュールのトレースが欠落することなく実行できる。
The present invention can also be implemented in the following modes.
In the first embodiment, the buffer in the page
上述の第1の実施形態をさらに具体的に実施するための一例を、実施例1として提示し、図面を参照して説明する。 An example for more specifically implementing the first embodiment described above will be presented as Example 1 and will be described with reference to the drawings.
図2は、本実施例に該当するデバッガ200とPC210の構成を示すブロック図である。なお、図1と共通し混同の虞がない部分については同じ符号を付して説明を省略する。
FIG. 2 is a block diagram showing the configuration of the
図2において、デバッガ200は、FIFOメモリ208と、外部通信手段としての機能を有するUART209とを具備するページ要求記録手段104を有し、また、外部インターフェース105としてRS−232C(シリアルポート)205を有する構成である。そして、デバッガ200の外部にデータ解析用のPC(パーソナルコンピュータ)210を備える。
In FIG. 2, the
FIFOメモリ208は、FIFO(First in, First out)方式でデータの入出力を行う、UART209のバッファメモリである。
UART209は、デバッガ200のパラレルバス(MMU103等からの信号路である)からやってくるバイトデータをシリアルのビットストリームに変換する。
その他の部分は、すでに図1において説明をした。
The
The
The other parts have already been described in FIG.
本実施例は、上記のような構成であり、下記のように動作する。
図3を参照して本実施例の動作時の流れを説明する。
図3は、本実施例の動作を説明するためのタイミングチャート図である。
The present embodiment is configured as described above and operates as follows.
With reference to FIG. 3, the operation flow of the present embodiment will be described.
FIG. 3 is a timing chart for explaining the operation of the present embodiment.
図3において、図中に示したケースA(TLBヒットした場合)とケースB(TLBミスした場合)との2種類のケースが存在し、ケースBが本実施例に特徴的な動作である。ケースBの理解を助けるためケースAについても説明する。 In FIG. 3, there are two types of cases, Case A (when a TLB hit) and Case B (when a TLB miss) shown in the figure, and Case B is a characteristic operation of this embodiment. Case A will also be described to assist in understanding case B.
ステップS301では、CPU101が、メモリ106にアクセスしようとして仮想アドレスのデータを参照する要求を出す。この要求を受けたMMU103は、TLB102に、該当する仮想アドレスと物理アドレスのハッシュを持つキャッシュが存在するか、問い合わせを行う(ステップS302)。
In step S <b> 301, the
TLB102にキャッシュのエントリがあった場合は、物理メモリのアドレス(物理アドレス)を返す(ステップS303)。そして、ステップS301における要求の延長でメモリ106に対してアクセスを実行する(ステップS304)。
If there is a cache entry in the
メモリ106はそのアクセスに対して、要求されたアドレス(実アドレス)のデータを返す(ステップS305)。なお、TLB102にエントリがあったということは過去に一度アクセスしたことがあるので、ここでは特にデータを、RS−232C205を経由して、外部へ出すことはない。
以上で、ケースAについての説明を終える。
In response to the access, the
This is the end of the description of Case A.
次に、ケースBについての説明をする。
ケースBでは、CPU101がメモリアクセスしようとして要求を出す(ステップS306)と、まず、MMU103はTLB102に問い合わせを行う(ステップS307)。
Next, the case B will be described.
In case B, when the
ケースBは、TLB102にページテーブル107のキャッシュエントリがない場合に相当するので、TLB102はMMU103に、その旨、応答する(ステップS308)。
Case B corresponds to the case where there is no cache entry in the page table 107 in the
応答を受け取ったMMU103は、変換テーブルであるページテーブル107を参照するためにメモリ106へアクセスする(ステップS309)。
メモリ106は、要求されたアドレス、ここでは変換テーブル(ページテーブル107)のデータが置いてあるアドレスのデータを返却する(ステップS310)。
Receiving the response, the
The
ようやく物理メモリのアドレスが判明したので、MMU103は、ステップS306におけるアクセス要求の延長で、メモリ106にアクセスを実行する(ステップS312)。このアクセスに応答して、メモリ106は、要求されたアドレスのデータを返す(ステップS313)。
Since the address of the physical memory is finally found, the
本実施例では、ステップS312と同時に、ページウォークが発生したので、FIFO208へ要求されたアドレスを渡す(ステップS311)。
UART209は、FIFO208にデータがたまると、そのデータを取り出して(ステップS314)、RS−232C205経由にて、外部へ通知する(ステップS315)。
In this embodiment, since a page walk has occurred simultaneously with step S312, the requested address is passed to the FIFO 208 (step S311).
When data is accumulated in the
解析用のPC210は、RS−232C205経由でデータを受信し(ステップS316)、内部のシンボル情報を基に解析を行う。
以上でケースBについての説明を終える。
The
This is the end of the explanation for Case B.
上記の実施例は、解析手段として外部の電子計算機を利用するので、ソフトウェアコードのテスト/デバッグ・システム全体の、拡張性と柔軟性を高めることができるという効果を奏する。 Since the above embodiment uses an external computer as an analysis means, there is an effect that the expandability and flexibility of the entire software code test / debug system can be improved.
本発明は、ソフトウェア開発におけるテストフェーズ、特に、リアルタイムOSの組み込み機器のためのソフトウェア開発に利用可能性がある。 The present invention can be used in a test phase in software development, particularly in software development for a real-time OS embedded device.
100 電子計算機
101 CPU
102 TLB
103 MMU
104 ページ要求記録手段
105 外部インターフェース
106 メモリ
107 ページテーブル
200 デバッガ
205 RS−232C
208 FIFOメモリ
209 UART
210 PC
100
102 TLB
103 MMU
104 page request recording means 105
208
210 PC
Claims (12)
テスト対象のソフトウェアコードの実行中、
前記メモリ管理ユニットが前記高速変換バッファを参照しても仮想アドレスに対応する物理アドレスが見つからずページテーブルを参照するページウォークが発生する場合ごとに、
前記ページウォークが発生した仮想アドレスと、該仮想アドレスのデータとを記録するページ要求記録ステップを有し、
解析手段が、前記ページ要求記録ステップが記録した前記仮想アドレスと前記データとに基づいて前記ソフトウェアコードの前記テストのカバレッジを測定するステップを行うことを特徴とするカバレッジ測定方法。 A coverage measurement method by an electronic computer comprising a memory management unit and a high-speed conversion buffer and performing main memory management by a virtual memory method,
While running the software code under test,
Even if the physical address corresponding to the virtual address is not found even if the memory management unit refers to the fast translation buffer, a page walk referring to the page table occurs.
A page request recording step of recording a virtual address where the page walk has occurred and data of the virtual address;
A method for measuring coverage, characterized in that the analysis means performs a step of measuring coverage of the test of the software code based on the virtual address and the data recorded in the page request recording step.
テスト対象のソフトウェアコードの実行中、
前記メモリ管理ユニットが前記高速変換バッファを参照しても仮想アドレスに対応する物理アドレスが見つからずページテーブルを参照するページウォークが発生する場合ごとに、
前記ページウォークが発生した仮想アドレスと、該仮想アドレスのデータとを記録するページ要求記録ステップを有し、
解析手段が、前記ページ要求記録ステップが記録した前記仮想アドレスと前記データとに基づいて前記ソフトウェアコードのモジュールのトレースをするステップを行うことを特徴とするモジュールのトレース方法。 A module tracing method by an electronic computer having a memory management unit and a high-speed conversion buffer and performing main memory management by a virtual memory method,
While running the software code under test,
Even if the physical address corresponding to the virtual address is not found even if the memory management unit refers to the fast translation buffer, a page walk referring to the page table occurs.
A page request recording step of recording a virtual address where the page walk has occurred and data of the virtual address;
A module tracing method, wherein the analyzing means performs a step of tracing the module of the software code based on the virtual address and the data recorded in the page request recording step.
前記高速変換バッファは、保持可能なエントリ数を唯1つに設定されたことを特徴とするモジュールのトレース方法。 A module tracing method according to claim 2, comprising:
The module trace method according to claim 1, wherein the high-speed conversion buffer is set to have only one entry that can be held.
テスト対象のソフトウェアコードの実行中、
前記メモリ管理ユニットが前記高速変換バッファを参照しても仮想アドレスに対応する物理アドレスが見つからずページテーブルを参照するページウォークが発生する場合ごとに、
前記ページウォークが発生した仮想アドレスと、該仮想アドレスのデータとを記録するページ要求記録手段と、
前記ページ要求記録手段が記録した前記仮想アドレスと前記データとに基づいて前記ソフトウェアコードの前記テストのカバレッジを測定する解析手段と、
を有することを特徴とするカバレッジ測定装置。 A coverage measuring device comprising a memory management unit and a high-speed conversion buffer and performing main memory management by a virtual memory method,
While running the software code under test,
Even if the physical address corresponding to the virtual address is not found even if the memory management unit refers to the fast translation buffer, a page walk referring to the page table occurs.
Page request recording means for recording the virtual address where the page walk has occurred, and data of the virtual address;
Analyzing means for measuring coverage of the test of the software code based on the virtual address and the data recorded by the page request recording means;
A coverage measuring apparatus comprising:
前記ページ要求記録手段は、FIFO方式によって前記仮想アドレスとデータとを記録することを特徴とするカバレッジ測定装置。 The coverage measurement apparatus according to claim 4,
The page request recording means records the virtual address and data by a FIFO method.
前記ページ要求記録手段は、実記憶領域内にあることを特徴とするカバレッジ測定装置。 The coverage measurement apparatus according to claim 4 or 5,
The page request recording means is in a real storage area.
前記ページ要求記録手段が記録した前記仮想アドレスと前記データとを、前記解析手段に送信する送信手段を有することを特徴とするカバレッジ測定装置。 The coverage measuring apparatus according to any one of claims 4 to 6,
A coverage measurement apparatus comprising: a transmission unit configured to transmit the virtual address and the data recorded by the page request recording unit to the analysis unit.
テスト対象のソフトウェアコードの実行中、
前記メモリ管理ユニットが前記高速変換バッファを参照しても仮想アドレスに対応する物理アドレスが見つからずページテーブルを参照するページウォークが発生する場合ごとに、
前記ページウォークが発生した仮想アドレスと、該仮想アドレスのデータとを記録するページ要求記録手段と、
前記ページ要求記録手段が記録した前記仮想アドレスと前記データとに基づいて前記ソフトウェアコードのモジュールのトレースをする解析手段と、
を有することを特徴とするトレース装置。 A trace device comprising a memory management unit and a high-speed conversion buffer and performing main storage management by a virtual storage method,
While running the software code under test,
Even if the physical address corresponding to the virtual address is not found even if the memory management unit refers to the high-speed translation buffer, a page walk referring to the page table occurs.
Page request recording means for recording the virtual address where the page walk has occurred, and data of the virtual address;
Analyzing means for tracing the module of the software code based on the virtual address and the data recorded by the page request recording means;
A tracing apparatus comprising:
前記ページ要求記録手段は、FIFO方式によって前記仮想アドレスとデータとを記録することを特徴とするトレース装置。 The trace device according to claim 8,
The page request recording means records the virtual address and data by a FIFO method.
前記ページ要求記録手段は、実記憶領域内にあることを特徴とするトレース装置。 The trace device according to claim 8 or 9, wherein
The tracing apparatus according to claim 1, wherein the page request recording means is in a real storage area.
前記ページ要求記録手段が記録した前記仮想アドレスと前記データとを、前記解析手段に送信する送信手段を有することを特徴とするトレース装置。 The trace device according to any one of claims 8 to 10,
A tracing apparatus comprising: a transmission unit configured to transmit the virtual address and the data recorded by the page request recording unit to the analysis unit.
前記高速変換バッファは、保持可能なエントリ数を唯1つに設定されたことを特徴とするトレース装置。 The trace device according to any one of claims 8 to 11,
The trace apparatus according to claim 1, wherein the high-speed conversion buffer is set to have only one holdable entry.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006304497A JP2008123130A (en) | 2006-11-09 | 2006-11-09 | Coverage measurement method and device and tracing method and device for module |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006304497A JP2008123130A (en) | 2006-11-09 | 2006-11-09 | Coverage measurement method and device and tracing method and device for module |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2008123130A true JP2008123130A (en) | 2008-05-29 |
Family
ID=39507842
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2006304497A Withdrawn JP2008123130A (en) | 2006-11-09 | 2006-11-09 | Coverage measurement method and device and tracing method and device for module |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2008123130A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2013145298A1 (en) * | 2012-03-30 | 2013-10-03 | 富士通株式会社 | Information processing device and method for collecting program analysis information |
| JP2014073378A (en) * | 2013-09-17 | 2014-04-24 | Kyoraku Sangyo Co Ltd | Pachinko game machine |
-
2006
- 2006-11-09 JP JP2006304497A patent/JP2008123130A/en not_active Withdrawn
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2013145298A1 (en) * | 2012-03-30 | 2013-10-03 | 富士通株式会社 | Information processing device and method for collecting program analysis information |
| JP2014073378A (en) * | 2013-09-17 | 2014-04-24 | Kyoraku Sangyo Co Ltd | Pachinko game machine |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6883162B2 (en) | Annotations for transaction tracing | |
| US8370687B2 (en) | Mechanism for storing and extracting trace information using internal memory in micro controllers | |
| US7996686B2 (en) | Branch trace methodology | |
| KR100338223B1 (en) | A method and apparatus for structured memory analysis of data processing systems and applications | |
| USRE49305E1 (en) | Data processing system having cache memory debugging support and method therefor | |
| US8185724B2 (en) | Monitoring values of signals within an integrated circuit | |
| JP2010044747A (en) | Message logging for software application | |
| US20090037886A1 (en) | Apparatus and method for evaluating a free-running trace stream | |
| US7533302B2 (en) | Trace and debug method and system for a processor | |
| KR20010006188A (en) | Trace cache for a microprocessor-based device | |
| KR19990077480A (en) | A method and apparatus for structured memory analysis of data processing systems and applications | |
| US8789028B2 (en) | Memory access monitoring | |
| US9069896B2 (en) | Data processor device for handling a watchpoint and method thereof | |
| JP2008513875A (en) | Method and apparatus for non-intrusive tracking | |
| US9223678B2 (en) | Data processor device having a debug control module which selectively modifies trace messages | |
| US20190272226A1 (en) | Determining instruction execution history in a debugger | |
| US6701412B1 (en) | Method and apparatus for performing software sampling on a microprocessor cache | |
| JP2008123130A (en) | Coverage measurement method and device and tracing method and device for module | |
| CN115240752B (en) | Apparatus, methods and electronic devices for analyzing signals from flash memory within a chip | |
| CN115269309A (en) | Processor micro-architecture monitoring method and device | |
| CN106598755B (en) | Processor and DCC communication system | |
| EP1100017A1 (en) | Memory access monitoring and debugging device | |
| CN119088657B (en) | A hybrid mode instruction stream acquisition method and device | |
| US20230161678A1 (en) | Classification of different types of cache misses | |
| Park et al. | A practical approach for finding anti-debugging routines in the Arm-Linux using hardware tracing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20100202 |