JP5267566B2 - Multiprocessor count value correction apparatus and multiprocessor having the same - Google Patents
Multiprocessor count value correction apparatus and multiprocessor having the same Download PDFInfo
- Publication number
- JP5267566B2 JP5267566B2 JP2010531754A JP2010531754A JP5267566B2 JP 5267566 B2 JP5267566 B2 JP 5267566B2 JP 2010531754 A JP2010531754 A JP 2010531754A JP 2010531754 A JP2010531754 A JP 2010531754A JP 5267566 B2 JP5267566 B2 JP 5267566B2
- Authority
- JP
- Japan
- Prior art keywords
- count value
- processor
- change
- operating frequency
- multiprocessor
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3604—Analysis of software for verifying properties of programs
- G06F11/3608—Analysis of software for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Description
この発明は、マルチプロセッサのカウント値補正装置等に係り、詳しくは、独立又は協働して駆動する複数のプロセッサ毎のクロックサイクルカウント値を、例えば、マルチプロセッサの駆動状況を分析などする際に、容易に利用することができるように補正するマルチプロセッサのカウント値補正装置等に関する。 The present invention relates to a multiprocessor count value correction device and the like, and more specifically, when analyzing a clock cycle count value for each of a plurality of processors driven independently or in cooperation, for example, analyzing a driving state of a multiprocessor. The present invention relates to a multiprocessor count value correction device and the like for correction so that it can be easily used.
従来、コンピュータプログラムのデバックや性能分析や最適化などを行う際には、そのプログラムの実行状況を追跡することが行われており、典型的には、そのプログラム中に該当箇所の実行を検知する実行プログラムを、明示的に加入したり、あるいは、プロセッサのブレークポイント機構等を実装するなどして埋め込む。 Conventionally, when performing debugging, performance analysis, optimization, etc. of a computer program, the execution status of the program is tracked, and typically the execution of the corresponding part in the program is detected. An execution program is embedded by explicitly joining or implementing a breakpoint mechanism of a processor or the like.
その実行プログラムでは、例えば、実行中のプログラムのアドレスや変数の値に相当するレジスタやメモリの情報などのトレースデータを生成して所定の記録領域に保存することにより追跡可能にする処理が行われる。また、性能分析や処理時間計測を行う場合には、例えば、該当のプローブを通過した時点の時刻をトレースデータとして記録することにより分析可能にするのが典型的な処理である。 In the execution program, for example, trace data such as register and memory information corresponding to the address and variable value of the program being executed is generated and saved in a predetermined recording area so as to be traceable. . Further, when performing performance analysis or processing time measurement, for example, it is a typical process to enable analysis by recording the time at which the probe has passed through as trace data.
このときの時刻データとしては、タイマやリアルタイムクロックデバイスから取得した時刻情報や、プロセッサが備えるクロックサイクルカウンタのカウント値を用いるのが一般的である。そのなかでも、ルーチン毎の実行時刻をサンプリングによらずに直接計測するなどの精細な時刻情報を要する場合には、クロックサイクルカウンタが用いられることが多い。 As time data at this time, time information acquired from a timer or a real-time clock device or a count value of a clock cycle counter provided in a processor is generally used. In particular, a clock cycle counter is often used when precise time information is required such as directly measuring the execution time of each routine without sampling.
このような追跡処理や性能分析や処理時間計測などを、複数のプロセッサを備えているマルチプロセッサで行う場合には、バスを介して情報のやり取りをすると、そのバス経由で取得することによる時刻データの遅延が無視できない。また、通常のマルチプロセッサでは、マイクロ秒以下の精度をもつデバイスが搭載されている訳ではないので分解能も十分でない。 When such tracking processing, performance analysis, and processing time measurement are performed by a multiprocessor equipped with a plurality of processors, time data obtained by exchanging information via the bus is obtained. The delay is not negligible. In addition, a normal multiprocessor does not have a device with an accuracy of microseconds or less, so the resolution is not sufficient.
このことから、マルチプロセッサでは、プロセッサ間を主従の関係で固定することなく、プロセッサ毎の時刻データを同期させる方式が特許文献1で提案されている。この文献1には、選択した一部のプロセッサ毎に全てのプロセッサに向けて自分の時刻データを送ることにより、受信した他のプロセッサからの時刻データと自身の時刻データの差分の平均値を算出して時刻データの補正を行うことが記載されている。
For this reason,
また、特許文献2には、通信ラインに接続されているターミナル間の時計を共通になるように補正する技術が記載されている。特許文献3には、通信ネットワークを介して接続されている情報処理装置の内部時計を同期させる技術が記載されている。 Patent Document 2 describes a technique for correcting a clock between terminals connected to a communication line to be common. Patent Document 3 describes a technique for synchronizing an internal clock of an information processing apparatus connected via a communication network.
しかしながら、近年のマルチプロセッサにあっては、プロセッサのクロック周波数(動作周波数)を一定のまま駆動させるとは限られず、例えば、消費電力の低減等のために、プロセッサ毎に、所定の契機に適宜、クロック周波数を変更して駆動するものもある。 However, recent multiprocessors are not limited to being driven with the clock frequency (operating frequency) of the processor kept constant. For example, in order to reduce power consumption, for example, each processor is appropriately triggered by a predetermined trigger. Some of them are driven by changing the clock frequency.
このため、トレースデータとしては、このようにプロセッサ毎のクロック周波数が変更された時刻データであるクロックサイクルカウント値をそのまま記録したとしても、クロック周波数が異なればそのカウントレートが異なることから、例えば、追跡処理や性能分析や処理時間計測を行う際にそのまま利用することはできない。 For this reason, as trace data, even if the clock cycle count value, which is the time data when the clock frequency for each processor is changed in this way, is recorded as it is, the count rate is different if the clock frequency is different. It cannot be used as it is when performing tracking processing, performance analysis, or processing time measurement.
ところで、ルーチン1個の大きさは、ループの有無などにもよるが、小さい場合には100命令にも満たない場合もあり、このような場合には、数百MHz〜数GHzで動作するプロセッサでの実行時間は1マイクロ秒以下になり得る。 By the way, although the size of one routine depends on the presence or absence of a loop, it may be less than 100 instructions if it is small. In such a case, a processor that operates at several hundred MHz to several GHz. The execution time at can be less than 1 microsecond.
その一方で、クロックサイクルカウンタは、プロセッサのクロックが進む都度増加するように動作するため、上記のような高精細な用途でも満足する分解能を備えている。また、クロックサイクルカウンタは、プロセッサのレジスタ等からカウント値を直接読み出すことから、読み出しに掛かる遅延としてもバス経由で接続されたデバイスよりは相当に小さい。例えば、インテル社製のIA−32アーキテクチャのプロセッサでは、クロックサイクルカウンタがタイムスタンプカウンタレジスタを読み出す命令(RDTSC:Read Time Stamp Counter)を用いてその値を取得することができ、その読出時の遅延は数十サイクル程度である。 On the other hand, since the clock cycle counter operates so as to increase as the processor clock advances, the clock cycle counter has a resolution that satisfies even the above-described high-definition applications. Further, since the clock cycle counter directly reads the count value from the processor register or the like, the delay required for the reading is considerably smaller than that of the device connected via the bus. For example, in an Intel IA-32 architecture processor, the clock cycle counter can obtain the value using an instruction (RDTSC: Read Time Stamp Counter) for reading a time stamp counter register, and a delay at the time of reading Is about several tens of cycles.
そして、マルチプロセッサの場合には、通常、プロセッサ毎にクロックサイクルカウンタが用意されていることから、プロセッサの時刻カウンタとして、これを利用することが時刻データを共通化させるのには好ましい。 In the case of a multiprocessor, since a clock cycle counter is usually prepared for each processor, it is preferable to use this as a time counter of the processor in order to share time data.
しかるに、マルチプロセッサは、プロセッサが異なればそのカウンタの値も最初からずれている可能性もある。特に、マルチプロセッサが電源管理機能を搭載して消費電力や処理量の傾向に応じてプロセッサ毎の動作速度をクロック周波数の変更により変化させる場合には、同一マシン内であっても各々のクロック周波数で駆動しているときもある。 However, in the multiprocessor, if the processors are different, the value of the counter may be deviated from the beginning. Especially when the multiprocessor is equipped with a power management function and the operating speed of each processor is changed by changing the clock frequency according to the power consumption and processing volume trends, Sometimes it is driven by.
このことから、マルチプロセッサでは、例えば、性能を拡大するために複数プロセッサを利用する等の目的でマルチスレッド化したアプリケーションプログラムを実行処理する場合には、その複数のプロセッサに跨って並行処理する。この場合には、その実行処理を行うプロセッサによって参照時計の時刻の進み方が異なることになるため、正確な計測が行えないことになる。また、OS(Operating System)のカーネルなどように並行処理を実行するプログラムの場合には、特定機能だけ処理が遅延するようなボトルネックがあるとシステム全体の性能が落ちる。 For this reason, in a multiprocessor, for example, when executing an application program that has been multithreaded for the purpose of using a plurality of processors in order to increase performance, the multiprocessor performs parallel processing across the plurality of processors. In this case, since the way of the time of the reference clock differs depending on the processor that performs the execution process, accurate measurement cannot be performed. Further, in the case of a program that executes parallel processing, such as an OS (Operating System) kernel, if there is a bottleneck that delays processing by a specific function, the performance of the entire system deteriorates.
すなわち、このようなプログラムでは、デバックや性能分析や最適化を行う際に、マルチプロセッサにおけるプロセッサ毎に、クロックサイクルカウンタにより計測する経過時刻を共通化することが必要である。 That is, in such a program, it is necessary to share the elapsed time measured by the clock cycle counter for each processor in the multiprocessor when performing debugging, performance analysis, or optimization.
この発明は、上述の事情に鑑みてなされたもので、マルチプロセッサがプロセッサ毎に動作周波数を変更可能な機能を備える場合に、そのプロセッサ毎のクロックサイクルカウント値を共通の経過時刻に補正して、追跡処理や性能分析や最適化処理などを容易に行い得るようにすることのできるマルチプロセッサのカウント値補正装置等を提供することを目的とする。 The present invention has been made in view of the above circumstances. When a multiprocessor has a function capable of changing the operating frequency for each processor, the clock cycle count value for each processor is corrected to a common elapsed time. Another object of the present invention is to provide a multiprocessor count value correction device and the like that can easily perform tracking processing, performance analysis, optimization processing, and the like.
上記課題を解決するために、この発明の第1の構成は、マルチプロセッサのカウント値補正装置に係り、マルチプロセッサを構築するプロセッサ毎の動作周波数の変更を検知する変更検知手段と、前記動作周波数を変更した前記プロセッサの識別情報を取得する変更プロセッサ識別情報取得手段と、前記動作周波数の変更後の当該動作周波数を取得する動作周波数取得手段と、前記動作周波数に基づいてカウントする前記プロセッサ毎のクロックサイクルカウンタの該動作周波数の変更時における変更時カウント値を取得する変更時カンウント値取得手段と、取得した前記動作周波数及び前記変更時カウント値を該当プロセッサの識別情報に対応付けして履歴情報として保持する変更履歴保持手段と、前記識別情報に対応付けされている前記動作周波数及び前記変更時カウント値の前記履歴情報に基づいて前記プロセッサ毎の仮想時刻を導出する時刻導出手段とを備えることを特徴としている。 In order to solve the above-described problem, a first configuration of the present invention relates to a multiprocessor count value correction apparatus, a change detecting means for detecting a change in operating frequency for each processor constituting the multiprocessor, and the operating frequency. For each processor that counts based on the operating frequency, a changed processor identification information acquiring unit that acquires the identification information of the processor that has changed the operating frequency, an operating frequency acquiring unit that acquires the operating frequency after the operating frequency is changed Change count value acquisition means for acquiring a change count value when the operation frequency of the clock cycle counter is changed, and history information by associating the acquired operation frequency and the change count value with identification information of the corresponding processor Change history holding means to hold as the identification information It is characterized in that it comprises a time derivation means for deriving the virtual time of each of the processors on the basis of the history information of the work frequency and the change at the time count value.
また、この発明の第2の構成は、マルチプロセッサのカウント値補正方法に係り、マルチプロセッサを構築するプロセッサ毎の動作周波数の変更の有無を監視して、該プロセッサの動作周波数の変更を検知したとき、前記動作周波数に基づいてカウントする前記プロセッサ毎のクロックサイクルカウンタの該動作周波数の変更時における変更時カウント値、及び、当該変更時における前記動作周波数を該プロセッサの識別情報と共に取得して該識別情報に対応付けして履歴情報として保持し、当該識別情報に対応付けされている前記動作周波数及び前記変更時カウント値の前記履歴情報に基づいて前記プロセッサ毎の仮想時刻を導出することを特徴としている。 The second configuration of the present invention relates to a count value correction method for a multiprocessor, and monitors whether or not the operating frequency of each processor constituting the multiprocessor is changed, and detects a change in the operating frequency of the processor. When the operating frequency of the clock cycle counter for each processor that counts based on the operating frequency is changed, and the operating frequency at the time of the change are acquired together with the identification information of the processor. It is stored as history information in association with identification information, and a virtual time for each processor is derived based on the history information of the operating frequency and the change count value associated with the identification information. It is said.
また、この発明の第3の構成は、マルチプロセッサのカウント値補正プログラムに係り、マルチプロセッサを搭載するコンピュータに読み込ませることにより、必要な情報をメモリ内に保持させつつ何れかのプロセッサが実行するステップとして、プロセッサ毎の動作周波数の変更の有無を監視して該動作周波数の変更を検知する変更検知ステップと、前記動作周波数を変更した該当プロセッサの識別情報を取得する変更プロセッサ識別情報取得ステップと、前記動作周波数の変更後の当該動作周波数を取得する動作周波数取得ステップと、前記動作周波数に基づいてカウントする前記プロセッサ毎のクロックサイクルカウンタの該動作周波数の変更時における変更時カウント値を取得する変更時カンウント値取得ステップと、取得した前記動作周波数及び前記変更時カウント値を該当プロセッサの識別情報に対応付けして履歴情報として保持する変更履歴保持ステップと、前記識別情報に対応付けされている前記動作周波数及び前記変更時カウント値の前記履歴情報に基づいて前記プロセッサ毎の仮想時刻を導出する時刻導出ステップとを有することを特徴としている。 The third configuration of the present invention relates to a multiprocessor count value correction program, which is executed by one of the processors while holding the necessary information in the memory by being read by a computer equipped with the multiprocessor. As a step, a change detection step for monitoring the presence or absence of a change in operating frequency for each processor and detecting a change in the operating frequency; a changed processor identification information acquiring step for acquiring identification information of the processor whose operating frequency has been changed; An operating frequency acquisition step for acquiring the operating frequency after the change of the operating frequency, and a count value at the time of changing the operating frequency of the clock cycle counter for each processor that counts based on the operating frequency The change count value acquisition step and the acquired A change history holding step for holding the operating frequency and the change count value in association with the identification information of the processor as history information, and the operating frequency and the change count value associated with the identification information. And a time deriving step for deriving a virtual time for each processor based on history information.
この発明の構成によれば、変更した動作周波数と共にその変更時のクロックサイクルカウント値を履歴情報としてプロセッサ毎に保持して、適宜、その履歴情報から仮想時刻を導出するので、分析等を行うプロセッサ毎のクロックサイクルカウント値を仮想時刻にして共通化することができる。したがって、マルチプロセッサにおけるプロセッサ毎のクロックサイクルカウント値を動作周波数の変更による影響のない仮想時刻にして、その仮想時刻を基準にして所望の分析等の処理を容易かつ効率よく行うことができる。 According to the configuration of the present invention, the changed operating frequency and the clock cycle count value at the time of the change are held as history information for each processor, and the virtual time is derived from the history information as appropriate. Each clock cycle count value can be shared as a virtual time. Therefore, the clock cycle count value for each processor in the multiprocessor is set to a virtual time that is not affected by the change of the operating frequency, and a desired analysis process or the like can be easily and efficiently performed based on the virtual time.
動作周波数を変更可能なプロセッサを複数備えるマルチプロセッサが、プロセッサ毎の動作周波数の変更を検知する変更検知手段と、前記動作周波数を変更した前記プロセッサの識別情報を取得する変更プロセッサ識別情報取得手段と、前記動作周波数の変更後の当該動作周波数を取得する動作周波数取得手段と、前記動作周波数に基づいてカウントする前記プロセッサ毎のクロックサイクルカウンタの該動作周波数の変更時における変更時カウント値を取得する変更時カンウント値取得手段と、取得した前記動作周波数及び前記変更時カウント値を該当プロセッサの識別情報に対応付けして履歴情報として保持する変更履歴保持手段と、前記識別情報に対応付けされている前記動作周波数及び前記変更時カウント値の前記履歴情報に基づいて前記プロセッサ毎の仮想時刻を導出する時刻導出手段とを備えており、前記時刻導出手段は、前記プロセッサ毎の前記変更時カウント値を対応する前記動作周波数により補正して、前記動作周波数の変更前後で共通の一定速度で増進する仮想時刻を導出するように構成されている。 A multi-processor including a plurality of processors capable of changing the operating frequency, a change detecting unit that detects a change in the operating frequency for each processor, a changed processor identification information acquiring unit that acquires the identification information of the processor that has changed the operating frequency, The operating frequency acquisition means for acquiring the operating frequency after the change of the operating frequency and the count value at the time of changing the operating frequency of the clock cycle counter for each processor that counts based on the operating frequency are acquired The change count value acquisition means, the change history holding means for holding the acquired operating frequency and the change count value in association with the identification information of the corresponding processor and holding it as history information, and the identification information Based on the history information of the operating frequency and the count value at the time of change Time deriving means for deriving a virtual time for each processor, and the time deriving means corrects the change count value for each processor with the corresponding operation frequency, and before and after the change of the operation frequency. Thus, it is configured to derive a virtual time to increase at a common constant speed.
以下、この発明の最良の実施形態を図面に基づいて説明する。 The best mode for carrying out the invention will be described below with reference to the drawings.
図1〜図7は、この発明に係るマルチプロセッサのカウント値補正プログラムをコンピュータに読み込ませて実行することによりマルチプロセッサのカウント値補正方法を実施する、マルチプロセッサのカウント値補正装置を搭載するマルチプロセッサの一実施形態を示す図である。図1はそのマルチプロセッサのカウント値補正装置の概略全体構成を示す概念構成図、図2はそのマルチプロセッサでプロセッサ毎に動作周波数を変更する場合のクロックサイクルカウント値を説明するグラフ、図3はそのマルチプロセッサが実行するプログラム中におけるプロセッサ毎のクロックサイクルカウント値の取得を説明するプローチャート、図4はそのマルチプロセッサのプロセッサが変更する動作周波数とその時のクロックサイクルカウント値の取得を説明するプローチャート、図5はその変更時の動作周波数とクロックサイクルカウント値の取得・保持を説明する概念図、図6及び図7はその異なる動作周波数でカウントされているクロックサイクルカウント値の補正処理を説明するフローチャートである。 FIGS. 1 to 7 show a multiprocessor equipped with a multiprocessor count value correction apparatus that implements a multiprocessor count value correction method by causing a computer to read and execute a multiprocessor count value correction program according to the present invention. FIG. 4 illustrates an embodiment of a processor. FIG. 1 is a conceptual configuration diagram showing a schematic overall configuration of the multiprocessor count value correction device, FIG. 2 is a graph for explaining clock cycle count values when the operating frequency is changed for each processor in the multiprocessor, and FIG. FIG. 4 is a flowchart for explaining the acquisition of the clock cycle count value for each processor in the program executed by the multiprocessor. FIG. 4 is a flowchart for explaining the operation frequency changed by the processor of the multiprocessor and the acquisition of the clock cycle count value at that time. FIG. 5 is a conceptual diagram illustrating the acquisition and retention of the operating frequency and the clock cycle count value at the time of the change, and FIGS. 6 and 7 illustrate the correction processing of the clock cycle count value counted at the different operating frequency. It is a flowchart to do.
図1において、マルチプロセッサ100は、第1〜第nプロセッサ101〜10n(nは2以上の自然数)が、処理プログラム等を予め格納するROM(Read Only Memory)111と、ワークエリアとして利用可能なRAM(Random Access Memory)112と共にバス113に共通接続されてコンピュータ内に搭載されている。この第1〜第nプロセッサ101〜10nは、それぞれがプロセッサID保持部11で保持するプロセッサID(identifier:識別情報)に基づいて互いに識別しつつ、個々の役割を単独で処理する、あるいは、それぞれに分担されている役割を並行処理して協働するマルチプロセッサとして機能するように構築されている。
In FIG. 1, a
この第1〜第nプロセッサ101〜10nは、それぞれクロック周波数設定部12内に予め設定されているクロック周波数(動作周波数)に応じた速度で同期を取りつつ駆動するように構築されており、そのクロック周波数に応じた速度のクロックサイクルカウント値をクロックサイクルカウント値保持部13で計数・保持することにより同期を取る。すなわち、第1〜第nプロセッサ101〜10nは、クロックサイクルカウント値保持部13を内蔵することにより、バス113を介すことなく(遅延させることなく)直接そのクロックサイクルカウント値を取得することができる。このため、例えば、100命令にも満たないルーチンを実行するような1マイクロ秒以下の実行時間を計数する高精細な用途でも満足する分解能を備えることができる。
The first to n-
さらに、第1〜第nプロセッサ101〜10nは、消費電力の削減等を実現するために、ROM111内の処理プログラムに基づくコンピュータ本体(第1〜第nプロセッサ101〜10n自身)からの指示・命令に応じて、駆動速度となるクロック周波数をそれぞれのクロック周波数設定部12内に個別に変更・設定することができる。ここで、この実施形態では、ROM111内に格納するプログラム自体をプログラム111と称して簡単に説明する。
Furthermore, the first to n-
例えば、図2に示すように、第1プロセッサ101は、100MHz、50MHz、150MHzと順次にクロック周波数を変更・設定(更新)して駆動している。これに対して、第2プロセッサ102は、25MHz、100MHz、150MHzと順次にクロック周波数を変更・設定して駆動している。この場合には、同一のタイミングT1であるのにも拘わらずに、第1プロセッサ101のクロックサイクルカウント値が150Mサイクル(C1)であるのに対して第2プロセッサ102のクロックサイクルカウント値は50Mサイクル(C2)である。また、クロックサイクルカウント値として150Mサイクル(C1)を計数するのは、第1プロセッサ101がタイミングT1であるのに対して第2プロセッサ102がタイミングT2と異なるタイミングになる。
For example, as shown in FIG. 2, the
このことから、マルチプロセッサ100は、第1〜第nプロセッサ101〜10n毎のクロックサイクルカウント値を、例えば、クロック周波数の変更に影響されることのないリアルタイムと同一速度で増進する経過時刻に補正した仮想時刻を導出することにより共通化する機能を備えている。これにより、マルチプロセッサ100は、第1〜第nプロセッサ101〜10n毎に異なるクロック周波数でクロックサイクルカウント値がカウントされるために、ソフトウェアのデバックや性能分析や最適化などの処理を複雑化させることなく、その補正後の仮想時刻を単純利用する容易な処理を実現することができる。なお、この仮想時刻としては、一定速度に限るものではなく、例えば、第1プロセッサ101のクロックサイクルカウント値を基準にして共通に進行する経過時刻に補正してもよいが、現実の時間経過に補正するのが簡易であることから、後述するように本実施形態のように補正処理を行うのが好ましい。
From this, the
具体的には、マルチプロセッサ100は、第1〜第nプロセッサ101〜10nが電源管理イベント等で実行するクロック周波数の変更を検知して、その時点でのクロックサイクルカウント値と変更後のクロック周波数を記録保持しておく。そして、このマルチプロセッサ100は、その保持するクロックサイクルカウント値を第1〜第nプロセッサ101〜10n間で共通化する補正を行って積算することにより仮想時刻を算出(導出)することができる。例えば、図2に示す第1プロセッサ101では、0〜100Mサイクルの間では100MHz(サイクル/秒)で動作していたので、一般的な現実の経過時刻としては、100Mサイクル/100MHz=1.0秒となって1.0秒だけ経過していることになる。同様に、100〜150Mサイクルの間では、50MHzで動作していたので、(150−100)/50=1.0となって1.0秒経過していることになる。さらに、150〜300Mサイクルの間では、150MHzで動作していたので、(300−150)/150=1.0となって1.0秒経過していることになる。このため、この場合には、これらを積算して合計で3.0秒経過していることなる。すなわち、マルチプロセッサ100は、この補正処理を第1〜第nプロセッサ101〜10n毎のクロックサイクルカウント値にも同様に施して仮想時刻を算出することにより、クロックサイクルカウント値に対応する各種トレースデータの履歴を一般化・共通化して計測・分析などを容易化することができる。
Specifically, the
例えば、マルチプロセッサ100は、第1〜第nプロセッサ101〜10nがプログラム111内に格納する性能計測用のソフトウェアの実行プローブ111aを呼び出して実行する際に、そのクロックサイクルカウント値を共通化する補正処理を行って仮想時刻を導出する。すなわち、実行プローブ111aの実行では、第1〜第nプロセッサ101〜10nがクロックサイクルカウント値などのトレース用データを集めてRAM112内に確保されているトレースデータ蓄積部112a内に書き込んで蓄積保持することによって性能計測を行う。このときの実行プローブ111aの実行では、その性能計測のソフトウェアをターゲットプログラムとして、第1〜第nプロセッサ101〜10nが収集したトレース用データを仮想時刻に補正することにより、その性能計測を効率よく、また容易に行うことができる。
For example, when the
詳細には、マルチプロセッサ100は、第1〜第nプロセッサ101〜10nがRAM112を利用しつつ実行プローブ111aを実行することにより、プロセッサID取得部21、クロックサイクルカウント値取得部22、クロック周波数変更部23、クロック周波数変更検知部24、及び、クロックサイクルカウント値補正部25として機能するように構成されている。また、このマルチプロセッサ100は、そのRAM112がクロック周波数変更履歴保持部26として機能するように構成されている。
Specifically, the
プロセッサID取得部21は、所定の契機における指示・命令に基づいて、例えば、ターゲットプログラムの性能計測の実行時に、第1〜第nプロセッサ101〜10n毎のプロセッサID保持部11からプロセッサIDをそれぞれ取り出して取得する。すなわち、このプロセッサID取得部21がクロック周波数を変更したプロセッサのIDを取得する変更プロセッサ識別情報取得手段を構成する。
The processor
クロックサイクルカウント値取得部22は、同様に、所定の契機における指示・命令に基づいて、例えば、第1〜第nプロセッサ101〜10nにおけるクロック周波数の変更が後述のクロック周波数変更検知部24により確認(検知)されたときに、その第1〜第nプロセッサ101〜10n毎のクロックサイクルカウント値保持部13が計数保持するクロックサイクルカウント値を取り出して取得する。すなわち、このクロックサイクルカウント値取得部22がクロック周波数(動作周波数)の変更を検知したときにクロックサイクルカウント値(変更時カウント値)を取得する変更時カンウント値取得手段を構成する。
Similarly, the clock cycle count
クロック周波数変更部23は、電源管理機構等からの指示などの所定の契機に応じて、第1〜第nプロセッサ101〜10n毎のクロック周波数設定部12内に設定されているクロック周波数を変更して更新させる。
The clock
クロック周波数変更検知部24は、第1〜第nプロセッサ101〜10n毎のクロック周波数設定部12内に設定されているクロック周波数を参照・取得してその設定更新(クロック周波数変更部23によるクロック周波数の書換)の有無を確認しクロック周波数の変更を検知する。すなわち、このクロック周波数変更検知部24が変更後のクロック周波数(動作周波数)を取得する動作周波数取得手段を構成するとともに、クロック周波数(動作周波数)の変更を検知する変更検知手段も構成する。
The clock frequency
クロック周波数変更履歴保持部26は、クロック周波数変更検知部24がクロック周波数の変更を検知したときに、取得するその変更後のクロック周波数と共に、クロックサイクルカウント値取得部22が取得するクロックサイクルカウント値を該当する第1〜第nプロセッサ101〜10nのプロセッサID毎に対応付けして変更履歴として記憶保持する。すなわち、このクロック周波数変更履歴保持部26がクロック周波数の変更を検知したときのクロック周波数とクロックサイクルカウント値(変更時カウント値)をその変更毎に履歴情報として保持する変更履歴保持手段を構成する。
The clock frequency change
クロックサイクルカウント値補正部25は、クロック周波数変更履歴保持部26が蓄積保持する変更履歴情報(変更後のクロック周波数と変更時のクロックサイクルカウント値)から一定速度で増進する共通の仮想時刻を算出して、例えば、性能計測の実行処理に利用可能にRAM112内に一時的に記録保持する。すなわち、クロックサイクルカウント値補正部25がクロック周波数や変更時カウント値の履歴情報に基づいて仮想時刻を導出する時刻導出手段を構成する。
The clock cycle count
これにより、マルチプロセッサ100は、例えば、性能計測を実行する第1〜第nプロセッサ101〜10n毎に、変更後のクロック周波数と変更時のクロックサイクルカウント値をそのプロセッサID毎に対応付けして変更履歴情報として蓄積保持することができる。そして、第1〜第nプロセッサ101〜10n毎のクロックサイクルカウント値は、その変更履歴情報に基づいて、例えば、現実の時間経過と同一の一定速度で増進する仮想時刻に補正して共通化した後に性能計測に利用することができる。
Thereby, for example, the
次に、ターゲットプログラムの実行時の性能計測を図3、図4、図6、図7に示すフローチャートと図5に示す変更履歴情報の概念図を用いて説明する。 Next, performance measurement during execution of the target program will be described with reference to the flowcharts shown in FIGS. 3, 4, 6, and 7 and the conceptual diagram of the change history information shown in FIG.
例えば、第1プロセッサ101が他の第2〜第nプロセッサ102〜10nを協働させて実行処理するターゲットプログラムの性能計測を行う場合には、図3のフローチャートに従う処理が実行される。まずは、そのターゲットプログラムの実行途中に繰り返し、実行プローブ111aにプログラム制御が移行する(ステップS11)。この実行プローブ111aによるプログラム制御では、クロック周波数の補正による仮想時刻の導出処理以外の性能計測に必要なトレースデータの収集・記録などを実行する(ステップS12)。次いで、第1〜第nプロセッサ101〜10n毎に、プロセッサID取得部21がプロセッサID保持部11からプロセッサIDを取得するとともに(ステップS13)、クロックサイクルカウント値取得部22がクロックサイクルカウント値保持部13からクロックサイクルカウント値を取得する(ステップS14)。この後に、実行プローブ111aは、その取得したクロックサイクルカウント値をプロセッサIDに対応付けしてトレースデータとしてトレースデータ蓄積部112a内に記憶保持させた後に(ステップS15)、性能計測対象のターゲットプログラムにプログラム制御を移行してこの実行プログラムを終了する(ステップS16)。ここで、以下では、実行プローブ111aのプログラム制御を単に実行プローブ111aと簡略化して説明する。
For example, when the
このとき、実行プローブ111aは、第1〜第nプロセッサ101〜10nが並行処理するその実行プログラム中には、図4のフローチャートに従う処理を実行する。まずは、第1〜第nプロセッサ101〜10n毎に、クロック周波数変更検知部24がクロック周波数設定部12に設定されているクロック周波数を参照することにより、先に取得したクロック周波数と比較してそのクロック周波数が変更されているか否かを、そのターゲットプログラムの実行途中に繰り返し確認する(ステップS21)。そのクロック周波数の変更を検知できない場合には、そのままこの処理を終了して、実行プログラムによる性能計測対象のターゲットプログラムに戻る。一方、そのクロック周波数の変更を検知すると、プロセッサID取得部21が該当プロセッサのプロセッサID保持部11からプロセッサIDを取り出して取得する(ステップS22)。次いで、クロックサイクルカウント値取得部22がその該当プロセッサのクロックサイクルカウント値保持部13に保持されているクロックサイクルカウント値を取り出して取得する(ステップS23)。同時に、クロック周波数変更検知部24がその該当プロセッサのクロック周波数設定部12に設定されている変更後のクロック周波数を改めて取得する(ステップS24)。この後に、クロック周波数変更履歴保持部26が取得したクロック周波数とクロックサイクルカウント値をプロセッサIDに対応付けして変更履歴として先の変更履歴情報の末尾に追記して記憶保持した後に(ステップS29)、この処理を終了して、実行プログラムによる性能計測対象のターゲットプログラムに戻る。
At this time, the
例えば、図2に示す第1、第2プロセッサ101、102のクロック周波数の変更履歴としては、図5に示すように、そのプロセッサID毎にクロックサイクルカウント値(CC)とクロック周波数(frequency)とがそれぞれ対応付けされてクロック周波数変更履歴保持部26内に記憶保持される。
For example, the clock frequency change history of the first and
ここで、クロック周波数の変更を記録する処理としては、上述のように、実行プローブ111a内に構成する場合を一例として説明しているが、これに限らず、次のように構成することもできる。まず、実行プローブ及びターゲットプログラムとは別に、クロック周波数変更履歴を書き込むプログラムを、クロック周波数変更検知部24の一部として用意しておく。次に、電源管理イベント等に起因する割り込みを契機として、クロック周波数変更検知部24は、割り込まれたプロセッサのクロック周波数が変更されているか否か検査する。そのクロック周波数が変更されている場合には、上述の手順でクロック周波数変更履歴保持部26へ該当プロセッサの変更履歴を書き込む。その書き込みが終わった後に、割り込み処理ルーチンを終了させて、通常のプログラムの実行に処理を戻す。このような構成を採用することにより、ターゲットプログラム及び実行プローブとは独立に、クロック周波数変更履歴の蓄積処理を実装することができる。
Here, as a process for recording the change of the clock frequency, the case where it is configured in the
そして、ターゲットプログラムを実行処理するときの性能計測の分析を行う場合には、第1〜第nプロセッサ101〜10nが単独又は協働して、その性能計測(分析)を効率よく、また、容易に行うために、実行プローブ111aがトレースデータ蓄積部112a内にトレースデータとして記憶保持するクロックサイクルカウント値を補正して第1〜第nプロセッサ101〜10n間で共通の経過時刻となる仮想時刻を算出する導出処理を開始する。
When analyzing the performance measurement when executing the target program, the first to n-
例えば、実行プローブ111aは、図6及び図7のフローチャートに従う処理を実行する。まずは、RAM112内に準備する変数mをリセット(m=0)した後に(ステップS31)、その変数mをインクリメント(m=m+1)して(ステップS32)、トレースデータ蓄積部112a内にそのm番目のトレースデータが記憶保持されているか否かを確認する(ステップS33)。
For example, the
この当初のステップS33では、性能計測分析の開始時には、少なくとも1つ以上のトレースデータが存在する。このことから、続けて、そのトレースデータ蓄積部112a内の最初のトレースデータのクロックサイクルカウント値とこれに対応付けされているプロセッサIDとを読み出してRAM112内に記憶保持する(ステップS34)。
In the initial step S33, at least one or more pieces of trace data exist at the start of the performance measurement analysis. Therefore, the clock cycle count value of the first trace data in the trace
次いで、そのRAM112内に記憶保持されたトレースデータのプロセッサIDを確認・特定して(ステップS35)、クロック周波数変更履歴保持部26内に履歴情報としてそのプロセッサIDに対応付けされている未処理のうちで最も時刻の古いクロック周波数とクロックサイクルカウント値の最先変更履歴エントリを読み出してRAM112内に記憶保持する(ステップS36)。
Next, the processor ID of the trace data stored and held in the
この後には、そのRAM112内に変更履歴エントリが記憶保持されたか否かを確認して(ステップS37)、クロック周波数が変更されていないために変更履歴エントリを確認できない場合には、後述するように、そのままこの性能計測分析における終了処理を実行する。 Thereafter, it is confirmed whether or not the change history entry is stored and held in the RAM 112 (step S37). If the change history entry cannot be confirmed because the clock frequency has not been changed, as will be described later. The end process in this performance measurement analysis is executed as it is.
一方、このステップS37において、クロック周波数が少なくとも1回以上変更されていて変更履歴エントリを確認できた場合には、RAM112内に保持する最先の変更履歴エントリのクロックサイクルカウント値(以下では、変更履歴カウント値ともいう)と、トレースデータのクロックサイクルカウント値(以下では、トレースデータカウント値ともいう)とを比較する(ステップS41)。すなわち、ここでは、最も時刻の古い最初の変更履歴カウント値とトレースデータカウント値とを比較する(ステップS41)。 On the other hand, if the clock frequency has been changed at least once in this step S37 and the change history entry has been confirmed, the clock cycle count value of the earliest change history entry held in the RAM 112 (hereinafter referred to as change) The history count value is also compared with the clock cycle count value of the trace data (hereinafter also referred to as the trace data count value) (step S41). That is, here, the first change history count value with the oldest time is compared with the trace data count value (step S41).
このステップS41において、最先の変更履歴カウント値がトレースデータカウント値よりも大きい場合には、そのトレースデータカウント値の取得時にはクロック周波数が変更されていないことから、後述するように、そのまま性能計測分析におけるこのトレースデータカウント値についての終了処理を実行する。 In this step S41, when the earliest change history count value is larger than the trace data count value, the clock frequency is not changed when the trace data count value is obtained, so that the performance measurement is performed as described later. A termination process for the trace data count value in the analysis is executed.
一方、このステップS41において、最先の変更履歴カウント値がトレースデータカウント値よりも小さい場合には、そのトレースデータカウント値の取得前にクロック周波数が変更されていることから、続けて、その最先の変更履歴カウント値から変更前の変更履歴カウント値を減算する(ステップS42)。すなわち、ここでは、最先の変更履歴カウント値から存在しない変更前の変更履歴カウント値なしを減算して増加分を算出する(ステップS42)。この後には、その増加分の増加カウント値を変更前の、言い換えると、変更されていないクロック周波数、すなわち、予めクロック周波数設定部12に設定されているデフォルトのクロック周波数を取得して除算することにより第1経過時刻を算出することができる(ステップS43)。そして、その第1経過時刻をRAM112内の積算経過時刻に加算(積算)して記憶保持する(ステップS44)。
On the other hand, if the earliest change history count value is smaller than the trace data count value in this step S41, the clock frequency has been changed before the trace data count value is acquired, so The change history count value before change is subtracted from the previous change history count value (step S42). That is, here, the increment is calculated by subtracting the change history count value before change that does not exist from the earliest change history count value (step S42). After this, the increment count value of the increment is obtained by dividing the clock frequency before the change, that is, the clock frequency that has not been changed, that is, the default clock frequency set in the clock
次いで、先のステップS36と同様に、クロック周波数変更履歴保持部26内に履歴情報として同一のプロセッサIDに対応付けされている次のクロック周波数とクロックサイクルカウント値(後続変更履歴エントリ)を読み出してRAM112内に記憶保持する(ステップS45)。
Next, as in the previous step S 36, the next clock frequency and clock cycle count value (subsequent change history entry) associated with the same processor ID is read as history information in the clock frequency change
この後には、同様に、そのRAM112内に後続の変更履歴エントリが記憶保持されたか否かを確認して(ステップS46)、最終のクロック周波数の変更までの補正処理が完了していて後続の変更履歴エントリを確認できない場合には、後述するように、そのまま性能計測分析におけるこのトレースデータカウント値についての終了処理を実行する。 After this, similarly, it is confirmed whether or not the subsequent change history entry is stored and held in the RAM 112 (step S46), and the correction processing up to the final clock frequency change is completed and the subsequent change is completed. If the history entry cannot be confirmed, the end processing for the trace data count value in the performance measurement analysis is executed as it is, as will be described later.
一方、このステップS46において、クロック周波数が続けて変更されていて後続の変更履歴エントリを確認できた場合には、ステップS41に戻って、RAM112内に保持する後続の変更履歴カウント値とトレースデータカウント値とを比較する。
On the other hand, when the clock frequency is continuously changed and the subsequent change history entry can be confirmed in step S46, the process returns to step S41 and the subsequent change history count value and trace data count held in the
この2回目のステップS41においても、後続の変更履歴カウント値がトレースデータカウント値よりも大きい場合には、そのトレースデータカウント値の取得時にはそのクロック周波数の変更は行われていないことから、後述するように、そのままこの性能計測分析におけるこのトレースデータカウント値についての終了処理を実行する。 Also in this second step S41, if the subsequent change history count value is larger than the trace data count value, the clock frequency is not changed when the trace data count value is acquired, and will be described later. As described above, the end processing for the trace data count value in the performance measurement analysis is executed as it is.
一方、この2回目のステップS41においても、後続の変更履歴カウント値がトレースデータカウント値よりも小さい場合には、そのトレースデータカウント値の取得前にクロック周波数が再度変更されていることから、続けて同様の処理を実行する。すなわち、後続変更履歴カウント値から先の最先変更履歴カウント値を減算して増加分を算出し(ステップS42)、その増加カウント値を変更前のクロック周波数で除算することにより第2経過時刻を算出し(ステップS43)、その第2経過時刻をRAM112内の積算経過時刻(第1経過時刻)に加算(積算)して記憶保持する(ステップS44)。
On the other hand, also in this second step S41, if the subsequent change history count value is smaller than the trace data count value, the clock frequency has been changed again before the trace data count value is acquired, so The same process is executed. That is, an increment is calculated by subtracting the previous earliest change history count value from the subsequent change history count value (step S42), and the second elapsed time is calculated by dividing the increment count value by the clock frequency before the change. The second elapsed time is calculated (step S43), added (integrated) to the accumulated elapsed time (first elapsed time) in the
この後には、クロック周波数変更履歴保持部26内から読み出していない後続変更履歴エントリが存在して、その後続変更履歴カウント値がトレースデータカウント値よりも小さく、そのトレースデータカウント値の取得前にクロック周波数が再度変更されている限り、これらステップS41〜S46を繰り返す。これにより、クロック周波数の変更時までの、言い換えると、最終の後続変更履歴カウント値までの増加分をその変更前のクロック周波数で除算した第k−1経過時刻を加算して積算経過時刻を算出(導出)することができ、その積算経過時刻をRAM112内に記憶保持する。
After this, there is a subsequent change history entry that has not been read from the clock frequency change
一方、ステップS41において、後続の変更履歴カウント値がトレースデータカウント値よりも大きく、そのトレースデータカウント値の取得後にクロック周波数が変更されていることを確認した場合には、このトレースデータカウント値についての終了処理に移行する。 On the other hand, when it is confirmed in step S41 that the subsequent change history count value is larger than the trace data count value and the clock frequency is changed after the trace data count value is obtained, The process ends.
この終了処理では、そのトレースデータカウント値から最終の後続変更履歴カウント値を減算して増加分を算出し(ステップS51)、その増加カウント値を最終のクロック周波数で除算して最終の第k経過時刻を算出した後に(ステップS52)、この最終の第k経過時刻をRAM112内の積算経過時刻に加算(積算)して記憶保持する(ステップS53)。次いで、そのRAM112内に記憶保持する最初のトレースデータカウント値に応じた積算経過時刻を他の第2〜第nプロセッサ102〜10nと共通の仮想時刻として、そのトレースデータカウント値と共にプロセッサIDに対応付けしてターゲットプログラムの性能計測(分析)に受け渡す(ステップS43)。この後に、このトレースデータカウント値についての導出処理を終了して、ステップS32に戻る。
In this end processing, the final subsequent change history count value is subtracted from the trace data count value to calculate an increment (step S51), and the increment count value is divided by the final clock frequency to obtain the final k-th elapsed time. After calculating the time (step S52), the final k-th elapsed time is added (integrated) to the accumulated elapsed time in the
この後には、変数mをインクリメント(m=m+1)することにより、トレースデータ蓄積部112a内に記憶保持するm個のトレースデータの全てについて、トレースデータカウント値に応じた積算経過時刻を算出して仮想時刻とする補正処理(ステップS32〜S54)を繰り返し行うことができ、その補正処理する対象のトレースデータのクロックサイクルカウント値がトレースデータ蓄積部112a内に存在せず、この補正処理の完了が確認できたときに(ステップS33)一連の補正処理を終了する。
Thereafter, by incrementing the variable m (m = m + 1), the total elapsed time corresponding to the trace data count value is calculated for all m pieces of trace data stored and held in the trace
ところで、ステップS46において、RAM112内に後続変更履歴エントリを確認することができずに、クロック周波数の変更自体が終了していることを確認した場合には、この性能計測分析におけるそのトレースデータカウント値についての終了処理に移行する(ステップS51〜S54)。この終了処理では、同様に、そのトレースデータカウント値から最終の後続変更履歴カウント値までの増加分の増加カウント値を最終のクロック周波数で除算して算出した最終の第k経過時刻を、RAM112内の積算経過時刻に加算(積算)して仮想時刻とし、トレースデータカウント値と共にプロセッサIDに対応付けしてターゲットプログラムの性能計測(分析)に受け渡して、ステップS32に戻る。
By the way, when it is confirmed in step S46 that the subsequent change history entry cannot be confirmed in the
また、ステップS37において、RAM112内に最先の変更履歴エントリを確認できずに、クロック周波数の変更自体が行われていないプロセッサの場合には、予めクロック周波数設定部12に設定されているクロック周波数を取得してRAM112内に記憶保持した後に(ステップS38)、この性能計測分析における終了処理に移行する(ステップS51〜S54)。この終了処理では、同様に、そのトレースデータカウント値までの増加分の増加カウント値(トレースデータカウント値自体)をデフォルトのクロック周波数で除算して算出した仮想時刻を、そのトレースデータカウント値と共にプロセッサIDに対応付けしてターゲットプログラムの性能計測(分析)に受け渡して、ステップS32に戻る。
In the case of a processor in which the first change history entry cannot be confirmed in the
このように、この実施形態によれば、変更後のクロック周波数と共にその変更時のクロックサイクルカウント値を履歴情報として取得・保持して、ターゲットプログラムの性能計測の分析等を行う際に使用するトレースデータカウント値(現実のタイミング)に応じた仮想時刻を算出・積算(導出)することができる。したがって、トレースデータカウント値は、第1〜第nプロセッサ101〜10nの動作するクロック周波数から離れて、現実の時間経過と同一の一定速度で増進する仮想時刻に補正して共通化することができる。この結果、例えば、ターゲットプログラムの性能計測などを第1〜第nプロセッサ101〜10nのクロック周波数の違いにより複雑化させることなく、簡易かつ容易に、また、効率よく処理することができる。
As described above, according to this embodiment, the clock frequency after the change and the clock cycle count value at the time of the change are acquired and retained as history information, and the trace used when performing the performance measurement analysis of the target program, etc. Virtual time according to the data count value (actual timing) can be calculated and integrated (derived). Therefore, the trace data count value can be corrected and shared with a virtual time that is separated from the clock frequency at which the first to n-
このトレースデータカウント値の補正処理は、ターゲットプログラム111の性能計測の実行処理中には、その第1〜第nプロセッサ101〜10nのプロセッサIDと共に変更時のクロック周波数とクロックサイクルカウント値のみを取得して記憶保持する処理に留めているので、仮想時刻の算出に必要な変更時のクロック周波数とクロックサイクルカウント値の走査や演算処理が負担になってしまうことはなく、実行プローブ111aを快適に実行させつつトレースデータなどをデータ収集することができる。
This correction processing of the trace data count value acquires only the clock frequency and clock cycle count value at the time of change together with the processor IDs of the first to n-
次に、図8〜図12は、上述実施形態に付加させることのできる、マルチプロセッサのカウント値補正プログラムをコンピュータに読み込ませて実行することによりマルチプロセッサのカウント値補正方法を実施するマルチプロセッサのカウント値補正装置の一例を示す図である。ここで、このマルチプロセッサの一例は、上述の実施形態と略同様に構成されていることから、図面を流用して、同様な構成には同一の符号を付して特徴部分を説明する。図8はプロセッサ毎のクロックサイクルカウント値のカウント開始時期を同期させるカウント値補正装置の概略全体構成を示す概念構成図、図9はそのプロセッサ間でのやり取りとその処理結果を説明する概念図、図10及び図11はそのプロセッサ毎のクロックサイクルカウント値のカウント開始時期の同期処理を説明するフローチャート、図12はそのプロセッサが実行するプログラム中におけるクロックサイクルカウント値の修正を説明するプローチャートである。 Next, FIGS. 8 to 12 show a multiprocessor that implements the multiprocessor count value correction method by causing a computer to read and execute a multiprocessor count value correction program that can be added to the above-described embodiment. It is a figure which shows an example of a count value correction apparatus. Here, since an example of this multiprocessor is configured in substantially the same manner as in the above-described embodiment, the same reference numerals are given to the same configurations and the characteristic portions will be described using the drawings. FIG. 8 is a conceptual configuration diagram showing a schematic overall configuration of a count value correction device that synchronizes the count start timing of the clock cycle count value for each processor, and FIG. 9 is a conceptual diagram illustrating the exchange between the processors and the processing results thereof. 10 and 11 are flowcharts for explaining the synchronization processing of the count start timing of the clock cycle count value for each processor. FIG. 12 is a flowchart for explaining the correction of the clock cycle count value in the program executed by the processor. .
図8において、マルチプロセッサ200は、上述実施形態でのマルチプロセッサ100と同様に、第1〜第nプロセッサ101〜10nが、ROM111やRAM112と共にバス113に共通接続されてコンピュータ内に搭載されている。この第1〜第nプロセッサ101〜10nは、それぞれのプロセッサID保持部11内のプロセッサIDに基づいてマルチプロセッサとして機能する。また、第1〜第nプロセッサ101〜10nは、クロック周波数設定部12内に予め設定されているクロック周波数に応じた速度のカウント値をクロックサイクルカウント値保持部13で計数・保持することにより同期を取る。すなわち、このマルチプロセッサ200では、第1〜第nプロセッサ101〜10nのそれぞれが上述実施形態のようにクロック周波数を変更することなく、固定のクロック周波数でクロックサイクルカウントを計数している。
In FIG. 8, a
このマルチプロセッサ200は、上述実施形態と同様に、プロセッサID取得部21とクロックサイクルカウント値取得部22を備えており、性能計測を実行する際のトレースデータをRAM12内のトレースデータ蓄積部112a内に蓄積保持する。
The
また、マルチプロセッサ200は、第1〜第nプロセッサ101〜10nがRAM112を利用しつつ実行プローブ111aを実行することにより機能する、クロック差分計測部31を備えるとともに、RAM112が順序カウント値保持部32とクロック差分保持部33を構成している。このマルチプロセッサ200は、これら各部を備えることにより、例えば、性能計測などを行う際に利用するクロックサイクルカウント値のカウント開始時期が同一タイミングになるようにリセットする同期処理を行って、第1〜第nプロセッサ101〜10n毎のトレース用データをより高精度に処理可能に補正する。
In addition, the
ここで、第1〜第nプロセッサ101〜10nは、高精細には、それぞれ順次に起動して駆動を開始することから内蔵するクロックサイクルカウント値保持部13のカウント開始もそれぞれ遅れることになる。例えば、図9に示すように、第1プロセッサ101が駆動を開始した後に第2プロセッサ102が駆動を開始する場合には、クロックサイクルカウント値保持部13内のクロックサイクルカウント値のカウント開始タイミングに遅延分dだけのずれが生じている。
Here, since the first to n-
このことから、第1〜第nプロセッサ101〜10nは、それぞれ他のプロセッサとクロックサイクルカウント値のカウント開始タイミングを一致させてそのクロックサイクルカウント値を信頼性高く、また容易に分析などに利用することができるようにする。
Therefore, the first to n-
具体的には、第1〜第nプロセッサ101〜10nは、実行プローブ111aの制御の下、何れか一つを基準プロセッサにするとともに他の一つを協働相手の対応プロセッサとして、その間で所定の信号のやり取りすることにより、第1〜第nプロセッサ101〜10n間の起動タイミングによるクロックサイクルカウント値のずれをリセットする。例えば、実行プローブ111aは、図9に示すように、基準プロセッサ101と応答プロセッサ102の間で所定の信号のやり取りをして、それぞれでのクロックサイクルカウント値を取得することにより、その間の起動タイミングによるクロックサイクルカウント値のずれをリセットする同期処理を次の手順により実行する。まずは、基準プロセッサ101が実行する実行プローブ111aの制御の下、プロセッサID取得部21がプロセッサID保持部11内のプロセッサIDを取得して特定する。また、クロックサイクルカウント値取得部22が、順序カウント値として、基準プロセッサ101の第1クロックサイクルカウント値A、応答プロセッサ102の第2クロックサイクルカウント値B、基準プロセッサ101の第3クロックサイクルカウント値Cを順次に取得して、順序カウント値保持部32内に記憶保持する。この後には、反対に、その応答プロセッサ102が実行する実行プローブ111aの制御の下、同様の処理により、その応答プロセッサ102に基準プロセッサとして振舞って貰うのと並行して、基準プロセッサ101にも応答プロセッサとして応答させることによって、逆転順序カウント値として、順次に取得した第1〜第3クロックサイクルカウント値a、b、cを順序カウント値保持部32内に記憶保持する。すなわち、実行プローブ111aは、基準プロセッサ101と対応プロセッサ102との間でやり取りさせて順序カウント値を取得する順序カウント値取得手段を構成している。
Specifically, the first to n-
ところで、この基準プロセッサ101と応答プロセッサ102では、クロックサイクルカウント値保持部13のカウント開始タイミングにずれがないと仮定すると、基準プロセッサ101が基準プロセッサとして機能する場合の所定信号のやり取りにおける往路と復路の伝送遅延Sを次式により算出することができ、
S=(C+A)/2−B
逆に、基準プロセッサ101が応答プロセッサとして機能する場合の所定信号のやり取りにおける往路と復路の伝送遅延sは次式により算出することができる。
s=(c+a)/2−bBy the way, assuming that there is no deviation in the count start timing of the clock cycle count
S = (C + A) / 2−B
On the contrary, the transmission delay s between the forward path and the return path in the exchange of a predetermined signal when the
s = (c + a) / 2−b
この基準プロセッサ101と応答プロセッサ102間の伝送遅延S、sは、往路と復路毎での伝送速度が同様であることから相殺することができる。しかるに、実際には、クロックサイクルカウント値保持部13のカウント開始タイミングにずれがある。このことから、その相殺の後には、その基準プロセッサ101と応答プロセッサ102におけるクロックサイクルカウント値保持部13のカウント開始タイミングのずれに応じた遅延分のカウント値dを差分として算出することができ、そのカウント値dは次式で導出することができる。
d=S−s=(C−c)/4+(A−a)/4−(B−b)/2The transmission delays S and s between the
d = S−s = (C−c) / 4 + (A−a) / 4− (B−b) / 2
そして、第1〜第nプロセッサ101〜10nは、基準プロセッサと対応プロセッサとして動作することにより取得した順序カウント値保持部32内のクロックサイクルカウント値A〜C、a〜cを用いて、クロック差分計測部31がクロックサイクルカウント値保持部13のカウント開始タイミングのずれ(差分)であるカウント値dを基準プロセッサに対応する応答プロセッサ毎に導出する。そして、クロック差分保持部33は、その応答プロセッサ毎のプロセッサIDとカウント値補正値d(同期補正値)を、基準プロセッサのプロセッサIDと共に対応付けして記憶保持する。すなわち、クロック差分計測部31が補正値導出手段を構成して、クロック差分保持部33が補正値保持手段を構成する。
Then, the first to n-
例えば、第1プロセッサ101は、図9に示すように、基準プロセッサとして応答プロセッサ102と協働するとき、第1クロックサイクルカウント値A=75、第2クロックサイクルカウント値B=125、第3クロックサイクルカウント値C=225を取得し、また、その第2プロセッサ102に基準プロセッサとして動作してもらうことにより、第1クロックサイクルカウント値a=275、第2クロックサイクルカウント値b=425、第3クロックサイクルカウント値c=425を取得して、順序カウント値保持部32内に保持したとする。すると、クロック差分計測部31は、これらカウント値A〜C、a〜cを上記式に代入することにより、その応答プロセッサ102のクロックサイクルカウント値保持部13のカウント開始タイミングのずれによるカウント値d=50を算出(導出)して、クロック差分保持部33がカウント値補正値dとして記憶保持する。これにより、基準プロセッサ101は、ターゲットプログラムの性能計測分析の実行時における自身のクロックサイクルカウント値t1=825はそのままトレースデータ蓄積部112a内に蓄積保持するのに対して、応答プロセッサ102のクロックサイクルカウント値t2=875にはクロック差分保持部33内に記憶保持するカウント値補正値=50を遅延カウント値として加算してそのクロックサイクルカウント値t2=925をトレースデータ蓄積部112a内に蓄積保持する。この結果、第1、第2プロセッサ101、102は、協働する性能計測分析などでも処理時間を正確に修正して分析等を実行することができる。
For example, as shown in FIG. 9, when the
次に、ターゲットプログラムの実行時の性能計測を図10〜図12に示すフローチャートを用いて説明する。 Next, performance measurement during execution of the target program will be described with reference to the flowcharts shown in FIGS.
まず、ターゲットプログラムを実行処理するときの性能計測を行うときに、例えば、そのターゲットプログラムを第1プロセッサ101が他の第2〜第nプロセッサ102〜10nを協働させて実行する場合には、その実行処理を開始する前に、言い換えると、プロセッサ101〜10nのそれぞれが実行プローブ111aの制御の下で駆動を開始する前に、その実行プローブ111aは、第1プロセッサ101を基準プロセッサとして、応答プロセッサの第2〜第nプロセッサ102〜10n毎に図10及び図11に示す同期処理を実行する。なお、基準プロセッサ101での同期処理は図10のフローチャートに示す一方、応答プロセッサ102での同期処理は図11のフローチャートに示している。
First, when performing performance measurement when executing a target program, for example, when the
詳細には、基準プロセッサ101は、まずは、RAM112内に準備する変数pをリセット(p=0)する(ステップS110)。この後に、プロセッサID取得部21がプロセッサID保持部11内の自身のプロセッサIDを取得するとともに、クロックサイクルカウント値取得部22がクロックサイクルカウント値保持部13内で計数保持する第1クロックサイクルカウント値Aを取得して、そのプロセッサIDに対応付けして順序カウント値保持部32内に記憶保持する(ステップS111)。次いで、基準プロセッサ101は、応答プロセッサ102に第2クロックサイクルカウント値Bと共にプロセッサIDを取得して返送するように指示し(ステップS112)、そのクロックサイクルカウント値BとプロセッサIDが応答プロセッサ102から送られてくるまで待機する(ステップS113)。ここで、以下においても、各種情報は第1、第2プロセッサ101、102毎に内部処理して取得することから、同様に、プロセッサIDはプロセッサID取得部21が第1、第2プロセッサ101、102毎のプロセッサID保持部11から取得するとともに、クロックサイクルカウント値もクロックサイクルカウント値取得部22がそれぞれのクロックサイクルカウント値保持部13から取得することから、以下の説明においては、例えば、プロセッサIDを取得するなどと簡単に説明する。
Specifically, the
一方、応答プロセッサ102は、基準プロセッサ101の処理と並行して、その基準プロセッサ101から第2クロックサイクルカウント値BとプロセッサIDを取得して返送することの指示が送られてくるのを待って(ステップP211)、その指示を確認すると、基準プロセッサ101と同様に、その第2クロックサイクルカウント値BとプロセッサIDを取得して基準プロセッサ101に送信し(ステップP212)、次の指示が基準プロセッサ101から送られてくるまで待機する(ステップP213)。
On the other hand, the
次いで、基準プロセッサ101は、応答プロセッサ102から送られてきた第2クロックサイクルカウント値BとプロセッサIDを受け取ると(ステップS113)、その第2クロックサイクルカウント値BとプロセッサIDを順序カウント値保持部32内に対応付けして記憶保持した後に(ステップS114)、ステップS111と同様に、第3クロックサイクルカウント値CとプロセッサIDを取得して順序カウント値保持部32内に対応付けして記憶保持する(ステップS115)。
Next, when the
この後に、基準プロセッサ101は、基準プロセッサとして動作してステップS111〜S115と同様の処理を実行する駆動指示を応答プロセッサ102に送信して(ステップS116)、その応答プロセッサ102から応答プロセッサとして動作することの指示が送られてくるのを待機する(ステップS117)。
Thereafter, the
一方、応答プロセッサ102は、基準プロセッサ101から基準プロセッサとして動作することの駆動指示を受け取ると(ステップP213)、第1クロックサイクルカウント値aとプロセッサIDを取得して順序カウント値保持部32内に対応付けして記憶保持した後に(ステップP214)、基準プロセッサ101に第2クロックサイクルカウント値bとプロセッサIDを取得して返送するように指示して(ステップP215)、その第2クロックサイクルカウント値bとプロセッサIDが基準プロセッサ101から送られてくるまで待機する(ステップP216)。
On the other hand, when the
他方、基準プロセッサ101は、応答プロセッサ102から第2クロックサイクルカウント値bとプロセッサIDを取得して返送することの指示が送られてくるのを待って(ステップS117)、その指示を確認すると、その第2クロックサイクルカウント値bとプロセッサIDを取得して応答プロセッサ102に送信し(ステップS118)、その応答プロセッサ102から集めた第1〜第3クロックサイクルカウント値a〜cとプロセッサIDが送られてくるまで待機する(ステップS119)。
On the other hand, the
一方、応答プロセッサ102は、基準プロセッサ101から送られてきた第2クロックサイクルカウント値bとプロセッサIDを受け取ると(ステップP216)、その第2クロックサイクルカウント値bとプロセッサIDを順序カウント値保持部32内に対応付けして記憶保持した後に(ステップP217)、第3クロックサイクルカウント値cとプロセッサIDを取得して順序カウント値保持部32内に対応付けして記憶保持した後に(ステップP218)、これらの一連の第1〜第3クロックサイクルカウント値a〜cとプロセッサIDをそれぞれ対応付けして基準プロセッサ101に送信して(ステップP219)、この応答プロセッサとしての1回分の処理を完了する。
On the other hand, when the
そして、基準プロセッサ101は、応答プロセッサ102から送信されてきた第1〜第3クロックサイクルカウント値a〜cとそれぞれのプロセッサIDを受け取ると(ステップS119)、取得・保持したクロックサイクルカウント値A〜C、a〜cをプロセッサIDと記憶順により識別して、上記の式に代入することにより、協働する応答プロセッサ102に対するカウント値補正値dを算出してクロック差分保持部33内にそのプロセッサIDに対応付けしてその導出回数pと共に記憶保持する(ステップS120)。
When the
この後には、基準プロセッサ101は、RAM112内の変数pをインクリメント(p=p+1)して、応答プロセッサ102に対するカウント値補正値dの導出回数pをカウントした後に(ステップS121)、その導出回数pが予め設定されている回数に達したか確認をして(ステップS122)、導出回数pが設定回数に達していない場合には、ステップS111に戻って同様の処理を繰り返す。
After this, the
一方、その導出回数pが設定回数に達したことを確認した場合には、設定回数分のカウント値補正値dの平均値を算出して応答プロセッサ102に対する平均カウント値補正値dとしてクロック差分保持部33内にそのプロセッサIDに対応付けして記憶保持して(ステップS123)、この基準プロセッサとしての一連の処理を完了する。
On the other hand, when it is confirmed that the derivation number p has reached the set number, the average value of the count value correction values d for the set number of times is calculated and the clock difference is held as the average count value correction value d for the
そして、ターゲットプログラムの性能計測を実行する際には、例えば、第1プロセッサ101では、図12に示すように、実行プローブ111aにプログラム制御が移行して(ステップS311)、上述した同期処理(ステップS110〜S123)を協働する第2〜第nプロセッサ102〜10n毎に実行した後に(ステップS312)、性能計測に必要なトレースデータの収集・記録などが実行される(ステップS313)。この後に、協働する第2〜第nプロセッサ102〜10nのプロセッサIDをプロセッサID取得部21がそれぞれのプロセッサID保持部11から取り出して取得するとともに(ステップS314)、そのプロセッサIDに対応付けされてクロック差分保持部33内に記憶保持されている平均カウント値補正値dを読み出して取得する(ステップS316)。これにより、性能計測に利用するために収集してトレースデータ蓄積部112a内にトレースデータとして記憶保持させたクロックサイクルカウント値は、そのプロセッサIDに対応する平均カウント値補正値dにより修正して、そのトレースデータ蓄積部112a内に記憶保持させることができ(ステップS317)、この後に、性能計測対象のターゲットプログラムにプログラム制御を移行してこの実行プログラムを終了する(ステップS318)。
When executing the performance measurement of the target program, for example, in the
このように、この付加装置によれば、第1〜第nプロセッサ101〜10n毎にカウント開始タイミングの一致するトレースデータカウント値に補正して共通化することができる。したがって、第1〜第nプロセッサ101〜10nのクロックサイクルカウント値保持部13の計数するカウント開始タイミングの違いにより正確性が低下してしまうことなく、ターゲットプログラムの性能計測の分析等を高精度に実行することができる。
Thus, according to this additional device, it is possible to correct and share the trace data count value having the same count start timing for each of the first to n-
以上で説明した付加装置は、単独で利用することができることはいうまでもないが、上述の第1実施形態と共に搭載する場合には、第1〜第nプロセッサ101〜10n毎に変更可能なクロック周波数でカウントするトレースデータカウント値を補正して共通化する仮想時刻を、さらに、そのカウント開始時刻を一致させることができ、より信頼性高くターゲットプログラムの性能計測の分析等を実行することができる。
Needless to say, the additional device described above can be used alone, but when mounted together with the above-described first embodiment, the clock can be changed for each of the first to n-
このクロックサイクルカウント値のカウント開始タイミングの同期処理は、ターゲットプログラムの実行開始直後に限るものではなく、例えば、クロック周波数の変更が繰り返し行われると、本来なら無視できる程度の誤差が蓄積されて算出する仮想時刻に信頼性がなくなる可能性がある。このことから、予め設定されている間隔あるいは時刻毎に、又は、任意のタイミングの指示命令に応じて、第1〜第nプロセッサ101〜10nのクロック周波数を一定値に固定して、上述の同期処理を実行することにより、導出する仮想時刻の信頼性低下をリセットすることができる。
The synchronization processing of the clock cycle count value count start timing is not limited to immediately after the start of execution of the target program. For example, if the clock frequency is changed repeatedly, errors that can be ignored are accumulated and calculated. There is a possibility that the reliability will be lost at the virtual time. From this, the clock frequency of the first to n-
以上、この発明の一実施形態を図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計の変更等があってもこの発明に含まれる。 As described above, the embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and there are design changes and the like without departing from the gist of the present invention. However, it is included in this invention.
例えば、上述の実施形態では、トレースデータカウント値毎に、クロック周波数の変更までのクロックサイクルカウント値の増加分から算出する経過時刻を積算する処理を繰り返すことにより仮想時刻を導出するようにしたが、これに限るものではない。例えば、先のトレースデータカウント値の補正処理における第n経過時刻までの積算値を保持しておき、その第n経過時刻までの積算値に、次に補正処理するトレースデータカウント値の増加分から算出する第n+1経過時刻を積算することにより、その仮想時刻となる積算経過時刻を導出するようにしてもよい。 For example, in the above-described embodiment, the virtual time is derived by repeating the process of accumulating the elapsed time calculated from the increment of the clock cycle count value until the clock frequency is changed for each trace data count value. This is not a limitation. For example, the integrated value up to the nth elapsed time in the correction processing of the previous trace data count value is held, and the integrated value up to the nth elapsed time is calculated from the increment of the trace data count value to be corrected next. The accumulated elapsed time that is the virtual time may be derived by integrating the (n + 1) th elapsed time.
また、上述の実施形態では、複数のプロセッサを搭載する場合に、クロック周波数の変更に影響されることのない仮想時刻を導出して経過時刻を共通化する場合について述べたが、これに限らない。例えば、一つのプロセッサを搭載する装置でも、そのクロック周波数の変更によりクロックサイクルカウント値の増加傾向が変化する場合にも適用することができ、そのクロックサイクルカウント値の経過時間を仮想時刻により一般化して、分析等を容易化することもできる。 Further, in the above-described embodiment, when a plurality of processors are mounted, a case has been described in which a virtual time that is not affected by a change in clock frequency is derived and the elapsed time is shared, but the present invention is not limited thereto. . For example, even a device equipped with a single processor can be applied when the increasing tendency of the clock cycle count value changes due to the change of the clock frequency, and the elapsed time of the clock cycle count value is generalized by virtual time. Thus, analysis and the like can be facilitated.
また、上述の実施形態では、性能測定するターゲットプログラムを一例にして説明したが、これに限らず、例えば、統計計算に拠らずに、個別に処理時間等の共通化や基準時のリセットも行うことができるので、一般的なプログラムにも適用することができ、例えば、計算資源を効率的に活用する高性能なプログラムの作成にも活用することができる。 In the above-described embodiment, the target program for performance measurement has been described as an example. However, the present invention is not limited to this. For example, the processing time and the like can be individually reset and reset at the reference time without using statistical calculation. Since it can be performed, it can be applied to general programs. For example, it can also be used to create high-performance programs that efficiently use computing resources.
この発明は、マルチプロセッサ上で動作する、計算資源を効率的に活用する高性能プログラムに広く適用することができる。 The present invention can be widely applied to high-performance programs that operate on a multiprocessor and efficiently use computational resources.
11 プロセッサID保持部
12 クロック周波数設定部
13 クロックサイクルカウント値保持部
21 プロセッサID取得部(変更プロセッサ識別情報取得手段、対応プロセッサ識別情報取得手段)
22 クロックサイクルカウント値取得部(変更時カンウント値取得手段)
23 クロック周波数変更部
24 クロック周波数変更検知部(変更検知手段、動作周波数取得手段)
25 クロックサイクルカウント補正部(時刻導出手段)
26 クロック周波数変更履歴保持部(変更履歴保持手段)
31 クロック差分計測部(補正値導出手段)
32 順序カウント値保持部
33 クロック差分保持部(補正値保持手段)
100、200 マルチプロセッサ
101〜10n 第1〜第nプロセッサ
101 基準プロセッサ
102 応答プロセッサ
111 ROM(ターゲットプログラム)
111a 実行プローブ(順序カウント値取得手段)
112 RAM
112a トレースデータ蓄積部11 processor
22 Clock cycle count value acquisition unit (count value acquisition means at change)
23 Clock
25 Clock cycle count correction unit (time deriving means)
26 Clock frequency change history holding unit (change history holding means)
31 Clock difference measuring unit (correction value deriving means)
32 Order count
100, 200
111a execution probe (order count value acquisition means)
112 RAM
112a Trace data storage unit
Claims (16)
前記動作周波数を変更した前記プロセッサの識別情報を取得する変更プロセッサ識別情報取得手段と、
前記動作周波数の変更後の当該動作周波数を取得する動作周波数取得手段と、
前記動作周波数に基づいてカウントする前記プロセッサ毎のクロックサイクルカウンタの該動作周波数の変更時における変更時カウント値を取得する変更時カンウント値取得手段と、
取得した前記動作周波数及び前記変更時カウント値を該当プロセッサの識別情報に対応付けして履歴情報として保持する変更履歴保持手段と、
前記識別情報に対応付けされている前記動作周波数及び前記変更時カウント値の前記履歴情報に基づいて前記プロセッサ毎の仮想時刻を導出する時刻導出手段と
を備えることを特徴とするマルチプロセッサのカウント値補正装置。Change detection means for detecting a change in operating frequency for each processor that constructs a multiprocessor;
Changed processor identification information acquisition means for acquiring identification information of the processor that has changed the operating frequency;
Operating frequency acquisition means for acquiring the operating frequency after the change of the operating frequency;
A change count value acquisition means for acquiring a change count value when the operation frequency of the clock cycle counter for each processor that counts based on the operation frequency is changed;
Change history holding means for holding the acquired operating frequency and the count value at the time of change as history information in association with identification information of the corresponding processor;
A time deriving unit for deriving a virtual time for each processor based on the history information of the operating frequency and the change count value associated with the identification information. Correction device.
少なくとも前記対応プロセッサの識別情報を取得する対応プロセッサ識別情報取得手段と、
前記基準プロセッサ用の前記クロックサイクルカウンタのカウント値に対する前記対応プロセッサ用の前記クロックサイクルカウンタのカウント値のずれをリセットするのに必要な同期補正値を前記順序カウント値に基づいて導出する補正値導出手段と、
前記基準プロセッサのカウント値に対する前記対応プロセッサのカウント値のずれをリセットする前記同期補正値を該対応プロセッサの識別情報に対応させて保持する補正値保持手段と
を備えることを特徴とする請求項1、2又は3記載のマルチプロセッサのカウント値補正装置。A predetermined order count value in the reference processor and the corresponding processor by exchanging in a predetermined order between the processors, with any one as a reference processor and any other as a corresponding processor Order count value acquisition means for acquiring
Corresponding processor identification information acquisition means for acquiring identification information of at least the corresponding processor;
Correction value derivation for deriving a synchronization correction value necessary for resetting a deviation of the count value of the clock cycle counter for the corresponding processor from the count value of the clock cycle counter for the reference processor based on the order count value Means,
2. The correction value holding means for holding the synchronization correction value for resetting a deviation of the count value of the corresponding processor with respect to the count value of the reference processor in correspondence with identification information of the corresponding processor. The multiprocessor count value correction apparatus according to 2 or 3.
前記補正値導出手段は、次式を用いて前記同期補正値dを算出し、
d=(C−c)/4+(A−a)/4−(B−b)/2
前記補正値保持手段は、算出した前記同期補正値dを前記対応プロセッサの前記識別情報に対応させて保持することを特徴とする請求項4記載のマルチプロセッサのカウント値補正装置。The sequence count value acquisition means acquires the second sequence count value B returned in response to the request to the corresponding processor after acquiring the first sequence count value A of the reference processor. The sequence processing for obtaining the third sequence count value C of the reference processor is executed again, and then the sequence processing is executed by reversing the reference processor and the corresponding processor to perform the reverse first to third sequence count values a. , B, c
The correction value deriving means calculates the synchronization correction value d using the following equation:
d = (C−c) / 4 + (A−a) / 4− (B−b) / 2
5. The multiprocessor count value correction apparatus according to claim 4, wherein the correction value holding means holds the calculated synchronization correction value d in association with the identification information of the corresponding processor.
当該順序カウント値に基づいて前記基準プロセッサ用の前記クロックサイクルカウンタのカウント値に対する前記対応プロセッサ用の前記クロックサイクルカウンタのカウント値のずれをリセットするのに必要な同期補正値を導出して、該同期補正値を該当対応プロセッサの識別情報に対応させて保持することを特徴とする請求項7、8又は9記載のマルチプロセッサのカウント値補正方法。A predetermined order count value in the reference processor and the corresponding processor by exchanging in a predetermined order between the processors, with any one as a reference processor and any other as a corresponding processor And after obtaining at least the identification information of the corresponding processor,
Deriving a synchronization correction value necessary for resetting a deviation of the count value of the clock cycle counter for the corresponding processor with respect to the count value of the clock cycle counter for the reference processor based on the order count value; 10. The multiprocessor count value correction method according to claim 7, wherein the synchronization correction value is held in correspondence with identification information of the corresponding processor.
次式を用いて前記同期補正値dを算出し、
d=(C−c)/4+(A−a)/4−(B−b)/2
該同期補正値dを前記対応プロセッサの前記識別情報に対応させて保持することを特徴とする請求項10記載のマルチプロセッサのカウント値補正方法。After obtaining the first order count value A of the reference processor as the order count value, the second order count value B returned in response to the request to the corresponding processor is obtained again after obtaining the second order count value B. An order process for obtaining the third order count value C of the reference processor is executed, and thereafter, the order process in which the reference processor and the corresponding processor are inverted is executed, and the reverse first to third order count values a, b , After obtaining c
The synchronization correction value d is calculated using the following equation:
d = (C−c) / 4 + (A−a) / 4− (B−b) / 2
11. The multiprocessor count value correction method according to claim 10, wherein the synchronization correction value d is held in correspondence with the identification information of the corresponding processor.
プロセッサ毎の動作周波数の変更の有無を監視して該動作周波数の変更を検知する変更検知ステップと、
前記動作周波数を変更した該当プロセッサの識別情報を取得する変更プロセッサ識別情報取得ステップと、
前記動作周波数の変更後の当該動作周波数を取得する動作周波数取得ステップと、
前記動作周波数に基づいてカウントする前記プロセッサ毎のクロックサイクルカウンタの該動作周波数の変更時における変更時カウント値を取得する変更時カンウント値取得ステップと、
取得した前記動作周波数及び前記変更時カウント値を該当プロセッサの識別情報に対応付けして履歴情報として保持する変更履歴保持ステップと、
前記識別情報に対応付けされている前記動作周波数及び前記変更時カウント値の前記履歴情報に基づいて前記プロセッサ毎の仮想時刻を導出する時刻導出ステップと
を有することを特徴とするマルチプロセッサのカウント値補正プログラム。As a step executed by any of the processors while holding necessary information in the memory by being read by a computer equipped with a multiprocessor,
A change detection step for monitoring the presence or absence of a change in operating frequency for each processor and detecting the change in the operating frequency;
A changed processor identification information acquisition step for acquiring identification information of the processor whose operating frequency has been changed;
An operating frequency acquisition step of acquiring the operating frequency after the change of the operating frequency;
A change count value acquisition step of acquiring a change count value at the time of change of the operation frequency of the clock cycle counter for each processor that counts based on the operation frequency;
A change history holding step for holding the acquired operating frequency and the count value at the time of change as history information in association with identification information of the corresponding processor;
A time derivation step for deriving a virtual time for each processor based on the history information of the operating frequency and the change count value associated with the identification information. Correction program.
少なくとも前記対応プロセッサの識別情報を取得する対応プロセッサ識別情報取得ステップと、
前記順序カウント値に基づいて前記基準プロセッサ用の前記クロックサイクルカウンタのカウント値に対する前記対応プロセッサ用の前記クロックサイクルカウンタのカウント値のずれをリセットするのに必要な同期補正値を導出する補正値導出ステップと、
前記基準プロセッサのカウント値に対する前記対応プロセッサのカウント値のずれをリセットする前記同期補正値を該対応プロセッサの識別情報に対応させて保持する補正値保持ステップと
を有することを特徴とする請求項12、13又は14記載のマルチプロセッサのカウント値補正プログラム。A predetermined order count value in the reference processor and the corresponding processor by exchanging in a predetermined order between the processors, with any one as a reference processor and any other as a corresponding processor Order count value acquisition step to acquire,
A corresponding processor identification information obtaining step for obtaining at least identification information of the corresponding processor;
Correction value derivation for deriving a synchronization correction value necessary for resetting a deviation of the count value of the clock cycle counter for the corresponding processor from the count value of the clock cycle counter for the reference processor based on the order count value Steps,
13. A correction value holding step for holding the synchronization correction value for resetting a shift in the count value of the corresponding processor with respect to the count value of the reference processor in correspondence with identification information of the corresponding processor. 15. A multiprocessor count value correction program according to claim 13 or 14.
前記補正値導出ステップでは、次式を用いて前記同期補正値dを算出し、
d=(C−c)/4+(A−a)/4−(B−b)/2
前記補正値保持ステップでは、算出した前記同期補正値dを前記対応プロセッサの前記識別情報に対応させて保持することを特徴とする請求項15記載のマルチプロセッサのカウント値補正プログラム。In the order count value obtaining step, after obtaining the first order count value A of the reference processor, the second order count value B returned in response to the request to the corresponding processor is obtained. The sequence processing for obtaining the third sequence count value C of the reference processor is executed again, and then the sequence processing is executed by reversing the reference processor and the corresponding processor to perform the reverse first to third sequence count values a. , B, c
In the correction value deriving step, the synchronization correction value d is calculated using the following equation:
d = (C−c) / 4 + (A−a) / 4− (B−b) / 2
16. The multiprocessor count value correction program according to claim 15, wherein in the correction value holding step, the calculated synchronization correction value d is held in correspondence with the identification information of the corresponding processor.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2010531754A JP5267566B2 (en) | 2008-10-03 | 2009-09-30 | Multiprocessor count value correction apparatus and multiprocessor having the same |
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008259095 | 2008-10-03 | ||
| JP2008259095 | 2008-10-03 | ||
| PCT/JP2009/005063 WO2010038459A1 (en) | 2008-10-03 | 2009-09-30 | Multiprocessor count value correction device and multiprocessor having the same |
| JP2010531754A JP5267566B2 (en) | 2008-10-03 | 2009-09-30 | Multiprocessor count value correction apparatus and multiprocessor having the same |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPWO2010038459A1 JPWO2010038459A1 (en) | 2012-03-01 |
| JP5267566B2 true JP5267566B2 (en) | 2013-08-21 |
Family
ID=42073238
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2010531754A Expired - Fee Related JP5267566B2 (en) | 2008-10-03 | 2009-09-30 | Multiprocessor count value correction apparatus and multiprocessor having the same |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP5267566B2 (en) |
| WO (1) | WO2010038459A1 (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9436265B2 (en) | 2013-10-24 | 2016-09-06 | Fujitsu Limited | Information processing apparatus and load control method |
| JP6855861B2 (en) * | 2017-03-22 | 2021-04-07 | 日本電気株式会社 | Virtual time distribution system, virtual time distribution device, virtual time distribution method, and program |
| JP7418159B2 (en) * | 2019-04-19 | 2024-01-19 | キヤノン株式会社 | information processing equipment |
| CN112162591B (en) * | 2020-10-30 | 2023-04-11 | 上海兆芯集成电路有限公司 | Electronic device with multiple processors and synchronization method thereof |
| WO2023084748A1 (en) * | 2021-11-12 | 2023-05-19 | 日本電信電話株式会社 | Computer system and control method therefor |
| CN117579213B (en) * | 2023-12-27 | 2024-06-25 | 中国科学院微电子研究所 | Multi-node time synchronization method and equipment for random synchronization triggering event |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3344121B2 (en) * | 1994-11-15 | 2002-11-11 | 株式会社日立製作所 | Performance data processing method in distributed processor system |
| JP4347082B2 (en) * | 2004-02-23 | 2009-10-21 | 日本電気株式会社 | Time correction device, time correction method, and time correction program for event trace data |
| JP4687258B2 (en) * | 2005-06-09 | 2011-05-25 | セイコーエプソン株式会社 | Log information management apparatus, log information management method and program thereof |
| JP4479660B2 (en) * | 2006-01-11 | 2010-06-09 | 日本電気株式会社 | Clock skew correction system, clock skew correction method, and clock skew correction program |
-
2009
- 2009-09-30 JP JP2010531754A patent/JP5267566B2/en not_active Expired - Fee Related
- 2009-09-30 WO PCT/JP2009/005063 patent/WO2010038459A1/en not_active Ceased
Also Published As
| Publication number | Publication date |
|---|---|
| JPWO2010038459A1 (en) | 2012-03-01 |
| WO2010038459A1 (en) | 2010-04-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5267566B2 (en) | Multiprocessor count value correction apparatus and multiprocessor having the same | |
| US10908941B2 (en) | Timestamping data received by monitoring system in NFV | |
| CN105556404B (en) | Programmable controller system, controller of the programmable controller system | |
| US9811336B2 (en) | Determining processor offsets to synchronize processor time values | |
| US7594146B2 (en) | Apparatus, method, and program for correcting time of event trace data | |
| JP2008269084A (en) | Log analysis method and apparatus | |
| EP2222003B1 (en) | Field control system | |
| CN108923876A (en) | Method for synchronizing time, apparatus and system | |
| WO2017016074A1 (en) | Cpu occupation rate detection method and apparatus | |
| US20150082325A1 (en) | Apparatuses and methods for generating and tracing event codes | |
| US20180027515A1 (en) | Server, method, recording medium, and system for maintaining accuracy of time | |
| US7430493B2 (en) | Method, system and program for correcting time of event trace data | |
| CN112653533A (en) | Intelligent time service management method for complex system | |
| US9400734B2 (en) | Apparatuses and methods for generating event codes including event source | |
| US20090122938A1 (en) | Method and System for Identifying Sources of Operating System Jitter | |
| Cochran et al. | Synchronizing the Linux system time to a PTP hardware clock | |
| CN107003691B (en) | Technique for synchronous sampling of counters based on a global clock | |
| CN112395231B (en) | Method and device for calculating data delay time among multiple processors | |
| US20100332888A1 (en) | Deriving accurate media position information | |
| US20210227101A1 (en) | Method, apparatus and terminal device for synchronous exposure | |
| EP2609509B1 (en) | Software instrumentation apparatus and method | |
| US9195524B1 (en) | Hardware support for performance analysis | |
| TWI574151B (en) | Clock diagnosis device and pulse diagnosis method | |
| CN115408867B (en) | Method, device and related equipment for improving calculation accuracy in real-time power simulation | |
| US7881906B2 (en) | Method, system and computer program product for event-based sampling to monitor computer system performance |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120802 |
|
| 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: 20130409 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130422 |
|
| 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 |