JP5353227B2 - Information processing apparatus having performance measurement program, performance measurement method, and performance measurement function. - Google Patents

Information processing apparatus having performance measurement program, performance measurement method, and performance measurement function. Download PDF

Info

Publication number
JP5353227B2
JP5353227B2 JP2008327211A JP2008327211A JP5353227B2 JP 5353227 B2 JP5353227 B2 JP 5353227B2 JP 2008327211 A JP2008327211 A JP 2008327211A JP 2008327211 A JP2008327211 A JP 2008327211A JP 5353227 B2 JP5353227 B2 JP 5353227B2
Authority
JP
Japan
Prior art keywords
virtual machine
performance
performance monitoring
interrupt
time
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.)
Expired - Fee Related
Application number
JP2008327211A
Other languages
Japanese (ja)
Other versions
JP2010152458A (en
Inventor
聡 平井
耕一 久門
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 JP2008327211A priority Critical patent/JP5353227B2/en
Publication of JP2010152458A publication Critical patent/JP2010152458A/en
Application granted granted Critical
Publication of JP5353227B2 publication Critical patent/JP5353227B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は、仮想計算機システムの性能を測定する技術に関する。   The present invention relates to a technique for measuring the performance of a virtual machine system.

近年、ハードウェアの高性能化とハイパーバイザ(Hypervisor)の開発により、マイクロプロセッサを用いたパーソナルコンピュータやサーバの分野でも仮想計算機システムが広く用いられるようになってきた。仮想計算機システムは、単一の物理マシン上で複数の同一または異なるOSを同時に稼動させることにより、仮想的に異なる複数の計算機環境が提供されるシステムである。   In recent years, virtual computer systems have come to be widely used in the field of personal computers and servers using microprocessors due to higher performance of hardware and the development of hypervisors. The virtual computer system is a system in which a plurality of virtually different computer environments are provided by simultaneously operating a plurality of identical or different OSs on a single physical machine.

図8は、仮想計算機システムの構成例を示すシステム構成図である。仮想計算機システム101は、CPU111、メモリ112、I/Oデバイス113を備えるハードウェア層110と、ハードウェア層110の制御と各仮想マシン間の調整を行うハイパーバイザ層120と、ハイパーバイザ層120の上で動作する仮想マシン層130とを備えるのが一般的である。   FIG. 8 is a system configuration diagram illustrating a configuration example of a virtual machine system. The virtual computer system 101 includes a hardware layer 110 including a CPU 111, a memory 112, and an I / O device 113, a hypervisor layer 120 that controls the hardware layer 110 and adjusts between each virtual machine, and a hypervisor layer 120. It is common to include a virtual machine layer 130 operating on the above.

仮想計算機システム101は、複数の仮想マシン131,132,133がハードウェア資源を共有するシステムである。ハイパーバイザ121は、複数の仮想マシン131,132,133のゲストOSを制御する仮想化ソフトウェアである。   The virtual machine system 101 is a system in which a plurality of virtual machines 131, 132, 133 share hardware resources. The hypervisor 121 is virtualization software that controls the guest OS of the plurality of virtual machines 131, 132, and 133.

仮想マシン層130を構成する各仮想マシン131,132,133は、それぞれゲストOS141,142,143とアプリケーションを備える。各仮想マシンに対応するゲストOSは、同じOSに限らず、バージョンが異なる同種のOSであってもよいし、例えばLinux とWindows(登録商標)というように異なる種類のOSであってもよい。   Each virtual machine 131, 132, 133 constituting the virtual machine layer 130 includes a guest OS 141, 142, 143 and an application, respectively. The guest OS corresponding to each virtual machine is not limited to the same OS, but may be the same type of OS with different versions, or may be a different type of OS such as Linux and Windows (registered trademark).

またコンピュータシステムの性能分析、最適化のために、性能モニタリング機構を備えたCPUが市販されている。例えば、 Intel社のXeon(登録商標)プロセッサや AMD社のOpteron(登録商標)プロセッサ、或いは IBM社のPowerPC(登録商標)プロセッサなどは、実行クロック数、実行命令数、キャッシュミス数などのプロセッサ内部のイベント及び外部とのやり取りのイベントを計測する機能を有する。   CPUs with a performance monitoring mechanism are commercially available for performance analysis and optimization of computer systems. For example, Intel Xeon (registered trademark) processor, AMD Opteron (registered trademark) processor, or IBM PowerPC (registered trademark) processor, etc., the number of execution clocks, number of executed instructions, number of cache misses, etc. And a function for measuring an event of exchange with the outside.

性能モニタリング機構を備えるCPUは、複数本のカウンタと、多種のイベントの中からそれぞれのカウンタが計測するイベントを選択して設定する設定レジスタを有する。また、性能モニタリング機構を備えたCPUは、指定したイベントを検知した際に、特定のベクタ或いは指定したベクタに割り込みを発生させる機能を有し、イベント発生時の付随情報を採取することを可能としている。   A CPU having a performance monitoring mechanism has a plurality of counters and a setting register for selecting and setting an event measured by each counter from various events. In addition, a CPU equipped with a performance monitoring mechanism has a function to generate an interrupt to a specific vector or a specified vector when a specified event is detected, and it is possible to collect accompanying information when the event occurs. Yes.

性能モニタリング機構を使用した一般的な性能分析手法は、モニタリングの対象となるプログラムの開始時と終了時にカウンタ値を読み出して、カウンタ値の差分により、対象プログラム実行中のイベント数を求める手法である。   A general performance analysis method using a performance monitoring mechanism is a method of reading the counter value at the start and end of the program to be monitored and obtaining the number of events during execution of the target program from the difference in the counter value. .

次に図9を参照して、仮想計算機システムの仮想マシン毎に性能測定を行うことを考える。仮想計算機システムにおいて、仮想マシンに割り当てられた一定時間の実行権が終了したとき、或いは処理の中断/放棄により、今まで実行していた仮想マシンから別の実行可能状態にある仮想マシンへ実行権を移す切替制御をハイパーバイザが行っている。従って、仮想マシンAにおける測定対象プログラムの実行開始と実行終了との間には、異なる仮想マシンBの実行時間が含まれる。   Next, with reference to FIG. 9, consider performing performance measurement for each virtual machine in the virtual machine system. In a virtual machine system, when an execution right assigned to a virtual machine ends for a certain period of time or when the process is suspended or abandoned, the execution right is changed from a virtual machine that has been executed until now to another virtual machine that is in an executable state. The hypervisor performs switching control to move Accordingly, the execution time of a different virtual machine B is included between the start and end of execution of the measurement target program in the virtual machine A.

このため、仮想マシンAとして実行されたプログラムの開始時と終了時に性能モニタリングカウンタの値を読み出して、その差によりイベント数を求めたとしても、この値の中には、同一CPUで実行された他の仮想マシンBによるイベント数が含まれている。これは、マイクロプロセッサが内蔵する性能モニタ機構が複数の仮想マシン間で共有されることと、ハイパーバイザが各仮想マシンの実行を切替える際の契機を仮想マシン側では認識する手段が無いことによる。   For this reason, even if the value of the performance monitoring counter is read at the start and end of the program executed as the virtual machine A, and the number of events is obtained from the difference, the value is executed by the same CPU. The number of events by another virtual machine B is included. This is because the performance monitoring mechanism built in the microprocessor is shared among a plurality of virtual machines, and there is no means for the virtual machine to recognize when the hypervisor switches execution of each virtual machine.

このような性能モニタ機構を備えたマイクロプロセッサを用いた仮想計算機システムにおいて、各仮想マシン毎の性能測定を行おうとすれば、ハイパーバイザを修正して、性能モニタリング機構の制御と性能情報収集機能を追加する必要がある。   In a virtual machine system using a microprocessor equipped with such a performance monitoring mechanism, if you want to measure the performance of each virtual machine, modify the hypervisor to control the performance monitoring mechanism and collect performance information. Need to add.

しかしながら、VMware社のVMware InfrastructureやMicrosoft社のHyper-Vといった仮想化製品を使用する場合、ソースコードが提供されていないためにハイパーバイザに手を加えることは現実的に不可能である。   However, when using virtualization products such as VMware's VMware Infrastructure and Microsoft's Hyper-V, it is practically impossible to modify the hypervisor because the source code is not provided.

さらに、仮想計算機システムの性能測定に関する従来技術としては、CPUハードウェアに仮想計算機サポート用の機構を付加して性能情報を効率よく採取する技術が知られている。この技術によれば、性能指標を計数する複数のカウンタと、動作中の仮想マシンを識別する手段と、動作中の仮想マシンに対応したカウンタ毎に計数動作の可否を切り替える切り替え手段を備える。そして仮想計算機システムの動作中に、計数が許可されたカウンタのみが性能指標を計数し、許可されていないカウンタは計数結果を保持することができるので、仮想計算機毎の性能指標の計数値が得られる。
VMware Infrastructure(平成20年7月31日検索、URL1:http://www.vmware.com/jp/products/vi) Hyper-V:Windows Server2008の主要機能(平成20年7月31日検索、URL2:http://www.microsoft.com/japan/windowsserver2008/virtualization/default.mspx) 特開2008−129931号公報 特公平8−33851号公報
Further, as a conventional technique related to performance measurement of a virtual machine system, a technique for efficiently collecting performance information by adding a mechanism for supporting a virtual machine to CPU hardware is known. According to this technique, a plurality of counters for counting performance indexes, a means for identifying an operating virtual machine, and a switching means for switching whether or not the counting operation is allowed for each counter corresponding to the operating virtual machine are provided. During the operation of the virtual machine system, only the counters that are allowed to count can count the performance index, and the counters that are not allowed can hold the count results, so that the count value of the performance index for each virtual machine is obtained. It is done.
VMware Infrastructure (searched July 31, 2008, URL1: http://www.vmware.com/jp/products/vi) Hyper-V: Major functions of Windows Server2008 (searched July 31, 2008, URL2: http://www.microsoft.com/japan/windowsserver2008/virtualization/default.mspx) JP 2008-129931 A Japanese Patent Publication No. 8-33851

しかしながら、特許文献1、2に記載の技術は、専用ハードウェアによりプロセッサ内部で仮想マシンの切替を検知して、複数のカウンタを切り替えている。そのために、既製のマイクロプロセッサを利用した仮想計算機システムにおいて、仮想マシン毎の性能モニタに適用できないという問題点があった。   However, the techniques described in Patent Documents 1 and 2 detect switching of a virtual machine inside a processor by dedicated hardware and switch a plurality of counters. Therefore, in a virtual machine system using an off-the-shelf microprocessor, there is a problem that it cannot be applied to a performance monitor for each virtual machine.

以上の問題点に鑑み、本発明の目的は、CPUを含むハードウェア及びハイパーバイザを変更することなく、性能モニタリング機構を備えた既製のマイクロプロセッサを用いた仮想計算機システムにおいて、仮想マシン上で実行されるプログラムの高精度な動作情報を効率よく採取することができる技術を提供することである。   In view of the above problems, the object of the present invention is to execute on a virtual machine in a virtual computer system using an off-the-shelf microprocessor equipped with a performance monitoring mechanism without changing the hardware including the CPU and the hypervisor. It is to provide a technique capable of efficiently collecting highly accurate operation information of a program to be executed.

開示する技術は、性能モニタリングカウンタを有する性能モニタリング機構を備えたCPUとメモリとからなる物理マシン上で動作する仮想計算機の性能を測定する性能測定機能を有する情報処理装置であって、計数すべきイベントを選択して前記性能モニタリングカウンタに指定されたイベントを計数する手段と、前記仮想マシンの切替え時に前記性能モニタリング機構で性能モニタリングのための前記割り込みを切替え先の仮想マシンに発生する手段と、前記割り込みが発生した前記仮想マシンの割込ハンドラが前記性能モニタリングカウンタの値と前記性能モニタリングカウンタを読み出した時点の時刻情報メモリへ記録する手段と、を備える。 The disclosed technology is an information processing apparatus having a performance measurement function for measuring the performance of a virtual machine operating on a physical machine including a CPU and a memory having a performance monitoring mechanism having a performance monitoring counter, and should be counted. means for counting the selected events specified in the performance monitoring counter events, means for generating said interrupt switching destination virtual machine for performance monitoring in front Symbol performance monitoring mechanism when switching of the virtual machine When, and means for recording the time information of the time the interrupt handler of the virtual machines before Symbol interrupt has occurred read the performance monitoring counter value of the performance monitoring counter to memory.

開示する技術によれば、仮想マシンの切替を検知する専用ハードウェアを用いることなく、性能モニタリングカウンタを備えた既製のマイクロプロセッサを用いた仮想計算機システムにおいて、仮想マシン上で実行されるプログラムの高精度な動作情報を効率よく採取・分析することができる。   According to the disclosed technology, in a virtual computer system using an off-the-shelf microprocessor equipped with a performance monitoring counter without using dedicated hardware for detecting the switching of the virtual machine, the program executed on the virtual machine is high. Accurate operation information can be collected and analyzed efficiently.

次に図面を参照して、本発明の実施の形態を詳細に説明する。図1は、性能測定プログラムが動作する、本発明の実施形態に係る仮想計算機システムのシステム構成図である。   Next, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a system configuration diagram of a virtual computer system according to an embodiment of the present invention in which a performance measurement program operates.

図1において、仮想計算機システム1は、ハードウェア層11と、ハイパーバイザ層12と、仮想マシン層13とを備える。ハードウェア層11は、性能モニタリング機構111aを備えたCPU111と、メモリ112と、I/Oデバイス113とを備える。   In FIG. 1, the virtual machine system 1 includes a hardware layer 11, a hypervisor layer 12, and a virtual machine layer 13. The hardware layer 11 includes a CPU 111 having a performance monitoring mechanism 111a, a memory 112, and an I / O device 113.

CPU111は、市販のマイクロプロセッサであり、例えば、 Intel社のXeon(登録商標)プロセッサや AMD社のOpteron(登録商標)プロセッサ、或いは IBM社のPowerPC(登録商標)プロセッサなどの性能モニタリング機構111aを内蔵するプロセッサである。   The CPU 111 is a commercially available microprocessor, and includes a performance monitoring mechanism 111a such as an Intel Xeon (registered trademark) processor, an AMD Opteron (registered trademark) processor, or an IBM PowerPC (registered trademark) processor. Processor.

性能モニタリング機構111aは、指定されたイベントを計数するカウンタと、該カウンタ毎に配置され多種のイベントの中から該カウンタが計測するイベントを選択して設定する設定レジスタとの対を複数有する。さらに設定レジスタには、設定されたイベントが何回発生したら割込を発生させるかを指定する割込頻度設定部と、この割込を発生させる(オン)か発生させないか(オフ)を指定する割込オン/オフ設定部が設けられている。   The performance monitoring mechanism 111a has a plurality of pairs of a counter that counts a designated event and a setting register that is arranged for each counter and selects and sets an event measured by the counter from various events. In addition, the setting register specifies the interrupt frequency setting section that specifies how many times a set event occurs, and whether to generate this interrupt (ON) or not (OFF). An interrupt on / off setting unit is provided.

これにより、性能モニタリング機構111aを備えたCPU111は、指定したイベントを検知した際に、特定のベクタ或いは指定したベクタに割り込みを発生させる機能を実現し、イベント発生時の付随情報を採取することを可能としている。   As a result, the CPU 111 having the performance monitoring mechanism 111a realizes a function of generating an interrupt to a specific vector or a specified vector when a specified event is detected, and collects accompanying information at the time of the event occurrence. It is possible.

ハイパーバイザ層12は、仮想化ソフトウェアであるハイパーバイザ121を備える。ハイパーバイザ121は、ハードウエア層11上で動作してハードウェア層11を制御するとともに、仮想マシン層13の各ゲストOS31〜33を制御する仮想化ソフトウェアである。ハイパーバイザ121は、ハードウェア層のCPU111の実行権を後述する各仮想マシンに割り当てるスケジューリング機能、及びメモリ112のマシンアドレス空間を各仮想マシンに割り当てるメモリ管理機能を有する。   The hypervisor layer 12 includes a hypervisor 121 that is virtualization software. The hypervisor 121 is virtualization software that operates on the hardware layer 11 to control the hardware layer 11 and controls the guest OSes 31 to 33 of the virtual machine layer 13. The hypervisor 121 has a scheduling function that assigns the execution right of the CPU 111 in the hardware layer to each virtual machine, which will be described later, and a memory management function that assigns the machine address space of the memory 112 to each virtual machine.

さらにハイパーバイザ121は、性能モニタリング機構111aが発生するハードウェア割り込みである性能モニタリング機構割り込みに基づいて、後述する実行中の仮想マシンに対してソフトウェア割り込みである性能モニタリング割り込みを行う機能を有する。   Furthermore, the hypervisor 121 has a function of performing a performance monitoring interrupt that is a software interrupt to a virtual machine that is being executed, which will be described later, based on a performance monitoring mechanism interrupt that is a hardware interrupt generated by the performance monitoring mechanism 111a.

仮想マシン層13は、仮想マシン21,22,23を備える。仮想マシンの数は、ハードウエア層11の能力と、場合によってはハイパーバイザ層21に依存し、図1の様に3つに限定されることはない。   The virtual machine layer 13 includes virtual machines 21, 22 and 23. The number of virtual machines depends on the capabilities of the hardware layer 11 and, in some cases, the hypervisor layer 21, and is not limited to three as shown in FIG.

仮想マシン21,22,23は、それぞれ対応するゲストOS31,32,33を備える。そして、ハイパーバイザ121は、ゲストOS31,32,33のうちからいずれか一つを選択して、選択したゲストOSに所定時間分のCPU111の実行権を割り当てる。ここで、選択されたゲストOSをゲストOS32とすると、CPU111の実行権を割り当てられたゲストOS32は、ハイパーバイザ121から割り当てられたメモリ112を使用して、ゲストOS32自身及びその配下の図示しないアプリケーションを実行する。ゲストOS32に実行権が割り当てられた所定時間が経過するか、或いは、入出力待ち、例外発生等により実行継続が不可能となった場合、ハイパーバイザ121は、ゲストOS32からCPU111の実行権を取り上げ、別のゲストOSを選択して、これにCPU111の実行権を割り当てることにより、仮想マシンの切り替えを行う。   The virtual machines 21, 22, and 23 are provided with corresponding guest OSes 31, 32, and 33, respectively. The hypervisor 121 selects one of the guest OSs 31, 32, and 33, and assigns the execution right of the CPU 111 for a predetermined time to the selected guest OS. Here, assuming that the selected guest OS is the guest OS 32, the guest OS 32 to which the execution right of the CPU 111 is assigned uses the memory 112 assigned by the hypervisor 121, and the guest OS 32 itself and an application (not shown) under the guest OS 32 itself. Execute. The hypervisor 121 picks up the execution right of the CPU 111 from the guest OS 32 when the predetermined time when the execution right is assigned to the guest OS 32 elapses or when the execution cannot be continued due to waiting for input / output or occurrence of an exception. The virtual machine is switched by selecting another guest OS and assigning the execution right of the CPU 111 thereto.

また、ゲストOS31,32,33は、性能モニタリング機構111aからハイパーバイザ121を介したソフトウェア割り込みである性能モニタリング割込みを処理する割込ハンドラ31a,32a,33aをそれぞれ備える。   The guest OSs 31, 32, and 33 include interrupt handlers 31a, 32a, and 33a that process performance monitoring interrupts that are software interrupts from the performance monitoring mechanism 111a via the hypervisor 121, respectively.

これらの割込ハンドラ31a,32a,33aの作用は、以下の通りである。まずS101において、実行中の仮想マシンに割り当てられた一定時間の実行権が終了したとき、或いは実行中の仮想マシンが処理の中断/放棄を行ったときに、ハイパーバイザ121が、仮想マシンの切替制御を行う。次いでS102で、性能モニタリング機構111aが仮想マシン切替時に起きるイベントを検出して、ハイパーバイザ121にハードウェア割込である性能モニタリング機構割り込みを発生させる。次いでS103において、ハイパーバイザ121が切り替え対象の仮想マシン21のゲストOS31の割込ハンドラ31aへソフトウェア割り込みである性能モニタリング割り込みを起こすことにより、ゲストOS31が仮想マシン切替を検知する。割り込みハンドラ31aは、性能モニタリング機構111aに格納されている性能モニタリングカウンタ値を読み出してメモリ112へ記録するとともに、性能モニタリングカウンタ値を読み出した時点のクロックレベルの時刻情報も併せてメモリ112に記録する。   The operation of these interrupt handlers 31a, 32a, 33a is as follows. First, in S101, when the execution right for a certain period of time assigned to the running virtual machine is completed, or when the running virtual machine interrupts / discards the process, the hypervisor 121 switches the virtual machine. Take control. In step S102, the performance monitoring mechanism 111a detects an event that occurs when the virtual machine is switched, and causes the hypervisor 121 to generate a performance monitoring mechanism interrupt that is a hardware interrupt. Next, in S103, the hypervisor 121 raises a performance monitoring interrupt, which is a software interrupt, to the interrupt handler 31a of the guest OS 31 of the virtual machine 21 to be switched, so that the guest OS 31 detects virtual machine switching. The interrupt handler 31a reads the performance monitoring counter value stored in the performance monitoring mechanism 111a and records it in the memory 112, and also records in the memory 112 the time information of the clock level at the time when the performance monitoring counter value is read. .

この性能モニタリング機構111aによる割り込みと、各ゲストOS31、32、33が備える割り込みハンドラ31a、32a、33aにより、仮想マシン切替毎に、性能モニタリングカウンタ値と、その値を読み出した時刻情報とがメモリ112に記録される。   The performance monitoring mechanism 111a and the interrupt handlers 31a, 32a, 33a included in the guest OSs 31, 32, 33 provide the memory 112 with the performance monitoring counter value and the time information at which the value is read every time the virtual machine is switched. To be recorded.

次に、図2の仮想マシン切替タームチャートを参照して、仮想マシン切替毎に読み出した性能モニタリングカウンタ値と、その値を読み出した時刻情報とをどのように利用するかを説明する。例えば仮想マシンA上で動作する性能データ採取プログラムが、あるイベントのイベント数を性能モニタリングカウンタ(以下、PMC(Perfomance Monitoring Counter)と略す)で計数することを考える。ここで、仮想マシンAと仮想マシンBが、時分割で実行されるとする。   Next, with reference to the virtual machine switching term chart of FIG. 2, how to use the performance monitoring counter value read for each virtual machine switching and the time information for reading the value will be described. For example, consider that a performance data collection program operating on the virtual machine A counts the number of events of a certain event with a performance monitoring counter (hereinafter abbreviated as PMC (Perfomance Monitoring Counter)). Here, it is assumed that the virtual machine A and the virtual machine B are executed in a time division manner.

性能測定としては、仮想マシンA上で性能データ採取プログラムを実行し、この性能データ採取プログラムの実行開始から実行終了までに発生するあるイベントの発生回数を求めるものとする。   For performance measurement, a performance data collection program is executed on the virtual machine A, and the number of occurrences of an event that occurs from the start to the end of execution of the performance data collection program is obtained.

性能データ採取プログラムの開始時刻taにおけるPMCのイベント計数値をNaとする。次いで時刻tbにおいて仮想マシンAから仮想マシンBへの切替が発生したとする。このとき、仮想マシン切替によりPMCからハイパーバイザへ性能モニタリング機構割り込みが発生し、ハイパーバイザは、切り替えられる仮想マシンBにソフトウェア割り込みである性能モニタリング割込みをかける。仮想マシンBの割り込みハンドラは、時刻tbのPMC値Nbと時刻情報とをメモリへ記録する。   The event count value of PMC at the start time ta of the performance data collection program is Na. Next, it is assumed that switching from the virtual machine A to the virtual machine B occurs at time tb. At this time, a performance monitoring mechanism interrupt is generated from the PMC to the hypervisor by switching the virtual machine, and the hypervisor issues a performance monitoring interrupt that is a software interrupt to the virtual machine B to be switched. The interrupt handler of the virtual machine B records the PMC value Nb and time information at time tb in the memory.

次いで時刻tcにおいて仮想マシンBから仮想マシンAへの切替が発生したとする。このときも同様に仮想マシンAに割込みが発生し、仮想マシンAは、時刻tcのPMC値Ncと時刻情報とをメモリへ記録する。次いで時刻tdにおいて仮想マシンAから仮想マシンBへの切替が発生し、このときのPMC値をNdとする。次いで時刻teにおいて仮想マシンBから仮想マシンAへの切替が発生したとする。このとき仮想マシンAに割込みが発生し、仮想マシンAは、このときのPMC値Neと時刻情報とをメモリへ記録する。最後に時刻tfで性能データ採取プログラムを終了し、このときのPMC値をNfとする。   Next, assume that switching from the virtual machine B to the virtual machine A occurs at time tc. At this time as well, an interruption occurs in the virtual machine A, and the virtual machine A records the PMC value Nc and time information at time tc in the memory. Next, switching from the virtual machine A to the virtual machine B occurs at time td, and the PMC value at this time is set to Nd. Next, it is assumed that switching from the virtual machine B to the virtual machine A occurs at time te. At this time, an interruption occurs in the virtual machine A, and the virtual machine A records the PMC value Ne and the time information at this time in the memory. Finally, the performance data collection program is terminated at time tf, and the PMC value at this time is set to Nf.

以上の性能データ採取プログラムの実行の結果、仮想マシンの切替毎に、PMC値と、PMC値を取得した時刻情報とがメモリへ記録される。従って、仮想マシンAによる性能データ採取プログラム実行中のイベント発生回数は、Nf−Na−((Nc−Nb)+(Ne−Nd))により、仮想マシンBの影響を除去したイベント数の値を算出することができる。   As a result of executing the performance data collection program, the PMC value and the time information at which the PMC value is acquired are recorded in the memory every time the virtual machine is switched. Therefore, the event occurrence count during the execution of the performance data collection program by the virtual machine A is the value of the number of events from which the influence of the virtual machine B is removed by Nf−Na − ((Nc−Nb) + (Ne−Nd)). Can be calculated.

次に、図3乃至図7を参照して、本発明に係る性能測定プログラムの実施例を備えた仮想計算機システムを詳細に説明する。図3は仮想計算機システム1の構成例を示すシステム図上に、性能測定の流れを示した図である。図4は性能モニタリングカウンタの設定例を説明する図である。図5は性能情報採取制御・集計プログラムのフローチャートである。図6は性能データ採取プログラムのフローチャートである。図7はゲストOSのPMC割込ハンドラのフローチャートである。   Next, with reference to FIG. 3 to FIG. 7, a virtual computer system including an embodiment of the performance measurement program according to the present invention will be described in detail. FIG. 3 is a diagram showing a flow of performance measurement on a system diagram showing a configuration example of the virtual machine system 1. FIG. 4 is a diagram for explaining a setting example of the performance monitoring counter. FIG. 5 is a flowchart of the performance information collection control / aggregation program. FIG. 6 is a flowchart of the performance data collection program. FIG. 7 is a flowchart of the guest OS PMC interrupt handler.

図3において、仮想計算機システム1は、CPU111と、メモリ112と、ハイパーバイザ121と、仮想マシン21,22,…,2Nと、制御マシン41とを備える。   3, the virtual machine system 1 includes a CPU 111, a memory 112, a hypervisor 121, virtual machines 21, 22,..., 2N, and a control machine 41.

CPU111は、例えば、 Intel社のXeonプロセッサ、 AMD社のOpteronプロセッサ、或いは IBM社のPowerPCプロセッサ等の性能モニタリング機構111aを内蔵する既製のマイクロプロセッサであり、特許文献1、2のような仮想マシンの性能モニタリングのための特別なハードウェアを備えないものである。   The CPU 111 is an off-the-shelf microprocessor incorporating a performance monitoring mechanism 111a such as an Intel Xeon processor, an AMD Opteron processor, or an IBM PowerPC processor. It does not have special hardware for performance monitoring.

性能モニタリング機構111aは、複数の性能モニタリングカウンタ(PMC)を備えると共に、計測対象のイベント検知時に、PMCからPMC割込を発生させることができるものである。   The performance monitoring mechanism 111a includes a plurality of performance monitoring counters (PMC), and can generate a PMC interrupt from the PMC when an event to be measured is detected.

ハイパーバイザ121は、CPU111やメモリ112などのハードウェアの制御と、各仮想マシン間の調整とを行う制御ソフトウェアである。ハイパーバイザ121には、PMC割込を含むハードウェアからの割込を受け付けて、割込ハンドラに処理を引き渡すための割込テーブル121aが備えられている。割込テーブル121aは、割り込みを識別するベクタと呼ばれる番号毎に、例えば、ハンドラを格納しているセグメントのセグメントアドレス、及びハンドラの最初の命令へのオフセット(セグメント内アドレス)をそれぞれエントリとして保持している。   The hypervisor 121 is control software that performs control of hardware such as the CPU 111 and the memory 112 and adjustment between the virtual machines. The hypervisor 121 is provided with an interrupt table 121a for accepting interrupts from hardware including PMC interrupts and transferring the processing to the interrupt handler. The interrupt table 121a holds, for each number, called a vector for identifying an interrupt, for example, a segment address of a segment storing a handler and an offset (intra-segment address) to the first instruction of the handler as an entry. ing.

また、ハイパーバイザ121は、VMware社のVMware Infrastructure(非特許文献1)やMicrosoft社のHyper-V(非特許文献2)といった仮想化製品であり、仮想マシンの性能モニタのための改変等は行っていないものである。従って、ソースコードが公開されていないハイパーバイザを用いることが可能である。   The hypervisor 121 is a virtualized product such as VMware Infrastructure (Non-patent Document 1) of VMware or Hyper-V (Non-patent Document 2) of Microsoft, and is modified for performance monitoring of virtual machines. It is not. Therefore, it is possible to use a hypervisor whose source code is not disclosed.

仮想マシン21のゲストOS31は、本発明の一実施例に係る性能測定プログラムとして、割込ハンドラ31aと性能データ採取プログラム31bとを備える。割込ハンドラ31aと性能データ採取プログラム31bとは、各仮想マシン21,22,…,2Nに備えられる。割込ハンドラ31aは、ハイパーバイザ121の割込テーブル121aに登録され、性能モニタリング機構111aによる割込を処理する。言い換えれば、PMC割り込みの割り込みベクタに対応した割込テーブル121aのエントリには、動作中の仮想マシンの割り込みハンドラ31aのセグメントとオフセットが格納されている。   The guest OS 31 of the virtual machine 21 includes an interrupt handler 31a and a performance data collection program 31b as performance measurement programs according to an embodiment of the present invention. The interrupt handler 31a and the performance data collection program 31b are provided in each of the virtual machines 21, 22, ..., 2N. The interrupt handler 31a is registered in the interrupt table 121a of the hypervisor 121 and processes interrupts by the performance monitoring mechanism 111a. In other words, the segment and offset of the interrupt handler 31a of the operating virtual machine are stored in the entry of the interrupt table 121a corresponding to the interrupt vector of the PMC interrupt.

性能データ採取プログラム31bは、性能モニタリング機構111aからの割込みを処理する割込ハンドラ31aをハイパーバイザ121の割込テーブル121aに登録する。また、いずれかの仮想マシンの性能データ採取プログラム31bは、性能モニタリング機構111aの各性能モニタリングカウンタに測定するイベントを設定し、各性能モニタリングカウンタから割込を発生させるか否か、及び幾つのカウント数で割込を発生させるかを設定する。   The performance data collection program 31b registers the interrupt handler 31a that processes an interrupt from the performance monitoring mechanism 111a in the interrupt table 121a of the hypervisor 121. Further, the performance data collection program 31b of any virtual machine sets an event to be measured in each performance monitoring counter of the performance monitoring mechanism 111a, whether or not an interrupt is generated from each performance monitoring counter, and how many counts Set whether to generate an interrupt with a number.

制御マシン41は、性能情報採取制御・集計プログラム51を備える。性能情報採取制御・集計プログラム51は、性能データ採取プログラム31bの計測準備を指示したり、性能データ採取プログラム31bから計測値の読出し指示に従って、性能測定の計測値をメモリ112から読み出して集計する。図3において、制御マシン41は、仮想マシン21〜2Nとは独立したコンソールのようなマシンであってもよいし、制御マシン41は、仮想マシン21〜2Nの内の一つであってもよい。   The control machine 41 includes a performance information collection control / aggregation program 51. The performance information collection control / aggregation program 51 instructs the measurement preparation of the performance data collection program 31b or reads out the measurement values of the performance measurement from the memory 112 in accordance with the measurement value read instruction from the performance data collection program 31b. In FIG. 3, the control machine 41 may be a machine such as a console independent of the virtual machines 21 to 2N, or the control machine 41 may be one of the virtual machines 21 to 2N. .

次に、性能測定の流れを説明する。まずS1において、制御マシン41の性能情報採取制御・集計プログラム51は、仮想マシン21上で動作する性能データ採取プログラム31bへ計測準備の指示をする。   Next, the flow of performance measurement will be described. First, in S1, the performance information collection control / aggregation program 51 of the control machine 41 instructs the performance data collection program 31b operating on the virtual machine 21 to prepare for measurement.

次いで、S2において、性能データ採取プログラム31bは、性能情報採取制御・集計プログラム51からの指示に基づき、ハイパーバイザ121の割込テーブル121aに、割込ハンドラ31aのセグメントとオフセットを登録する。   Next, in S2, the performance data collection program 31b registers the segment and offset of the interrupt handler 31a in the interrupt table 121a of the hypervisor 121 based on an instruction from the performance information collection control / aggregation program 51.

次いでS3において、性能測定対象の仮想マシンの性能データ採取プログラム31bは、各PMCにカウントすべきイベントを設定する。   Next, in S3, the performance data collection program 31b of the performance measurement target virtual machine sets an event to be counted in each PMC.

図4は、性能モニタリングカウンタ(PMC)の設定例を説明する図である。イベントを設定するPMCのイベント設定領域には、性能モニタリングカウンタnに示すように、計数を行なうべきイベント種別を設定する部分と、設定されたイベントにより割込みを行わせるか否かを指定する割込みon/offを設定する部分と、イベントが何回発生する毎に割込みを発生させるかを指定する割込み頻度を設定する部分とがある。   FIG. 4 is a diagram illustrating a setting example of the performance monitoring counter (PMC). In the event setting area of the PMC for setting an event, as shown in the performance monitoring counter n, a part for setting an event type to be counted, and an interrupt on that specifies whether or not an interrupt is caused by the set event There is a part for setting / off, and a part for setting an interrupt frequency for designating how many times an event occurs.

図4の例では、性能モニタリングカウンタ0に、測定するイベントとして「TLBフラッシュ」つまりTLBエントリの無効化、割込みのon/offとして「割込みon」、割込み頻度として「1回毎」を設定している。これにより、仮想マシン切替毎に発生するTLB無効化処理により、仮想マシンに割り込むことができ、仮想マシンの割込ハンドラでPMC及び時刻情報を読み出すことができる。また、性能モニタリングカウンタ1には、測定するイベントとして「実行命令数」、割込みのon/offは「割込みoff」に設定している。割込みoffに設定されたPMCは、それが計数するイベントの発生により、割り込みを生じることはない。その他、計測したいイベントの数だけ、それぞれの性能モニタリングカウンタに、イベントの種別と割込みoffを設定する。   In the example of FIG. 4, “TLB flush”, that is, invalidation of TLB entry, “interrupt on” as interrupt on / off, and “every time” as interrupt frequency are set in the performance monitoring counter 0. Yes. Accordingly, the virtual machine can be interrupted by the TLB invalidation process that occurs every time the virtual machine is switched, and the PMC and time information can be read by the interrupt handler of the virtual machine. In the performance monitoring counter 1, “the number of executed instructions” is set as an event to be measured, and on / off of the interrupt is set to “interrupt off”. A PMC set to interrupt off does not generate an interrupt due to the occurrence of an event that it counts. In addition, the event type and the interrupt off are set in each performance monitoring counter for the number of events to be measured.

図3に戻ってS4において、性能データ採取プログラム31bは、PMCにカウントを開始させる。次いでS5において、実行中の仮想マシンが実行権を与えられた一定時間を使い切ったり、実行中の仮想マシンが処理の中断または放棄を行ったことをハイパーバイザが検知すると、ハイパーバイザ121が仮想マシン切替を行う。仮想マシン切替時には、コンテキスト切替を伴うので、TLBエントリの無効化が行われる。このとき、性能モニタリングカウンタ0には、計測するイベントとしてTLBフラッシュ、割込みon、1回毎の割込み、が設定されているので、S6に示すように、TLBエントリの無効化が行なわれることにより、性能モニタリング機構111aからハイパーバイザ121へハードウェア割込が発生する。このハードウェア割込の割込ベクトルは、割込テーブル121のPMC割込エントリを指すように設定されているので、S7に示すように、ハイパーバイザ121によりゲストOS31の割込ハンドラ31aが起動されることになる。   Returning to FIG. 3, in S4, the performance data collection program 31b causes the PMC to start counting. Next, in S5, when the hypervisor detects that the running virtual machine has used up a certain period of time during which execution rights have been given, or the running virtual machine has suspended or abandoned processing, the hypervisor 121 detects that the virtual machine Switch. At the time of virtual machine switching, context switching is involved, so the TLB entry is invalidated. At this time, since the performance monitoring counter 0 is set with TLB flush, interrupt on, and interrupt every time as events to be measured, as shown in S6, the TLB entry is invalidated. A hardware interrupt is generated from the performance monitoring mechanism 111a to the hypervisor 121. Since this hardware interrupt vector is set to point to the PMC interrupt entry in the interrupt table 121, the hypervisor 121 activates the interrupt handler 31a of the guest OS 31 as shown in S7. Will be.

ここで121から割り込まれるゲストOSは、仮想マシン切替により新たに実行権が与えられる仮想マシン21〜2Nのいずれかに対応するゲストOSであり、ここでは仮にゲストOS31とする。   Here, the guest OS interrupted from 121 is a guest OS corresponding to any of the virtual machines 21 to 2N to which execution rights are newly given by virtual machine switching, and is assumed to be a guest OS 31 here.

次いでS8において、ゲストOS31の割込ハンドラ31aが、CPU111の性能モニタリング機構111aから、S3で計数するイベントを設定したPMCの値の読み出しを行う。次いでS9にて、割込ハンドラ31aがS8で読み出したPMC値をメモリ112へ格納する。このとき、S8におけるPMC値読み出し時の時刻情報、或いは、PMC値のメモリへの書き込み時の時刻情報を同様にメモリ112へ格納する。   Next, in S8, the interrupt handler 31a of the guest OS 31 reads from the performance monitoring mechanism 111a of the CPU 111 the PMC value in which the event counted in S3 is set. Next, in S9, the PMC value read in S8 by the interrupt handler 31a is stored in the memory 112. At this time, the time information when the PMC value is read in S8 or the time information when the PMC value is written to the memory is stored in the memory 112 in the same manner.

時刻情報は、CPU111に設けられている時刻情報を計時する専用のタイムスタンプカウンタ(TSC:Time Stamp Counter)や高精細度イベントタイマ(HPET:High Precision Event Timer)から読み出しても良い。また、時刻情報は、PMCの一つに計測するイベントとしてクロックを設定することにより、PMC読み出し時にカウントしたクロック数も含めて読み出すようにしてもよい。以下の説明では、TSCを読み出すことにより、時刻情報を取得するものとする。   The time information may be read from a dedicated time stamp counter (TSC: Time Stamp Counter) or a high definition event timer (HPET: High Precision Event Timer) that measures time information provided in the CPU 111. Further, the time information may be read including the number of clocks counted at the time of PMC reading by setting a clock as an event to be measured in one of the PMCs. In the following description, it is assumed that time information is acquired by reading TSC.

S5からS9は、性能データ採取プログラム31bの実行が終わるまでに、仮想マシン切替が生じれば、その都度繰り返される。   Steps S5 to S9 are repeated each time virtual machine switching occurs before the execution of the performance data collection program 31b is completed.

次いでS10で、性能データ採取プログラム31bが終了すると、性能データ採取プログラム31bから性能情報採取制御・集計プログラム51へ、各割込ハンドラがメモリ112に格納したPMC読み出し値及びTSC値の読み出し指示が行われる。次いで、S11において、この読み出し指示により、性能情報採取制御・集計プログラム51がメモリ112から仮想マシン切替毎に格納されたPMC値とTSC値とを読み出して、各仮想マシンが仮想マシン切替を割り込みにより認識した時刻を抽出する。   Next, in S10, when the performance data collection program 31b ends, the performance data collection program 31b instructs the performance information collection control / aggregation program 51 to read out the PMC read value and TSC value stored in the memory 112 by each interrupt handler. Is called. Next, in S11, in response to this read instruction, the performance information collection control / aggregation program 51 reads the PMC value and TSC value stored for each virtual machine switching from the memory 112, and each virtual machine interrupts virtual machine switching by interruption. Extract the recognized time.

そして性能情報採取制御・集計プログラム51は、計測対象のプログラムの計測開始から計測終了までの期間内にハイパーバイザ121による仮想マシンの切替があったか否かを判定する。仮想マシン切替があった場合には、性能情報採取制御・集計プログラム51は、仮想マシン切替のシーケンスを認識し、図2で示したように、性能データ採取プログラム31bを実行した仮想マシンにおけるイベント数を算出する。   Then, the performance information collection control / aggregation program 51 determines whether or not the virtual machine has been switched by the hypervisor 121 within the period from the measurement start to the measurement end of the measurement target program. If there is a virtual machine switch, the performance information collection control / aggregation program 51 recognizes the virtual machine switch sequence and, as shown in FIG. 2, the number of events in the virtual machine that has executed the performance data collection program 31b. Is calculated.

次に図5を参照して、制御マシンで動作する性能情報採取制御・集計プログラム51による処理を説明する。性能情報採取制御・集計プログラム51に応じて実行される処理は、前処理と後処理からなる。前処理は、図5(a)に示すように、S21で性能データ採取プログラム31bへ計測開始を指定して終了する。これは、図3のS1に相当する。後処理は、図5(b)に示すように、まずS22で、各仮想マシンの割込ハンドラが採取しメモリへ格納したPMC値とTSC値とをTSC値の時系列に従って統合し、性能測定中に仮想マシン切り替えが行われたスケジューリングを識別する。次いでS23で、カウントすべきイベント毎に、性能測定対象プログラムである性能データ採取プログラムが実行されていた時間に対応するPMCカウント数を算出する。   Next, processing performed by the performance information collection control / aggregation program 51 operating on the control machine will be described with reference to FIG. Processing executed in accordance with the performance information collection control / aggregation program 51 includes preprocessing and postprocessing. As shown in FIG. 5A, the pre-processing is ended by designating the performance data collection program 31b to start measurement in S21. This corresponds to S1 in FIG. As shown in FIG. 5B, in the post-processing, first, in S22, the PMC value and the TSC value collected by the interrupt handler of each virtual machine and stored in the memory are integrated according to the time series of the TSC value to measure the performance. Identify the scheduling during which the virtual machine switch occurred. Next, in S23, for each event to be counted, the PMC count corresponding to the time during which the performance data collection program, which is the performance measurement target program, was executed is calculated.

これにより性能データ採取プログラムを仮想マシンで実行した場合の各イベント毎のカウント数を得ることができる。S22とS23とは、図3のS11に相当する。   Thereby, it is possible to obtain the count number for each event when the performance data collection program is executed in the virtual machine. S22 and S23 correspond to S11 in FIG.

次に図6を参照して、各仮想マシン上で動作する性能データ採取プログラム31bによる処理を説明する。性能データ採取プログラム31bに基づく処理は、前処理と後処理からなる。前処理は、図6(a)に示すように、S31でハイパーバイザ121の割込テーブル121aに、ゲストOSの割込ハンドラ31aのセグメントとオフセットを登録する。   Next, processing performed by the performance data collection program 31b operating on each virtual machine will be described with reference to FIG. The processing based on the performance data collection program 31b includes preprocessing and postprocessing. In the preprocessing, as shown in FIG. 6A, the segment and offset of the interrupt handler 31a of the guest OS are registered in the interrupt table 121a of the hypervisor 121 in S31.

次いでS32で、一つのPMCが計数するイベントを設定する。この例では、図4に示した性能モニタリングカウンタ0に、PMCが計数するイベントとして、仮想マシン切替時に必ず発生するTLBフラッシュを設定するものとする。このとき、イベントが設定されたPMCからの割込が発生するように、PMCに割り込みonを設定するとともに、割込頻度として「1」を設定し、イベントが1回発生する毎に割込みを発生させるように設定する。ここで、仮想マシン切替時に必ず発生するイベントとしては、TLBフラッシュに限らず、ハイパーバイザモードからゲストOSモードへの遷移命令等、仮想マシン切替時にハイパーバイザが1回だけ実行する命令の検出をイベントとして設定してもよい。さらに、仮想マシン制御テーブルの切替や、I/Oマッピングテーブルの切替などの仮想マシン切替時に発生する事象をイベントとして設定してもよい。次いでS33で、他のPMCに測定したいイベント、例えば、実行クロック数、実行命令数、L1,L2,L3の各レベルにおけるキャッシュミス数、分岐成功(分岐GO)数、分岐失敗(分岐NO GO )数、分岐予測成功数、分岐予測失敗数等、メモリ読み込み数、メモリ書き込み数、等を設定する。そして、S34でPMCのカウントを開始させ、性能データ採取プログラム31bの前処理を終了する。   Next, in S32, an event counted by one PMC is set. In this example, it is assumed that a TLB flush that always occurs at the time of virtual machine switching is set in the performance monitoring counter 0 shown in FIG. 4 as an event counted by the PMC. At this time, an interrupt on is set in the PMC so that an interrupt from the PMC in which the event is set is generated, and “1” is set as the interrupt frequency, and an interrupt is generated every time an event occurs. Set to Here, the event that is always generated when the virtual machine is switched is not limited to the TLB flash, but an event that the hypervisor executes only once when the virtual machine is switched, such as a transition instruction from the hypervisor mode to the guest OS mode. May be set as Furthermore, an event that occurs at the time of virtual machine switching, such as switching of a virtual machine control table or switching of an I / O mapping table, may be set as an event. Next, in S33, events to be measured by other PMCs, for example, the number of execution clocks, the number of execution instructions, the number of cache misses at each of the levels L1, L2, and L3, the number of branch successes (branch GO), the branch failure (branch NO GO). Number, branch prediction success number, branch prediction failure number, memory read number, memory write number, etc. In S34, PMC counting is started, and the preprocessing of the performance data collection program 31b is terminated.

性能データ採取プログラム31bの後処理は、図6(b)に示すように、S35で、性能情報採取制御・集計プログラム51に対して、計測値の読出し、集計処理を指示して終了する。   As shown in FIG. 6B, the post-processing of the performance data collection program 31b ends in S35 by instructing the performance information collection control / aggregation program 51 to read out the measured values and perform the aggregation processing.

次に図7のフローチャートを参照して、割込ハンドラ31aを説明する。割込ハンドラ31aは、まずS41でPMCのカウント値を読み取り、読み取ったカウント値をメモリ112の所定の領域へ書き込む。この操作を、測定イベントを設定したPMCの数だけ行う。次いで、S42で、PMC割込ハンドラ31aは、タイムスタンプカウンタ(TSC)の値を読み取り、このカウント値をメモリ112の所定の領域へ書き込んで終了する。S41とS42とは順序を入れ替えてもよい。   Next, the interrupt handler 31a will be described with reference to the flowchart of FIG. The interrupt handler 31a first reads the PMC count value in S41, and writes the read count value to a predetermined area of the memory 112. This operation is performed for the number of PMCs for which measurement events are set. Next, in S42, the PMC interrupt handler 31a reads the value of the time stamp counter (TSC), writes this count value in a predetermined area of the memory 112, and ends. S41 and S42 may be switched in order.

以上説明したように本実施形態によれば、性能モニタリングカウンタを備えた既製のマイクロプロセッサを用いた仮想計算機システムにおいて、仮想マシン切替毎に、切り替えられる仮想マシンへ性能モニタリング割込を起こさせ、この割込を処理する仮想マシンの割込ハンドラがPMC値と時刻情報(TSC値)とをメモリへ格納しているので、性能測定プログラム終了後に、メモリを読み出すことにより、仮想マシン切替のシーケンスを判別して、測定対象の仮想マシンにおけるプログラムの高精度な動作情報を効率よく採取・分析することができる性能測定プログラムを提供することができる。   As described above, according to this embodiment, in a virtual machine system using an off-the-shelf microprocessor equipped with a performance monitoring counter, a performance monitoring interrupt is caused to the virtual machine to be switched every time the virtual machine is switched. Since the interrupt handler of the virtual machine that processes the interrupt stores the PMC value and time information (TSC value) in the memory, the sequence of virtual machine switching is determined by reading the memory after the performance measurement program ends. Thus, it is possible to provide a performance measurement program that can efficiently collect and analyze high-precision operation information of a program in a virtual machine to be measured.

また、本性能測定プログラムは、仮想マシン上のOSのデバイスドライバとして作成可能であり、従来ではハードウェアの改変もしくはハイパーバイザに手を加えなければ採取できなかった仮想マシンの切替え検知、ならびに各仮想マシンの性能情報を正確に採取できるようになる。   In addition, this performance measurement program can be created as an OS device driver on a virtual machine. In the past, virtual machine switching detection, which could not be collected without hardware modification or hypervisor manipulation, and each virtual machine Machine performance information can be collected accurately.

また、性能モニタリングカウンタ機能はCPUが通常有している機能であり、仮想マシン切替え時に発生するイベント(例えばTLBエントリ無効化イベント)もIntel社のXeon(登録商標)やAMD社のOpteron(登録商標)を始めとした多くのCPUで計測可能である。このため、該当機能を有する多くのCPUで、ハードウェアを一切付加・変更することなく実現可能であるため、適用範囲も広い。   In addition, the performance monitoring counter function is a function that the CPU normally has, and an event that occurs when a virtual machine is switched (for example, TLB entry invalidation event) is also used by Intel Xeon (registered trademark) or AMD Opteron (registered trademark). ) And many other CPUs. For this reason, many CPUs having the corresponding functions can be realized without adding or changing any hardware, so that the application range is wide.

本発明が適用される仮想計算機システムの構成例を示すシステム構成図である。1 is a system configuration diagram illustrating a configuration example of a virtual machine system to which the present invention is applied. 仮想マシンAと仮想マシンBが時分割で実行される場合の仮想マシンAの性能計測値を説明する図である。It is a figure explaining the performance measurement value of the virtual machine A in case the virtual machine A and the virtual machine B are performed by a time division. 仮想計算機システム1の構成例を示すシステム図上に、実施例における性能測定の流れを示した図である。It is the figure which showed the flow of the performance measurement in an Example on the system diagram which shows the structural example of the virtual computer system 1. FIG. 性能モニタリングカウンタの設定例を説明する図である。It is a figure explaining the example of a setting of a performance monitoring counter. 性能情報採取制御・集計プログラムの実施例を示すフローチャートである。It is a flowchart which shows the Example of a performance information collection control and totalization program. 性能データ採取プログラムの実施例を示すフローチャートである。It is a flowchart which shows the Example of a performance data collection program. ゲストOSの割込ハンドラの実施例を示すフローチャートである。It is a flowchart which shows the Example of the interrupt handler of a guest OS. 仮想計算機システムを説明する構成図である。It is a block diagram explaining a virtual machine system. 従来の仮想計算機システムにおける仮想マシンの性能測定上の問題点を説明する図である。It is a figure explaining the problem in the performance measurement of the virtual machine in the conventional virtual computer system.

符号の説明Explanation of symbols

1 仮想計算機システム
21,22,…、2N 仮想マシン
31 ゲストOS
31a 割込ハンドラ
31b 性能データ採取プログラム
41 制御マシン
51 性能情報採取制御・集計プログラム
111 CPU
111a 性能モニタリング機構
112 メモリ
121 ハイパーバイザ
121a 割込テーブル
1 Virtual machine system 21, 22, ..., 2N Virtual machine 31 Guest OS
31a Interrupt handler 31b Performance data collection program 41 Control machine 51 Performance information collection control / aggregation program 111 CPU
111a Performance monitoring mechanism 112 Memory 121 Hypervisor 121a Interrupt table

Claims (5)

性能モニタリングカウンタを有する性能モニタリング機構を備えたCPUとメモリとからなる物理マシン上で動作する仮想計算機に、前記仮想計算機に含まれる各仮想マシンの性能を測定させる手順を実行させる性能測定プログラムであって、
前記仮想計算機に、
計数すべきイベントを選択して前記性能モニタリングカウンタに指定されたイベントを計数させる手順と、
前記仮想マシンの切替え時に前記性能モニタリング機構で性能モニタリングのための割り込みを切替え先の仮想マシンに発生させる手順と、
記割り込みが発生した前記仮想マシンの割込ハンドラが前記性能モニタリングカウンタの値と前記性能モニタリングカウンタを読み出した時点の時刻情報をメモリへ記録させる手順と、
を実行させるための性能測定プログラム。
A performance measurement program for causing a virtual machine operating on a physical machine including a CPU and a memory having a performance monitoring mechanism having a performance monitoring counter to execute a procedure for measuring the performance of each virtual machine included in the virtual machine. And
In the virtual machine ,
A procedure for selecting an event to be counted and causing the performance monitoring counter to count the specified event ;
A step of generating the interrupt switching destination virtual machine for performance monitoring in front Symbol performance monitoring mechanism at the time of switching the virtual machines,
And instructions for recording the time information of the time the interrupt handler of the virtual machines before Symbol interrupt has occurred read the performance monitoring counter value of the performance monitoring counter to the memory,
Performance measurement program for running
前記物理マシンは、割込テーブルを有するハイパーバイザを更に有し、
前記仮想計算機に、
前記ハイパーバイザの前記割込テーブルに前記割込ハンドラへのリンクを設定させる手順を、更に実行させるための請求項1記載の性能測定プログラム。
The physical machine further comprises a hypervisor having an interrupt table ;
In the virtual machine ,
The performance measurement program according to claim 1, further causing a procedure for setting a link to the interrupt handler in the interrupt table of the hypervisor.
前記仮想計算機に、
計数すべきイベントとしてTLBエントリの無効化を前記性能モニタリングカウンタに設定する手順と、
TLBエントリの無効化が1回発生する毎に前記性能モニタリングカウンタ割込がハイパーバイザに割り込むことにより、前記割込ハンドラを起動される手順を、更に実行させるための請求項1または2に記載の性能測定プログラム。
In the virtual machine ,
A procedure for setting the TLB entry invalidation in the performance monitoring counter as an event to be counted;
3. The method according to claim 1, further comprising executing a procedure for starting the interrupt handler by interrupting the performance monitoring counter interrupt to a hypervisor every time a TLB entry is invalidated. 4. Performance measurement program.
性能モニタリングカウンタを有する性能モニタリング機構を備えたCPUとメモリとからなる物理マシン上で動作する仮想計算機において、前記仮想計算機に含まれる各仮想マシンの性能を測定する方法であって、
計数すべきイベントを選択して前記性能モニタリングカウンタに指定されたイベントを計数する過程と、
前記仮想マシンの切替え時に前記性能モニタリング機構で性能モニタリングのための割り込みを切替え先の仮想マシンに発生する過程と、
記割り込みが発生した前記仮想マシンの前記割込ハンドラが前記性能モニタリングカウンタの値と前記性能モニタリングカウンタを読み出した時点の時刻情報をメモリへ記録させる過程と、
を含むことを特徴とする性能測定方法。
In a virtual machine operating on a physical machine comprising a CPU and a memory having a performance monitoring mechanism having a performance monitoring counter, a method for measuring the performance of each virtual machine included in the virtual machine,
Selecting events to be counted and counting the events specified in the performance monitoring counter;
A step of generating the interrupt switching destination virtual machine for performance monitoring in front Symbol performance monitoring mechanism at the time of switching the virtual machines,
A process for recording the time information of time when the interrupt handler of the virtual machines before Symbol interrupt has occurred read the performance monitoring counter value of the performance monitoring counter to the memory,
A method for measuring performance, comprising:
性能モニタリングカウンタを有する性能モニタリング機構を備えたCPUとメモリとからなる物理マシン上で動作する仮想計算機の性能を測定する性能測定機能を有する処理装置であって、
計数すべきイベントを選択して前記性能モニタリングカウンタに指定されたイベントを計数する手段と、
前記仮想マシンの切替え時に前記性能モニタリング機構で性能モニタリングのための割り込みを切替え先の仮想マシンに発生する手段と、
記割り込みが発生した前記仮想マシンの割込ハンドラが前記性能モニタリングカウンタの値と前記性能モニタリングカウンタを読み出した時点の時刻情報をメモリへ記録する手段と、
を備えたことを特徴とする性能測定機能を備えた情報処理装置。
A processing apparatus having a performance measurement function for measuring the performance of a virtual machine operating on a physical machine including a CPU and a memory having a performance monitoring mechanism having a performance monitoring counter ,
Means for selecting events to be counted and counting the events specified in the performance monitoring counter;
It means for generating an interrupt to the switching destination virtual machine for performance monitoring in front Symbol performance monitoring mechanism at the time of switching the virtual machines,
And means for recording the time information of the time the interrupt handler of the virtual machines before Symbol interrupt has occurred read the performance monitoring counter value of the performance monitoring counter to the memory,
An information processing apparatus having a performance measurement function.
JP2008327211A 2008-12-24 2008-12-24 Information processing apparatus having performance measurement program, performance measurement method, and performance measurement function. Expired - Fee Related JP5353227B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008327211A JP5353227B2 (en) 2008-12-24 2008-12-24 Information processing apparatus having performance measurement program, performance measurement method, and performance measurement function.

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008327211A JP5353227B2 (en) 2008-12-24 2008-12-24 Information processing apparatus having performance measurement program, performance measurement method, and performance measurement function.

Publications (2)

Publication Number Publication Date
JP2010152458A JP2010152458A (en) 2010-07-08
JP5353227B2 true JP5353227B2 (en) 2013-11-27

Family

ID=42571512

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008327211A Expired - Fee Related JP5353227B2 (en) 2008-12-24 2008-12-24 Information processing apparatus having performance measurement program, performance measurement method, and performance measurement function.

Country Status (1)

Country Link
JP (1) JP5353227B2 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8346509B2 (en) * 2009-04-08 2013-01-01 Intel Corporation Context switch sampling
CN102822802B (en) 2010-03-30 2016-08-03 富士通株式会社 multi-core processor system and control method
JP5709735B2 (en) * 2011-12-08 2015-04-30 三菱電機株式会社 Virtual computer system
WO2014118362A1 (en) * 2013-02-01 2014-08-07 Siemens Aktiengesellschaft Method and apparatus for monitoring security intrusion of a distributed computer system
JP6048225B2 (en) * 2013-03-05 2016-12-21 三菱電機株式会社 Processing device and performance monitoring information acquisition program
JP5905412B2 (en) * 2013-06-19 2016-04-20 株式会社日立製作所 Virtual computer system and processor performance measurement method
GB2517494B (en) 2013-08-23 2021-02-24 Advanced Risc Mach Ltd Handling time intensive instructions
JP6248608B2 (en) * 2013-12-18 2017-12-20 富士通株式会社 Information processing device, information processing device performance measurement method, and information processing device performance measurement program
JP2015162003A (en) * 2014-02-26 2015-09-07 三菱電機株式会社 Processor management apparatus
JP6213309B2 (en) * 2014-03-03 2017-10-18 富士通株式会社 Information processing apparatus, performance information collecting program for information processing apparatus, and performance information collecting method for information processing apparatus
US9830178B2 (en) * 2014-03-06 2017-11-28 Intel Corporation Dynamic reassignment for multi-operating system devices
CN103955422B (en) * 2014-04-21 2017-04-12 中国科学院计算技术研究所 Method for analyzing I/O (Input/Output) performance interference of coexisting application in virtualized environment and system thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0833851B2 (en) * 1986-03-15 1996-03-29 株式会社日立製作所 Virtual machine monitoring method
JP3941848B2 (en) * 1998-10-07 2007-07-04 富士通株式会社 Performance measuring apparatus, recording medium storing performance measuring program, and performance measuring method
JP2004318538A (en) * 2003-04-17 2004-11-11 Fujitsu Ltd Method for monitoring performance
JP2008234191A (en) * 2007-03-19 2008-10-02 Toshiba Corp Hardware monitor management device and method of executing hardware monitor function
JP4769755B2 (en) * 2007-03-29 2011-09-07 富士通株式会社 Profiling support program, profiling support method, and computer
JP5119994B2 (en) * 2008-03-14 2013-01-16 富士通株式会社 Performance monitoring program, performance monitoring method, performance monitoring device

Also Published As

Publication number Publication date
JP2010152458A (en) 2010-07-08

Similar Documents

Publication Publication Date Title
JP5353227B2 (en) Information processing apparatus having performance measurement program, performance measurement method, and performance measurement function.
JP6079317B2 (en) Virtual computer system, its management method, and virtual computer system management program
CN108475236B (en) Measuring address translation delay
JP6138142B2 (en) Hardware-based runtime instrumentation for managed runtimes
JP6495319B2 (en) Idle time accumulation in multithreading computer systems
US10733009B2 (en) Information processing apparatus and information processing method
GB2540070B (en) Hardware counters to track utilization in a multithreading computer system
US7519966B2 (en) Information processing and control
JP2009223451A (en) Performance monitoring program, performance monitoring method and performance monitoring device
US10613895B2 (en) Virtualization of storage buffers used by asynchronous processes
JP2015513376A (en) Runtime instrumentation indirect sampling with instruction operation code
Xie et al. Metis: a profiling toolkit based on the virtualization of hardware performance counters
US10409636B2 (en) Apparatus and method to correct an execution time of a program executed by a virtual machine
WO2014131319A1 (en) Methods and apparatuses for identifying and tracking process of operating system, and for obtaining information
JP2004318538A (en) Method for monitoring performance
Zhang et al. ANOLE: A profiling-driven adaptive lock waiter detection scheme for efficient MP-guest scheduling
Biancheri et al. Fine-grained multilayer virtualized systems analysis
US20230315453A1 (en) Forward conditional branch event for profile-guided-optimization (pgo)
JP4973149B2 (en) Virtual computer performance monitoring method and computer system
JP6213309B2 (en) Information processing apparatus, performance information collecting program for information processing apparatus, and performance information collecting method for information processing apparatus
Starke et al. System-Management-Mode in Real-Time PC-Based Control Applications

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110907

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130207

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130219

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130422

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130514

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130716

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130730

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130812

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees