JP2015162003A - Processor management apparatus - Google Patents

Processor management apparatus Download PDF

Info

Publication number
JP2015162003A
JP2015162003A JP2014035591A JP2014035591A JP2015162003A JP 2015162003 A JP2015162003 A JP 2015162003A JP 2014035591 A JP2014035591 A JP 2014035591A JP 2014035591 A JP2014035591 A JP 2014035591A JP 2015162003 A JP2015162003 A JP 2015162003A
Authority
JP
Japan
Prior art keywords
processor
program
interrupt
cache miss
performance monitor
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
JP2014035591A
Other languages
Japanese (ja)
Inventor
西川 浩司
Koji Nishikawa
浩司 西川
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2014035591A priority Critical patent/JP2015162003A/en
Publication of JP2015162003A publication Critical patent/JP2015162003A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To obtain a configuration capable of analyzing an event that occurs to a processor without providing a dedicated hardware in the processor.SOLUTION: If a PM mechanism 40 incorporated in a processor 100 detects the occurrence of a specific even during execution of a program by the processor 100, a PM interruption handler 400 is activated in response to an interruption from the PM mechanism 40 and receives processor state information indicating a state of the processor 100 during the occurrence of the specific event. An address locating unit 600 locates a memory address that causes the occurrence of the specific event using a program 800 and the processor state information.

Description

プロセッサで発生した事象を解析する技術に関する。   The present invention relates to a technique for analyzing events occurring in a processor.

従来の組み込みシステムに搭載されているプロセッサでは、ハードウェアの動作状態を解析する機構としてパフォーマンスモニター機構(PM機構)が組み込まれている。
そして、このPM機構によって命令の実行回数や、キャッシュのミス回数などの事象回数を計測することができ、プログラムの動作解析を行っていた。
組み込みシステムでは、周期処理を繰り返すため、1度発生した事象は別の周期にて再度発生することが多いため、複数周期にわたり事象回数を採取し、これらの情報を基にプログラムの解析を行っていた。
特にキャッシュミスは処理時間に大きな影響を及ぼすため、キャッシュミスしたアドレスなどの詳細な情報が必要であった。
しかし、単純なPM機構では、キャッシュミスしたアドレスなどの詳細情報を採取することが困難であり、プログラムの詳細な解析を行うため、プロセッサ内に専用ハードウェアとして履歴記録部を設け、キャッシュミスしたアドレス情報を得る方法が提案されている(特許文献1)。
In a processor mounted on a conventional embedded system, a performance monitor mechanism (PM mechanism) is incorporated as a mechanism for analyzing the operating state of hardware.
The PM mechanism can measure the number of instructions executed and the number of events such as the number of cache misses, and analyzes the operation of the program.
In an embedded system, since cyclic processing is repeated, an event that occurs once often occurs again in another cycle. Therefore, the number of events is collected over multiple cycles, and the program is analyzed based on this information. It was.
In particular, since a cache miss has a large effect on processing time, detailed information such as a cache missed address is required.
However, with a simple PM mechanism, it is difficult to collect detailed information such as a cache missed address, and in order to perform a detailed analysis of the program, a history recording unit is provided as dedicated hardware in the processor to make a cache miss. A method for obtaining address information has been proposed (Patent Document 1).

特開2010−218367号公報JP 2010-218367 A

従来のプロセッサにおいてキャッシュミスしたアドレスの詳細情報を得るには、専用のハードウェアとしてプロセッサ内に履歴記録部を設けなければならないという課題があった。
この発明は上記のような課題を解決することを主な目的としており、プロセッサ内の専用のハードウェアを設けることなく、プロセッサで発生した事象を解析可能な構成を得ることを主な目的とする。
In order to obtain detailed information of an address where a cache miss has occurred in a conventional processor, there has been a problem that a history recording unit must be provided in the processor as dedicated hardware.
The main object of the present invention is to solve the above-described problems, and it is a main object of the present invention to obtain a configuration that can analyze an event occurring in a processor without providing dedicated hardware in the processor. .

本発明に係るプロセッサ管理装置は、
プロセッサに組み込まれたパフォーマンスモニター機構が前記プロセッサによるプログラムの実行中に特定の事象が発生したことを検出した場合に、前記パフォーマンスモニター機構からの割込みにより起動され、前記特定の事象の発生の際の前記プロセッサの状態を示すプロセッサ状態情報を受信する割込みハンドラと、
前記プログラムと前記プロセッサ状態情報とを用いて、前記特定の事象を発生させたメモリアドレスを特定するアドレス特定部とを有することを特徴とする。
The processor management device according to the present invention is:
When the performance monitor mechanism incorporated in the processor detects that a specific event has occurred during the execution of the program by the processor, it is activated by an interrupt from the performance monitor mechanism, and when the specific event occurs An interrupt handler for receiving processor state information indicating the state of the processor;
An address specifying unit that specifies a memory address that caused the specific event using the program and the processor state information.

本発明によれば、パフォーマンスモニター機構からの割込みによりプロセッサ状態情報を受信し、受信したプロセッサ状態情報とプログラムとを用いて特定の事象を発生させたメモリアドレスを特定するため、プロセッサ内に専用のハードウェアを設けることなく、プロセッサで発生した事象を解析することができる。   According to the present invention, the processor status information is received by an interrupt from the performance monitor mechanism, and the processor address information and the received program are used to identify the memory address that generated the specific event. Events that occur in the processor can be analyzed without providing hardware.

実施の形態1に係るプロセッサ及びプロセッサ管理装置の構成例を示す図。2 is a diagram illustrating a configuration example of a processor and a processor management device according to Embodiment 1. FIG. 実施の形態1に係るPM機構制御部の動作例を示すフローチャート図。FIG. 3 is a flowchart showing an operation example of a PM mechanism control unit according to the first embodiment. 実施の形態1に係るPM割込みハンドラの動作例を示すフローチャート図。FIG. 4 is a flowchart showing an operation example of a PM interrupt handler according to the first embodiment. 実施の形態1に係るキャッシュミス履歴記録部の動作例を示す図。FIG. 6 is a diagram illustrating an operation example of a cache miss history recording unit according to the first embodiment. 実施の形態1に係るアドレス特定部の動作例を示す図。FIG. 6 is a diagram illustrating an operation example of an address specifying unit according to the first embodiment.

実施の形態1.
以下、図面を参照して、本実施の形態について説明する。
本実施の形態では、プロセッサで発生した事象としてキャッシュミスを例にして説明を行う。
Embodiment 1 FIG.
Hereinafter, the present embodiment will be described with reference to the drawings.
In the present embodiment, a cache miss is taken as an example of an event that has occurred in the processor.

図1は、プロセッサ100とプロセッサ管理装置700の構成例を示す。   FIG. 1 shows a configuration example of the processor 100 and the processor management device 700.

プロセッサ100において、10は、命令の取り出し、デコード、命令の実行、実行結果の格納を行うプロセッサコア部である。   In the processor 100, reference numeral 10 denotes a processor core unit that fetches and decodes instructions, executes instructions, and stores execution results.

11は、プロセッサコア部10からの命令取り出し要求である。
12は、プロセッサコア部10からの命令取り出し要求11が有効なタイミングで参照する命令アドレス他の情報である。
13は、プロセッサコア部10に供給される命令コードである。
14は、プロセッサコア部10からのオペランドアクセス要求である。
15は、プロセッサコア部10からのオペランドアクセス要求14が有効なタイミングで参照するオペランドアドレス他の情報である。
16は、プロセッサコア部10からのライト用オペランドデータまたは、プロセッサコア部10からのリード要求に対するオペランドデータである。
11 is an instruction fetch request from the processor core unit 10.
Reference numeral 12 denotes information such as an instruction address referred to when the instruction fetch request 11 from the processor core unit 10 is valid.
Reference numeral 13 denotes an instruction code supplied to the processor core unit 10.
Reference numeral 14 denotes an operand access request from the processor core unit 10.
Reference numeral 15 denotes operand address and other information that is referred to when the operand access request 14 from the processor core unit 10 is valid.
Reference numeral 16 denotes operand data for writing from the processor core unit 10 or operand data for a read request from the processor core unit 10.

20は、プロセッサコア部10からの命令取り出し要求11と命令アドレス他の情報12を受け付け、内部のキャッシュメモリを参照し、取り出した命令コード13をプロセッサコア部10に供給する命令キャッシュである。
21は、プロセッサコア部10からの命令取り出し要求11と命令アドレス他の情報12で命令キャッシュ20の内部を検索した結果、命令キャッシュ20に含まれていない場合に、上位キャッシュまたはメモリコントローラ200に命令取り出しを要求する命令取り出し要求である。
22は、命令取り出し要求21が有効なタイミングで参照する命令アドレス他の情報である。
23は、命令キャッシュに供給される命令コードである。
データキャッシュ30へのリード要求時には、内部のキャッシュメモリを参照し、取り出したオペランドデータ16をプロセッサコア部10に供給する。
Reference numeral 20 denotes an instruction cache that receives an instruction fetch request 11 and an instruction address other information 12 from the processor core unit 10, refers to an internal cache memory, and supplies the fetched instruction code 13 to the processor core unit 10.
When the instruction cache 20 is not included in the instruction cache 20 as a result of searching the instruction cache 20 using the instruction fetch request 11 from the processor core unit 10 and the instruction address and other information 12, This is an instruction fetch request for requesting fetch.
Reference numeral 22 denotes information such as an instruction address referred to when the instruction fetch request 21 is valid.
Reference numeral 23 denotes an instruction code supplied to the instruction cache.
When a read request is made to the data cache 30, the internal cache memory is referred to and the extracted operand data 16 is supplied to the processor core unit 10.

30は、プロセッサコア部10からのオペランドアクセス要求14(リードやライト)とオペランドアドレス他の情報15、ライト要求ではオペランドデータ16を受け付け、内部のキャッシュメモリに書き込みを行うデータキャッシュ部である。
34は、プロセッサコア部10からのオペランドアクセス要求14とオペランドアドレス他の情報15でデータキャッシュ30の内部を検索した結果、データキャッシュ30に含まれていない場合に、上位のキャッシュメモリにオペランドアクセスを要求するオペランドアクセス要求である。
35は、オペランドアクセス要求34が有効なタイミングで参照するオペランドアドレス他の情報である。
36は、データキャッシュ30と上位キャッシュまたはメモリコントローラ200との間で移動するオペランドである。
Reference numeral 30 denotes a data cache unit that accepts operand access request 14 (read or write) from the processor core unit 10, operand address and other information 15, and operand data 16 in a write request, and writes it to the internal cache memory.
34, if the result of searching the inside of the data cache 30 with the operand access request 14 from the processor core unit 10 and the operand address and other information 15 is not included in the data cache 30, operand access is made to the upper cache memory. Operand access request to request.
Reference numeral 35 denotes operand address and other information referred to when the operand access request 34 is valid.
Reference numeral 36 denotes an operand that moves between the data cache 30 and the upper cache or the memory controller 200.

40は、設定された事象の発生を監視し、設定された回数の発生を検出するとプロセッサコア部10に通知するPM機構である。
PM機構40において、41は、監視すべき事象を選択するセレクタ44により選択された事象の発生回数を計測する回数計測部である。
42は、プロセッサコア部10への通知を発生させるための所定の発生回数を設定する割り込み間隔である。
43は、回数計測部41と割り込み間隔42の値を比較し、一致した場合にプロセッサコア部10に通知する比較器である。
44は、命令取り出し要求21とオペランドアクセス要求34のいずれかを選択するセレクタである。
45は、比較器43で回数計測部41と割り込み間隔42の値が一致した場合に、プロセッサコア部10に通知されるPM割り込み信号である。
Reference numeral 40 denotes a PM mechanism that monitors the occurrence of a set event and notifies the processor core unit 10 when the occurrence of the set number of times is detected.
In the PM mechanism 40, reference numeral 41 denotes a number measuring unit that measures the number of occurrences of an event selected by a selector 44 that selects an event to be monitored.
42 is an interrupt interval for setting a predetermined number of occurrences for generating a notification to the processor core unit 10.
Reference numeral 43 denotes a comparator that compares the value of the number counting unit 41 and the interrupt interval 42 and notifies the processor core unit 10 when they match.
A selector 44 selects either the instruction fetch request 21 or the operand access request 34.
Reference numeral 45 denotes a PM interrupt signal notified to the processor core unit 10 when the comparator 43 matches the value of the number counting unit 41 and the interrupt interval 42.

200は、命令キャッシュ20での命令取り出しでキャッシュミスした場合や、データキャッシュ30でオペランドの取り出し、格納でキャッシュミスした場合に、参照する上位キャッシュまたはメモリコントローラである。   Reference numeral 200 denotes a higher-level cache or a memory controller that is referred to when a cache miss occurs due to an instruction fetch in the instruction cache 20 or when a cache miss occurs when an operand is fetched and stored in the data cache 30.

700は、特定の事象(例えば、キャッシュミス)が発生した場合に、特定の事象を発生させたメモリアドレスを特定するプロセッサ管理装置である。   Reference numeral 700 denotes a processor management device that identifies a memory address that causes a specific event when a specific event (for example, a cache miss) occurs.

プロセッサ管理装置700において、300は、セレクタ44にPM機構40で計測すべき特定の事象を設定し、割り込み間隔42に所定の値を設定するPM機構制御部である。   In the processor management apparatus 700, 300 is a PM mechanism control unit that sets a specific event to be measured by the PM mechanism 40 in the selector 44 and sets a predetermined value in the interrupt interval 42.

400は、特定の事象が発生した場合にPM機構40によって通知された割り込みがプロセッサコア部10で認識され、プログラム実行されるPM割込みハンドラである。
PM割込みハンドラ400は、特定の事象が発生した際のプロセッサの状態を示すプロセッサ状態情報をプロセッサコア部10から受信する。
401は、PM機構40によって通知された割り込みによって発生するPM割込みハンドラ起動信号である。
Reference numeral 400 denotes a PM interrupt handler in which an interrupt notified by the PM mechanism 40 is recognized by the processor core unit 10 and a program is executed when a specific event occurs.
The PM interrupt handler 400 receives processor state information indicating the state of the processor when a specific event occurs from the processor core unit 10.
401 is a PM interrupt handler activation signal generated by the interrupt notified by the PM mechanism 40.

500は、PM割込みハンドラ400がプロセッサ状態情報を格納するキャッシュミス履歴記録部である。   Reference numeral 500 denotes a cache miss history recording unit in which the PM interrupt handler 400 stores processor state information.

600は、キャッシュミス履歴記録部500に格納されているプロセッサ状態情報と、プログラム800とを用いてキャッシュミスを発生させたメモリアドレスを特定するアドレス特定部である。   Reference numeral 600 denotes an address specifying unit that specifies the memory address that caused the cache miss using the processor state information stored in the cache miss history recording unit 500 and the program 800.

PM機構制御部300、PM割込みハンドラ400、アドレス特定部600は、例えばプログラムで実現される。
PM機構制御部300、PM割込みハンドラ400、アドレス特定部600を実現するプログラムは、プロセッサ100又は組込みシステム内の他のプロセッサにより実行されて、以下にて説明する処理が行われる。
キャッシュミス履歴記録部500は、プロセッサ100内のレジスタやRAM(Random Access Memory)により実現される。
The PM mechanism control unit 300, the PM interrupt handler 400, and the address specifying unit 600 are realized by programs, for example.
A program for realizing the PM mechanism control unit 300, the PM interrupt handler 400, and the address specifying unit 600 is executed by the processor 100 or another processor in the embedded system, and the processing described below is performed.
The cache miss history recording unit 500 is realized by a register in the processor 100 or a RAM (Random Access Memory).

次に動作について説明する。   Next, the operation will be described.

まず、PM機構制御部300が、PM機構40で計測すべき事象の設定を行い、セレクタ44の選択条件を決定する。
また、PM機構制御部300は、割り込み間隔の設定を割り込み間隔42に行う。
セレクタ44と割り込み間隔42を設定することで、プログラム実行中に計測が必要な事象の数の計測が開始される。
First, the PM mechanism control unit 300 sets an event to be measured by the PM mechanism 40 and determines a selection condition of the selector 44.
In addition, the PM mechanism control unit 300 sets the interrupt interval to the interrupt interval 42.
By setting the selector 44 and the interrupt interval 42, measurement of the number of events that need to be measured during program execution is started.

PM機構制御部300の処理フローを図2に従い、説明する。   A processing flow of the PM mechanism control unit 300 will be described with reference to FIG.

PM機構制御部300は、S201で、計測すべき事象を決定し、セレクタ44を設定する。
S202では、割り込み間隔42を設定せず、周期での事象の発生回数を計測する。
S203では、PM割込みハンドラ400の実行時間を計測する。
S204では、周期あたりの計測事象の発生回数や、PM割込みハンドラ400の実行時間から、割り込みの発生間隔を決め、割り込み間隔42を設定する。
In S201, the PM mechanism control unit 300 determines an event to be measured and sets the selector 44.
In S202, the interrupt interval 42 is not set, and the number of occurrences of events in the cycle is measured.
In S203, the execution time of the PM interrupt handler 400 is measured.
In S204, an interrupt generation interval is determined from the number of occurrences of measurement events per period and the execution time of the PM interrupt handler 400, and the interrupt interval 42 is set.

割り込み間隔42は、以下の(1)〜(3)のいずれかの方法で決定される。
(1)組み込みシステムで設定された周期処理の時間マージン内で実行可能なPM割込みハンドラの実行回数
たとえば、周期1m秒で、マージン5%、PM割込みハンドラの1回の実行時間5u秒とした場合、1m秒×5%/5u秒=10回となる。
これは、周期時間や処理内容を変更することなく、計測できる。
ただし、1周期で発生する事象回数が多い場合は、複数周期のデータ採取を行い、データの補完を行うことが必要である。
採取する最低周期数は、1周期で発生する事象回数/PM割込みハンドラ実行回数となる。
(2)組み込みシステムで設定された周期処理の時間内で発生する事象の回数に対する比率に従った割り込み回数
比率は、周期あたりの発生回数により、変更される。
たとえば、1周期で2000回事象が発生した場合は、比率を1%とし、2000×1%=20回となる。
また、1周期で20回事象が発生した場合は、比率を10%とし、20回×10%=2回となる。
データ採取のオーバーヘッドが周期処理の時間マージンと比べて、同等以上の場合には、周期時間や、処理内容の修正が発生する。
発生回数に対する比率が決まっているため、採取する最低周期数が決まる。
(3)上記(1)と(2)の組み合わせ
発生回数に対する比率と割り込みハンドラの実行時間から最適な回数を決定する。
The interrupt interval 42 is determined by any of the following methods (1) to (3).
(1) Number of executions of the PM interrupt handler that can be executed within the time margin of the periodic processing set in the embedded system For example, when the cycle is 1 ms, the margin is 5%, and the execution time of one PM interrupt handler is 5 u seconds 1 ms × 5% / 5 u seconds = 10 times.
This can be measured without changing the cycle time or the processing content.
However, if the number of events that occur in one cycle is large, it is necessary to collect data for a plurality of cycles and supplement the data.
The minimum number of cycles to be collected is the number of events that occur in one cycle / the number of PM interrupt handler executions.
(2) The interrupt count ratio according to the ratio to the number of events that occur within the period of the periodic processing set in the embedded system is changed according to the number of occurrences per cycle.
For example, when 2000 events occur in one cycle, the ratio is 1%, and 2000 × 1% = 20 times.
Further, when an event occurs 20 times in one cycle, the ratio is 10%, and 20 times × 10% = 2 times.
If the data collection overhead is equal to or greater than the time margin of the periodic processing, the periodic time and the processing content are corrected.
Since the ratio to the number of occurrences is determined, the minimum number of cycles to be collected is determined.
(3) Combination of (1) and (2) The optimum number is determined from the ratio to the number of occurrences and the execution time of the interrupt handler.

次に、PM割込みハンドラ400の処理フローを図3に従い、説明する。   Next, the processing flow of the PM interrupt handler 400 will be described with reference to FIG.

PM割込みハンドラ400は、S301で、割り込みからの復帰用にPC(プログラムカウンタ)をセーブしておく。
S302で、キャッシュミス履歴記録部500にPC、レジスタ内容を記録する。
S303で、割り込みからの復帰用にセーブ(S301)したPCを設定する。
S304で、割り込みから復帰する。
In step S301, the PM interrupt handler 400 saves a PC (program counter) for returning from an interrupt.
In S302, the PC and register contents are recorded in the cache miss history recording unit 500.
In S303, the PC saved (S301) for returning from the interrupt is set.
In S304, the process returns from the interrupt.

S302では、計測事象により、プロセッサ状態情報として記録するデータが異なる。
命令キャッシュミスの計測では、PCのみ記録し、データキャッシュミスの計測では、PCとレジスタ内容を記録する。
命令キャッシュミスではPCがキャッシュミスしたアドレスとなるが、データキャッシュミスではPCで示される命令コードを解析し、オペランドアドレスを生成することが必要となるためである。
プロセッサによっては、キャッシュミスしたアドレスを保持し、プログラムから読み出すことができるプロセッサもあり、その場合は、読み出したアドレスを記録する。
In S302, data to be recorded as processor state information differs depending on the measurement event.
In the instruction cache miss measurement, only the PC is recorded, and in the data cache miss measurement, the PC and register contents are recorded.
This is because an instruction cache miss results in an address where the PC has missed the cache, but a data cache miss requires analysis of the instruction code indicated by the PC and generation of an operand address.
Some processors hold a cache missed address and can be read from the program. In this case, the read address is recorded.

プログラム実行時のキャッシュミス履歴記録部500への書き込み動作について図4を用いて説明する。   A write operation to the cache miss history recording unit 500 during program execution will be described with reference to FIG.

計測対象のプログラムを図4に記載のプログラムとする。
図4のプログラムは、「0x1010」の「LDR R13,R2,0x0000」を例にとると、レジスタR2に記憶されているメモリアドレスに「0x0000」を加算して得られるメモリアドレスに格納されているデータをレジスタR2にロードするという内容である。
また、図4では、計測事象は、データキャッシュミスであり、割り込み発生間隔は2である。
The program to be measured is the program shown in FIG.
The program shown in FIG. 4 is stored at a memory address obtained by adding “0x0000” to the memory address stored in the register R2 when “LDR R13, R2, 0x0000” of “0x1010” is taken as an example. The content is that data is loaded into the register R2.
In FIG. 4, the measurement event is a data cache miss, and the interrupt generation interval is 2.

0x1010番地のロード命令(メモリ内容をレジスタにコピーする命令)は、データキャッシュにヒットする。
0x1020番地のロード命令は、データキャッシュミスが発生し、これによりPM割り込み信号45が出力される。
PM割り込みにより起動されるPM割込みハンドラ400は、プロセッサ状態情報として、PCとレジスタ内容(R0〜R15の全てのレジスタの内容)をキャッシュミス履歴記録部500に格納する。
0x1030番地のロード命令は、データキャッシュミスが発生するが、割り込み間隔が2となっており、0x1020番地のロード命令で割り込みが発生したため、0x1030番地のロード命令によるデータキャッシュミスではPM割り込み信号45は出力されない。
0x1040番地のロード命令は、データキャッシュミスが発生し、これによりPM割り込み信号45が出力される。
PM割り込みにより起動されるPM割込みハンドラ400は、プロセッサ状態情報として、PCとレジスタ内容(R0〜R15の全てのレジスタの内容)をキャッシュミス履歴記録部500に格納する。
The load instruction at address 0x1010 (instruction to copy the memory contents to the register) hits the data cache.
In the load instruction at address 0x1020, a data cache miss occurs, and as a result, a PM interrupt signal 45 is output.
The PM interrupt handler 400 activated by the PM interrupt stores the PC and register contents (contents of all registers R0 to R15) in the cache miss history recording unit 500 as processor state information.
The load instruction at address 0x1030 causes a data cache miss, but the interrupt interval is 2, and an interrupt is generated at the load instruction at address 0x1020. Therefore, in the data cache miss due to the load instruction at address 0x1030, the PM interrupt signal 45 is Not output.
A data cache miss occurs in the load instruction at address 0x1040, and as a result, a PM interrupt signal 45 is output.
The PM interrupt handler 400 activated by the PM interrupt stores the PC and register contents (contents of all registers R0 to R15) in the cache miss history recording unit 500 as processor state information.

キャッシュミス履歴記録部500に記録された情報と、実行したプログラムから、データキャッシュミスしたアドレスの再現について、図5を用いて説明する。   With reference to FIG. 5, a description will be given of the reproduction of an address where a data cache miss has occurred from the information recorded in the cache miss history recording unit 500 and the executed program.

アドレス特定部600は、キャッシュミス履歴記録部500に記録されたPCの値と実行したプログラム800から、命令の特定を行う。
図5の例では、PC=0x1020であることから、アドレス特定部600は、データキャッシュミスした命令を、
LDR R15,R1,0x1000
と特定する。
このとき、データキャッシュを参照したメモリアドレスは、R1+0x1000から生成されていることから、アドレス特定部600は、R1の内容(0x00010000)と0x1000を加算した0x00011000がデータキャッシュミスを起こしたアドレスであると特定する。
The address specifying unit 600 specifies an instruction from the PC value recorded in the cache miss history recording unit 500 and the executed program 800.
In the example of FIG. 5, since PC = 0x1020, the address specifying unit 600 determines the instruction having a data cache miss as
LDR R15, R1, 0x1000
Is specified.
At this time, since the memory address referring to the data cache is generated from R1 + 0x1000, the address specifying unit 600 determines that 0x00011000 obtained by adding the contents of R1 (0x00010000) and 0x1000 is the address where the data cache miss occurred. Identify.

次に、キャッシュミス履歴記録部500に記録されているレコードは、PC=0x1040であることから、アドレス特定部600は、データキャッシュミスした命令を、
LDR R14,R15,0x2000
と特定する。
このとき、データキャッシュを参照したアドレスは、R15+0x2000から生成されていることから、アドレス特定部600は、R15の内容(0x00002000)と0x2000を加算した0x00004000がデータキャッシュミスを起こしたアドレスであると特定する。
メモリ参照するアドレスの生成方法は、プロセッサアーキテクチャごとに定義されているので、その定義にしたがい、データキャッシュミスしたアドレスを生成する。
Next, since the record recorded in the cache miss history recording unit 500 is PC = 0x1040, the address specifying unit 600 determines the instruction that caused the data cache miss as follows:
LDR R14, R15, 0x2000
Is specified.
At this time, since the address referring to the data cache is generated from R15 + 0x2000, the address specifying unit 600 specifies that 0x00004000 obtained by adding the contents of R15 (0x00002000) and 0x2000 is the address that caused the data cache miss. To do.
A method for generating an address for referring to a memory is defined for each processor architecture, and according to the definition, an address in which a data cache miss is generated is generated.

以上のように、プログラム実行時にキャッシュミスなどの計測対象の事象と割り込み間隔を設定するようにし、PM割り込み発生時にアドレス生成に使用されたレジスタとPCを記録するようにしているので、実行したプログラムと記録情報からキャッシュミスが発生したアドレスを生成することができる。   As described above, an event to be measured such as a cache miss and an interrupt interval are set at the time of program execution, and a register and a PC used for address generation are recorded when a PM interrupt occurs. And the address where the cache miss occurred can be generated from the recorded information.

10 プロセッサコア部、11 命令取り出し要求、12 命令アドレス他の情報、13 命令コード、14 オペランドアクセス要求、15 オペランドアドレス他の情報、16 オペランドデータ、20 命令キャッシュ、21 命令取り出し要求、22 命令アドレス他の情報、23 命令コード、30 データキャッシュ、34 オペランドアクセス要求、35 オペランドアドレス他の情報、36 オペランドデータ、40 PM機構、41 回数計測部、42 割り込み間隔、43 比較器、44 セレクタ、100 プロセッサ、200 上位キャッシュまたはメモリコントローラ、300 PM機構制御部、400 PM割込みハンドラ、500 キャッシュミス履歴記録部、600 アドレス特定部、700 プロセッサ管理装置、800 プログラム。   10 processor core, 11 instruction fetch request, 12 instruction address and other information, 13 instruction code, 14 operand access request, 15 operand address and other information, 16 operand data, 20 instruction cache, 21 instruction fetch request, 22 instruction address and others Information, 23 instruction code, 30 data cache, 34 operand access request, 35 operand address and other information, 36 operand data, 40 PM mechanism, 41 count unit, 42 interrupt interval, 43 comparator, 44 selector, 100 processor, 200 upper cache or memory controller, 300 PM mechanism control unit, 400 PM interrupt handler, 500 cache miss history recording unit, 600 address specifying unit, 700 processor management device, 800 Program.

Claims (6)

プロセッサに組み込まれたパフォーマンスモニター機構が前記プロセッサによるプログラムの実行中に特定の事象が発生したことを検出した場合に、前記パフォーマンスモニター機構からの割込みにより起動され、前記特定の事象の発生の際の前記プロセッサの状態を示すプロセッサ状態情報を受信する割込みハンドラと、
前記プログラムと前記プロセッサ状態情報とを用いて、前記特定の事象を発生させたメモリアドレスを特定するアドレス特定部とを有することを特徴とするプロセッサ管理装置。
When the performance monitor mechanism incorporated in the processor detects that a specific event has occurred during the execution of the program by the processor, it is activated by an interrupt from the performance monitor mechanism, and when the specific event occurs An interrupt handler for receiving processor state information indicating the state of the processor;
A processor management apparatus, comprising: an address specifying unit that specifies a memory address that causes the specific event using the program and the processor state information.
前記割込みハンドラは、
前記パフォーマンスモニター機構が前記プロセッサによるプログラムの実行中に命令キャッシュミスが発生したことを検出した場合に、前記プロセッサ状態情報として、前記命令キャッシュミスの発生の際のプログラムカウンタの値を受信し、
前記アドレス特定部は、
前記プログラムと前記プログラムカウンタの値とを用いて、前記命令キャッシュミスを発生させたメモリアドレスを特定することを特徴とする請求項1に記載のプロセッサ管理装置。
The interrupt handler is
When the performance monitor mechanism detects that an instruction cache miss has occurred during execution of a program by the processor, the processor status information receives a value of a program counter at the time of occurrence of the instruction cache miss,
The address specifying unit includes:
The processor management apparatus according to claim 1, wherein a memory address at which the instruction cache miss has occurred is specified using the program and the value of the program counter.
前記割込みハンドラは、
前記パフォーマンスモニター機構が前記プロセッサによるプログラムの実行中にデータキャッシュミスが発生したことを検出した場合に、前記プロセッサ状態情報として、前記データキャッシュミスの発生の際のプログラムカウンタの値と、前記プログラムの実行に用いられたレジスタに格納されていたメモリアドレスを受信し、
前記アドレス特定部は、
前記プログラムと前記プログラムカウンタの値と前記レジスタに格納されていたメモリアドレスとを用いて、前記データキャッシュミスを発生させたメモリアドレスを特定することを特徴とする請求項1に記載のプロセッサ管理装置。
The interrupt handler is
When the performance monitor mechanism detects that a data cache miss has occurred during execution of a program by the processor, the processor status information includes a value of a program counter when the data cache miss occurs, Receives the memory address stored in the register used for execution,
The address specifying unit
2. The processor management apparatus according to claim 1, wherein the memory address causing the data cache miss is specified using the program, the value of the program counter, and the memory address stored in the register. .
前記プロセッサ管理装置は、更に、
割込みの発生頻度を前記パフォーマンスモニター機構に設定するパフォーマンスモニター機構制御部を有することを特徴とする請求項1に記載のプロセッサ管理装置。
The processor management device further includes:
The processor management apparatus according to claim 1, further comprising a performance monitor mechanism control unit configured to set an interrupt generation frequency in the performance monitor mechanism.
前記パフォーマンスモニター機構制御部は、
前記プロセッサで行われる周期処理のマージンの時間と、前記割込みハンドラの実行時間とに基づき算出された割込みの頻度を、前記パフォーマンスモニター機構に設定することを特徴とする請求項4に記載のプロセッサ管理装置。
The performance monitor mechanism controller is
5. The processor management according to claim 4, wherein a frequency of an interrupt calculated based on a margin time of periodic processing performed by the processor and an execution time of the interrupt handler is set in the performance monitor mechanism. apparatus.
前記パフォーマンスモニター機構制御部は、
前記プロセッサで行われる周期処理での前記特定の事象の発生頻度に基づき算出された割込みの頻度を、前記パフォーマンスモニター機構に設定することを特徴とする請求項4に記載のプロセッサ管理装置。
The performance monitor mechanism controller is
5. The processor management apparatus according to claim 4, wherein an interrupt frequency calculated based on an occurrence frequency of the specific event in the periodic processing performed by the processor is set in the performance monitor mechanism.
JP2014035591A 2014-02-26 2014-02-26 Processor management apparatus Pending JP2015162003A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014035591A JP2015162003A (en) 2014-02-26 2014-02-26 Processor management apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014035591A JP2015162003A (en) 2014-02-26 2014-02-26 Processor management apparatus

Publications (1)

Publication Number Publication Date
JP2015162003A true JP2015162003A (en) 2015-09-07

Family

ID=54185073

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014035591A Pending JP2015162003A (en) 2014-02-26 2014-02-26 Processor management apparatus

Country Status (1)

Country Link
JP (1) JP2015162003A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009043061A (en) * 2007-08-09 2009-02-26 Oki Electric Ind Co Ltd Debugging device and debugging method
JP2010152458A (en) * 2008-12-24 2010-07-08 Fujitsu Ltd Performance measurement program, performance measurement method, and information processor having performance measurement function

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009043061A (en) * 2007-08-09 2009-02-26 Oki Electric Ind Co Ltd Debugging device and debugging method
JP2010152458A (en) * 2008-12-24 2010-07-08 Fujitsu Ltd Performance measurement program, performance measurement method, and information processor having performance measurement function

Similar Documents

Publication Publication Date Title
US8286032B2 (en) Trace messaging device and methods thereof
US9021172B2 (en) Data processing apparatus and method and method for generating performance monitoring interrupt signal based on first event counter and second event counter
JP6143886B2 (en) Method and apparatus for canceling loop data prefetch request
US10140216B2 (en) Measuring address translation latency
US9081629B2 (en) Excluding counts on software threads in a state
TWI461908B (en) Optional logging of debug activities in a real time instruction tracing log
US9665461B2 (en) Obtaining application performance data for different performance events via a unified channel
US9135082B1 (en) Techniques and systems for data race detection
JP2006309760A (en) Monitoring logic and monitoring method for detecting abnormal operation of data processor
US8286192B2 (en) Kernel subsystem for handling performance counters and events
JP2015515652A (en) Computer program product, method, and system for monitoring processor characteristics information of a processor using runtime instrumentation (runtime instrumentation monitoring of processor characteristics)
Akiyama et al. Quantitative evaluation of intel pebs overhead for online system-noise analysis
US20080104371A1 (en) Method and system using hardware assistance for continuance of trap mode during or after interruption sequences
US20160378636A1 (en) Software-Initiated Trace Integrated with Hardware Trace
JP2017167930A (en) Information processing device, power measurement method and power measurement program
US20080141002A1 (en) Instruction pipeline monitoring device and method thereof
KR20200088760A (en) Checksum generation
US8271711B2 (en) Program status detecting apparatus and method
US9619361B2 (en) Performance profiling apparatus and performance profiling method
JP2015501046A5 (en)
Zheng et al. CBA-detector: An accurate detector against cache-based attacks using HPCs and pintools
JP2005215816A (en) Performance profiling method using hardware monitor
JP2015162003A (en) Processor management apparatus
US9547484B1 (en) Automated compiler operation verification
US11693588B2 (en) Precise longitudinal monitoring of memory operations

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170822

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20180703