JP2014228889A - Performance information collection program, information processing device, and performance information collection method - Google Patents
Performance information collection program, information processing device, and performance information collection method Download PDFInfo
- Publication number
- JP2014228889A JP2014228889A JP2013105502A JP2013105502A JP2014228889A JP 2014228889 A JP2014228889 A JP 2014228889A JP 2013105502 A JP2013105502 A JP 2013105502A JP 2013105502 A JP2013105502 A JP 2013105502A JP 2014228889 A JP2014228889 A JP 2014228889A
- Authority
- JP
- Japan
- Prior art keywords
- function
- user
- identification information
- user function
- collected
- 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.)
- Granted
Links
Images
Abstract
Description
本願は、性能情報収集プログラム、情報処理装置及び性能情報収集方法に関する。 The present application relates to a performance information collection program, an information processing apparatus, and a performance information collection method.
アプリケーションは、演算処理装置としてのCPU(Central Processing Unit)が何らかの原因で命令の実行に時間を浪費している場合、自身の性能を十分に発揮することができない。そこで、プロファイラは、CPUに時間を浪費させる命令に対応するアプリケーションの問題箇所を限定又は特定するため、アプリケーションの動作情報を一定時間間隔で又はトレースして収集する(例えば、特許文献1、2、非特許文献1)。アプリケーションの問題箇所を限定又は特定するために、プロファイラを効果的に利用することができる場合は、CPU使用率が高いアプリケーションの箇所を限定又は特定するときである。
When a CPU (Central Processing Unit) as an arithmetic processing unit is wasting time for executing an instruction for some reason, the application cannot sufficiently exhibit its performance. Therefore, the profiler collects application operation information at regular time intervals or by tracing in order to limit or specify the problem part of the application corresponding to an instruction that causes the CPU to waste time (for example,
しかしながら、CPUが命令の実行に時間を浪費する場合には、CPU使用率が高い場合に限らず、CPU使用率が低い場合もある。例えば、アプリケーションから呼び出されたユーザ関数の実行時間は短くても、当該ユーザ関数の次に実行されるOS関数がCPUをアイドル状態にする場合がある。かかる場合、プロファイラによる情報収集の時間間隔がアプリケーションから呼び出されたユーザ関数の実行時間より長いとき、当該ユーザ関数を特定することは困難である。また、トレースにより当該ユーザ関数を特定する場合、プロファイラのオーバーヘッドが大きくなる。 However, when the CPU wastes time for executing instructions, the CPU usage rate is not limited to high, and the CPU usage rate may be low. For example, even if the execution time of the user function called from the application is short, the OS function executed next to the user function may put the CPU in an idle state. In such a case, when the time interval for collecting information by the profiler is longer than the execution time of the user function called from the application, it is difficult to specify the user function. Further, when the user function is specified by tracing, the profiler overhead increases.
本発明の目的のひとつは、オーバーヘッドを抑えて、プロセッサをアイドル状態にするアプリケーションの箇所を限定することができる性能情報収集プログラム、性能情報収集装置及び性能情報収集方法を提供することにある。 One of the objects of the present invention is to provide a performance information collection program, a performance information collection device, and a performance information collection method that can limit the application locations that place the processor in an idle state while suppressing overhead.
本願の一観点は、演算処理装置がオペレーティングシステムを介して実行するユーザプログラムの性能情報を、記憶部を有する情報処理装置に取得させる性能情報収集プログラムにおいて、前記情報処理装置に、前記記憶部に記憶された前記オペレーティングシステムを介した前記ユーザプログラムを前記演算処理装置に実行させる場合、前記オペレーティングシステムから呼び出されたオペレーティングシステム関数の識別情報と前記ユーザプログラムから呼び出されたユーザ関数の識別情報とを、周期的に収集させるとともに前記記憶部に記憶させ、前記記憶部に記憶されたユーザ関数の識別情報に基づいて、各ユーザ関数が収集された回数である個別ユーザ関数収集回数を、各ユーザ関数の種別毎に集計させ、前記記憶部に記憶されたオペレーティングシステム関数の識別情報とユーザ関数の識別情報とに基づいて、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の識別情報が収集された一周期前に、前記ユーザ関数の識別情報が収集された個別特定ユーザ関数収集回数を、各ユーザ関数の種別毎に集計させ、集計された各個別ユーザ関数収集回数に対する各個別特定ユーザ関数収集回数の割合を、前記ユーザ関数の種別毎に算出させる。 One aspect of the present application provides a performance information collection program that causes an information processing device having a storage unit to acquire performance information of a user program executed by an arithmetic processing device via an operating system. When causing the arithmetic processing unit to execute the stored user program via the operating system, identification information of an operating system function called from the operating system and identification information of a user function called from the user program The number of individual user function collections, which is the number of times each user function is collected based on the identification information of the user function stored in the storage unit and periodically stored and stored in the storage unit, For each type, and stored in the storage unit Based on the identification information of the operating system function and the identification information of the user function, the identification information of the user function is collected one cycle before the identification information of the operating system function for bringing the arithmetic processing unit into an idle state is collected. The collected number of individual specific user functions is totaled for each type of user function, and the ratio of the number of individual specific user function collections to the total number of collected individual user functions is calculated for each type of the user function. .
本願の一観点によれば、オーバーヘッドを抑えて、プロセッサをアイドル状態にするアプリケーションの箇所を限定することができる。 According to one aspect of the present application, it is possible to limit the application locations that place the processor in an idle state while suppressing overhead.
本実施の形態に係る情報処理装置を、その図面に基づいて説明する。 An information processing apparatus according to the present embodiment will be described with reference to the drawings.
実施の形態1
図1は、情報処理装置10のハードウェア構成例を示すブロック図である。情報処理装置10は、例えば汎用コンピュータ、ワークステーション、PC(パーソナルコンピュータ)等である。情報処理装置10は、演算処理装置としてのCPU(演算処理装置、収集部、集計部、算出部、抽出部、トレース収集部、特定部、変換部)11及びROM(Read Only Memory)12を含む。また、情報処理装置10は、RAM(Random Access Memory)(記憶部)13、ハードディスク(記憶部)14、ディスクドライブ15、表示部16、操作部17及び通信部18を含む。
FIG. 1 is a block diagram illustrating a hardware configuration example of the
CPU11は、ソフトウェアプログラムに記述された命令セットを実行するためのプロセッサである。CPU11は、情報処理装置10の各構成部を制御する。CPU11は、ハードディスク14に記憶されたOS(Operating System、オペレーションシステム)100、ユーザプログラム1UP及びプログラム(性能情報収集プログラム)1PをRAM13に読み出し、RAM13に読み出した各ソフトウェアを実行する。
The
OS100は、ハードウェア上で動作する基本ソフトウェアである。OS100は、CPU11内部のレジスタのオーバーフローに基づいて、OS100自身及びユーザプログラム1UPのパフォーマンスをプロファイルするプロファイラ(収集部)を有している。
ユーザプログラム1UPは、ユーザが作成したプログラムである。ユーザプログラム1UPは、OS100の制御の下、実行されるアプリケーションプログラムである。
プログラム1Pは、ユーザプログラム1UPの性能を解析する機能を有しており、OS100の中に組み込まれていてもよいし、OS100と独立していてもよい。図1の例では、プログラム1Pは、OS100と独立して、ハードディスク14に記憶されている。
The OS 100 is basic software that operates on hardware. The OS 100 has a profiler (collecting unit) that profiles the performance of the
The user program 1UP is a program created by the user. The user program 1UP is an application program that is executed under the control of the
The
CPU11は、PID(Process ID)レジスタ111、タイマ(時計部)112、制御設定レジスタ113、カウンタレジスタ114及びプログラムカウンタ115を含む。PIDレジスタ111等は、パフォーマンス・イベントをモニターするためのハードウェア構成部である。
PIDはOS100が実行しているプロセスの識別子であり、PIDレジスタ111はPIDを一時的に記憶するレジスタである。タイマ112は、タイムスタンプカウンタであり、クロックサイクルに基づいて、時刻を計時する計時部である。
The
The PID is an identifier of a process executed by the
制御設定レジスタ113及びカウンタレジスタ114は、OS100が有しているプロファイラが割り込み処理を実行するためのレジスタである。制御設定レジスタ113は、タイマ112によるカウントの制御パラメータを一時的に記憶する。カウンタレジスタ114は、タイマ112のクロックサイクル毎に増加するカウント値をカウントし、カウントした結果を一時的に記憶するレジスタである。プログラムカウンタ115は、CPU11が次に実行する命令を記憶したRAM13上のアドレスを一時的に格納するレジスタである。
The
ROM12は、例えば不揮発性の半導体メモリ又は半導体メモリ以外の読み出し専用記憶媒体である。ROM12は、情報処理装置10の起動時にCPU11が実行するBIOS(Basic Input_Output System)、ファームウェア等を記憶している。
The
RAM13は、主記憶装置である。RAM13は、例えばSRAM又はDRAMであり、CPU11が実行する処理の過程で必要な作業変数、データ等を一時的に記憶する。なお、RAM13の代わりにフラッシュメモリ、メモリカード等が用いられてもよい。
The
ハードディスク14は、補助記憶装置である。ハードディスク14は、大容量の情報の記憶が可能なフラッシュメモリ又はCD(Compact Disc)、DVD(Digital Versatile Disc)、BD(Blu-ray Disc、登録商標)等の光ディスク1dで代替されてもよい。ハードディスク14は、CPU11が実行するOS100、ユーザプログラム1UP及びプログラム1P並びに各種テーブルを記憶している。なお、ユーザプログラム1UPは、バイナリデータである。ユーザプログラム1UPのソースファイルは、ハードディスク14に記憶されていてもよいし、記憶されていなくてもよい。
The
各種テーブルは、サンプリングテーブル1T及び集計テーブル2Tを含む。サンプリングテーブル1Tは、OS100及びユーザプログラム1UPから呼び出される関数の動作情報を記録するテーブルである。集計テーブル2Tは、サンプリングテーブル1Tのデータを集計した結果を記録するテーブルである。サンプリングテーブル1T及び集計テーブル2Tの詳細については、後述する。
The various tables include a sampling table 1T and a total table 2T. The sampling table 1T is a table that records operation information of functions called from the
ハードディスク14は、情報処理装置10の内部に取り付けられるものであっても、情報処理装置10の外部に置かれるものであってもよい。例えば、ハードディスク14に記憶された各種テーブルは、外部のデータベースサーバに記憶されていてもよい。かかる場合、情報処理装置10は、外部のデータベースサーバにアクセスして、サンプリングテーブル1Tに記憶されている情報を取得し、取得した情報に基づき、集計テーブル2Tを更新してもよい。
The
ディスクドライブ15は、外部の記憶媒体であるCD、DVD、BD等の光ディスク1dから情報を読み出し、光ディスク1dに情報を記録する。
The
表示部16は、画像を表示する表示装置である。表示部16は、例えば液晶ディスプレイ、有機EL(Electro Luminescence)ディスプレイ、CRT(Cathode Ray Tube)ディスプレイ等の画面を有し、CPU11からの指示に従って、OS100、ユーザプログラム1UP及びプログラム1Pに係る各種情報を表示する。
The
操作部17は、ユーザが各種の入力を行うキーボード、マウス、電源スイッチ、ディスクドライブ15から光ディスク1dを排出するための操作ボタン等の入力デバイスである。操作部17は、ユーザによる操作に基づいて入力信号を生成する。生成された入力信号は、バス1bを介してCPU11に送信される。
The
通信部18は、有線又は無線通信のモデム、LANカード、ルータ、USB端子、接続コネクタ等である。通信部18は、LAN、WAN、電話回線、衛星通信回線、インターネット等のネットワーク1Nと接続されている。通信部18は、パラレルポート又はプリンタポートを備えていてもよい。
The
なお、CPU11は、ディスクドライブ15を介して、プログラム1Pを光ディスク1dから読み込んでもよい。CPU11は、通信部18を介して、プログラム1Pを外部の情報処理装置又は記憶装置から読み込んでもよい。さらに、プログラム1Pを記憶したフラッシュメモリ等の半導体メモリ1mが、情報処理装置10内に実装されていてもよい。
Note that the
図2は、制御設定レジスタ113及びカウンタレジスタ114のレイアウト例を示す説明図である。制御設定レジスタ113は、FIXED_CTR_CTRL113a、PERF_GLOBAL_CTRL113b及びFIXED_OVF_CTRL113cを含む(図2A、図2B及び図2C)。図2Dに示すカウンタレジスタ114は、例えば64ビットのレジスタである。
FIG. 2 is an explanatory diagram showing a layout example of the
図2AのFIXED_CTR_CTRL113aは、カウントの有効、無効を設定する場合に利用される例えば64ビットのレジスタである。4ビット目に1が設定された場合、OS100の実行時にカウントが有効にされる。4ビット目に0が設定された場合、OS100の実行時にカウントが無効にされる。5ビット目に1が設定された場合、ユーザブログラム1UPの実行時にカウントが有効にされる。5ビット目に0が設定された場合、ユーザプログラム1UPの実行時にカウントが無効にされる。
図2BのPERF_GLOBAL_CTRL113bは、カウントの有効、無効を設定する場合に利用される例えば64ビットのレジスタである。33ビット目に1が設定された場合、カウントが有効にされる。33ビット目に0が設定された場合、カウントが無効にされる。7ビット目に1が設定された場合、カウンタレジスタ114がオーバーフローした際、OS100のプロファイラはプロセスに割り込みを発生させる。
The
図2CのFIXED_OVF_CTRL113cは、カウントのオーバーフローをクリアする場合に利用される例えば64ビットのレジスタである。カウンタレジスタ114がオーバーフローした場合、33ビット目は1になる。
次に、情報処理装置10の機能について説明する。
図3は、情報処理装置10の機能例を示す機能ブロック図である。情報処理装置10の各機能部は、ハードディスク14に記憶されたOS100、ユーザプログラム1UP及びプログラム1Pと、CPU11、RAM13等のハードウェア資源とが協働して動作することにより実現される。
Next, functions of the
FIG. 3 is a functional block diagram illustrating an example of functions of the
情報処理装置10は、プロファイラ1pr、解析部1an及び出力部80を含む。プロファイラ1prは、OS100に含まれる機能部であり、一定時間間隔でOS100及びユーザプログラム1UPの動作に関する情報をCPU11からサンプリングする。なお、プロファイラ1prは、プログラム1Pに含まれる機能部でもある。
解析部1anは、プログラム1Pに含まれる機能部であり、プロファイラ1prがサンプリングした情報を利用して、ユーザプログラム1UPから呼び出された関数のうち、CPU11をアイドル状態にする可能性の高い関数を抽出する。
出力部80は、プログラム1Pに含まれる機能部であり、解析部1anが抽出したユーザプログラム1UPの関数に関する情報を出力する機能部である。
The
The analysis unit 1an is a functional unit included in the
The
プロファイラ1prは、コード実行部11pr、設定制御部12pr、割り込みハンドら部13pr及び記録部14prを含む。コード実行部11prは、解析部1anが解析対象とするユーザプログラム1UPを実行させる機能部である。設定制御部12prは、サンプリング内容、サンプリング時間間隔等の設定と、カウンタレジスタ114に記憶されるカウント値のカウント等を制御する。設定制御部12prが設定するサンプリング内容は、OS100及びユーザプログラム1UPから呼び出された関数に関する例えばPID、RAM13上のアドレス及びサンプリング時刻である。
The profiler 1pr includes a code execution unit 11pr, a setting control unit 12pr, an interrupt hand unit 13pr, and a recording unit 14pr. The code execution unit 11pr is a functional unit that causes the analysis unit 1an to execute the user program 1UP to be analyzed. The setting control unit 12pr controls setting of sampling contents, sampling time interval, and the like, and counting of count values stored in the
割り込みハンドラ部13prは、CPU11に対して、実行中の処理を中断させ、設定制御部12prが設定した情報をサンプリングする処理を要求する機能部である。CPU11は、PIDをPIDレジスタ111から、関数のアドレスをプログラムカウンタ115から、サンプリング時刻をタイマ112から取得する。記録部14prは、割り込みハンドラ部13prがCPU11にサンプリングさせたOS100及びユーザプログラム1UPの動作に関する上記情報をRAM13に記録する機能部である。記録部14prは、サンプリングされた情報を例えばサンプリングテーブル1Tの書式でRAM13に記録する。
The interrupt handler unit 13pr is a functional unit that requests the
図4は、サンプリングテーブル1Tのレコードレイアウトの一例を示す説明図である。サンプリングテーブル1Tは、サンプリング結果の記録に関するデータ管理方式の一例である。サンプリングテーブル1Tは、PID、アドレス、時刻、プロセス名及び関数名の各列を含む。
PIDは、OS100及びユーザプログラム1UPから呼び出されたサンプリング対象である関数に対応するプロセスの識別情報である。アドレスは、サンプリング対象の関数が記憶されているRAM13上のアドレスである。時刻は、サンプリング時刻である。プロセス名は、PIDに対応するプロセスの名称である。関数名は、OS100及びユーザプログラム1UPから呼び出されたサンプリング対象の関数の名称である。
FIG. 4 is an explanatory diagram showing an example of the record layout of the sampling table 1T. The sampling table 1T is an example of a data management method related to recording of sampling results. The sampling table 1T includes columns of PID, address, time, process name, and function name.
The PID is process identification information corresponding to a sampling target function called from the
割り込みハンドラ部13prによりサンプリングされた情報を記録部14prが記録する段階では、プロセス名及び関数名は不明であるため、図4のプロレス名及び関数名の列は空欄になっている。 At the stage where the recording unit 14pr records the information sampled by the interrupt handler unit 13pr, the process name and function name are unknown, and therefore the column of the wrestling name and function name in FIG. 4 is blank.
図3に戻り、説明を続ける。
解析部1anは、収集部11an及び関数名取得部(変換部)12anを含む。収集部11anは、プロファイラ1prの記録部14prがRAM13に記録したサンプリングテーブル1Tの内容をハードディスク14に書き込む機能部である。
Returning to FIG. 3, the description will be continued.
The analysis unit 1an includes a collection unit 11an and a function name acquisition unit (conversion unit) 12an. The collection unit 11an is a functional unit that writes the contents of the sampling table 1T recorded in the
関数名取得部12anは、プロファイラ1prがサンプリングした関数に対応する関数名及びプロセス名を取得する機能部である。例えば図4において、PID=「0」、アドレス=「ffffffff・・・」の行は、OS100の関数に関するサンプリングデータであることを示している。また、図4において、PID=「0」、アドレス=「ffffffff・・・」以外の行は、ユーザプログラム1UPの関数に関するサンプリングデータであることを示している。関数名取得部12anは、OS100から、図4のOS100のPID及びアドレスに夫々対応するプロセス名及び関数名を取得する。関数名取得部12anは、ユーザプログラム1UPのバイナリデータから、図4のユーザプログラム1UPのPID及びアドレスに夫々対応するプロセス名及び関数名を取得する。関数名取得部12anは、取得した各関数に対応するプロセス名及び関数名を、例えばサンプリングテーブル1Tとしてハードディスク14に書き込む。
The function name acquisition unit 12an is a functional unit that acquires a function name and a process name corresponding to the function sampled by the profiler 1pr. For example, in FIG. 4, the row of PID = “0” and address = “ffffffff...” Indicates sampling data regarding the function of the
図5は、サンプリングテーブル1Tのレコードレイアウトの一例を示す説明図である。図5は、関数名取得部12anがサンプリングテーブル1Tのプロセス名及び関数名の各列に、取得したプロセス名及び関数名を夫々追記した様子を示している。 FIG. 5 is an explanatory diagram showing an example of the record layout of the sampling table 1T. FIG. 5 shows a state in which the function name acquisition unit 12an adds the acquired process name and function name to each column of the process name and function name in the sampling table 1T.
解析部1anは、算出部(集計部、算出部、抽出部)13anを含む。算出部13anは、サンプリングテーブル1Tに基づいて、CPU11をアイドル状態にした可能性が高いユーザプログラム1UPの関数を抽出するための数値を算出する機能部である。以下、OS100に含まれる関数をOS関数、ユーザプログラム1UPに含まれる関数をユーザ関数と呼ぶ。また、CPU11をアイドル状態にするOS関数をアイドル関数、OSのアイドル関数を呼び出すユーザ関数をアイドル要因関数と呼ぶ。
The analysis unit 1an includes a calculation unit (aggregation unit, calculation unit, extraction unit) 13an. The calculation unit 13an is a functional unit that calculates a numerical value for extracting a function of the user program 1UP that is highly likely to have put the
図6は、プロファイラ1prが一定時間間隔でOS100及びユーザプログラム1UPから呼び出された関数に関する情報をサンプリングするタイミングを示す説明図である。図6の横軸は、時間を示している。上から下へ向かう稲妻を模した矢印は、プロファイラ1prによるサンプリングのタイミングを示している。斜線入りの矢印は、プロファイラ1prがアイドル要因関数に関する情報をサンプリングするタイミングを示している。
FIG. 6 is an explanatory diagram showing the timing at which the profiler 1pr samples information about functions called from the
時間の経過と共に、ユーザプログラム1UPからユーザ関数が、OS100からOS関数が次々と呼び出され、CPU11により実行される。図6は、CPU11がユーザ関数を実行しているタイミングを白抜きのボックスで、OS関数を実行しているタイミングを斜線入りのボックスで示している。
As time elapses, user functions are successively called from the user program 1UP and OS functions are successively called from the
いま、ユーザ関数に対応するプロセスが複数あり、複数のプロセスが例えばセマフォに係る共有資源を保有しているとする。かかる場合、複数のプロセスが共有資源に同時にアクセスしないように、OS100がCPU11をアイドル状態にするアイドル関数(例えば図5におけるpoll_idle)を呼び出すことが考えられる。このような場合、CPU11の使用率は、低下する。
CPU使用率が低い状態でプロファイラ1prによりサンプリングが実行された場合、アイドル要因関数に関する情報がサンプリングされた後、1サンプリング周期の後に、アイドル関数に関する情報がサンプリングされる可能性が高いと考えられる。
Now, assume that there are a plurality of processes corresponding to the user function, and the plurality of processes have shared resources related to, for example, a semaphore. In such a case, it is conceivable that the
When sampling is executed by the profiler 1pr in a state where the CPU usage rate is low, it is considered that there is a high possibility that the information regarding the idle function is sampled after one sampling period after the information regarding the idle factor function is sampled.
一定の時間範囲では、1つのユーザ関数だけが実行されるかもしれないし、異なる複数のユーザ関数が連続して実行されるかもしれない。そのため、プロファイラ1prがアイドル関数に関する情報をサンプリングする1サンプリング周期前に実行される関数は、アイドル要因関数ではないかもしれない。また、プロファイラ1prがアイドル要因関数に関する情報をサンプリングした1サンプリング周期後に実行される関数は、アイドル要因関数以外のユーザ関数かもしれない。しかし、サンプリング型のプロファイラ1prが収集する情報が統計的要約である以上、サンプリングテーブル1Tのデータを統計処理することにより、ユーザ関数をアイドル要因関数の可能性が高い関数と、そうでない関数とに区分することができる。また、サンプリングテーブル1Tのデータを統計処理することにより、ユーザ関数をアイドル要因関数の可能性が高い順に並び替えることができる。 In a certain time range, only one user function may be executed, or different user functions may be executed in succession. Therefore, the function executed one sampling period before the profiler 1pr samples information on the idle function may not be the idle factor function. Further, the function executed after one sampling period when the profiler 1pr samples information on the idle factor function may be a user function other than the idle factor function. However, as long as the information collected by the sampling type profiler 1pr is a statistical summary, the data of the sampling table 1T is statistically processed, so that the user function is changed to a function that is highly likely to be an idle factor function and a function that is not. Can be classified. Further, by statistically processing the data of the sampling table 1T, the user functions can be rearranged in the descending order of the possibility of the idle factor function.
算出部13anは、ユーザ関数毎に、プロファイラ1prがサンプリングしたサンプリング回数を集計する。算出部13anは、ユーザ関数毎に、ユーザ関数に関する情報がサンプリングされた1サンプリング周期後にアイドル関数に関する情報がサンプリングされた回数を集計する。算出部13anは、ユーザ関数毎に、ユーザ関数に関する情報がサンプリングされた1サンプリング周期後にアイドル関数以外の関数に関する情報がサンプリングされた回数を集計する。算出部13anは、集計した結果をハードディスク14に記憶された集計テーブル2Tに書き込む。
The calculation unit 13an totals the number of samplings sampled by the profiler 1pr for each user function. For each user function, the calculation unit 13an counts the number of times the information related to the idle function is sampled after one sampling period in which the information related to the user function is sampled. For each user function, the calculation unit 13an counts the number of times information related to functions other than the idle function is sampled after one sampling period when the information related to the user function is sampled. The calculating unit 13an writes the totaled result to the totaling table 2T stored in the
図7は、集計テーブル2Tのレコードレイアウトの一例を示す説明図である。集計テーブル2Tは、順位、関数名、総サンプリング回数、A回数、B回数及び割合の各列を含む。
順位については、後述する。関数名は、サンプリングテーブル1Tの関数名と同じである。総サンプリング回数は、プロファイラ1prによりユーザ関数についてサンプリングが実行された総回数である。A回数は、プロファイラ1prによりユーザ関数に関する情報がサンプリングされた1サンプリング周期後にアイドル関数に関する情報がサンプリングされた回数を、ユーザ関数毎に集計した回数である。B回数は、プロファイラ1prによりユーザ関数に関する情報がサンプリングされた1サンプリング周期後にアイドル関数以外の関数に関する情報がサンプリングされた回数を、ユーザ関数毎に集計した回数である。B回数に係るアイドル関数以外の関数は、ユーザ関数及びアイドル関数以外のOS関数である。
A回数とB回数との合計は、総サンプリング回数に等しい。
FIG. 7 is an explanatory diagram showing an example of a record layout of the aggregation table 2T. The tabulation table 2T includes columns of rank, function name, total sampling count, A count, B count, and ratio.
The order will be described later. The function name is the same as the function name of the sampling table 1T. The total number of times of sampling is the total number of times the user function has been sampled by the profiler 1pr. The number of times A is the number of times the number of times information related to the idle function is sampled for each user function after one sampling period when the information related to the user function is sampled by the profiler 1pr. The number of times B is the number of times, for each user function, the number of times information related to functions other than the idle function is sampled after one sampling period when the information related to the user function is sampled by the profiler 1pr. The functions other than the idle function related to the B count are OS functions other than the user function and the idle function.
The sum of the A count and the B count is equal to the total sampling count.
算出部13anは、ユーザ関数毎に、A回数を総サンプリング回数で除算し、100倍した値を求める。算出部13anは、求めた値を集計テーブルの割合列に書き込む。すなわち、集計テーブル2Tの割合は、アイドル関数に関する情報がサンプリングされる1サンプリング周期前に、サンプリングされたユーザ関数の統計的実行頻度を示している。換言すると、集計テーブル2Tの割合が大きいユーザ関数は、アイドル関数の実行時刻の少し前に実行されることが多い。 For each user function, the calculation unit 13an divides the number A by the total number of samplings to obtain a value multiplied by 100. The calculation unit 13an writes the obtained value in the ratio column of the aggregation table. That is, the ratio of the total table 2T indicates the statistical execution frequency of the user function sampled one sampling period before the information on the idle function is sampled. In other words, a user function having a large ratio in the aggregation table 2T is often executed slightly before the execution time of the idle function.
算出部13anは、集計テーブル2Tのレコードを割合の降順に並び替える。算出部13anは、並び替えたレコードに対応する集計テーブル2Tの順位に、割合の大きいものから昇順に、1、2、3・・・と番号を書き込む。すなわち、集計テーブル2Tには、サンプリングされたユーザ関数がアイドル関数の実行時刻の少し前に実行される可能性が高い順にソートした結果が記録される。
算出部13anは、集計テーブル2Tから全ユーザ関数のうち、順位が例えば上位10%に入るユーザ関数を抽出する。算出部13anは、抽出したユーザ関数に対応する集計テーブル2T及びサンプリングテーブル1Tのデータを出力部80に与える。
The calculation unit 13an rearranges the records in the aggregation table 2T in descending order of the ratio. The calculating unit 13an writes the
The calculating unit 13an extracts, from the total table 2T, user functions whose rank is, for example, the top 10% among all user functions. The calculation unit 13an provides the
なお、サンプリングテーブル1T及び集計テーブル2Tは、リレーショナルデータベースにおけるテーブル、スプレッドシート、CSV等のテキスト等のいずれでもよく、特定のデータ管理方式に限定されない。 The sampling table 1T and the aggregation table 2T may be any table in a relational database, a spreadsheet, text such as CSV, and the like, and are not limited to a specific data management method.
出力部80は、算出部13anが抽出した集計テーブル2Tの内容及び当該内容に対応するサンプリングテーブル1Tの内容を、例えば表示部16に表示する。出力部80は、通信部18を介して、同様の内容を外部の情報処理装置に送信してもよい。
The
次に、情報処理装置10の動作について説明する。
図8は、アイドル要因関数である確率が高いユーザ関数を抽出する処理の手順の一例を示すフローチャートである。図8は、処理の概要を示している。
CPU11は、ユーザプログラム1UPを実行する(ステップS1)。CPU11は、サンプリングする内容設定及びカウンタレジスタ114のオーバーフローに係るカウント設定を行う(ステップS2)。CPU11は、OS関数及びユーザ関数に関する動作情報のサンプリング処理を実行する(ステップS3)。
Next, the operation of the
FIG. 8 is a flowchart illustrating an example of a processing procedure for extracting a user function having a high probability of being an idle factor function. FIG. 8 shows an outline of the processing.
The
CPU11は、収集したサンプリングテーブル1Tのデータを解析して、アイドル要因関数である確率が高いユーザ関数を抽出する(ステップS4)。CPU11は、抽出したアイドル要因関数である確率が高いユーザ関数に係る情報を外部に出力し(ステップS5)、処理を終了する。
The
図9は、設定処理の手順の一例を示すフローチャートである。図9の処理は、図8の設定処理(ステップS2)に対応する。 FIG. 9 is a flowchart illustrating an example of the procedure of the setting process. The process of FIG. 9 corresponds to the setting process (step S2) of FIG.
CPU11は、オーバーフローさせるカウンタレジスタ114のビットをクリアする(ステップS21)。CPU11は、カウンタレジスタ114がオーバーフローした場合、割り込みを発生させるように設定する(ステップS22)。CPU11は、クロックカウントをセットして、サンプリングを実行するためのサンプリング時間間隔を設定する(ステップS23)。CPU11は、OS100及びユーザプログラム1UPの実行時におけるカウントを有効に設定し(ステップS24)、処理を終了する。
The
図10は、サンプリング処理の手順の一例を示すフローチャートである。図10の処理は、図8のサンプリング処理(ステップS3)に対応する。
CPU11は、タイマ112の計時に基づいて一定時間が経過したか否か、あるいはRAM13の使用率が一定値以上に達したか否かを判定する(ステップS31)。CPU11は、一定時間が経過したと判定した場合、あるいはRAM13の使用率が一定値以上に達したと判定した場合(ステップS31:YES)、処理を終了する。
FIG. 10 is a flowchart illustrating an example of the procedure of the sampling process. The process of FIG. 10 corresponds to the sampling process (step S3) of FIG.
The
CPU11は、一定時間が経過していないと判定した場合、あるいはRAM13の使用率が一定値以上に達していないと判定した場合(ステップS31:NO)、以下の処理を実行する。すなわち、CPU11は、実行中のプロセスを中断し、中断したプロセスに対応した関数に係るPID、RAM13上のアドレス及び現在時刻を、夫々PIDレジスタ111、プログラムカウンタ115及びタイマ112から取得する(ステップS32)。CPU11は、取得したPID、アドレス及び時刻をRAM13に記録する(ステップS33)。CPU11は、設定処理(ステップS2)を実行し(ステップS34)、ステップS31に処理を戻す。
When the
図11は、解析処理の手順の一例を示すフローチャートである。図11の処理は、図8の解析処理(ステップS4)に対応する。図11は、解析処理の概要を示している。
CPU11は、一定時間間隔でサンプリングしたOS関数及びユーザ関数に関するPID、アドレス及び時刻を収集する収集処理を実行する(ステップS41)。CPU11は、収集したPID及びアドレスを夫々プロセス名及び関数名に変換するプロセス関数名変換処理を実行する(ステップS42)。CPU11は、ユーザ関数毎にアイドル要因関数である確率を算出する算出処理を実行し(ステップS43)、処理を終了する。
FIG. 11 is a flowchart illustrating an example of the analysis processing procedure. The process of FIG. 11 corresponds to the analysis process (step S4) of FIG. FIG. 11 shows an outline of the analysis process.
The
図12は、収集処理の手順の一例を示すフローチャートである。図12の処理は、図11の収集処理(ステップS41)に対応する。
CPU11は、図10のステップS33においてRAM13に記録したOS関数及びユーザ関数のPID、アドレス及び時刻をハードディスク14に記憶されているサンプリングテーブル1Tに書き込み(ステップS411)、処理を終了する。
FIG. 12 is a flowchart illustrating an example of a collection processing procedure. The process of FIG. 12 corresponds to the collection process (step S41) of FIG.
The
図13は、プロセス関数名変換処理の手順の一例を示すフローチャートである。図13の処理は、図11のプロセス関数名変換処理(ステップS42)に対応する。
CPU11は、サンプリングテーブル1Tから未処理であるOS関数並びにユーザ関数のPID及びアドレスを夫々読み出す(ステップS421)。CPU11は、OS100及びユーザプログラム1UPのバイナリデータを参照し、読み出したPID及びアドレスを夫々プロセス名及び関数名に変換する(ステップS422)。
FIG. 13 is a flowchart illustrating an example of a process function name conversion process. The process of FIG. 13 corresponds to the process function name conversion process (step S42) of FIG.
The
CPU11は、特定したOS関数及びユーザ関数に係るプロセス名及び関数名をサンプリングテーブル1Tに書き込む(ステップS423)。CPU11は、サンプリングテーブル1Tに未処理のOS関数又はユーザ関数があるか否かを判定する(ステップS424)。CPU11は、サンプリングテーブル1Tに未処理のOS関数又はユーザ関数があると判定した場合(ステップS424:YES)、ステップS421に処理を戻す。
The
CPU11は、サンプリングテーブル1Tに未処理のOS関数又はユーザ関数がないと判定した場合(ステップS424:NO)、処理を終了する。
If the
図14及び図15は、算出処理の手順の一例を示すフローチャートである。図14及び図15の処理は、図11の算出処理(ステップS43)に対応する。
CPU11は、サンプリングテーブル1Tにおいて、未処理のユーザ関数のレコードを1つ選択する(ステップS431)。ステップS431において、CPU11は、時刻が古いレコードから新しいレコードへ向かって、1つずつユーザ関数のレコードを選択する。CPU11は、選択したユーザ関数の関数名が集計テーブル2Tに書かれているか否かを判定する(ステップS432)。
14 and 15 are flowcharts illustrating an example of a calculation processing procedure. The process of FIGS. 14 and 15 corresponds to the calculation process (step S43) of FIG.
The
CPU11は、選択したユーザ関数の関数名が集計テーブル2Tに書かれていると判定した場合(ステップS432:YES)、ステップS434へ処理を進める。CPU11は、選択したユーザ関数の関数名が集計テーブル2Tに書かれていないと判定した場合(ステップS432:NO)、選択したユーザ関数の関数名を集計テーブル2Tの関数名列に書き込む(ステップS433)。
If the
CPU11は、集計テーブル2Tにおいて、選択したユーザ関数の総サンプリング回数を1回インクリメントする(ステップS434)。CPU11は、選択したユーザ関数に関する情報をサンプリングした次の1サンプリング周期後に、アイドル関数に関する情報をサンプリングしたか否かを判定する(ステップS435)。ステップS435において、CPU11は、サンプリングテーブル1Tの時刻からサンプリングされたタイミングを判別し、サンプリングテーブル1Tの関数名からアイドル関数を判別する。
The
CPU11は、アイドル関数に関する情報をサンプリングしたと判定した場合(ステップS435:YES)、集計テーブル2Tにおいて、選択したユーザ関数のA回数を1回インクリメントする(ステップS436)。CPU11は、アイドル関数に関する情報をサンプリングしなかったと判定した場合(ステップS435:NO)、集計テーブル2Tにおいて、選択したユーザ関数のB回数を1回インクリメントする(ステップS437)。
When the
CPU11は、サンプリングテーブル1Tにおいて、未処理のユーザ関数のレコードがあるか否かを判定する(ステップS438)。CPU11は、サンプリングテーブル1Tにおいて、未処理のユーザ関数のレコードがあると判定した場合(ステップS438:YES)、ステップS431へ処理を戻す。CPU11は、サンプリングテーブル1Tにおいて、未処理のユーザ関数のレコードがないと判定した場合(ステップS438:NO)、集計テーブル2Tにおいて、ユーザ関数毎に総サンプリング回数に対するA回数の割合を算出する(ステップS439)。
The
CPU11は、算出した割合をユーザ関数毎に集計テーブル2Tの割合列に書き込む(ステップS440)。CPU11は、集計テーブル2Tのレコードを割合の降順に並べ替える(ステップS441)。CPU11は、並べ替えたレコードの先頭から最後へ向かって、集計テーブル2Tの順位列に順位を書き込み(ステップS442)、処理を終了する。
The
情報処理装置10によれば、オーバーヘッドを抑えて、CPUをアイドル状態にするアプリケーションの箇所を限定することができる。
サンプリング型のプロファイラ1prは、トレーサのように時間資源及び物理的ハードウェア資源を大量に使用しないため、オーバーヘッドが小さい。プロファイラ1prが一定時間間隔でサンプリングしたOS関数及びユーザ関数の動作情報を解析することにより、情報処理装置10はアイドル要因関数である可能性が高いユーザ関数を抽出することができる。
According to the
Since the sampling type profiler 1pr does not use a large amount of time resources and physical hardware resources like a tracer, the overhead is small. By analyzing the OS function and user function operation information sampled by the profiler 1pr at regular time intervals, the
実施の形態2
実施の形態2は、アイドル要因関数である可能性の高いユーザ関数のみをトレースして、アイドル要因関数を特定する形態に関する。
なお、実施の形態2において、実施の形態1と同様である構成要素には同一の参照番号を付してその詳細な説明を省略する。
The second embodiment relates to a form in which only the user function that is likely to be an idle factor function is traced to identify the idle factor function.
In the second embodiment, the same reference numerals are assigned to the same components as those in the first embodiment, and detailed description thereof is omitted.
図16は、プロファイラ1prが一定時間間隔でOS関数及びユーザ関数に関する情報をサンプリングするタイミングを示す説明図である。図16の横軸は、時間を示している。上から下へ向かう稲妻を模した矢印は、プロファイラ1prによるサンプリングのタイミングを示している。CPU11がユーザ関数を実行しているタイミングは、白抜きのボックスで、CPU11がOS関数を実行しているタイミングは、斜線入りのボックスで示されている。
FIG. 16 is an explanatory diagram showing the timing at which the profiler 1pr samples information related to the OS function and the user function at regular time intervals. The horizontal axis in FIG. 16 indicates time. An arrow simulating lightning from top to bottom indicates the timing of sampling by the profiler 1pr. The timing at which the
いま、CPU11によりユーザ関数A、B、C、Dが連続して実行され、その次にOS関数が実行される処理が2回繰り返されるものとする。また、ユーザ関数Dはアイドル要因関数であり、CPU11によりユーザ関数Dが実行されることで、OS関数のアイドル関数が実行されるものとする。これにより、CPU使用率は低くなる。この状況下で、図16に示したサンプリング時間間隔でプロファイラ1prがサンプリングを実行したとする。
Now, it is assumed that the user functions A, B, C, and D are continuously executed by the
図16の状況では、プロファイラ1prは、ユーザ関数A、ユーザ関数D、アイドル関数、アイドル関数、ユーザ関数C、アイドル関数、アイドル関数の順にPIDと、RAM13上のアドレスと、時刻とを周期的にサンプリングする。その結果、情報処理装置10は、ユーザ関数Dと、ユーザ関数Cとをアイドル要因関数である可能性の高いユーザ関数として抽出する。かかる場合、実際にはアイドル要因関数ではないユーザ関数Cもアイドル要因関数である可能性の高いユーザ関数として抽出される。
In the situation of FIG. 16, the profiler 1pr periodically generates a PID, an address on the
実施の形態1では、時間的に飛び飛びに取得したデータのみを使用して、あるユーザ関数がアイドル要因関数である可能性が高いかどうかを統計的に算出した。この統計的要約の精度を高めるためには、具体的にはサンプリング時間間隔を狭くする方法がある。しかし、サンプリング時間間隔を狭くした場合、狭くした分だけ、オーバーヘッドが大きくなる。また、サンプリングしたデータを保存するためのRAM13の記憶容量も増大させなければならなくなる。
In the first embodiment, it is statistically calculated whether or not there is a high possibility that a certain user function is an idle factor function by using only data acquired in a timely manner. In order to improve the accuracy of the statistical summarization, there is specifically a method of narrowing the sampling time interval. However, when the sampling time interval is narrowed, the overhead is increased by the narrowed amount. In addition, the storage capacity of the
一方、例えばユーザ関数A、B、C、Dの実行順序が明らかになれば、アイドル要因関数である可能性の高いユーザ関数として抽出されたユーザ関数Cは、アイドル要因関数ではないと確実に判定することができる。そのためには、どうしてもトレーサによるユーザプログラム1UPの動作情報収集が必要となる。しかし、トレーサはオーバーヘッドが大きいため、サンプリング時間間隔を狭くすることと同様の課題が発生する。 On the other hand, for example, if the execution order of the user functions A, B, C, and D is clarified, the user function C extracted as a user function having a high possibility of being an idle factor function is reliably determined not to be an idle factor function. can do. For this purpose, it is necessary to collect operation information of the user program 1UP by the tracer. However, since the tracer has a large overhead, a problem similar to that of narrowing the sampling time interval occurs.
そこで、実施の形態2では、実施の形態1で抽出されたユーザ関数のみに的を絞って、トレースを実行する。これにより、オーバーヘッドを抑えることができる。トレースでは、ユーザ関数のアドレス及び時刻を取得する。また、アイドル関数が実行される時刻を取得するために、トレースと同時に実施の形態1と同様のプロファイラ1prによるサンプリングを実行する。アイドル関数が実行される直前に実行されるユーザ関数がアイドル要因関数であるとして、トレーサが収集したユーザ関数の実行時刻と、プロファイラ1prが収集したアイドル関数のサンプリング時刻とを比較する。例えば図16の例において、ユーザ関数Dの実行時刻及びアイドル関数のサンプリング時刻の差が、ユーザ関数Cの実行時刻及びアイドル関数のサンプリング時刻の差よりも小さいことが判明すれば、ユーザ関数Dのみをアイドル要因関数に特定することができる。 Therefore, in the second embodiment, tracing is executed by focusing only on the user function extracted in the first embodiment. Thereby, overhead can be suppressed. In the trace, the address and time of the user function are acquired. Further, in order to acquire the time at which the idle function is executed, sampling by the profiler 1pr similar to the first embodiment is executed simultaneously with the tracing. Assuming that the user function executed immediately before the idle function is executed is the idle factor function, the execution time of the user function collected by the tracer is compared with the sampling time of the idle function collected by the profiler 1pr. For example, in the example of FIG. 16, if it is found that the difference between the execution time of the user function D and the sampling time of the idle function is smaller than the difference between the execution time of the user function C and the sampling time of the idle function, only the user function D Can be specified as an idle factor function.
図17は、情報処理装置10の機能例を示す機能ブロック図である。情報処理装置10の各機能部は、ハードディスク14に記憶されたOS100、ユーザプログラム1UP及びプログラム1Pと、CPU11、RAM13等のハードウェア資源とが協働して動作することにより実現される。
なお、実施の形態2では、ハードディスク14にユーザプログラム1UPのバイナリデータと、コンパイル前のユーザプログラム1UPのソースコードとが記憶されている。また、図17では、プロファイラ1prにおける設定制御部12pr及び割り込みハンドラ部13prと、解析部1anにおける収集部11an、関数名取得部12an及び算出部13anとを省略している。
FIG. 17 is a functional block diagram illustrating an example of functions of the
In the second embodiment, the binary data of the user program 1UP and the source code of the user program 1UP before compilation are stored in the
プログラム1Pは、抽出結果取得部20、トレースコード挿入部30及びリコンパイル部40を含む。抽出結果取得部20は、実施の形態1において算出部13anが集計テーブル2Tから抽出した例えば上位10%のユーザ関数に対応する動作情報をサンプリングテーブル1Tから取得する機能部である。
The
トレースコード挿入部30は、ユーザプログラム1UPのソースコードにおいて、抽出結果取得部20により取得されたユーザ関数が記述された位置にトレース結果(例えば、トレースログ)を取得するためのコードを挿入する機能部である。このようなソース埋め込み型のトレーサには、例えばgprof、CTrace、etrace等があり、トレースコード挿入部30はどのようなトレーサを利用してもよい。以下では、トレースコード挿入部30は、一例としてetraceを利用するものとする。etraceは、ターゲットプログラムのトレース箇所にトレースコードを挿入する。そこで、トレースコード挿入部30は、抽出結果取得部20が取得したユーザ関数の関数名に基づいて、ユーザプログラム1UPのソースコードにおける当該ユーザ関数の箇所にトレースコードを挿入する。
The trace
リコンパイル部40は、トレースコード挿入部30がトレースコードを挿入したユーザプログラム1UPを再コンパイルする機能部である。リコンパイル部40は、例えばGNU C Compilerの拡張コンパイルオプションである“-finstruments-functions”を用いて、トレースコードを挿入したユーザプログラム1UPを再コンパイルする。“-finstruments-functions”は、ユーザ関数のentryとreturnとによって、挿入したトレースコードを実行することが可能である。これにより、ユーザ関数の実行時における様々な動作情報が取得される。実施の形態2では、ユーザ関数のRAM13上におけるアドレスと時刻とを取得する。
The
なお、トレース対象から除くユーザ関数については、トレースコード挿入部30が以下の宣言をソースコードに挿入することにより、トレース対象から除くことができる。
“_attribute_((no_instrument_function))”
The user function excluded from the trace target can be excluded from the trace target by the trace
“_Attribute _ ((no_instrument_function))”
コード実行部11prは、リコンパイル部40が再コンパイルしたユーザプログラムを実行する。その後、プロファイラ1pr及び解析部1anが実行する処理は、実施の形態1と同様である。
The code execution unit 11pr executes the user program recompiled by the
実施の形態2に係る解析部1anは、トレース結果取得部(トレース収集部)14an及びアイドル要因関数決定部(特定部)15anを含む。トレース結果取得部14anは、トレースコード挿入部30により挿入されたトレースコードのトレース結果(アドレス及び時刻)をRAM13から取得する機能部である。トレース結果取得部14anは、ユーザプログラムのバイナリデータを参照し、アドレスをユーザ関数の関数名に変換し、変換した関数名とその関数の実行時刻とをRAM13に記憶する。
The analysis unit 1an according to the second embodiment includes a trace result acquisition unit (trace collection unit) 14an and an idle factor function determination unit (specification unit) 15an. The trace result acquisition unit 14an is a functional unit that acquires the trace result (address and time) of the trace code inserted by the trace
アイドル要因関数決定部15anは、アイドル要因関数であるユーザ関数を決定する機能部である。アイドル要因関数決定部15anは、再コンパイルして生成したユーザプログラム1UPを実行して作成されたサンプリングテーブル1Tから、アイドル関数のサンプリング時刻を取得する。アイドル要因関数決定部15anは、トレース結果取得部14anが変換したユーザ関数の関数名とその実行時刻とを取得する。 The idle factor function determining unit 15an is a functional unit that determines a user function that is an idle factor function. The idle factor function determination unit 15an acquires the sampling time of the idle function from the sampling table 1T created by executing the user program 1UP generated by recompilation. The idle factor function determination unit 15an acquires the function name of the user function converted by the trace result acquisition unit 14an and its execution time.
アイドル要因関数決定部15anは、ユーザ関数の実行時刻と、アイドル関数のサンプリング時刻とを照らし合わせ、抽出結果取得部20が取得したユーザ関数の実行順序を決定する。また、アイドル要因関数決定部15anは、実行時刻がアイドル関数のサンプリング時刻より前で、アイドル関数のサンプリング時刻に最も近いユーザ関数をアイドル要因関数に決定する。
The idle factor function determination unit 15an compares the execution time of the user function with the sampling time of the idle function, and determines the execution order of the user functions acquired by the extraction
アイドル要因関数決定部15anは、決定したアイドル要因関数毎に、その前後に実行されたユーザ関数及びアイドル関数を含めて、実行順に関数を並べた配列を作成する。アイドル要因関数決定部15anは、作成した関数の配列を、その配列に対応するアイドル関数のサンプリング時刻の昇順に並べ替える。アイドル要因関数決定部15anは、並べ替えた関数の配列を出力用データとして出力部80に出力する。
For each determined idle factor function, the idle factor function determining unit 15an creates an array in which the functions are arranged in the execution order including the user function and the idle function that are executed before and after the idle factor function. The idle factor function determination unit 15an rearranges the created function array in ascending order of sampling times of idle functions corresponding to the array. The idle factor function determination unit 15an outputs the rearranged function array to the
出力部80は、アイドル要因関数決定部15anから入力した出力用データを、例えば表示部16に表示する。出力部80は、通信部18を介して、同様の内容を外部の情報処理装置に送信してもよい。
The
図18は、アイドル要因関数決定部15anによる出力用データの一例を示す説明図である。func_F、func_G、func_H、func_I、func_Jは、ユーザ関数である。idleは、アイドル関数である。−>は実行順序の方向を示している。
図18の1行目に注目した場合、func_Iがアイドル要因関数であることがわかる。図18の2行目に注目した場合も、func_Iがアイドル要因関数であることがわかる。CPU11をアイドル状態にするユーザプログラム1UPの箇所を詳細に調査する場合、図18からfunc_Iを調査対象に決定し、func_F、func_G、func_H及びfunc_Jを調査対象から除けばよいことがわかる。
FIG. 18 is an explanatory diagram showing an example of output data by the idle factor function determining unit 15an. func_F, func_G, func_H, func_I, and func_J are user functions. idle is an idle function. -> Indicates the direction of execution order.
When attention is focused on the first line in FIG. 18, it can be seen that func_I is an idle factor function. When attention is paid to the second line in FIG. 18, it can be seen that func_I is an idle factor function. When investigating in detail the location of the user program 1UP that puts the
なお、ユーザプログラム1UPのfunc_Iを調査し、func_Iがアイドル要因関数ではないことが判明した場合、抽出結果取得部20は、実施の形態1において算出部13anが集計テーブル2Tから抽出した例えば上位10〜20%のユーザ関数に対応する動作情報をサンプリングテーブル1Tから取得してもよい。情報処理装置10は、上位10〜20%のユーザ関数について、上述と同様の処理を繰り返す。
If the func_I of the user program 1UP is examined and it is found that the func_I is not an idle factor function, the extraction
次に、情報処理装置10の動作について説明する。
図19は、アイドル要因関数を決定する処理の手順の一例を示すフローチャートである。図19は、処理の概要を示している。
CPU11は、トレースコード処理を実行する(ステップS101)。トレースコード処理は、ユーザプログラム1UPのソースコードにトレースコードを挿入し、再コンパイルする処理である。CPU11は、トレースコードが挿入されたユーザプログラム1UPを実行する(ステップS102)。
Next, the operation of the
FIG. 19 is a flowchart illustrating an example of a processing procedure for determining an idle factor function. FIG. 19 shows an overview of the processing.
The
CPU11は、トレース結果取得処理を実行する(ステップS103)。トレース結果取得処理は、トレースコードの実行によるトレース結果を取得し、取得したトレース結果に基づいて、ユーザ関数の関数名と実行時刻とを対応付けてRAM13に記憶する処理である。なお、CPU11は、トレース結果取得処理と同時並行に、図8に示した設定処理(ステップS2)、サンプリング処理(ステップS3)及び解析処理(ステップS4)を実行する。
CPU11 performs a trace result acquisition process (step S103). The trace result acquisition process is a process of acquiring a trace result by execution of the trace code and storing the function name of the user function and the execution time in the
CPU11は、アイドル要因関数決定処理を実行し(ステップS104)、処理を終了する。アイドル要因関数決定処理は、ユーザ関数の時効時刻と、アイドル関数のサンプリング時刻とに基づいて、アイドル要因関数を決定する処理である。
The
図20は、トレースコード処理の手順の一例を示すフローチャートである。図20の処理は、図19のトレースコード処理(ステップS101)に対応する。
CPU11は、アイドル要因関数である可能性が高いとして抽出されたユーザ関数に関するサンプリングテーブル1Tのデータを受け付ける(ステップS1011)当該データには関数名が含まれている。CPU11は、受け付けたユーザ関数の関数名に基づいて、ユーザプログラム1UPのソースコードにトレースコードを挿入する(ステップS1012)。CPU11は、トレースコードを挿入したユーザプログラム1UPを再コンパイルし(ステップS1013)、処理を終了する。
FIG. 20 is a flowchart illustrating an example of the procedure of the trace code processing. The process of FIG. 20 corresponds to the trace code process (step S101) of FIG.
The
図21は、トレース結果取得処理の手順の一例を示すフローチャートである。図21の処理は、図19のトレース結果取得処理(ステップS103)に対応する。
CPU11は、トレースコードの実行結果をRAM13から読み出す(ステップS1031)。トレースコードの実行結果には、トレースしたユーザ関数のRAM13上におけるアドレス及び実行時刻が含まれている。CPU11は、ユーザプログラム1UPのバイナリデータを参照し、アドレスを関数名に変換する(ステップS1032)。CPU11は、変換したユーザ関数の関数名と実行時刻とを対応付けてRAM13に記憶し(ステップS1033)、処理を終了する。ここで、アイドル要因関数である可能性が高いユーザ関数が複数であった場合、複数の関数名及び実行時刻がRAMに記憶される。
FIG. 21 is a flowchart illustrating an example of the procedure of the trace result acquisition process. The process of FIG. 21 corresponds to the trace result acquisition process (step S103) of FIG.
The
図22は、アイドル要因関数決定処理の手順の一例を示すフローチャートである。図22の処理は、図19のアイドル要因関数決定処理(ステップS104)に対応する。
CPU11は、トレースコードが挿入されたユーザプログラム1UPの実行により生成されたサンプリングテーブル1Tから、アイドル関数を1つ選択する(ステップS1041)。CPU11は、トレースコードが挿入されたユーザプログラム1UPの実行により生成されたサンプリングテーブル1Tから、選択したアイドル関数のサンプリング時刻を読み出す(ステップS1042)。
FIG. 22 is a flowchart illustrating an exemplary procedure of idle factor function determination processing. The process of FIG. 22 corresponds to the idle factor function determination process (step S104) of FIG.
The
CPU11は、RAM13に対応付けて記憶しているユーザ関数の関数名及び実行時刻の1つを選択する(ステップS1043)。CPU11は、読み出したアイドル関数のサンプリング時刻と、選択したユーザ関数の実行時刻との差を算出する(ステップS1044)。ステップS1043において、CPU11は、選択したユーザ関数の実行時刻が読み出したアイドル関数のサンプリング時刻より後の時刻である場合、算出処理を実行しない。
The
CPU11は、算出した時刻差、ユーザ関数の関数名及びアイドル関数の関数名を対応付けて、RAM13に記憶する(ステップS1045)。CPU11は、未処理のユーザ関数があるか否かを判定する(ステップS1046)。CPU11は、未処理のユーザ関数があると判定した場合(ステップS1046:YES)、ステップS1043に処理を戻す。CPU11は、未処理のユーザ関数がないと判定した場合(ステップS1046:NO)、RAM13に記憶した時刻差、ユーザ関数の関数名及びアイドル関数の関数名のレコードを時刻差の昇順に並べ替える(ステップS1047)。CPU11は、ステップS1047で並べ替えたレコードを出力用データとしてRAM13に記憶する(ステップS1048)。
The
CPU11は、未処理のアイドル関数があるか否かを判定する(ステップS1049)。CPU11は、未処理のアイドル関数があると判定した場合(ステップS1049:YES)、ステップS1041に処理を戻す。CPU11は、未処理のアイドル関数がないと判定した場合(ステップS1049:NO)、ステップS1048でRAM13に記憶した出力用データを出力し(ステップS1050)、処理を終了する。
The
情報処理装置10によれば、オーバーヘッドを抑えて、CPUをアイドル状態にするアプリケーションの箇所を特定することができる。
情報処理装置10は、アイドル要因関数である可能性が高いユーザ関数の実行順序を明らかにすることで、アイドル要因関数を特定することができる。情報処理装置10は、アイドル要因関数である可能性が高いユーザ関数に絞って、トレースを実行するため、オーバーヘッドを抑えることができる。トレースのためにユーザプログラム1UPのソースコードにトレースコードを挿入した場合、挿入が原因となってターゲットプログラムであるユーザプログラム1UPの挙動が変化する虞がある。しかし、情報処理装置10は、一部のユーザ関数のみにトレースコードを挿入するので、ユーザプログラム1UPの挙動変化を抑えることができる。
According to the
The
実施の形態3
実施の形態3は、ユーザ関数の実行を動的にトレースする形態に関する。
なお、実施の形態3において、実施の形態1、2と同様である構成要素には同一の参照番号を付してその詳細な説明を省略する。
The third embodiment relates to a form for dynamically tracing the execution of a user function.
In the third embodiment, the same reference numerals are assigned to the same components as those in the first and second embodiments, and detailed description thereof is omitted.
図23は、情報処理装置10の機能例を示す機能ブロック図である。情報処理装置10の各機能部は、ハードディスク14に記憶されたOS100、ユーザプログラム1UP及びプログラム1Pと、CPU11、RAM13等のハードウェア資源とが協働して動作することにより実現される。
なお、実施の形態3では、ハードディスク14にユーザプログラム1UPのバイナリデータが記憶されているが、コンパイル前のユーザプログラム1UPのソースコードは記憶されていない。また、図23では、プロファイラ1prにおける設定制御部12pr及び割り込みハンドラ部13prと、解析部1anにおける収集部11an、関数名取得部12an及び算出部13anとを省略している。
FIG. 23 is a functional block diagram illustrating an example of functions of the
In the third embodiment, the binary data of the user program 1UP is stored in the
プログラム1Pは、動的変換部50を含む。動的変換部50は、ユーザプログラム1UPにおいて、抽出結果取得部20により取得されたユーザ関数のコードを実行時に動的に変換することにより、フックコードを埋め込む。例えばGDBのptraceシステムコールを利用する場合、ターゲットのユーザ関数を子プロセスとして実行し、子プロセスのコードへフックコードを埋め込む。フックコードが実行された場合、親プロセスへ制御が戻る。親プロセスに制御が戻った時点で、子プロセスに係るRAM13の領域にアクセスすることで、ユーザ関数のアドレス及び実行時刻を取得することができる。なお、トレース結果であるユーザ関数のアドレス及び実行時刻の取得は、トレース結果取得部14anにより実行される。
The
次に、情報処理装置10の動作について説明する。
図24は、アイドル要因関数を決定する処理の手順の一例を示すフローチャートである。図24は、処理の概要を示している。
CPU11は、ユーザプログラム1UPを実行する(ステップS201)。CPU11は、コード変換処理を実行する(ステップS202)。コード変換処理は、ユーザプログラム1UPにおいて、抽出結果取得部20により取得されたユーザ関数の先頭アドレスにフックコードを埋め込む処理である。CPU11は、変換済みのユーザプログラム1UPを実行する(ステップS203)。CPU11は、子プロセスに係るユーザ関数のアドレス及び実行時刻を取得する(ステップS204)。CPU11は、ユーザプログラム1UPのバイナリデータを参照し、ユーザ関数のアドレスを関数名に変換する(ステップS205)。CPU11は、アイドル要因関数決定処理を実行し(ステップS206)、処理を終了する。
Next, the operation of the
FIG. 24 is a flowchart illustrating an example of a processing procedure for determining an idle factor function. FIG. 24 shows an overview of the processing.
The
なお、CPU11は、ステップS202〜ステップS205と同時並行に、図8に示した設定処理(ステップS2)、サンプリング処理(ステップS3)及び解析処理(ステップS4)を実行する。また、ステップS206のアイドル要因関数決定処理は、図19のアイドル要因関数決定処理(ステップS104)と同じである。
The
図25は、コード変換処理の手順の一例を示すフローチャートである。図25の処理は、図24のコード変換処理(ステップS202)に対応する。
CPU11は、アイドル要因関数である可能性が高いとして抽出されたユーザ関数に関するサンプリングテーブル1Tのデータを受け付ける(ステップS2021)。当該データにはユーザ関数のアドレスが含まれている。CPU11は、受け付けたユーザ関数のアドレスに基づいて、ユーザプログラム1UPのバイナリコードから当該ユーザ関数の先頭アドレスを取得する(ステップS2022)。CPU11は、取得したユーザ関数の先頭アドレスにフックコードを埋め込み(ステップS2023)、処理を終了する。
FIG. 25 is a flowchart illustrating an example of the procedure of the code conversion process. The process of FIG. 25 corresponds to the code conversion process (step S202) of FIG.
The
情報処理装置10によれば、CPUをアイドル状態にするアプリケーションの箇所を特定することができる。
情報処理装置10は、ユーザプログラム1UPに対してフックコードを動的に埋め込んで変換する。この処理は、実施の形態2における静的なソース埋め込み型に比べてオーバーヘッドが大きい。しかし、動的変換の場合、ユーザプログラム1UPのソースコードは不要である。従って、実施の形態3に係る情報処理装置10は、ソースコードが入手不可能なユーザプログラム1UPの問題箇所を特定する場合、より大きな効果を奏する。
According to the
The
開示された実施の形態は、全ての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上述の説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味及び範囲内での全ての変更が含まれることが意図される。 The disclosed embodiments are to be considered in all respects as illustrative and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
また、各実施の形態で記載されている技術的特徴(構成要件)はお互いに組合せ可能であり、組み合わせすることにより、新しい技術的特徴を形成することができる。 Further, the technical features (components) described in each embodiment can be combined with each other, and a new technical feature can be formed by combining them.
以上の実施の形態に関し、更に以下の付記を開示する。 Regarding the above embodiment, the following additional notes are disclosed.
(付記1)
演算処理装置がオペレーティングシステムを介して実行するユーザプログラムの性能情報を、記憶部を有する情報処理装置に取得させる性能情報収集プログラムにおいて、
前記情報処理装置に、
前記記憶部に記憶された前記オペレーティングシステムを介した前記ユーザプログラムを前記演算処理装置に実行させる場合、前記オペレーティングシステムから呼び出されたオペレーティングシステム関数の識別情報と前記ユーザプログラムから呼び出されたユーザ関数の識別情報とを、周期的に収集させるとともに前記記憶部に記憶させ、
前記記憶部に記憶されたユーザ関数の識別情報に基づいて、各ユーザ関数が収集された回数である個別ユーザ関数収集回数を、各ユーザ関数の種別毎に集計させ、
前記記憶部に記憶されたオペレーティングシステム関数の識別情報とユーザ関数の識別情報とに基づいて、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の識別情報が収集された一周期前に、前記ユーザ関数の識別情報が収集された個別特定ユーザ関数収集回数を、各ユーザ関数の種別毎に集計させ、
集計された各個別ユーザ関数収集回数に対する各個別特定ユーザ関数収集回数の割合を、前記ユーザ関数の種別毎に算出させる
ことを特徴とする性能情報収集プログラム。
(Appendix 1)
In a performance information collection program that causes an information processing device having a storage unit to acquire performance information of a user program executed by an arithmetic processing device via an operating system,
In the information processing apparatus,
When causing the arithmetic processing unit to execute the user program via the operating system stored in the storage unit, identification information of an operating system function called from the operating system and a user function called from the user program The identification information is periodically collected and stored in the storage unit,
Based on the identification information of the user function stored in the storage unit, the number of individual user function collection, which is the number of times each user function is collected, is aggregated for each type of user function,
Based on the identification information of the operating system function and the identification information of the user function stored in the storage unit, the user is notified one cycle before the identification information of the operating system function that puts the arithmetic processing unit into an idle state is collected. The number of individual specific user function collections for which function identification information has been collected is aggregated for each type of user function,
A performance information collection program that causes a ratio of each individual user function collection number to each collected individual user function collection number to be calculated for each type of the user function.
(付記2)
算出した割合が高いユーザ関数を上位から一又は複数抽出させる
付記1に記載の性能情報収集プログラム。
(Appendix 2)
The performance information collection program according to
(付記3)
前記情報処理装置は時計部を有し、
収集した前記オペレーティングシステム関数及びユーザ関数夫々の識別情報並びに前記時計部が該識別情報の収集時を計時した収集時刻を対応付けて前記記憶部に記憶させる
付記2に記載の性能情報収集プログラム。
(Appendix 3)
The information processing apparatus has a clock unit,
The performance information collecting program according to
(付記4)
前記識別情報を周期的に収集させる処理と共に、前記オペレーティングシステム及びユーザプログラムの実行時に、抽出した前記割合が高いユーザ関数の識別情報をトレースして収集させ、
周期的に収集させた前記識別情報及び収集時刻並びにトレースして収集した前記識別情報及び前記時計部が計時した前記割合が高いユーザ関数の実行時刻を前記記憶部に記憶させ、
前記記憶部の記憶内容に基づいて、前記割合が高いユーザ関数の実行時刻から、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の収集時刻までの時間が最短であるユーザ関数を特定させる
付記3に記載の性能情報収集プログラム。
(Appendix 4)
Along with the process of periodically collecting the identification information, when the operating system and the user program are executed, the extracted identification information of the user function having a high ratio is traced and collected.
The identification information and collection time collected periodically, the identification information collected by tracing, and the execution time of the user function with the high ratio measured by the clock unit are stored in the storage unit,
Based on the storage contents of the storage unit, the user function having the shortest time from the execution time of the user function having the high ratio to the collection time of the operating system function that puts the arithmetic processing unit in the idle state is specified. Performance information collection program described in 1.
(付記5)
前記識別情報を周期的に収集させる処理は、前記一又は複数のオペレーティングシステム関数及びユーザ関数が前記記憶部に夫々記憶されているアドレスを収集させ、
前記トレースによる収集処理は、抽出した前記割合が高いユーザ関数が前記記憶部に記憶されているアドレスを収集させ、
前記記憶部に記憶されたオペレーティングシステム及びユーザプログラムに基づいて、収集した各アドレスを前記識別情報に変換させる
付記4に記載の性能情報収集プログラム。
(Appendix 5)
The process of collecting the identification information periodically collects addresses at which the one or more operating system functions and user functions are respectively stored in the storage unit,
In the collection process by the trace, the extracted user function having a high ratio is collected at the address stored in the storage unit,
The performance information collection program according to
(付記6)
前記識別情報を周期的に収集させる処理は、前記一又は複数のユーザ関数に夫々対応するプロセスの識別子を収集させ、
前記記憶部に記憶されたユーザプログラムに基づいて、収集したプロセスの識別子をプロセス名に変換させる
付記5に記載の性能情報収集プログラム。
(Appendix 6)
The process of periodically collecting the identification information includes collecting process identifiers corresponding to the one or more user functions,
The performance information collection program according to
(付記7)
前記記憶部に前記ユーザプログラムのソースコードが記憶されており、
前記ユーザプログラムのソースコードにて、抽出した前記割合が高いユーザ関数の箇所にフックコード又はトレースコードを埋め込ませ、
フックコード又はトレースコードを埋め込んだ前記ユーザプログラムのソースコードをコンパイルさせ、
前記トレースによる収集処理は、コンパイルした前記ユーザプログラムの実行時に、前記割合が高いユーザ関数の識別情報を収集させる
付記4から付記6までのいずれか一つに記載の性能情報収集プログラム。
(Appendix 7)
Source code of the user program is stored in the storage unit,
In the source code of the user program, the hook code or the trace code is embedded at the location of the extracted user function with a high ratio,
Compile the source code of the user program in which hook code or trace code is embedded,
The performance information collection program according to any one of
(付記8)
前記記憶部に記憶されたユーザプログラムにて、抽出した前記割合が高いユーザ関数の先頭アドレスにフックコードを埋め込ませ、
前記トレースによる収集処理は、埋め込んだフックコードが実行された場合、前記割合が高いユーザ関数の識別情報を収集させる
付記4から付記7までのいずれか一つに記載の性能情報収集プログラム。
(Appendix 8)
In the user program stored in the storage unit, the hook code is embedded at the start address of the extracted user function with a high ratio,
The performance information collection program according to any one of
(付記9)
演算処理装置がオペレーティングシステムを介して実行するユーザプログラムの性能情報を取得する情報処理装置において、
前記オペレーティングシステムと前記ユーザプログラムとを記憶する記憶部と、
前記オペレーティングシステムを介した前記ユーザプログラムを前記演算処理装置に実行させる場合、前記オペレーティングシステムから呼び出されたオペレーティングシステム関数の識別情報と前記ユーザプログラムから呼び出されたユーザ関数の識別情報とを、周期的に収集するとともに前記記憶部に記憶する収集部と、
前記記憶部に記憶されたユーザ関数の識別情報に基づいて、各ユーザ関数が収集された回数である個別ユーザ関数収集回数を、各ユーザ関数の種別毎に集計するとともに、前記記憶部に記憶されたオペレーティングシステム関数の識別情報とユーザ関数の識別情報とに基づいて、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の識別情報が収集された一周期前に、前記ユーザ関数の識別情報が収集された個別特定ユーザ関数収集回数を、各ユーザ関数の種別毎に集計する集計部と、
集計された各個別ユーザ関数収集回数に対する各個別特定ユーザ関数収集回数の割合を、前記ユーザ関数の種別毎に算出する算出部と
を有する
ことを特徴とする情報処理装置。
(Appendix 9)
In an information processing device that acquires performance information of a user program executed by an arithmetic processing device via an operating system,
A storage unit for storing the operating system and the user program;
When causing the arithmetic processing unit to execute the user program via the operating system, the operating system function identification information called from the operating system and the user function identification information called from the user program are periodically A collecting unit that collects and stores in the storage unit,
Based on the identification information of the user function stored in the storage unit, the number of individual user function collections, which is the number of times each user function is collected, is tabulated for each type of user function and stored in the storage unit. Based on the identification information of the operating system function and the identification information of the user function, the identification information of the user function is collected one cycle before the identification information of the operating system function that puts the arithmetic processing unit into an idle state is collected. A totaling unit that counts the number of collected individual specific user functions for each type of user function;
An information processing apparatus comprising: a calculation unit that calculates a ratio of each individual user function collection number to each collected individual user function collection number for each type of the user function.
(付記10)
前記算出部が算出した割合が高いユーザ関数を上位から一又は複数抽出する抽出部を備える
付記9に記載の情報処理装置。
(Appendix 10)
The information processing apparatus according to appendix 9, further comprising: an extraction unit that extracts one or more user functions having a high ratio calculated by the calculation unit from the top.
(付記11)
時計部を備え、
前記収集部は収集した前記識別情報及び前記時計部が該識別情報の収集時に計時した収集時刻を対応付けて前記記憶部に記憶する
付記10に記載の情報処理装置。
(Appendix 11)
With a clock,
The information processing apparatus according to
(付記12)
前記収集部による前記識別情報の周期的な収集と共に、前記オペレーティングシステム及びユーザプログラムの実行時に、前記抽出部が抽出した前記割合が高いユーザ関数の識別情報をトレースして収集するトレース収集部を備え、
前記収集部は収集した前記識別情報及び収集時刻並びに前記トレース収集部が収集した前記識別情報及び前記時計部が計時した前記割合が高いユーザ関数の実行時刻を記憶し、
前記記憶部の記憶内容に基づいて、前記割合が高いユーザ関数の実行時刻から、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の収集時刻までの時間が最短であるユーザ関数を特定する特定部を備える
付記11に記載の情報処理装置。
(Appendix 12)
Along with the periodic collection of the identification information by the collection unit, a trace collection unit that traces and collects the identification information of the user function having a high ratio extracted by the extraction unit when the operating system and the user program are executed. ,
The collection unit stores the collected identification information and the collection time, the identification information collected by the trace collection unit, and the execution time of the user function with the high ratio measured by the clock unit,
A specifying unit that specifies the user function having the shortest time from the execution time of the user function having a high ratio to the collection time of the operating system function that puts the arithmetic processing unit in an idle state based on the storage content of the storage unit The information processing apparatus according to
(付記13)
前記収集部は前記一又は複数のオペレーティングシステム関数及びユーザ関数が前記記憶部に夫々記憶されているアドレスを収集し、
前記トレース収集部は前記割合が高いユーザ関数が前記記憶部に記憶されているアドレスを収集し、
前記記憶部が記憶するオペレーティングシステム及びユーザプログラムに基づいて、前記収集部及びトレース収集部が夫々収集した各アドレスを前記識別情報に変換する変換部を備える
付記12に記載の情報処理装置。
(Appendix 13)
The collection unit collects addresses at which the one or more operating system functions and user functions are stored in the storage unit, respectively.
The trace collection unit collects addresses at which the user functions having a high ratio are stored in the storage unit,
The information processing apparatus according to
(付記14)
前記収集部は前記一又は複数のユーザ関数に夫々対応するプロセスの識別子を収集し、
前記変換部は、前記記憶部に記憶されたユーザプログラムに基づいて、前記収集部が収集したプロセスの識別子をプロセス名に変換する
付記13に記載の情報処理装置。
(Appendix 14)
The collection unit collects process identifiers corresponding to the one or more user functions,
The information processing apparatus according to
(付記15)
演算処理装置がオペレーティングシステムを介して実行するユーザプログラムの性能情報を、記憶部を有する情報処理装置に取得させる性能情報収集方法において、
前記情報処理装置が、
前記記憶部に記憶された前記オペレーティングシステムを介した前記ユーザプログラムを前記演算処理装置に実行させる場合、前記オペレーティングシステムから呼び出されたオペレーティングシステム関数の識別情報と前記ユーザプログラムから呼び出されたユーザ関数の識別情報とを、周期的に収集するとともに前記記憶部に記憶し、
前記記憶部に記憶されたユーザ関数の識別情報に基づいて、各ユーザ関数が収集された回数である個別ユーザ関数収集回数を、各ユーザ関数の種別毎に集計し、
前記記憶部に記憶されたオペレーティングシステム関数の識別情報とユーザ関数の識別情報とに基づいて、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の識別情報が収集された一周期前に、前記ユーザ関数の識別情報が収集された個別特定ユーザ関数収集回数を、各ユーザ関数の種別毎に集計し、
集計された各個別ユーザ関数収集回数に対する各個別特定ユーザ関数収集回数の割合を、前記ユーザ関数の種別毎に算出する
ことを特徴とする性能情報収集方法。
(Appendix 15)
In a performance information collection method for causing an information processing device having a storage unit to acquire performance information of a user program executed by an arithmetic processing device via an operating system,
The information processing apparatus is
When causing the arithmetic processing unit to execute the user program via the operating system stored in the storage unit, identification information of an operating system function called from the operating system and a user function called from the user program The identification information is periodically collected and stored in the storage unit,
Based on the identification information of the user function stored in the storage unit, the number of individual user function collection, which is the number of times each user function is collected, is totalized for each type of user function,
Based on the identification information of the operating system function and the identification information of the user function stored in the storage unit, the user is notified one cycle before the identification information of the operating system function that puts the arithmetic processing unit into an idle state is collected. The number of individual specific user functions collected for which function identification information has been collected is aggregated for each type of user function,
A performance information collecting method, characterized in that a ratio of each individual user function collection number to each collected individual user function collection number is calculated for each type of the user function.
(付記16)
算出した割合が高いユーザ関数を上位から一又は複数抽出する
付記15に記載の性能情報収集方法。
(Appendix 16)
The performance information collection method according to
10 情報処理装置
11 CPU(演算処理装置、収集部、集計部、算出部、抽出部、トレース収集部、特定部、変換部)
112 タイマ(時計部)
13 RAM(記憶部)
14 ハードディスク(記憶部)
1pr プロファイラ(収集部)
11an 収集部
12an 関数名取得部(変換部)
13an 算出部(集計部、算出部、抽出部)
14an トレース結果取得部(トレース収集部)
15an アイドル要因関数決定部(特定部)
1P プログラム(性能情報収集プログラム)
100 OS(オペレーションシステム)
1UP ユーザプログラム
10
112 Timer (clock part)
13 RAM (storage unit)
14 Hard disk (storage unit)
1pr profiler (collecting part)
11an collection unit 12an function name acquisition unit (conversion unit)
13an calculation part (aggregation part, calculation part, extraction part)
14an Trace result acquisition unit (trace collection unit)
15an Idle factor function decision part (specific part)
1P program (performance information collection program)
100 OS (operation system)
1UP user program
Claims (8)
前記情報処理装置に、
前記記憶部に記憶された前記オペレーティングシステムを介した前記ユーザプログラムを前記演算処理装置に実行させる場合、前記オペレーティングシステムから呼び出されたオペレーティングシステム関数の識別情報と前記ユーザプログラムから呼び出されたユーザ関数の識別情報とを、周期的に収集させるとともに前記記憶部に記憶させ、
前記記憶部に記憶されたユーザ関数の識別情報に基づいて、各ユーザ関数が収集された回数である個別ユーザ関数収集回数を、各ユーザ関数の種別毎に集計させ、
前記記憶部に記憶されたオペレーティングシステム関数の識別情報とユーザ関数の識別情報とに基づいて、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の識別情報が収集された一周期前に、前記ユーザ関数の識別情報が収集された個別特定ユーザ関数収集回数を、各ユーザ関数の種別毎に集計させ、
集計された各個別ユーザ関数収集回数に対する各個別特定ユーザ関数収集回数の割合を、前記ユーザ関数の種別毎に算出させる
ことを特徴とする性能情報収集プログラム。 In a performance information collection program that causes an information processing device having a storage unit to acquire performance information of a user program executed by an arithmetic processing device via an operating system,
In the information processing apparatus,
When causing the arithmetic processing unit to execute the user program via the operating system stored in the storage unit, identification information of an operating system function called from the operating system and a user function called from the user program The identification information is periodically collected and stored in the storage unit,
Based on the identification information of the user function stored in the storage unit, the number of individual user function collection, which is the number of times each user function is collected, is aggregated for each type of user function,
Based on the identification information of the operating system function and the identification information of the user function stored in the storage unit, the user is notified one cycle before the identification information of the operating system function that puts the arithmetic processing unit into an idle state is collected. The number of individual specific user function collections for which function identification information has been collected is aggregated for each type of user function,
A performance information collection program that causes a ratio of each individual user function collection number to each collected individual user function collection number to be calculated for each type of the user function.
請求項1に記載の性能情報収集プログラム。 The performance information collection program according to claim 1, wherein one or a plurality of user functions having a high calculated ratio are extracted from the top.
収集した前記オペレーティングシステム関数及びユーザ関数夫々の識別情報並びに前記時計部が該識別情報の収集時を計時した収集時刻を対応付けて前記記憶部に記憶させる
請求項2に記載の性能情報収集プログラム。 The information processing apparatus has a clock unit,
The performance information collection program according to claim 2, wherein the collected identification information of the operating system function and the user function and the collection time when the clock unit measures the collection time of the identification information are associated with each other and stored in the storage unit.
周期的に収集させた前記識別情報及び収集時刻並びにトレースして収集した前記識別情報及び前記時計部が計時した前記割合が高いユーザ関数の実行時刻を前記記憶部に記憶させ、
前記記憶部の記憶内容に基づいて、前記割合が高いユーザ関数の実行時刻から、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の収集時刻までの時間が最短であるユーザ関数を特定させる
請求項3に記載の性能情報収集プログラム。 Along with the process of periodically collecting the identification information, when the operating system and the user program are executed, the extracted identification information of the user function having a high ratio is traced and collected.
The identification information and collection time collected periodically, the identification information collected by tracing, and the execution time of the user function with the high ratio measured by the clock unit are stored in the storage unit,
The user function having the shortest time from the execution time of the user function having the high ratio to the collection time of the operating system function that puts the arithmetic processing unit in an idle state is specified based on the storage content of the storage unit. 3. The performance information collection program according to 3.
前記トレースによる収集処理は、抽出した前記割合が高いユーザ関数が前記記憶部に記憶されているアドレスを収集させ、
前記記憶部に記憶されたオペレーティングシステム及びユーザプログラムに基づいて、収集した各アドレスを前記識別情報に変換させる
請求項4に記載の性能情報収集プログラム。 The process of collecting the identification information periodically collects addresses at which the one or more operating system functions and user functions are respectively stored in the storage unit,
In the collection process by the trace, the extracted user function having a high ratio is collected at the address stored in the storage unit,
The performance information collection program according to claim 4, wherein each collected address is converted into the identification information based on an operating system and a user program stored in the storage unit.
前記記憶部に記憶されたユーザプログラムに基づいて、収集したプロセスの識別子をプロセス名に変換させる
請求項5に記載の性能情報収集プログラム。 The process of periodically collecting the identification information includes collecting process identifiers corresponding to the one or more user functions,
The performance information collection program according to claim 5, wherein the identifier of the collected process is converted into a process name based on the user program stored in the storage unit.
前記オペレーティングシステムと前記ユーザプログラムとを記憶する記憶部と、
前記オペレーティングシステムを介した前記ユーザプログラムを前記演算処理装置に実行させる場合、前記オペレーティングシステムから呼び出されたオペレーティングシステム関数の識別情報と前記ユーザプログラムから呼び出されたユーザ関数の識別情報とを、周期的に収集するとともに前記記憶部に記憶する収集部と、
前記記憶部に記憶されたユーザ関数の識別情報に基づいて、各ユーザ関数が収集された回数である個別ユーザ関数収集回数を、各ユーザ関数の種別毎に集計するとともに、前記記憶部に記憶されたオペレーティングシステム関数の識別情報とユーザ関数の識別情報とに基づいて、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の識別情報が収集された一周期前に、前記ユーザ関数の識別情報が収集された個別特定ユーザ関数収集回数を、各ユーザ関数の種別毎に集計する集計部と、
集計された各個別ユーザ関数収集回数に対する各個別特定ユーザ関数収集回数の割合を、前記ユーザ関数の種別毎に算出する算出部と
を有する
ことを特徴とする情報処理装置。 In an information processing device that acquires performance information of a user program executed by an arithmetic processing device via an operating system,
A storage unit for storing the operating system and the user program;
When causing the arithmetic processing unit to execute the user program via the operating system, the operating system function identification information called from the operating system and the user function identification information called from the user program are periodically A collecting unit that collects and stores in the storage unit,
Based on the identification information of the user function stored in the storage unit, the number of individual user function collections, which is the number of times each user function is collected, is tabulated for each type of user function and stored in the storage unit. Based on the identification information of the operating system function and the identification information of the user function, the identification information of the user function is collected one cycle before the identification information of the operating system function that puts the arithmetic processing unit into an idle state is collected. A totaling unit that counts the number of collected individual specific user functions for each type of user function;
An information processing apparatus comprising: a calculation unit that calculates a ratio of each individual user function collection number to each collected individual user function collection number for each type of the user function.
前記情報処理装置が、
前記記憶部に記憶された前記オペレーティングシステムを介した前記ユーザプログラムを前記演算処理装置に実行させる場合、前記オペレーティングシステムから呼び出されたオペレーティングシステム関数の識別情報と前記ユーザプログラムから呼び出されたユーザ関数の識別情報とを、周期的に収集するとともに前記記憶部に記憶し、
前記記憶部に記憶されたユーザ関数の識別情報に基づいて、各ユーザ関数が収集された回数である個別ユーザ関数収集回数を、各ユーザ関数の種別毎に集計し、
前記記憶部に記憶されたオペレーティングシステム関数の識別情報とユーザ関数の識別情報とに基づいて、前記演算処理装置をアイドル状態にするオペレーティングシステム関数の識別情報が収集された一周期前に、前記ユーザ関数の識別情報が収集された個別特定ユーザ関数収集回数を、各ユーザ関数の種別毎に集計し、
集計された各個別ユーザ関数収集回数に対する各個別特定ユーザ関数収集回数の割合を、前記ユーザ関数の種別毎に算出する
ことを特徴とする性能情報収集方法。 In a performance information collection method for causing an information processing device having a storage unit to acquire performance information of a user program executed by an arithmetic processing device via an operating system,
The information processing apparatus is
When causing the arithmetic processing unit to execute the user program via the operating system stored in the storage unit, identification information of an operating system function called from the operating system and a user function called from the user program The identification information is periodically collected and stored in the storage unit,
Based on the identification information of the user function stored in the storage unit, the number of individual user function collection, which is the number of times each user function is collected, is totalized for each type of user function,
Based on the identification information of the operating system function and the identification information of the user function stored in the storage unit, the user is notified one cycle before the identification information of the operating system function that puts the arithmetic processing unit into an idle state is collected. The number of individual specific user functions collected for which function identification information has been collected is aggregated for each type of user function,
A performance information collecting method, characterized in that a ratio of each individual user function collection number to each collected individual user function collection number is calculated for each type of the user function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013105502A JP6075204B2 (en) | 2013-05-17 | 2013-05-17 | Performance information collection program, information processing apparatus, and performance information collection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013105502A JP6075204B2 (en) | 2013-05-17 | 2013-05-17 | Performance information collection program, information processing apparatus, and performance information collection method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014228889A true JP2014228889A (en) | 2014-12-08 |
JP6075204B2 JP6075204B2 (en) | 2017-02-08 |
Family
ID=52128716
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013105502A Active JP6075204B2 (en) | 2013-05-17 | 2013-05-17 | Performance information collection program, information processing apparatus, and performance information collection method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6075204B2 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015088068A (en) * | 2013-10-31 | 2015-05-07 | 富士通株式会社 | Information processing device, method for analyzing information processing device, and program for analyzing information processing device |
CN105607986A (en) * | 2015-01-06 | 2016-05-25 | 北京志翔科技股份有限公司 | Acquisition method and device of user behavior log data |
CN113448815A (en) * | 2020-03-26 | 2021-09-28 | 华为技术有限公司 | Method for collecting and tracking trace call chain and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050028145A1 (en) * | 2003-07-31 | 2005-02-03 | Sun Microsystems, Inc. | Flexible error trace mechanism |
JP2005332030A (en) * | 2004-05-18 | 2005-12-02 | Mitsubishi Electric Corp | Controller |
JP2007133604A (en) * | 2005-11-09 | 2007-05-31 | Fujitsu Ten Ltd | Computer system, operational state determination program and operational state determination method |
JP2007213205A (en) * | 2006-02-08 | 2007-08-23 | Fujitsu Ltd | System analysis program, device, and method |
-
2013
- 2013-05-17 JP JP2013105502A patent/JP6075204B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050028145A1 (en) * | 2003-07-31 | 2005-02-03 | Sun Microsystems, Inc. | Flexible error trace mechanism |
JP2005332030A (en) * | 2004-05-18 | 2005-12-02 | Mitsubishi Electric Corp | Controller |
JP2007133604A (en) * | 2005-11-09 | 2007-05-31 | Fujitsu Ten Ltd | Computer system, operational state determination program and operational state determination method |
JP2007213205A (en) * | 2006-02-08 | 2007-08-23 | Fujitsu Ltd | System analysis program, device, and method |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015088068A (en) * | 2013-10-31 | 2015-05-07 | 富士通株式会社 | Information processing device, method for analyzing information processing device, and program for analyzing information processing device |
CN105607986A (en) * | 2015-01-06 | 2016-05-25 | 北京志翔科技股份有限公司 | Acquisition method and device of user behavior log data |
CN113448815A (en) * | 2020-03-26 | 2021-09-28 | 华为技术有限公司 | Method for collecting and tracking trace call chain and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
JP6075204B2 (en) | 2017-02-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3191964B1 (en) | Memory leak analysis by usage trends correlation | |
US9454467B2 (en) | Method and apparatus for mining test coverage data | |
CN113641701B (en) | Data query method, system, heterogeneous acceleration platform and storage medium | |
CN103699637A (en) | Code productivity statistic method and system | |
US10331538B2 (en) | Information processing apparatus and program execution status display method | |
WO2017128952A1 (en) | Stack protection method and device | |
JP6075204B2 (en) | Performance information collection program, information processing apparatus, and performance information collection method | |
US20090083716A1 (en) | Profiling method and program | |
US20120297168A1 (en) | Processing instruction grouping information | |
Novillo | Samplepgo-the power of profile guided optimizations without the usability burden | |
Gaikwad et al. | Performance analysis for languages hosted on the truffle framework | |
CN111813672B (en) | Non-invasive coverage rate statistical method for various processor architectures | |
JP2019219848A (en) | Source code analysis method and source code analysis device | |
US20150154103A1 (en) | Method and apparatus for measuring software performance | |
Zhang et al. | Faster or Slower? Performance Mystery of Python Idioms Unveiled with Empirical Evidence | |
Mytkowicz et al. | Inferred call path profiling | |
US8756580B2 (en) | Instance-based field affinity optimization | |
Zhu et al. | An analysis of programming language statement frequency in C, C++, and Java source code | |
CN111401934A (en) | Distributed advertisement statistical method and device | |
Helm et al. | Perfmemplus: A tool for automatic discovery of memory performance problems | |
Wang et al. | Lightweight hardware transactional memory profiling | |
CN112540913B (en) | Method, system, equipment and readable storage medium for determining code coverage rate | |
Hung et al. | New tracing and performance analysis techniques for embedded applications | |
US11847448B2 (en) | Automatic generation of exporter configuration rules | |
JP5682109B2 (en) | Coverage information generation program, coverage information generation apparatus, and coverage information generation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160226 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20161207 |
|
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: 20161213 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20161226 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6075204 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |