JP2015210574A - Information processor, processing method and processing program - Google Patents
Information processor, processing method and processing program Download PDFInfo
- Publication number
- JP2015210574A JP2015210574A JP2014090249A JP2014090249A JP2015210574A JP 2015210574 A JP2015210574 A JP 2015210574A JP 2014090249 A JP2014090249 A JP 2014090249A JP 2014090249 A JP2014090249 A JP 2014090249A JP 2015210574 A JP2015210574 A JP 2015210574A
- Authority
- JP
- Japan
- Prior art keywords
- information
- basic block
- branch
- instruction
- unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、情報処理装置,処理方法及び処理プログラムに関する。 The present invention relates to an information processing apparatus, a processing method, and a processing program.
計算機上で実行されるプログラムの性能を評価するプログラム性能解析方法として、例えば、性能プロファイラが知られている。性能プロファイラは、プログラムの実行を通して情報を収集することでプログラムの性能を解析する性能解析プログラムである。
性能プロファイラは、プログラム実行時の各種情報を収集し、特に、関数呼び出しの頻度やそれにかかる時間を計測する。
As a program performance analysis method for evaluating the performance of a program executed on a computer, for example, a performance profiler is known. A performance profiler is a performance analysis program that analyzes program performance by collecting information through program execution.
The performance profiler collects various types of information at the time of program execution, and in particular, measures the frequency of function calls and the time it takes.
図12は性能プロファイラの機能構成を模式的に示す図、図13はその測定フェーズを説明する図、図14は解析結果を例示する図である。
性能プロファイラは、図12に示すように、PMC(Performance Monitoring Counter)とサンプリングドライバ(Sampling Driver)とを備える。例えば、PMCとしての機能はCPU(Central Processing Unit)によって実現され、また、サンプリングドライバはカーネルの機能として実装される。
12 is a diagram schematically illustrating the functional configuration of the performance profiler, FIG. 13 is a diagram illustrating the measurement phase, and FIG. 14 is a diagram illustrating the analysis result.
As shown in FIG. 12, the performance profiler includes a PMC (Performance Monitoring Counter) and a sampling driver (Sampling Driver). For example, the function as PMC is realized by a CPU (Central Processing Unit), and the sampling driver is implemented as a kernel function.
PMCは、一定間隔サンプリングドライバに対して割り込み(overflow割り込み,sampling割り込み)を発生させる。PMCは、レジスタのカウンタオーバーフロー割り込みを用いて、前述した割り込みを発生させる。図12に示す例においては、PMCが1ms毎にオーバーフロー割り込みを発生させている。
サンプリングドライバは、PMCから割り込みが入力されると、解析対象である動作プログラムの情報を採取する。採取するプログラムの情報としては、例えば、実行中のプログラムのプロセスIDや命令アドレスである。
The PMC generates an interrupt (overflow interrupt, sampling interrupt) for the sampling driver at regular intervals. The PMC uses the register counter overflow interrupt to generate the aforementioned interrupt. In the example shown in FIG. 12, the PMC generates an overflow interrupt every 1 ms.
When an interrupt is input from the PMC, the sampling driver collects information on the operation program to be analyzed. The information on the collected program is, for example, the process ID and instruction address of the program being executed.
図13においては、3種類のプログラムA,B,Cが、A,C,B,Aの順に実行された状態を例示している。そして、1ms毎(1ms rate)に発生されるオーバーフロー割り込みに応じて、サンプリングドライバがその時点でCPU(Central Processing Unit)により実行されているプログラムの情報を採取する。
採取されたプログラムの情報に対しては統計的解析が行なわれる。図14に示す例においては、各動作プログラムをCPU使用率でソートして示している。これにより、例えば、各プログラムの処理に要した時間をそれぞれ知ることができる。
FIG. 13 illustrates a state in which three types of programs A, B, and C are executed in the order of A, C, B, and A. Then, in response to an overflow interrupt generated every 1 ms (1 ms rate), the sampling driver collects information on a program being executed by a CPU (Central Processing Unit) at that time.
Statistical analysis is performed on the collected program information. In the example shown in FIG. 14, each operation program is sorted according to the CPU usage rate. Thereby, for example, the time required for processing of each program can be known.
しかしながら、近年においては、計算機の性能向上に伴い、解析対象のプログラムの実行時間が短くなってきており、例えば、そのレスポンスが1ms以内に行なわれることが求められる場合もある。すなわち、図13に示す例において、図中に横軸方向に示す各動作プログラムの実行時間が短くなり、PMCからのオーバーフロー割り込みでは時系列解析に必要な情報を十分に採取できない場合があるという課題がある。 However, in recent years, with the improvement in computer performance, the execution time of a program to be analyzed has been shortened. For example, the response may be required to be performed within 1 ms. That is, in the example shown in FIG. 13, the execution time of each operation program shown in the horizontal axis direction in the drawing is shortened, and there is a case where information necessary for time series analysis may not be collected sufficiently by an overflow interrupt from PMC. There is.
本発明の目的の一つは、精度の高い実行時間の算出を可能とすることである。
なお、前記目的に限らず、後述する発明を実施するための形態に示す各構成により導かれる作用効果であって、従来の技術によっては得られない作用効果を奏することも本発明の他の目的の1つとして位置付けることができる。
One of the objects of the present invention is to enable calculation of execution time with high accuracy.
In addition, the present invention is not limited to the above-described object, and other effects of the present invention can be achieved by the functions and effects derived from the respective configurations shown in the embodiments for carrying out the invention which will be described later. It can be positioned as one of
このため、この情報処理装置は、性能測定カウンタを用いて、CPUサイクルイベントと実行命令数イベントとを測定し、単位命令サイクル数を算出する実測部と、解析対象プログラムにおける複数の分岐情報を採取する採取部と、前記採取部が採取した分岐情報に基づき、前記解析対象プログラムから作成された逆アセンブルリスト上の実走行パスを特定し、所定の分岐の直後の命令から次に分岐する命令を含む基本ブロックを抽出し、抽出された各基本ブロックに含まれるアセンブラ命令数をカウントした結果に基づいて、基本ブロック特定情報と前記アセンブラ命令数との対応関係情報を保持する解析部と、前記対応関係情報に含まれる各基本ブロックの前記アセンブラ命令数に前記単位命令サイクル数を乗算して実行時間を算出する算出部とを有する。 For this reason, this information processing apparatus uses a performance measurement counter to measure a CPU cycle event and an execution instruction count event, and collects a plurality of branch information in the analysis target program, and an actual measurement unit that calculates the number of unit instruction cycles. And an actual branch path on the disassembly list created from the analysis target program based on the branch information collected by the collection unit, and an instruction to branch next from an instruction immediately after a predetermined branch An analysis unit that stores correspondence information between basic block identification information and the number of assembler instructions based on a result of counting the number of assembler instructions included in each extracted basic block The execution time is calculated by multiplying the number of unit instruction cycles by the number of assembler instructions of each basic block included in the relationship information. And a detecting section.
一実施形態によれば、精度の高い実行時間の算出を可能とする。 According to one embodiment, it is possible to calculate the execution time with high accuracy.
以下、図面を参照して本情報処理装置,処理方法及び処理プログラムに係る実施の形態を説明する。ただし、以下に示す実施形態はあくまでも例示に過ぎず、実施形態で明示しない種々の変形例や技術の適用を排除する意図はない。すなわち、本実施形態を、その趣旨を逸脱しない範囲で種々変形して実施することができる。又、各図は、図中に示す構成要素のみを備えるという趣旨ではなく、他の機能等を含むことができる。 Hereinafter, embodiments of the information processing apparatus, processing method, and processing program will be described with reference to the drawings. However, the embodiment described below is merely an example, and there is no intention to exclude application of various modifications and techniques not explicitly described in the embodiment. That is, the present embodiment can be implemented with various modifications without departing from the spirit of the present embodiment. Each figure is not intended to include only the components shown in the figure, and may include other functions.
図1は実施形態の一例としての情報処理装置の機能構成を示す図、図2はそのハードウェア構成を示す図である。
本実施形態の情報処理装置1は、プログラムを実行することにより各種機能を実現する計算機である。
本情報処理装置1は、図2に示すように、CPU201,メモリ202,ディスプレイ205,キーボード206,マウス207,媒体読取装置208及び記憶装置209を備える。
FIG. 1 is a diagram illustrating a functional configuration of an information processing apparatus as an example of an embodiment, and FIG. 2 is a diagram illustrating a hardware configuration thereof.
The
As shown in FIG. 2, the
ディスプレイ205は種々の情報を表示する表示装置であり、例えば、液晶ディスプレイ装置やCRT(Cathode Ray Tube)ディスプレイ装置である。
マウス207及びキーボード206はオペレータが種々の入力を行なうために操作する入力装置である。
メモリ202はROM(Read Only Memory)及びRAM(Random Access Memory)を含む記憶装置である。メモリ202のROMには、プログラム性能解析に係るソフトウェアプログラムやこのプログラム用のデータ類が書き込まれている。メモリ202上のソフトウェアプログラムは、CPU201に適宜読み込まれて実行される。
The
A
The
また、メモリ202のRAMは、一次記憶メモリあるいはワーキングメモリとして利用される。このメモリ202のRAMは、種々のデータやプログラムを一時的に格納する記憶装置であり図示しないメモリ領域をそなえる。
メモリ領域には、CPU201がプログラムを実行する際に、データやプログラムを一時的に格納・展開して用いる。例えば、メモリ領域には、後述する、基本ブロック情報テーブルT,T′の情報や、逆アセンブルリスト等が格納される。
The RAM of the
Data and programs are temporarily stored and expanded in the memory area when the
記憶装置209は、ハードディスクドライブ(Hard disk drive:HDD)、SSD(Solid State Drive)等の記憶装置であって、種々のデータを格納するものである。また、記憶装置209には、OS(Operating System)や解析対象のプログラムのオブジェクトファイル等も格納される。
媒体読取装置208は、記録媒体RMが装着可能に構成される。媒体読取装置208は、記憶媒体RMが装着された状態において、記録媒体RMに記録されている情報を読み取り可能に構成される。本例では、記録媒体RMは可搬性を有する。記録媒体RMは、コンピュータ読取可能な記録媒体であって、例えば、フレキシブルディスク,CD(CD−ROM,CD−R,CD−RW等),DVD(DVD−ROM,DVD−RAM,DVD−R,DVD+R,DVD−RW,DVD+RW,HD DVD等),ブルーレイディスク,磁気ディスク,光ディスク,光磁気ディスク、又は、半導体メモリである。
The
The
CPU201は、種々の制御や演算を行なう処理装置であり、メモリ202に格納されたOSやプログラムを実行することにより、種々の機能を実現する。例えば、CPU201は、図1に示すように、性能解析部211としての機能を実現する。
すなわち、CPU201が、性能解析プログラムを実行することにより、性能解析部211として機能する。
The
That is, the
なお、この性能解析部211としての機能を実現するためのプログラム(処理プログラム)は、例えば前述した記録媒体RMに記録された形態で提供される。そして、コンピュータはその記録媒体RMからプログラムを読み取って内部記憶装置または外部記憶装置に転送し格納して用いる。又、そのプログラムを、例えば磁気ディスク,光ディスク,光磁気ディスク等の記憶装置(記録媒体)に記録しておき、その記憶装置から通信経路を介してコンピュータに提供するようにしてもよい。
Note that a program (processing program) for realizing the function as the
性能解析部211としての機能を実現する際には、内部記憶装置(本実施形態ではメモリ202のRAMやROM)に格納されたプログラムがコンピュータのマイクロプロセッサ(本実施形態ではCPU201)によって実行される。このとき、記録媒体に記録されたプログラムをコンピュータが読み取って実行するようにしてもよい。
性能解析部211は、本情報処理装置1において実行されるプログラムの性能を解析する。
When realizing the function as the
The
この性能解析部211は、図1に示すように、分岐トレース支援部22,CPI実測部23,分岐トレース採取部24,オブジェクト回収部25,逆アセンブル部26,基本ブロック解析部27,基本ブロック実行時間算出部28、及び、PMC21a〜21cとしての機能を備える。
PMC21a〜21cは、所定のイベントを監視して計数するカウンタ(性能イベント監視カウンタ)であり、レジスタのカウンタオーバーフロー割り込みを用いて、割り込みを発生させる。この割り込みをオーバーフロー(overflow)割り込み、もしくは、サンプリング(sampling)割り込みという場合がある。
As shown in FIG. 1, the
The
PMC21aはCPUサイクル(CPU Cycle)イベントを測定し、周波数同期サイクル数を計数する。また、PMC21bは実行命令数イベントを測定し、命令数を計数する。
これらのPMC21a,21bによる計数結果(カウント値)は、レジスタ等の所定の記憶領域(図示省略)に格納される。
PMC21cは固定サイクル数を計数するものである。このPMC21cにおいては、例えば、CPU201のクロック周波数に基づき、所定時間経過毎(例えば、1ms毎)にオーバーフロー割り込みが出力されるように設定されている。このPMC21cから出力されるオーバーフロー割り込みが、CPI実測部23及び分岐トレース採取部24に入力され、それぞれサンプリング契機として用いられる。すなわち、PMC21cからのオーバーフロー割り込み通知(サンプリング割り込み)が、CPI実測部23や分岐トレース採取部24による情報取得のトリガ通知として用いられる。
The
Count results (count values) by these
The
なお、これらのPMC21a〜21cとしての機能はCPUの既知の機能によって実現され、その詳細な説明は省略する。
CPI実測部23は、PMC21aによって計数されたCPUサイクル数と、PMC21bによって計数された命令実行数イベントとをPMC21cからのオーバーフロー割り込みを契機に採取する、実測部として機能する。すなわち、CPI実測部23は、本情報処理装置1におけるCPUサイクルイベント及び命令実行数イベントを実測する。
Note that these functions as the
The CPI
なお、PMC21a,21bの各カウンタ値は、CPI実測部23によりデータ取得が行なわれる度にリセットされる。
また、CPI実測部23は、これらのCPUサイクル数及び命令実行数の各値を用いてCPIを算出する。
CPIは、1命令あたりの実行に要するCPUサイクル数(平均命令実行サイクル数)である。CPI実測部23は、CPUサイクル数の実測値を命令実行数の実測値で除算することで、CPIを算出する。このように、CPUサイクル数及び命令実行数の各実測値を用いて算出されるCPIを実測CPIという場合がある。
The counter values of the
The CPI
CPI is the number of CPU cycles required for execution per instruction (average instruction execution cycle number). The CPI
このCPI実測部23によって算出された実測CPIは、後述する基本ブロック実行時間算出部28に通知される。
分岐トレース支援部22は、解析対象のプログラム(実行プログラム)について、プログラム中の分岐アドレスを採取する。例えば、分岐トレース支援部22は、プログラム中の分岐コマンド(例えば、jumpやcall,return)を検知することで分岐アドレスを特定する。
The actual CPI calculated by the CPI
The branch
また、分岐トレース支援部22は、例えば、LBR(Last Branch Record)やBTS(Branch Trace Store)等の分岐トレース支援機能を実行することで、プログラムの実行に伴う分岐情報を採取する。具体的には、分岐トレース支援部22は、分岐トレース支援機能により、実行された分岐のソース(分岐元となる分岐命令アドレス)と、ターゲット(分岐先の命令アドレス)とを取得し、所定の記憶領域に保存する。
The branch
図3は実施形態の一例としての情報処理装置1における分岐トレース支援部22によって作成される分岐情報を例示する図である。この図3においては、分岐情報としてLBRを用いた例を示している。
分岐トレース支援部22は、CPU201によって実行されたプログラム中で発生した分岐について、そのソース(分岐元となる分岐命令アドレス)とターゲット(分岐先の命令アドレス)とを取得し、所定のレジスタに記録する。
FIG. 3 is a diagram illustrating the branch information created by the branch
The branch
分岐トレース支援部22は、図3に示すように、分岐について取得したソース(From)とターゲット(To)の各命令アドレス(IP:Instruction Pointer)を、専用のサイクリック・レジスタ・スタックにペア(分岐ペア)で記録する。
なお、この分岐トレース支援部22による分岐トレース支援機能は既知の手法で実現することができる。
As shown in FIG. 3, the branch
The branch trace support function by the branch
例えば、Intel(登録商標)のCPUでは、16ペア分の分岐アドレスが、LBRと呼ばれるレジスタ・スタックに記録され、最後の記録位置を示すTOS(Top Of Stack)と呼ばれるインデックス(index)レジスタも同時に更新される。TOSにはインデックスとして、サイクリック・レジスタ・スタックに登録される16ペア分の分岐アドレスに対応する1〜15のいずれかの数字が記録される。 For example, in an Intel (registered trademark) CPU, 16 pairs of branch addresses are recorded in a register stack called LBR, and an index register called TOS (Top Of Stack) indicating the last recording position is also simultaneously recorded. Updated. In TOS, any number of 1 to 15 corresponding to the 16 pairs of branch addresses registered in the cyclic register stack is recorded as an index.
なお、分岐トレース支援機能においては、例えば、採取対象とする分岐命令の種類(無条件分岐/条件分岐/call/return等)や特権レベル(OSモード、userモード)のフィルタリング設定、および採取開始・停止指示等を操作することができる。
なお、上述した分岐トレース支援部22としての機能は既知の手法で実現することができ、その詳細な説明は省略する。この分岐トレース支援部22によって採取された分岐アドレスは分岐トレース採取部24に通知される。
In the branch trace support function, for example, the type of branch instruction to be collected (unconditional branch / conditional branch / call / return, etc.), privilege level (OS mode, user mode) filtering setting, and collection start / A stop instruction or the like can be operated.
The function as the branch
以下、分岐トレース支援機能としてLBRを用いる例について示す。
分岐トレース採取部24は、分岐トレース支援部22によってレジスタ等に記録された分岐情報(各分岐アドレス)を採取する。すなわち、分岐トレース採取部24は、本情報処理装置1におけるプログラムの実行履歴を採取するものであり、分岐トレース支援部22によってレジスタ等に記録された分岐情報を読み出し、基本ブロック解析部27に受け渡す。この分岐トレース採取部24は、解析対象プログラムにおける複数の分岐情報を採取する採取部として機能する。
Hereinafter, an example in which LBR is used as a branch trace support function will be described.
The branch
オブジェクト回収部25は、解析対象のプログラム(ファイル)のオブジェクトファイルを取得するものであり、対象のオブジェクトファイルを当該オブジェクトファイルが格納された記憶装置209等の記憶装置から読み出し、予め規定された所定のフォルダ(処理用フォルダ)にコピー(回収)する。
逆アセンブル部26は、オブジェクト回収部25によって回収された各オブジェクトファイルに対して逆アセンブルを行なうことにより逆アセンブルリスト(命令列)を作成する。
The
The
図4は実施形態の一例としての情報処理装置1における逆アセンブルリストを例示する図である。この図4に例示する逆アセンブルリストは、単純な演算関数をtest1()、test2()、test3()、test4()、test5()の順にネストしてcallするプログラムの一部(test4及びtest5)を示す。
逆アセンブル部26は、プログラムのコードを、図4に示すような人間が処理の流れを視認できる形式の逆アセンブルリスト(命令列)に変換(作成)する。
FIG. 4 is a diagram illustrating a disassemble list in the
The
基本ブロック解析部27は、解析対象のプログラムの逆アセンブルリストから基本ブロックを抽出し、この基本ブロックに含まれる命令数(Instruction Count)を計数する。この基本ブロック解析部27は、図1に示すように、基本ブロック抽出部271及び命令数カウント部272を備える。
基本ブロック抽出部271は、分岐トレース採取部24が採取した分岐情報に基づいて、基本ブロック情報Tを作成する。
The basic
The basic
図5(a),(b)は実施形態の一例としての情報処理装置1における基本ブロックアドレス情報の生成方法を説明するための図であり、(a)は分岐情報の構成を例示する図、(b)は基本ブロック情報Tの構成を示す図である。
基本ブロックとは、実行プログラム中において、図5(a)に示す分岐情報のターゲットN−1とソースNとの間の命令列である。
FIGS. 5A and 5B are diagrams for explaining a method of generating basic block address information in the
The basic block is an instruction sequence between the target N-1 and the source N of the branch information shown in FIG.
基本ブロックは、命令列上において途中で分岐することなく真っ直ぐ走行した命令ブロックであり、ある分岐の直後の命令から次に分岐する命令までの範囲(ブロック)である。LBRデータである分岐情報においては、分岐のターゲットN−1からソースNまでの範囲がこの基本ブロックに相当する。なお、一般に、基本ブロックのことを、ベーシック・ブロックもしくは実行命令ブロックという場合がある。 The basic block is an instruction block that has run straight without branching in the middle of the instruction sequence, and is a range (block) from the instruction immediately after a certain branch to the instruction that branches next. In the branch information that is LBR data, the range from the branch target N-1 to the source N corresponds to this basic block. In general, the basic block may be referred to as a basic block or an execution instruction block.
基本ブロック抽出部271は、分岐トレース支援部22によって採取された分岐情報に基づいて、逆アセンブリリスト上の実走行パスを特定する。基本ブロック抽出部271は、分岐情報から読み出したターゲットN−1及びソースNの各アドレスの値を、図5(b)に示すように、基本ブロック情報Tにおいて、基本ブロックの開始アドレスおよび終点アドレスとして登録する。
The basic
ターゲットN−1とソースNとの間の命令列が基本ブロックとして抽出され、この間にある全ての命令が1回リタイアしている(実行されている)。ただし、この間にある全ての分岐は実行されていない。
なお、図5(b)に示す例においては、基本ブロック情報Tは、基本ブロックを特定する情報(例えば、基本ブロック1,2)に対して、開始アドレス及び終点アドレスを関連付けたテーブルとして構成されている。開始アドレスと終点アドレスとはペア情報として分岐情報から抽出され、基本ブロック情報に記録される。ペア情報を成す開始アドレスと終点アドレスとは、逆アセンブルリスト中における1つの基本ブロックの範囲を表し、基本ブロック特定情報として機能する。
The instruction sequence between the target N-1 and the source N is extracted as a basic block, and all the instructions in between are retired once (executed). However, all branches in between are not executed.
In the example shown in FIG. 5B, the basic block information T is configured as a table in which the start address and the end point address are associated with information specifying the basic block (for example, the
また、図5(b)に示すように、基本ブロック情報Tには、各基本ブロックに対して、その基本ブロックに含まれる命令数が解析結果として対応付けて記録される。この命令数は、後述する命令数カウント部272によって計数され、基本ブロック情報Tに記録される。以下、基本ブロック情報Tを基本ブロック情報テーブルTという場合がある。
命令数カウント部272は、基本ブロック抽出部271によって抽出された各基本ブロック中に含まれる命令(comment)の数を計数する。この命令数カウント部272は、各基本ブロックに対応する逆アセンブルリスト上の実走行パスから、各基本ブロックに含まれる命令数(アセンブラ命令数)を計数する。
Further, as shown in FIG. 5B, in the basic block information T, the number of instructions included in each basic block is recorded in association with each basic block as an analysis result. The number of instructions is counted by an instruction
The instruction
命令数カウント部272は、基本ブロック抽出部271が作成した基本ブロック情報(基本ブロック情報テーブル)Tを参照して、解析対象プログラムの逆アセンブルリストから、開始アドレスと終点アドレスとの組み合わせを読み出すことにより各基本ブロックを抽出する。
そして、命令数カウント部272は、抽出した各基本ブロックにおける命令数を計数する。
The
Then, the
基本ブロック実行時間算出部28は、基本ブロック情報テーブルT上の各基本ブロックの実行命令数(IC:Instruction Count)に、CPI実測部23によって算出された実測CPIを乗算して、実行時間を算出する。なお、以下、実行命令数を単に命令数もしくはICという場合がある。また、実測CPIを単にCPIという場合がある。
CPIにICを乗算することで、CPUの時間性能を現すCPUサイクル数(CPU Cycles,CPU Times)を算出することができる。時間性能とは、ある処理に要した時間で性能を現す指標であり、CPU時間性能とは、CPUがある処理に要した時間をいう。
The basic block execution
By multiplying CPI by IC, the number of CPU cycles (CPU Cycles, CPU Times) expressing the time performance of the CPU can be calculated. The time performance is an index representing the performance in the time required for a certain process, and the CPU time performance is the time required for a certain process.
なお、本実施形態においては、時間性能の表現としてCPUサイクル数を用いるが、これに限定されるものではなく、例えば秒等の他の単位を用いてよい。Cyclesから秒への単位変換は、“ Cycles/CPU周波数(Hz)”を演算することで実現できる。
また、基本ブロック実行時間算出部28は、算出した実行時間を基本ブロック情報テーブルT上の対応する各基本ブロックに対して、再度、記録保持する。
In this embodiment, the number of CPU cycles is used as an expression of time performance, but is not limited to this, and other units such as seconds may be used. Unit conversion from Cycles to seconds can be realized by calculating “Cycles / CPU frequency (Hz)”.
The basic block execution
上述の如く構成された実施形態の一例としての情報処理装置1におけるプログラム性能解析方法の概要を、図6に示すフローチャート(ステップS1〜S2)に従って説明する。
まず、ステップS1の測定フェーズにおいて、PMC21cからサンプリング間隔毎に行なわれるオーバーフロー割り込みを契機に、CPI実測部23及び分岐トレース採取部24が情報採取を行なう。
The outline of the program performance analysis method in the
First, in the measurement phase of step S1, the CPI
すなわち、CPI実測部23は、PMC21a,21bからサイクル数と実行命令数とを採取し、これらの値を用いて実測CPIを算出する。
また、分岐トレース採取部24は、分岐トレース支援部22によってレジスタ等に記録された分岐情報(各分岐アドレス)を採取する。この際、分岐トレース採取部24は、逆アセンブルリスト中の複数の分岐についての分岐情報を一括で採取する。
That is, the CPI
The branch
さらに、オブジェクト回収部25が、動作していたプログラムのオブジェクトファイルの回収を行なう。
次に、ステップS2の解析フェーズにおいて、逆アセンブル部26が、オブジェクト回収部25が回収したオブジェクトファイルより逆アセンブルリスト(命令列リスト)を作成する。また、基本ブロック解析部27の基本ブロック抽出部271が、分岐トレース採取部24が採取した分岐情報より、逆アセンブル部26が作成した命令列リスト上での実行パスを特定する。すなわち、解析対象のプログラムを実行させることにより実際に走行した基本ブロックを特定する。基本ブロック抽出部271は、基本ブロック情報テーブルTを作成する。基本ブロック抽出部271による基本ブロックの特定・抽出手法については、図7に示すフローチャートを用いて後述する。
Further, the
Next, in the analysis phase of step S2, the
さらに、命令数カウント部272が、特定された各基本ブロックに対する命令数を逆アセンブルリスト上の命令列で計数することにより、各基本ブロックの実走行命令数を求める。
そして、基本ブロック実行時間算出部28が、ステップS1においてCPU実測部23が算出した実測CPIと、ステップS1において命令数カウント部272が求めた各ブロックの命令数とを乗算することにより、各基本ブロックの実行時間をそれぞれ求める。このようにして求められた各基本ブロックの実行時間の情報は、記憶装置209等の記憶領域に基本ブロックを特定する情報に対応付けて記録される。そして、各基本ブロックの実行時間の情報は、例えば統計解析に用いられ、図14に例示したような解析結果として出力される。
Further, the
Then, the basic block execution
次に、実施形態の一例としての情報処理装置1の基本ブロック抽出部271による基本ブロックの抽出手法を、図7に示すフローチャート(ステップA1〜A6)に従って説明する。
なお、この図7においては、LBRデータからの基本ブロック抽出方法を示し、LBRスタックのうち、時間的に一番古いデータから時間順に辿る場合について例示する。分岐トレース採取部24は、分岐トレース支援部22が特段のフィルタを設定することなく採取した16ペア分の分岐アドレスを採取する。
Next, a basic block extraction method by the basic
FIG. 7 shows a method of extracting basic blocks from LBR data, and exemplifies a case where the oldest data in the LBR stack is traced in time order. The branch
ステップA1において、基本ブロック抽出部271は、変数Nに対して、TOSレジスタの値を設定する。また、変数iに初期値としての1を設定する。
ステップA2において、基本ブロック抽出部271は、N+2の値がLBRのレジスタ・スタックの数である16よりも小さいか否かを判定することで、LBRのサイクリックレジスタにおいてラップアラウンドさせるか否かを判定する。
In step A1, the basic
In step A2, the basic
判定の結果、N+2の値が16未満の場合(ステップA2のYESルート参照)、ステップA3において、基本ブロック抽出部271は、分岐NについてのLBRレコード(分岐情報)を参照して、ターゲットN+1及びソースN+2の値を読み出す。そして、基本ブロック抽出部271は、基本ブロック情報Tにおいて、基本ブロックNの開始アドレスとしてターゲットN+1の値を記録し、また、基本ブロックNの終点アドレスとしてソースN+2の値を記録する。その後、Nをインクリメントする。
As a result of the determination, if the value of N + 2 is less than 16 (see YES route in step A2), in step A3, the basic
ステップA5において、基本ブロック抽出部271は、iが16未満であるか否かを確認し、iが16以上である場合には(ステップA5のNOルート参照)、処理を終了する。また、iが16未満である場合には(ステップA5のYESルート参照)、ステップA6においてiをインクリメントした後、ステップA2に戻る。
一方、ステップA2における判定の結果、N+2の値が16以上の場合(ステップA2のNOルート参照)、ステップA4において、LBRのサイクリックレジスタにおいてラップアラウンドさせる処理を行なう。
In step A5, the basic
On the other hand, if the value of N + 2 is 16 or more as a result of the determination in step A2 (see the NO route in step A2), in step A4, a wraparound process is performed in the LBR cyclic register.
すなわち、分岐NについてのLBRレコード(分岐情報)を参照して、ターゲット15及びソース0の値を読み出す。そして、基本ブロック抽出部271は、基本ブロック情報Tにおいて、基本ブロックNの開始アドレスとしてターゲット15の値を記録し、また、基本ブロックNの終点アドレスとしてソース0の値を記録する。その後、Nに“−1”を設定し、ステップA5に移行する。
That is, the values of the target 15 and the
この後、命令数カウント部272が、各基本ブロックに含まれる命令数を計数し、図5(b)に示す基本ブロック情報Tに記録することで、基本ブロック情報Tが生成される。
さて、上述した実施形態においては、基本ブロック情報Tにおいて、基本ブロックに対して、開始アドレス,終点アドレス及び命令数を対応付けているが、これに限定されるものではない。
Thereafter, the instruction
In the embodiment described above, in the basic block information T, the basic block is associated with the start address, the end address, and the number of instructions. However, the present invention is not limited to this.
図8は実施形態の一例としての情報処理装置1における基本ブロックアドレス情報の変形例を示す図である。
この図8に示す基本ブロック情報T′においては、図5(b)に示した基本ブロック情報Tに、更に、関数名を関連付けられている。
この基本ブロック情報T′の関数名は、基本ブロックにおいて実行される関数シンボルを示す。例えば、処理対象のオブジェクトファイルのシンボルマップを予め作成しておき、基本ブロック抽出部271による基本ブロックの抽出後に、基本ブロック解析部27が、基本ブロックのターゲットN+1のアドレスの値に基づいてシンボルマップを参照することにより、当該基本ブロックに対応する関数名を取得することができる。なお、シンボルマップの作成は、例えば、nmコマンドを実行する等の機知の手法を用いて行なうことができ、その詳細な説明は省略する。
FIG. 8 is a diagram illustrating a modification of the basic block address information in the
In the basic block information T ′ shown in FIG. 8, a function name is further associated with the basic block information T shown in FIG.
The function name of the basic block information T ′ indicates a function symbol executed in the basic block. For example, a symbol map of an object file to be processed is created in advance, and after the basic block is extracted by the basic
基本ブロック情報T′に関数名を備えることにより、関数単位での実行履歴を参照することができ利便性が高い。例えば、for文によりループが繰り返されると、LBRのレジスタ・スタックはすぐに埋まってしまう。
プログラムの性能解析において、関数単位での挙動解析で良い場合には、このような基本ブロック情報T′の利便性が高い。なお、この際、分岐トレースは機知の分岐トレース支援機能のフィルタリング機能を用いて、call/returnのみを採取することが望ましい。
By providing a function name in the basic block information T ′, it is possible to refer to an execution history in units of functions, which is highly convenient. For example, if a loop is repeated by a “for” statement, the LBR register stack is immediately filled.
In the performance analysis of the program, when the behavior analysis in units of functions is sufficient, the convenience of such basic block information T ′ is high. At this time, it is desirable to collect only call / return using the filtering function of the well-known branch trace support function.
このような実施形態の一例としての情報処理装置1の基本ブロック抽出部271による基本ブロックの抽出手法の変形例を、図9に示すフローチャート(ステップA1〜A6,A31,A41)に従って説明する。この図9に示すフローチャートによる基本ブロックの抽出手法によれば、図8に示す基本ブロック情報T′が生成される。
なお、この図9においても、LBRデータからの基本ブロック抽出方法を示し、LBRスタックのうち、時間的に一番古いデータから時間順に辿る場合について例示する。分岐トレース採取部24は、分岐トレース支援部22がフィルタリングでcall/return分岐のみの16ペア分の分岐アドレスを採取するものとする。
A modification of the basic block extraction method by the basic
FIG. 9 also shows a basic block extraction method from LBR data, and exemplifies a case where the oldest data in the LBR stack is traced in time order. The branch
分岐トレース採取部24は、1セット分(16ペア分)のLBRデータ採取し、また、オブジェクトファイルのシンボルマップも予め作成される。
ステップA1において、基本ブロック抽出部271は、変数Nに対して、TOSレジスタの値を設定する。また、変数iに初期値としての1を設定する。
ステップA2において、基本ブロック抽出部271は、N+2の値がLBRのレジスタ・スタックの数である16よりも小さいか否かを判定することで、LBRのサイクリックレジスタにおいてラップアラウンドさせるか否かを判定する。
The branch
In step A1, the basic
In step A2, the basic
判定の結果、N+2の値が16未満の場合(ステップA2のYESルート参照)、ステップA3において、基本ブロック抽出部271は、分岐NについてのLBRレコード(分岐情報)を参照して、ターゲットN+1及びソースN+2の値を読み出す。そして、基本ブロック抽出部271は、基本ブロック情報T′において、基本ブロックNの開始アドレスとしてターゲットN+1の値を記録し、また、基本ブロックNの終点アドレスとしてソースN+2の値を記録する。その後、Nをインクリメントする。
As a result of the determination, if the value of N + 2 is less than 16 (see YES route in step A2), in step A3, the basic
ステップA31において、基本ブロック解析部27は、ターゲットN+1をシンボルマップと照らし合わせて関数名に変換し、その関数名を基本ブロック情報T′に記録する。
ステップA5において、基本ブロック抽出部271は、iが16未満であるか否かを確認し、iが16以上である場合には(ステップA5のNOルート参照)、処理を終了する。また、iが16未満である場合には(ステップA5のYESルート参照)、ステップA6においてiをインクリメントした後、ステップA2に戻る。
In step A31, the
In step A5, the basic
一方、ステップA2における判定の結果、N+2の値が16以上の場合(ステップA2のNOルート参照)、ステップA4において、LBRのサイクリックレジスタにおいてラップアラウンドさせる処理を行なう。
すなわち、基本ブロック抽出部271は、分岐NについてのLBRレコード(分岐情報)を参照して、ターゲット15及びソース0の値を読み出す。そして、基本ブロック抽出部271は、基本ブロック情報T′において、基本ブロックNの開始アドレスとしてターゲット15の値を記録し、また、基本ブロックNの終点アドレスとしてソース0の値を記録する。その後、Nに“−1”を設定する。
On the other hand, if the value of N + 2 is 16 or more as a result of the determination in step A2 (see the NO route in step A2), in step A4, a wraparound process is performed in the LBR cyclic register.
That is, the basic
ステップA41において、基本ブロック解析部27は、ターゲット15をシンボルマップと照らし合わせて関数名に変換し、その関数名を基本ブロック情報T′に記録する。その後、ステップA5に移行する。
この後、命令数カウント部272が、各基本ブロックに含まれる命令数を計数し、図8に示す基本ブロック情報T′に記録することで、基本ブロック情報T′が生成される。
In step A41, the basic
Thereafter, the instruction
図10は図4に示す逆アセンブルリストを実行した場合に採取される採取データの一部を例示する図であり、図11は図10に例示する採取データから生成される基本ブロック情報T′の一部を例示する図である。なお、図11に示す例においては、基本ブロック情報T′に、本手法により基本ブロック実行時間算出部28が算出した実行時間(Cycles;CPI×命令数)と、従来のシミュレーション手法による求めた実行時間(Cycles)とを付して示している。なお、この従来のシミュレーション手法による実行時間“19”は、CPIの仕様上の理想値“0.5”を命令数に乗算することにより算出されている(38×0.5=19)。
FIG. 10 is a diagram illustrating a part of the collected data collected when the disassemble list shown in FIG. 4 is executed, and FIG. 11 shows basic block information T ′ generated from the collected data exemplified in FIG. It is a figure which illustrates a part. In the example shown in FIG. 11, the basic block information T ′ includes the execution time (Cycles; CPI × number of instructions) calculated by the basic block execution
図10に示す採取データにおいては、1行に1サンプル分の取得データを示すことで3サンプル分の採取データを例示している。また、この図10中においては、上から2番目及び3番目のサンプルについての詳細なデータ例の図示を省略している。
例えば、CPI実測部23による採取結果として、命令数として“312007(符号P1参照)”が、また、サイクル数として“297491(符号P2参照)”が示されている。これにより、実測CPIは、297491/312007=0.95と求められる(符号P3参照)。また、最新のTOSが“5”である。
In the collected data shown in FIG. 10, collected data for three samples is illustrated by showing acquired data for one sample in one line. Further, in FIG. 10, illustration of detailed data examples for the second and third samples from the top is omitted.
For example, as a result of collection by the CPI
図11に示すように、基本ブロック1の開始アドレス(ターゲット0)が“400c9a”であり、その終点アドレス(ソース1)が“400c17”である。また、この範囲で示されるk本ブロックの関数名は“test5”であり、命令数は38である。この場合、CPI×命令数(Cycles)は、0.95×38=36.1と求められる。
このCyclesの値は、従来のシミュレーション手法の理想値“19”よりも現実に即した値となっている。
As shown in FIG. 11, the start address (target 0) of the
This Cycles value is more realistic than the ideal value “19” of the conventional simulation method.
このように、実施形態の一例としての情報処理装置1によれば、基本ブロック実行時間算出部28が、基本ブロック毎の実行時間の実測値を算出する。これにより、解析対象のプログラムにおいて、当該プログラムを構成する基本ブロック毎に処理に要した時間を把握することができる。
LBRやBTS等の分岐トレース支援機能においては、一度のサンプリングで採取される分岐情報に含まれる各分岐ペアの採取時刻が不明であるが、本情報処理装置1によれば、基本ブロック毎の実行時間を知ることができ利便性が高い。
As described above, according to the
In the branch trace support function such as LBR and BTS, the collection time of each branch pair included in the branch information collected by one sampling is unknown, but according to the
また、短時間で処理されるプロセスについても、基本ブロック単位で実行時間の算出を確実に行なうことができ、精度の高い実行時間の算出を可能とし、また、性能解析に必要な情報を収集することができる。例えば、100μs未満の超短処理プロセスの高精細解析が可能になる。
基本ブロック毎に処理に要した時間を把握することができるので、例えば、どのプロセスにおいて待ち(遅延)が発生したか等を容易に知ることができ利便性が高い。
For processes that are processed in a short time, the execution time can be reliably calculated in units of basic blocks, making it possible to calculate the execution time with high accuracy and collecting information necessary for performance analysis. be able to. For example, high-definition analysis of an ultra-short processing process of less than 100 μs becomes possible.
Since it is possible to grasp the time required for processing for each basic block, for example, it is easy to know in which process a wait (delay) has occurred, which is highly convenient.
また、この際、CPI実測部23が、PMC21cからのオーバーフロー割り込みを契機として、PMC21a,21bからサイクル数と実行命令数とを採取し、これらの値を用いて実測CPIを算出する。すなわち、基本ブロック実行時間算出部28は、サンプリング毎に算出された実測CPIを用いて基本ブロック毎の実行時間の実測値を算出することができる。例えば、キャッシュミス等が発生した場合には、算出される実測CPIの値は、このキャッシュミスの発生に応じて一時的に小さくなる。すなわち、CPU201による実際の処理状況が反映された解析を行なうことができ信頼性が高い。
At this time, the CPI
PMC21cからのオーバーフロー割り込みを契機として、1回のサンプリングで、分岐トレース採取部24がLBRの16ペア分の分岐情報を採取することができる。これにより、高精細な解析を行なうことができる。例えば、従来手法である性能プロファイラを用いる場合に比べて、解像度が17倍に向上する。
また、分岐毎に割り込みを発生させることで分岐情報を採取する、分岐トラップを利用した既知の命令トレーサ手法に比べて、採取負荷を例えば1/1000程度に軽減することができる。
In response to an overflow interrupt from the
In addition, the sampling load can be reduced to, for example, about 1/1000 compared to a known instruction tracer method using a branch trap that collects branch information by generating an interrupt for each branch.
そして、開示の技術は上述した実施形態に限定されるものではなく、本実施形態の趣旨を逸脱しない範囲で種々変形して実施することができる。本実施形態の各構成及び各処理は、必要に応じて取捨選択することができ、あるいは適宜組み合わせてもよい。
例えば、上述した実施形態においては、分岐トレース支援部22が分岐情報をLBRを用いて取得する例を示しているが、これに限定されるものではなく、種々変形して実施することができる。例えば、分岐トレース支援部22はBTSを用いて分岐情報を取得してもよい。
The disclosed technology is not limited to the above-described embodiment, and various modifications can be made without departing from the spirit of the present embodiment. Each structure and each process of this embodiment can be selected as needed, or may be combined suitably.
For example, in the above-described embodiment, the branch
なお、LBRに代えてBTSを用いる場合には、基本ブロックの抽出に際して、LBRのレジスタ・スタックの数である16を用いて比較判断を行なう(図7や図9参照)代わりに、分岐ペアの記憶に用いる記憶領域のアドレス等を用いることが望ましい。
また、上述した実施形態においては、情報処理装置1がオブジェクト回収部25及び逆アセンブル部26を備え、解析対象のプログラムのオブジェクトファイルを回収して逆アセンブルリストを作成しているが、これに限定されるものではない。すなわち、例えば、生成された逆アセンブルリストを外部から入力してもよく、種々変形して実施することができる。
When a BTS is used instead of the LBR, a comparison decision is made using 16 which is the number of LBR register stacks when extracting a basic block (see FIGS. 7 and 9). It is desirable to use an address of a storage area used for storage.
In the above-described embodiment, the
また、上述した開示により本実施形態を当業者によって実施・製造することが可能である。
以上の実施形態に関し、更に以下の付記を開示する。
(付記1)
性能測定カウンタを用いて、CPUサイクルイベントと実行命令数イベントとを測定し、単位命令サイクル数を算出する実測部と、
解析対象プログラムにおける複数の分岐情報を採取する採取部と、
前記採取部が採取した分岐情報に基づき、前記解析対象プログラムから作成された逆アセンブルリスト上の実走行パスを特定し、所定の分岐の直後の命令から次に分岐する命令を含む基本ブロックを抽出し、抽出された各基本ブロックに含まれるアセンブラ命令数をカウントした結果に基づいて、基本ブロック特定情報と前記アセンブラ命令数との対応関係情報を保持する解析部と、
前記対応関係情報に含まれる各基本ブロックの前記アセンブラ命令数に前記単位命令サイクル数を乗算して実行時間を算出する算出部と
を有することを特徴とする、情報処理装置。
Further, according to the above-described disclosure, this embodiment can be implemented and manufactured by those skilled in the art.
Regarding the above embodiment, the following additional notes are disclosed.
(Appendix 1)
Using a performance measurement counter, an actual measurement unit that measures a CPU cycle event and an executed instruction number event and calculates a unit instruction cycle number;
A collection unit for collecting multiple branch information in the analysis target program;
Based on the branch information collected by the collection unit, the actual traveling path on the disassembly list created from the analysis target program is specified, and the basic block including the instruction to branch next from the instruction immediately after the predetermined branch is extracted. And, based on the result of counting the number of assembler instructions included in each extracted basic block, an analysis unit that holds correspondence information between basic block identification information and the number of assembler instructions,
An information processing apparatus comprising: a calculation unit configured to calculate an execution time by multiplying the number of unit instruction cycles by the number of assembler instructions of each basic block included in the correspondence relationship information.
(付記2)
前記解析対象プログラムのオブジェクトファイルを回収する回収部と、
前記回収部が回収したオブジェクトファイルから前記逆アセンブルリストを作成する逆アセンブル部と
を備えることを特徴とする、付記1記載の情報処理装置。
(Appendix 2)
A collection unit for collecting an object file of the analysis target program;
The information processing apparatus according to
(付記3)
前記採取部が、分岐トレース支援機能により作成された複数分岐情報を一度の情報採取で読み出すことで採取する
ことを特徴とする、付記1又は2記載の情報処理装置。
(付記4)
性能測定カウンタを用いて、CPUサイクルイベントと実行命令数イベントとを測定し、単位命令サイクル数を算出する処理と、
解析対象プログラムにおける複数の分岐情報を採取する処理と、
採取した分岐情報に基づき、前記解析対象プログラムから作成された逆アセンブルリスト上の実走行パスを特定し、所定の分岐の直後の命令から次に分岐する命令を含む基本ブロックを抽出し、抽出された各基本ブロックに含まれるアセンブラ命令数をカウントした結果に基づいて、基本ブロック特定情報と前記アセンブラ命令数との対応関係情報を保持する処理と、
前記対応関係情報に含まれる各基本ブロックの前記アセンブラ命令数に前記単位命令サイクル数を乗算して実行時間を算出する処理と
を有することを特徴とする、処理方法。
(Appendix 3)
The information processing apparatus according to
(Appendix 4)
A process for measuring a CPU cycle event and an execution instruction count event using a performance measurement counter and calculating a unit instruction cycle count;
Processing to collect multiple branch information in the analysis target program,
Based on the collected branch information, the actual travel path on the disassemble list created from the analysis target program is specified, and the basic block including the instruction to branch next from the instruction immediately after the predetermined branch is extracted and extracted. Based on the result of counting the number of assembler instructions included in each basic block, processing for holding correspondence information between the basic block identification information and the number of assembler instructions,
And a process of calculating an execution time by multiplying the number of unit instruction cycles by the number of assembler instructions of each basic block included in the correspondence information.
(付記5)
前記解析対象プログラムのオブジェクトファイルを回収する処理と、
回収したオブジェクトファイルから前記逆アセンブルリストを作成する処理と
を備えることを特徴とする、付記4記載の処理方法。
(付記6)
分岐トレース支援機能により作成された複数分岐情報を一度の情報採取で読み出すことで採取する
ことを特徴とする、付記4又は5記載の処理方法。
(Appendix 5)
A process of collecting an object file of the analysis target program;
The processing method according to claim 4, further comprising a process of creating the disassembly list from the collected object file.
(Appendix 6)
The processing method according to
(付記7)
性能測定カウンタを用いて、CPUサイクルイベントと実行命令数イベントとを測定し、単位命令サイクル数を算出し、
解析対象プログラムにおける複数の分岐情報を採取し、
採取した分岐情報に基づき、前記解析対象プログラムから作成された逆アセンブルリスト上の実走行パスを特定し、所定の分岐の直後の命令から次に分岐する命令を含む基本ブロックを抽出し、抽出された各基本ブロックに含まれるアセンブラ命令数をカウントした結果に基づいて、基本ブロック特定情報と前記アセンブラ命令数との対応関係情報を保持し、
前記対応関係情報に含まれる各基本ブロックの前記アセンブラ命令数に前記単位命令サイクル数を乗算して実行時間を算出する
処理をコンピュータに実行させることを特徴とする、処理プログラム。
(Appendix 7)
Using the performance measurement counter, measure the CPU cycle event and the execution instruction count event, calculate the unit instruction cycle count,
Collect multiple branch information in the analysis target program,
Based on the collected branch information, the actual travel path on the disassemble list created from the analysis target program is specified, and the basic block including the instruction to branch next from the instruction immediately after the predetermined branch is extracted and extracted. Based on the result of counting the number of assembler instructions included in each basic block, the correspondence information between the basic block identification information and the number of assembler instructions is held,
A processing program for causing a computer to execute a process of calculating an execution time by multiplying the number of unit instruction cycles by the number of assembler instructions of each basic block included in the correspondence relationship information.
(付記8)
前記解析対象プログラムのオブジェクトファイルを回収し、
回収したオブジェクトファイルから前記逆アセンブルリストを作成する
処理を、前記コンピュータに実行させることを特徴とする、付記7記載の処理プログラム。
(Appendix 8)
Collect the object file of the analysis target program,
The processing program according to appendix 7, wherein the computer is caused to execute processing for creating the disassembly list from the collected object file.
(付記9)
分岐トレース支援機能により作成された複数分岐情報を一度の情報採取で読み出すことで採取する
処理を、前記コンピュータに実行させることを特徴とする、付記7又は8記載の処理プログラム。
(Appendix 9)
9. The processing program according to appendix 7 or 8, characterized in that the computer executes a process of collecting a plurality of pieces of branch information created by the branch trace support function by reading the information once.
1 情報処理装置
21a,21b,21c PMC
22 分岐トレース支援部
23 CPI実測部
24 分岐トレース採取部
25 オブジェクト回収部
26 逆アセンブル部
27 基本ブロック解析部
28 基本ブロック実行時間算出部
271 基本ブロック抽出部
272 命令数カウント部
T,T′ 基本ブロック情報
1
22 branch
Claims (5)
解析対象プログラムにおける複数の分岐情報を採取する採取部と、
前記採取部が採取した分岐情報に基づき、前記解析対象プログラムから作成された逆アセンブルリスト上の実走行パスを特定し、所定の分岐の直後の命令から次に分岐する命令を含む基本ブロックを抽出し、抽出された各基本ブロックに含まれるアセンブラ命令数をカウントした結果に基づいて、基本ブロック特定情報と前記アセンブラ命令数との対応関係情報を保持する解析部と、
前記対応関係情報に含まれる各基本ブロックの前記アセンブラ命令数に前記単位命令サイクル数を乗算して実行時間を算出する算出部と
を有することを特徴とする、情報処理装置。 Using a performance measurement counter, an actual measurement unit that measures a CPU cycle event and an executed instruction number event and calculates a unit instruction cycle number;
A collection unit for collecting multiple branch information in the analysis target program;
Based on the branch information collected by the collection unit, the actual traveling path on the disassembly list created from the analysis target program is specified, and the basic block including the instruction to branch next from the instruction immediately after the predetermined branch is extracted. And, based on the result of counting the number of assembler instructions included in each extracted basic block, an analysis unit that holds correspondence information between basic block identification information and the number of assembler instructions,
An information processing apparatus comprising: a calculation unit configured to calculate an execution time by multiplying the number of unit instruction cycles by the number of assembler instructions of each basic block included in the correspondence relationship information.
前記回収部が回収したオブジェクトファイルから前記逆アセンブルリストを作成する逆アセンブル部と
を備えることを特徴とする、請求項1記載の情報処理装置。 A collection unit for collecting an object file of the analysis target program;
The information processing apparatus according to claim 1, further comprising: a disassembly unit that creates the disassembly list from the object file collected by the collection unit.
ことを特徴とする、請求項1又は2記載の情報処理装置。 The information processing apparatus according to claim 1, wherein the collection unit collects the plurality of pieces of branch information created by the branch trace support function by reading the information once.
解析対象プログラムにおける複数の分岐情報を採取する処理と、
採取した分岐情報に基づき、前記解析対象プログラムから作成された逆アセンブルリスト上の実走行パスを特定し、所定の分岐の直後の命令から次に分岐する命令を含む基本ブロックを抽出し、抽出された各基本ブロックに含まれるアセンブラ命令数をカウントした結果に基づいて、基本ブロック特定情報と前記アセンブラ命令数との対応関係情報を保持する処理と、
前記対応関係情報に含まれる各基本ブロックの前記アセンブラ命令数に前記単位命令サイクル数を乗算して実行時間を算出する処理と
を有することを特徴とする、処理方法。 A process for measuring a CPU cycle event and an execution instruction count event using a performance measurement counter and calculating a unit instruction cycle count;
Processing to collect multiple branch information in the analysis target program,
Based on the collected branch information, the actual travel path on the disassemble list created from the analysis target program is specified, and the basic block including the instruction to branch next from the instruction immediately after the predetermined branch is extracted and extracted. Based on the result of counting the number of assembler instructions included in each basic block, processing for holding correspondence information between the basic block identification information and the number of assembler instructions,
And a process of calculating an execution time by multiplying the number of unit instruction cycles by the number of assembler instructions of each basic block included in the correspondence information.
解析対象プログラムにおける複数の分岐情報を採取し、
採取した分岐情報に基づき、前記解析対象プログラムから作成された逆アセンブルリスト上の実走行パスを特定し、所定の分岐の直後の命令から次に分岐する命令を含む基本ブロックを抽出し、抽出された各基本ブロックに含まれるアセンブラ命令数をカウントした結果に基づいて、基本ブロック特定情報と前記アセンブラ命令数との対応関係情報を保持し、
前記対応関係情報に含まれる各基本ブロックの前記アセンブラ命令数に前記単位命令サイクル数を乗算して実行時間を算出する
処理をコンピュータに実行させることを特徴とする、処理プログラム。 Using the performance measurement counter, measure the CPU cycle event and the execution instruction count event, calculate the unit instruction cycle count,
Collect multiple branch information in the analysis target program,
Based on the collected branch information, the actual travel path on the disassemble list created from the analysis target program is specified, and the basic block including the instruction to branch next from the instruction immediately after the predetermined branch is extracted and extracted. Based on the result of counting the number of assembler instructions included in each basic block, the correspondence information between the basic block identification information and the number of assembler instructions is held,
A processing program for causing a computer to execute a process of calculating an execution time by multiplying the number of unit instruction cycles by the number of assembler instructions of each basic block included in the correspondence relationship information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014090249A JP2015210574A (en) | 2014-04-24 | 2014-04-24 | Information processor, processing method and processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014090249A JP2015210574A (en) | 2014-04-24 | 2014-04-24 | Information processor, processing method and processing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2015210574A true JP2015210574A (en) | 2015-11-24 |
Family
ID=54612735
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014090249A Pending JP2015210574A (en) | 2014-04-24 | 2014-04-24 | Information processor, processing method and processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2015210574A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0520135A (en) * | 1991-07-15 | 1993-01-29 | Nec Corp | Execution time performance measuring system for target program |
JP2000194585A (en) * | 1998-12-24 | 2000-07-14 | Fuji Electric Co Ltd | Execution time calculating device for program |
JP2002163150A (en) * | 2000-11-28 | 2002-06-07 | Toshiba Corp | Processor |
JP2004030514A (en) * | 2002-06-28 | 2004-01-29 | Ip Flex Kk | Method for analyzing performance |
WO2010001766A1 (en) * | 2008-07-02 | 2010-01-07 | 国立大学法人 東京工業大学 | Execution time estimation method, execution time estimation program, and execution time estimation device |
US20110106519A1 (en) * | 2009-11-03 | 2011-05-05 | Ayose Falcon Samper | Simulating an application |
JP2011103026A (en) * | 2009-11-10 | 2011-05-26 | Hitachi Ltd | Method for measuring number of dynamic steps, method for measuring number of clocks, and computer system |
JP2012247908A (en) * | 2011-05-26 | 2012-12-13 | Nec Corp | Memory arrangement management device, memory arrangement management method, memory arrangement management program, and program generation system |
JP2013206321A (en) * | 2012-03-29 | 2013-10-07 | Fujitsu Ltd | Management device, resource management method, resource management program and information processing system |
-
2014
- 2014-04-24 JP JP2014090249A patent/JP2015210574A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0520135A (en) * | 1991-07-15 | 1993-01-29 | Nec Corp | Execution time performance measuring system for target program |
JP2000194585A (en) * | 1998-12-24 | 2000-07-14 | Fuji Electric Co Ltd | Execution time calculating device for program |
JP2002163150A (en) * | 2000-11-28 | 2002-06-07 | Toshiba Corp | Processor |
JP2004030514A (en) * | 2002-06-28 | 2004-01-29 | Ip Flex Kk | Method for analyzing performance |
WO2010001766A1 (en) * | 2008-07-02 | 2010-01-07 | 国立大学法人 東京工業大学 | Execution time estimation method, execution time estimation program, and execution time estimation device |
US20110106519A1 (en) * | 2009-11-03 | 2011-05-05 | Ayose Falcon Samper | Simulating an application |
JP2011103026A (en) * | 2009-11-10 | 2011-05-26 | Hitachi Ltd | Method for measuring number of dynamic steps, method for measuring number of clocks, and computer system |
JP2012247908A (en) * | 2011-05-26 | 2012-12-13 | Nec Corp | Memory arrangement management device, memory arrangement management method, memory arrangement management program, and program generation system |
JP2013206321A (en) * | 2012-03-29 | 2013-10-07 | Fujitsu Ltd | Management device, resource management method, resource management program and information processing system |
Non-Patent Citations (3)
Title |
---|
グレッグ・ナヒモフスキー: "「トレース・ファイルの生成と処理」", SUNWORLD 2002年2月号, vol. 第12巻 第2号, JPN6018026969, 1 February 2002 (2002-02-01), JP, pages 第70頁-第75頁 * |
下沢 拓 他: "「メニーコア環境におけるキャッシュアウェア・オペレーティングシステムに向けて」", 情報処理学会研究報告 2011年4月、5月研究発表会開催分 [CD−ROM], JPN6017045631, 15 June 2011 (2011-06-15), JP, pages 第1頁-第8頁 * |
松本 幸 他: "「大規模並列システムの性能評価を目的としたプログラムコード抽象化技法」", 情報処理学会研究報告, vol. 第2007巻 第80号, JPN6017045632, 3 August 2007 (2007-08-03), JP * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3191964B1 (en) | Memory leak analysis by usage trends correlation | |
JP4899511B2 (en) | System analysis program, system analysis apparatus, and system analysis method | |
JP4599902B2 (en) | Performance analysis method using hardware monitor | |
JP5119994B2 (en) | Performance monitoring program, performance monitoring method, performance monitoring device | |
US10228994B2 (en) | Information processing system, information processing method, and program | |
JP6090327B2 (en) | Bottleneck detection apparatus, method and program | |
EP2128768B1 (en) | Detecting device, program, and detecting method | |
KR101423030B1 (en) | Method of analysis application object which computer-executable, server performing the same and storage media storing the same | |
JP5029245B2 (en) | Profiling method and program | |
JP6691295B2 (en) | Information processing apparatus, program execution state display method, and program execution state display program | |
JP2017167930A (en) | Information processing device, power measurement method and power measurement program | |
US9703667B2 (en) | Hardware-based edge profiling | |
Canuto et al. | A methodology for full-system power modeling in heterogeneous data centers | |
JP2016149123A (en) | Method of determining valid input for unknown binary module and non-transitory computer-readable medium | |
US10114725B2 (en) | Information processing apparatus, method, and computer readable medium | |
JP2015210574A (en) | Information processor, processing method and processing program | |
Hazott et al. | DSA monitoring framework for HW/SW partitioning of application kernels leveraging VPs | |
JP2004078338A (en) | Method and system for evaluating computer performance | |
JP6384109B2 (en) | Information processing apparatus, processing method, and processing program | |
WO2012056569A1 (en) | Performance measurement method, performance measurement device, and performance measurement program | |
JP6503774B2 (en) | Program execution analysis method, information processing apparatus and program execution analysis program | |
JP2021060959A (en) | Factor analysis device and factor analysis method | |
Nowak et al. | Low-overhead dynamic instruction mix generation using hybrid basic block profiling | |
US20140236564A1 (en) | Coverage model and measurements for partial instrumentation | |
US9740588B2 (en) | Performance enhancement mode selection tool |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20170110 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20171121 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20171205 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20180201 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20180717 |