JP2002318712A - Program execution history analysis method - Google Patents
Program execution history analysis methodInfo
- Publication number
- JP2002318712A JP2002318712A JP2001123301A JP2001123301A JP2002318712A JP 2002318712 A JP2002318712 A JP 2002318712A JP 2001123301 A JP2001123301 A JP 2001123301A JP 2001123301 A JP2001123301 A JP 2001123301A JP 2002318712 A JP2002318712 A JP 2002318712A
- Authority
- JP
- Japan
- Prior art keywords
- data
- task
- storage area
- history
- history data
- 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
Landscapes
- Debugging And Monitoring (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
(57)【要約】
【課題】 プログラムの実行中に有効な履歴データを取
得してデータ格納領域に書き込み、プログラム実行終了
後に履歴データをデータ格納領域から読み出して適切に
解析することにより、プログラム開発の効率を向上させ
ることができるプログラム実行履歴解析方法を提供す
る。
【解決手段】 書き込み処理においては、プログラム実
行の履歴データを、データ格納領域の最終アドレスから
前方に向かって順次書き込み、データ格納領域に空き領
域がなくなった場合は、データ格納領域の最終アドレス
へ戻って古い履歴データに上書きする。読み出し処理に
おいては、書き込み順とは逆に、データ格納領域へ最後
に書き込んだデータから、後方のアドレス領域に向かっ
て履歴データを順次読み出す。
(57) [Summary] [PROBLEMS] Program development by acquiring valid history data during execution of a program, writing the history data into a data storage area, reading the history data from the data storage area after the program execution, and appropriately analyzing the history data. To provide a program execution history analysis method that can improve the efficiency of program execution. In a writing process, program execution history data is sequentially written from the last address of a data storage area to the front, and when there is no free space in the data storage area, the program returns to the last address of the data storage area. Overwrite the old history data. In the reading process, the history data is sequentially read from the data written last to the data storage area to the address area at the rear, in the reverse order of the writing.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、ソフトウェアプロ
グラムの実行の際にプログラム実行の履歴データをデー
タ格納領域に書き込み、プログラム終了後に前記履歴デ
ータを読み出して解析するプログラム実行履歴解析方法
に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program execution history analysis method for writing program execution history data in a data storage area when a software program is executed, and reading and analyzing the history data after the program ends.
【0002】[0002]
【従来の技術】従来、例えばタスクの生成、遷移、およ
び削除などのプログラム実行履歴データを記憶して解析
することにより、プログラムの動作異常を検出する手法
が、プログラム開発などにおいて用いられている。従来
のプログラム実行履歴解析方法およびプログラム実行履
歴解析装置は、プログラム実行中にプログラムを構成す
るタスクの実行遷移や関数の実行などが発生するごと
に、それらの履歴データをデータ格納領域の先頭アドレ
スから後方のアドレスへ順次書き込み、空き領域が足り
なくなれば先頭アドレスへ戻り古いデータを上書きして
いく。プログラムの終了後データを読み出すときは、デ
ータ格納領域に残っている最も古いデータから順次読み
出していた。2. Description of the Related Art Conventionally, a technique of detecting an abnormal operation of a program by storing and analyzing program execution history data such as task generation, transition, and deletion has been used in program development and the like. The conventional program execution history analysis method and the program execution history analysis apparatus are configured such that every time execution transition of a task constituting a program, execution of a function, or the like occurs during execution of a program, the history data is read from a start address of a data storage area. The data is sequentially written to the subsequent address, and when the free space becomes insufficient, the process returns to the first address and overwrites the old data. When reading data after the end of the program, the oldest data remaining in the data storage area was read sequentially.
【0003】解析結果をグラフ化するときは、縦軸にタ
スクを識別番号ごとに並べ、横軸に時刻をとり、タスク
の実行履歴データをもとにタスク実行遷移の様子を折れ
線で示す。また関数実行は、関数実行が行われた時刻に
実行中のタスクの線上にマーキングする。タスクの実行
履歴データは、タスク遷移が発生した時刻と遷移先のタ
スク識別番号で構成される。グラフ表示は、履歴データ
を時間順に並べたとき、最初に現れるタスク実行履歴デ
ータ以降から可能であり、それ以前の関数実行履歴デー
タは実行中のタスクが特定できないため、グラフ表示は
できなかった。関数実行データは、関数を発行した時
刻、関数名や引数の値で構成し、これらを解析ツールで
テキストデータとして出力していた。When graphing the analysis result, the tasks are arranged on the vertical axis for each identification number, the time is taken on the horizontal axis, and the state of task execution transition is indicated by a broken line based on task execution history data. The function execution is marked on the line of the task being executed at the time when the function execution is performed. The task execution history data includes the time at which the task transition occurred and the task identification number of the transition destination. When the history data is arranged in chronological order, the graph can be displayed from the task execution history data that appears first onward, and since the function execution history data before that cannot identify the task being executed, the graph cannot be displayed. The function execution data is composed of the time at which the function was issued, the function name and the value of the argument, and these were output as text data by the analysis tool.
【0004】タスクの実行履歴を解析する上で、タスク
識別番号よりもタスク名を用いたほうがわかりやすいの
で、例えばグラフ表示においては、縦軸のエントリをタ
スク識別番号で表示せず、タスク名で表示する。タスク
には2種類あり、プログラムの最初から存在する静的タ
スクと、プログラム実行中に生成、削除される動的タス
クがある。静的タスクについては、タスク定義ファイル
から識別番号と名前の対応がわかるので、タスク識別番
号からタスク名に変換することができるが、動的タスク
については識別番号から名前への変換が難しかった。In analyzing the execution history of a task, it is easier to use the task name than the task ID number. For example, in the graph display, the entry on the vertical axis is not displayed by the task ID number but by the task name. I do. There are two types of tasks: static tasks that exist from the beginning of the program, and dynamic tasks that are created and deleted during program execution. For a static task, the correspondence between the identification number and the name can be known from the task definition file, so that the task identification number can be converted to the task name, but for the dynamic task, the conversion from the identification number to the name has been difficult.
【0005】履歴データを上書きしたくなければ、デー
タ格納領域に空き領域がなくなった時点で、プログラム
の実行を中断させる設定ができる。中断後、手動でデー
タ格納領域の履歴データを退避した後に実行を再開して
いた。If it is not desired to overwrite the history data, a setting can be made to interrupt the execution of the program when there is no more free space in the data storage area. After the interruption, the execution was resumed after manually saving the history data in the data storage area.
【0006】タスクが使用するスタックサイズを算出す
るには、タスクが呼び出す関数がさらにどの関数を呼び
出しているかを静的に解析し、各関数が必要とするスタ
ックサイズをもとに最も多くのスタックサイズを使用し
ているところをタスクが必要なスタックサイズとみなし
ていた。[0006] To calculate the stack size used by a task, the function called by the task is further statically analyzed to determine which function is called, and the largest stack size is calculated based on the stack size required by each function. The task using the size was regarded as the stack size required by the task.
【0007】[0007]
【発明が解決しようとする課題】前記従来のプログラム
実行履歴解析手法によれば、データ格納領域は容量に限
りがあるため、空き領域がなくなると古い履歴データは
新しい履歴データで上書きされて消滅する。このため、
特に、履歴データがその種類によってサイズが異なる場
合、すなわち履歴データが可変長である場合、履歴デー
タをデータ格納領域から読み出そうとするときに、デー
タ格納領域に残っている最も古い履歴データを検索する
ことが困難であるという問題がある。According to the conventional program execution history analysis method, since the data storage area has a limited capacity, when the free area runs out, the old history data is overwritten with the new history data and disappears. . For this reason,
In particular, when the size of the history data differs depending on its type, that is, when the history data is variable in length, when the history data is read from the data storage area, the oldest history data remaining in the data storage area is deleted. There is a problem that it is difficult to search.
【0008】また、履歴データをグラフ化する場合、タ
スク実行遷移履歴データより、前に書き込まれた関数発
行履歴データは、どのタスクが実行したものかが特定で
きない。When graphing history data, it is not possible to specify which task has been executed in the function issue history data written before the task execution transition history data.
【0009】また、関数発行履歴データは、関数名や引
数値はわかるが、ソースコードのどこで実行されたもの
かが特定できない。The function issuance history data can know the function name and the argument value, but cannot specify where in the source code the data was executed.
【0010】また、プログラムの実行中に生成、削除さ
れる動的タスクは、タスク定義ファイルに登録されない
ため、タスク定義ファイルを参照してタスク名を取得す
ることができない。[0010] In addition, a dynamic task created and deleted during execution of a program is not registered in the task definition file, so that the task name cannot be obtained by referring to the task definition file.
【0011】また、上書きさせないでデータ格納領域の
容量を越える履歴データを取得する場合、プログラムの
中断中もタイマーが稼動しているシステムでは、実行再
開後の履歴データでは、中断時間も含んだ時刻となり、
タスクの実行時間の算出などにおいて正確な値が得られ
ない。In the case where the history data exceeding the capacity of the data storage area is obtained without being overwritten, in a system in which the timer is running even during the interruption of the program, the history data after the execution is resumed includes the time including the interruption time. Becomes
An accurate value cannot be obtained in the calculation of the task execution time or the like.
【0012】また、タスクが使用するスタックサイズを
調べるときにタスクが呼び出す関数が使用するスタック
サイズを調べる方法では、関数の再帰呼び出しや関数へ
のポインタを使った呼び出しが含まれる場合、実行しな
ければ再起呼び出し関数の呼び出し回数がわからなかっ
たり、ポインタを使った関数呼び出しでどの関数が呼ば
れるかがわからなかったりするため、スタックサイズを
特定することができない。In the method of checking the stack size used by the function called by the task when checking the stack size used by the task, if the function includes a recursive call or a call using a pointer to the function, the method must be executed. For example, the stack size cannot be specified because the number of times the recursive call function is called is not known, or which function is called by the function call using the pointer.
【0013】本発明は、これらの問題を解決するため
に、有効な履歴データを取得すると共にこの履歴データ
の解析処理を適切に行うことにより、プログラム開発の
効率を向上させることができるプログラム実行履歴解析
方法を提供することを目的とする。In order to solve these problems, the present invention obtains effective history data and appropriately analyzes the history data to improve the efficiency of program development. It is intended to provide an analysis method.
【0014】[0014]
【課題を解決するための手段】前記の目的を達成するた
めに、本発明にかかる第1の実行履歴解析方法は、プロ
グラム実行の履歴データをデータ格納領域に書き込む書
き込み処理と、前記データ格納領域から前記履歴データ
を読み出して解析する解析処理とを含むプログラム実行
履歴解析方法において、前記書き込み処理にて、各履歴
データを、前回の履歴データを書き込んだアドレス領域
よりも前方のアドレス領域へ書き込み、書き込むべき履
歴データのデータサイズに対応する空き領域がないと判
断された場合は、前記データ格納領域の最終アドレスへ
戻って履歴データを上書きし、前記解析処理にて、前記
書き込み処理において最後に書き込まれた履歴データか
ら、前記データ格納領域の後方アドレスへ向かって、格
納されている履歴データを順次読み出し、前記データ格
納領域の最終アドレスまで履歴データを読み出してもま
だ読み出すべきデータがある場合は、前記データ格納領
域の先頭アドレスへジャンプし、前記最後に書き込まれ
た履歴データより前方アドレスに格納されている履歴デ
ータを順次読み出すことを特徴とする。In order to achieve the above object, a first execution history analysis method according to the present invention comprises a writing process of writing program execution history data to a data storage area; In the program execution history analysis method including an analysis process of reading and analyzing the history data from, in the write process, write each history data to an address area ahead of the address area where the previous history data was written, If it is determined that there is no free area corresponding to the data size of the history data to be written, the process returns to the last address of the data storage area and overwrites the history data, and the analysis process performs the last write in the write process. From the stored history data to the rear address of the data storage area. If the history data is read out to the last address of the data storage area and there is still data to be read, the data is jumped to the top address of the data storage area, and the data is read ahead of the last written history data. It is characterized in that history data stored in an address is sequentially read.
【0015】この方法によれば、履歴データを格納領域
の最終アドレスから前方に向かって順次書き込み、デー
タ格納領域に空き領域がなくなった場合は最終アドレス
へもどって上書きして書き込み、読み出すときには書き
込み順とは逆に、最後に書き込まれたデータから後方の
アドレスへ向かって、順次読み出しを行う。これによ
り、読み出し開始位置を検索する必要がなく、ただちに
履歴データの読み出しを開始することができるので、プ
ログラム実行履歴解析処理の効率が向上する。特に、履
歴データが可変長であり、履歴データが上書きされてい
る場合に、従来は困難であった読み出し開始位置の検索
を容易に行うことができるので、その効果は顕著であ
る。According to this method, the history data is sequentially written from the last address of the storage area to the front, and when there is no free area in the data storage area, the data is overwritten by returning to the last address, and when the data is read, the writing order is changed. Conversely, reading is performed sequentially from the last written data to a subsequent address. As a result, it is not necessary to search for the read start position, and the reading of the history data can be started immediately, so that the efficiency of the program execution history analysis processing is improved. In particular, when the history data has a variable length and the history data is overwritten, the search for the read start position, which has been difficult in the past, can be easily performed, and the effect is remarkable.
【0016】前記第1のプログラム実行履歴解析方法に
おいて、前記書き込み処理において、書き込むべき履歴
データのデータサイズよりも空き領域の容量が小さいと
判断された場合、当該履歴データのうち、前記空き領域
に書き込める部分を当該空き領域へ書き込み、残りの部
分を前記データ格納領域の最終アドレスから前方のアド
レス領域へ書き込むことが好ましい。In the first program execution history analysis method, if it is determined in the writing process that the capacity of the free area is smaller than the data size of the history data to be written, the free area of the history data is It is preferable that a writable portion is written to the free space, and the remaining portion is written to an address area in front of the last address of the data storage area.
【0017】また、本発明にかかる第2の実行履歴解析
方法は、プログラム実行の履歴データをデータ格納領域
に書き込む書き込み処理と、前記データ格納領域から前
記履歴データを読み出して解析する解析処理とを含むプ
ログラム実行履歴解析方法において、前記書き込み処理
にて、タスクの実行遷移が発生したとき、当該実行遷移
が発生した時刻と、実行遷移元のタスク識別子とを含む
データを、前記実行履歴データとして前記データ格納領
域に書き込むことを特徴とする。Further, a second execution history analysis method according to the present invention includes a writing process of writing program execution history data to a data storage area, and an analysis process of reading and analyzing the history data from the data storage area. In the method for analyzing program execution history including, when the execution transition of a task occurs in the writing process, the data including the time when the execution transition occurred and the task identifier of the execution transition source is defined as the execution history data. It is characterized in that data is written in a data storage area.
【0018】この方法によれば、プログラム実行中にタ
スクの実行遷移が発生した時に、実行遷移が発生した時
刻と実行遷移元のタスク識別子とを含む履歴データをデ
ータ格納領域に書き込むことにより、例えば、タスク実
行遷移が発生する直前の履歴データが、関数が発行され
たことを表している場合等に、その関数をどのタスクが
実行したかを特定することが可能となる。なお、タスク
識別子としては、個々のタスクを特定できるものであれ
ば、数字もしくは記号またはこれらの組み合わせ等、任
意の表現形式を用いることができる。According to this method, when a task execution transition occurs during the execution of a program, history data including the time at which the execution transition occurred and the task identifier of the execution transition source is written into the data storage area. For example, when the history data immediately before the occurrence of the task execution transition indicates that the function has been issued, it is possible to specify which task executed the function. As the task identifier, any expression form such as a number, a symbol, or a combination thereof can be used as long as it can identify an individual task.
【0019】前記第2のプログラム実行解析方法は、前
記書き込み処理にて、解析対象プログラム停止時に、停
止直前に実行されていたタスクのタスク識別子を含むデ
ータを、実行履歴データとして前記データ格納領域に書
き込むことが好ましい。これにより、解析対象プログラ
ムの実行開始から停止までの全期間にわたって、タスク
実行がどのように遷移したかを特定することが可能とな
る。In the second program execution analysis method, in the writing process, when the analysis target program is stopped, data including a task identifier of a task executed immediately before the stop is stored as execution history data in the data storage area. It is preferable to write. This makes it possible to specify how the task execution has transitioned over the entire period from the start to the stop of the execution of the analysis target program.
【0020】また、本発明にかかる第3の実行履歴解析
方法は、プログラム実行の履歴データをデータ格納領域
に書き込む書き込み処理と、前記データ格納領域から前
記履歴データを読み出して解析する解析処理とを含むプ
ログラム実行履歴解析方法において、前記書き込み処理
にて、前記プログラムの実行中に関数が実行されるごと
に、当該関数実行が発生した時刻、関数名、および関数
戻りアドレスを含むデータを、前記履歴データとして前
記データ格納領域に書き込み、前記解析処理にて、前記
関数戻りアドレスとソースコード情報との対応を示すソ
ースコード情報対応表から、前記データ格納領域から読
み出した履歴データに含まれる関数戻りアドレスに対応
するソースコード情報を取得し、取得したソースコード
情報を表示することを特徴とする。A third execution history analysis method according to the present invention includes a writing process of writing program execution history data in a data storage area and an analysis process of reading and analyzing the history data from the data storage area. In the program execution history analysis method, each time a function is executed during execution of the program in the writing process, data including a time at which the function execution occurred, a function name, and a function return address are stored in the history. The data is written to the data storage area, and in the analysis processing, the function return address included in the history data read from the data storage area is obtained from a source code information correspondence table indicating the correspondence between the function return address and the source code information. Acquires source code information corresponding to and displays the acquired source code information. The features.
【0021】この方法では、実行履歴データとして関数
戻りアドレスを書き込み、解析処理の際にこの関数戻り
アドレスをソースコード情報に変換する。ソースコード
情報としては、例えば、関数戻りアドレスに対応するソ
ースファイル名および行番号などを用いることができ
る。これにより、関数が、ソースコードのどこで実行さ
れたものかを特定することが可能となる。According to this method, a function return address is written as execution history data, and the function return address is converted into source code information during analysis processing. As the source code information, for example, a source file name and a line number corresponding to the function return address can be used. This makes it possible to specify where in the source code the function was executed.
【0022】なお、前記ソースコード情報対応表は、前
記プログラムのコンパイル時にコンパイラによって作成
することができる。また、前記関数戻りアドレスは、関
数呼び出しの際に書き込まれたスタックから取得するこ
とができる。The source code information correspondence table can be created by a compiler when compiling the program. Further, the function return address can be obtained from the stack written at the time of calling the function.
【0023】本発明にかかる第4の実行履歴解析方法
は、プログラム実行の履歴データをデータ格納領域に書
き込む書き込み処理と、前記データ格納領域から前記履
歴データを読み出して解析する解析処理とを含むプログ
ラム実行履歴解析方法において、前記書き込み処理に
て、(a)タスクが生成されるごとに、当該タスクが生
成された時刻、タスク識別子、およびタスク名を含むタ
スク生成データを、前記履歴データとして前記データ格
納領域に書き込み、(b)タスクが削除されるごとに、
当該タスクが削除された時刻、タスク識別子、およびタ
スク名を含むタスク削除データを、前記履歴データとし
て前記データ格納領域に書き込み、(c)タスク遷移が
発生するごとに、当該タスク遷移が発生した時刻および
タスク識別子を含むタスク遷移データを、前記履歴デー
タとして前記データ格納領域に書き込み、前記解析処理
にて、前記データ格納領域から読み出した履歴データの
うち、前記タスク生成データおよび前記タスク削除デー
タから、タスク識別子、タスク生成時刻、タスク削除時
刻、およびタスク名を含むタスク名対応表を作成し、デ
ータ格納領域から読み出した履歴データのうち、前記タ
スク遷移データからタスクの遷移グラフを作成し、前記
遷移グラフ上に、基準時刻およびタスク識別子に基づき
前記タスク名対応表から取得したタスク名を表示するこ
とを特徴とする。A fourth execution history analysis method according to the present invention is a program including a writing process of writing history data of program execution to a data storage area, and an analysis process of reading and analyzing the history data from the data storage area. In the execution history analysis method, in the writing process, (a) each time a task is generated, task generation data including a time at which the task is generated, a task identifier, and a task name are used as the history data. Write to the storage area, (b) Every time a task is deleted,
Task deletion data including the time at which the task was deleted, the task identifier, and the task name are written to the data storage area as the history data. (C) The time at which the task transition occurred every time a task transition occurred And task transition data including a task identifier, writing the history data in the data storage area, in the analysis processing, of the history data read from the data storage area, from the task generation data and the task deletion data, A task name correspondence table including a task identifier, a task creation time, a task deletion time, and a task name is created, and among the history data read from the data storage area, a task transition graph is created from the task transition data. On the graph, the task name corresponding to the reference time and task identifier And displaying the task name obtained from.
【0024】この方法では、タスクの生成、削除、およ
び遷移にかかる情報を、履歴データとしてデータ格納領
域に書き込み、解析処理において、それらをもとにタス
ク名対応表を作成し、タスクの遷移グラフ出力の際に、
基準時刻を決定して、基準時刻とタスク識別子をキーと
してタスク名対応表からタスク名を取得する。これによ
り、動的に生成、削除されるタスクについても、それら
の名前をグラフ表示することが可能となり、プログラム
解析が容易になる。In this method, information on task generation, deletion, and transition is written as history data in a data storage area, and in an analysis process, a task name correspondence table is created based on the information, and a task transition graph is created. On output,
The reference time is determined, and the task name is obtained from the task name correspondence table using the reference time and the task identifier as keys. This makes it possible to graphically display the names of tasks that are dynamically created and deleted, thereby facilitating program analysis.
【0025】また、本発明にかかる第5の実行履歴解析
方法は、プログラム実行の履歴データをデータ格納領域
に書き込む書き込み処理と、前記データ格納領域から前
記履歴データを読み出して解析する解析処理とを含むプ
ログラム実行履歴解析方法において、前記書き込み処理
にて、(a)プログラム実行が中断した時刻のデータを
含む中断データを、前記履歴データとして前記データ格
納領域に記録し、(b)プログラム実行を再開させた時
刻のデータを含む再開データを、前記履歴データとして
前記データ格納領域に記録し、前記解析処理にて、前記
中断データおよび前記再開データに基づき、プログラム
実行の中断時間を求め、前記再開データより後の時刻に
かかる履歴データの時刻から、前記中断時間を減算する
ことを特徴とする。A fifth execution history analysis method according to the present invention includes a writing process of writing program execution history data to a data storage area, and an analysis process of reading and analyzing the history data from the data storage area. In the program execution history analysis method, (a) in the write processing, interrupted data including data of the time at which the program execution was interrupted is recorded as the history data in the data storage area, and (b) program execution is resumed. The resume data including the data at the time when the program was executed is recorded as the history data in the data storage area, and in the analysis process, the interruption time of the program execution is obtained based on the suspend data and the resume data. The interruption time is subtracted from the time of the history data at a later time.
【0026】この方法によれば、何らかの理由によりプ
ログラム実行が中断したとき、中断時刻と再開時刻とを
履歴データとしてデータ格納領域に記録し、解析処理時
に、プログラム実行再開後の各履歴データの時刻から中
断時間を減算することで、あたかも中断がなかったよう
に、実行履歴を解析することができる。According to this method, when the program execution is interrupted for some reason, the interruption time and the restart time are recorded in the data storage area as history data, and the time of each history data after the program execution is resumed at the time of analysis processing. By subtracting the interruption time from, the execution history can be analyzed as if there was no interruption.
【0027】これにより、例えば、書き込み処理にて、
前記データ格納領域に履歴データを書き込むべき空き領
域が足りなくなると判断したときに、データ格納領域に
格納されているすべての履歴データを他のデータ格納領
域などの待避領域へ待避させるためにプログラム実行を
中断させることも可能となる。この場合、履歴データの
待避が完了した後に、必要に応じてデータ格納領域の初
期化を行い、プログラム実行および履歴データの書き込
みを再開し、解析処理においては、前記待避領域からプ
ログラム実行中断前の履歴データを読み出し、データ格
納領域から前記プログラム実行再開後の履歴データを読
み出し、上述したように、実行再開後の各履歴データの
時刻から中断時間を減算することにより、あたかも中断
がなかったように、実行履歴を解析することができる。Thus, for example, in the writing process,
When it is determined that there is not enough free space for writing history data in the data storage area, a program is executed to save all history data stored in the data storage area to a save area such as another data storage area. Can be interrupted. In this case, after the saving of the history data is completed, the data storage area is initialized if necessary, and the execution of the program and the writing of the history data are resumed. The history data is read, the history data after the program execution is resumed from the data storage area, and the interruption time is subtracted from the time of each history data after the execution is resumed as described above, as if there was no interruption. , The execution history can be analyzed.
【0028】本発明にかかる第6の実行履歴解析方法
は、プログラム実行の履歴データをデータ格納領域に書
き込む書き込み処理と、前記データ格納領域から前記履
歴データを読み出して解析する解析処理とを含むプログ
ラム実行履歴解析方法において、前記書き込み処理に
て、タスク遷移が発生するごとに、遷移元タスクまたは
遷移先タスクのタスク識別子と、前記タスクが使用して
いるスタックサイズとを含むデータを、前記履歴データ
として前記データ格納領域に書き込み、前記解析処理に
て、前記データ格納領域から読み出したすべての履歴デ
ータから、前記タスク識別子ごとのスタックサイズ最大
値を算出することを特徴とする。A sixth execution history analysis method according to the present invention is a program including a writing process of writing history data of program execution to a data storage area, and an analysis process of reading and analyzing the history data from the data storage area. In the execution history analysis method, every time a task transition occurs in the writing process, data including a task identifier of a transition source task or a transition destination task and a stack size used by the task is stored in the history data. And writing a maximum stack size for each task identifier from all the history data read from the data storage area in the analysis processing.
【0029】この方法によれば、タスクが使用している
スタックサイズを履歴データとしてデータ格納領域に記
憶させ、解析処理時に各タスクのスタックサイズの最大
値を算出することにより、各タスクが使用するスタック
サイズの設定を最適化することが可能となる。According to this method, the stack size used by each task is stored as history data in the data storage area, and the maximum value of the stack size of each task is calculated at the time of analysis processing, so that each task uses the stack size. It is possible to optimize the setting of the stack size.
【0030】[0030]
【発明の実施の形態】(実施の形態1)図1および図2
を参照して、本発明の一実施形態について説明する。(Embodiment 1) FIGS. 1 and 2
An embodiment of the present invention will be described with reference to FIG.
【0031】図1は、本実施形態にかかるプログラム実
行履歴解析方法の処理手順を示すフローチャートであ
る。本プログラム実行履歴解析方法は、プログラムの実
行中に、データ格納領域への履歴データの書き込み処理
100を行い、プログラムの終了後に、前記データ格納
領域からの履歴データの読み出し処理150を行う。な
お、この読み出し処理150は、履歴データの解析処理
の一部として行われるものである。FIG. 1 is a flowchart showing a processing procedure of the program execution history analysis method according to the present embodiment. In this program execution history analysis method, a process 100 for writing history data to a data storage area is performed during execution of a program, and a process 150 for reading history data from the data storage area is performed after the program is completed. The reading process 150 is performed as a part of the history data analysis process.
【0032】書き込み処理100では、以下のような手
順により、データ格納領域の最終アドレスから前方へ
と、順に、履歴データを書き込む。In the writing process 100, history data is written in order from the last address of the data storage area to the front according to the following procedure.
【0033】すなわち、書き込み処理100では、ま
ず、データ格納領域の最終アドレスをポインタAに格納
する(ステップ101)。次に、書き込もうとする履歴
データのサイズとデータ格納領域の残容量とを比較し
(ステップ102)、履歴データを書き込むのに十分な
残容量がデータ格納領域にあれば(ステップ102の結
果がY)、ポインタAが指すアドレスを、書き込もうと
する履歴データのサイズ分前方に設定する(ステップ1
05)。その後、ポインタAの指すアドレスから履歴デ
ータを書き込む(ステップ106)。That is, in the write processing 100, first, the last address of the data storage area is stored in the pointer A (step 101). Next, the size of the history data to be written is compared with the remaining capacity of the data storage area (step 102), and if there is sufficient remaining capacity in the data storage area to write the history data (the result of step 102 is Y ), The address pointed by the pointer A is set ahead by the size of the history data to be written (step 1).
05). Thereafter, the history data is written from the address indicated by the pointer A (step 106).
【0034】一方、履歴データを書き込むのに十分な残
容量がデータ格納領域にない場合(ステップ102の結
果がN)は、ポインタBにポインタAがもつアドレス値
を代入し(ステップ103)、ポインタAにデータ格納
領域の最終アドレスを代入(ステップ104)した後、
ステップ105および106を実行する。すなわち、デ
ータ格納領域の空き領域が足りなくなると、最後に書き
込んだ履歴データの位置をポインタBに記録しておき、
データ格納領域の最終アドレスから前方へ、古い履歴デ
ータを上書きしていく。On the other hand, if there is not enough free space in the data storage area to write the history data (the result of step 102 is N), the address value of the pointer A is substituted for the pointer B (step 103). After substituting the last address of the data storage area into A (step 104),
Perform steps 105 and 106. That is, when there is not enough free space in the data storage area, the position of the last written history data is recorded in the pointer B,
Older history data is overwritten forward from the last address of the data storage area.
【0035】プログラム実行が終了、すなわち書き込む
べき履歴データがなくなるまで(ステップ107の結果
がY)、前述のステップ102〜106が繰り返され
る。Steps 102 to 106 are repeated until the program execution ends, that is, until there is no more history data to be written (the result of step 107 is Y).
【0036】ここで、履歴データa〜gを、データ格納
領域に書き込む場合の手順を、図2を参照しながら説明
する。なお、履歴データaを書き込む前のポインタAの
位置は、図2におけるA’であったものとする。この場
合、履歴データaは、前記A’の位置から履歴データA
のデータサイズ分だけ前方に設定されたアドレスを先頭
として、図2に示すようにデータ格納領域に書き込まれ
る。以後、同様に、履歴データb,cが、図2に示すよ
うに、データ格納領域の前方へ向かって、順次書き込ま
れる。そして、履歴データdを書き込もうとしたとき、
データ格納領域の空き容量が履歴データdのデータサイ
ズよりも小さかったので、データ格納領域の最終アドレ
スに戻って、古いデータの上に、履歴データdが上書き
される。続いて、履歴データe,f,gの順に、データ
格納領域の前方へ向かって書き込まれ、データgを書き
込んだ時点で、書き込み処理100が終了している。図
2から分かるように、書き込み処理100が終了する時
点のポインタAは、最後に書き込まれた履歴データ(図
2の場合は履歴データg)の先頭アドレスを指してい
る。Here, a procedure for writing the history data a to g in the data storage area will be described with reference to FIG. It is assumed that the position of the pointer A before writing the history data a is A ′ in FIG. In this case, the history data a is the history data A from the position of A ′.
The data is written in the data storage area as shown in FIG. Thereafter, similarly, history data b and c are sequentially written toward the front of the data storage area as shown in FIG. Then, when trying to write the history data d,
Since the free space of the data storage area is smaller than the data size of the history data d, the process returns to the last address of the data storage area, and the history data d is overwritten on the old data. Subsequently, the history data e, f, and g are written in the order of the front of the data storage area, and when the data g is written, the writing process 100 is completed. As can be seen from FIG. 2, the pointer A at the end of the write processing 100 points to the head address of the last written history data (history data g in FIG. 2).
【0037】次に、プログラム実行が終了した後に行わ
れる、図1に示す読み出し処理150について説明す
る。なお、読み出し処理150では、書き込み処理10
0とは逆に、データ格納領域の前方から後方へ向かっ
て、履歴データが順次読み出される。Next, the reading process 150 shown in FIG. 1 which is performed after the execution of the program is described. In the reading process 150, the writing process 10
Conversely to 0, the history data is sequentially read from the front to the rear of the data storage area.
【0038】読み出し処理150では、まず、ポインタ
Aのアドレス値をポインタCに代入する(ステップ15
1)。すなわち、図2の場合は、書き込み処理100に
おいて最後に書き込まれた履歴データgの先頭アドレス
が、読み出し開始位置として、ポインタCに代入される
こととなる。In the reading process 150, first, the address value of the pointer A is assigned to the pointer C (step 15).
1). That is, in the case of FIG. 2, the head address of the history data g written last in the write processing 100 is substituted into the pointer C as the read start position.
【0039】次に、履歴データを読み出す前に、ポイン
タAのアドレスとデータ格納領域の最終アドレスとを比
較し(ステップ152)、等しくなければ(ステップ1
52の結果がN)、ポインタAの指す位置から履歴デー
タを読み出す(ステップ154)。一方、ポインタAの
指すアドレスがデータ格納領域の最終アドレスと等しけ
れば(ステップ152の結果がY)、ポインタBの値を
ポインタAに代入(ステップ153)した後、ステップ
154を実行する。Next, before reading the history data, the address of the pointer A is compared with the last address of the data storage area (step 152).
When the result of 52 is N), the history data is read from the position indicated by the pointer A (step 154). On the other hand, if the address pointed by the pointer A is equal to the last address of the data storage area (the result of step 152 is Y), the value of the pointer B is assigned to the pointer A (step 153), and then step 154 is executed.
【0040】ステップ154で履歴データを読み出した
後は、ポインタAの指す位置を読み出した履歴データの
データサイズ分だけ後方にずらす(ステップ155)。
次に、ポインタCのアドレスとポインタAのアドレスと
を比較し(ステップ156)、これらが等しければ(ス
テップ156の結果がY)、処理を終了し、等しくなけ
ればステップ152へ戻り、次の履歴データの読み出し
処理を行う。After reading the history data in step 154, the position pointed to by the pointer A is shifted backward by the data size of the read history data (step 155).
Next, the address of the pointer C is compared with the address of the pointer A (step 156). If they are equal (the result of step 156 is Y), the processing is terminated. Perform data read processing.
【0041】このように、図2の場合であれば、履歴デ
ータg,f,e,dの順に読み出しを行い、次の履歴デ
ータcを読み出すときは、ポインタBの指すアドレスを
参照すれば、その読み出し位置がわかる。そしてさら
に、履歴データb,aを読み出す。最後に書き込まれた
履歴データaにより上書きされたデータは、その一部が
残っているが、履歴データgにより上書きされて無効に
なっているため読み出さない。つまり、読み出し処理
は、履歴データaを読み出した時点で終了する。As described above, in the case of FIG. 2, reading is performed in the order of the history data g, f, e, and d. When reading the next history data c, referring to the address indicated by the pointer B, The read position is known. Further, the history data b and a are read. Part of the data overwritten by the history data a written last remains, but is not read because it is overwritten by the history data g and is invalid. That is, the reading process ends when the history data a is read.
【0042】以上のように、図1に示す手順によれば、
例えば図2に示したように、a,b,c,d,e,f,
gの順でデータ格納領域に書き込んだ履歴データを、書
き込んだときとは逆の順に、すなわち、g,f,e,
d,c,b,aの順に読み出すこととなる。As described above, according to the procedure shown in FIG.
For example, as shown in FIG. 2, a, b, c, d, e, f,
The history data written to the data storage area in the order of g is written in the reverse order of writing, that is, g, f, e,
Reading is performed in the order of d, c, b, and a.
【0043】これにより、データ格納領域において履歴
データが上書きされている状態でも、読み出し時に、ポ
インタAが指すデータから読み出せばよく、最初に読み
出す履歴データを探す必要がない。なお、本実施形態で
は、データ格納領域の空き容量が足りなくなった場合、
データ格納領域先頭の空き領域には何も書かずに、最終
アドレスから上書きしているが、履歴データを分割し
て、先頭の空き領域の容量分に書き込める部分のデータ
を書き込んで、残りの部分を最終アドレスから書き込ん
でもかまわない。Thus, even when the history data is overwritten in the data storage area, it is sufficient to read from the data indicated by the pointer A at the time of reading, and it is not necessary to search for the history data to be read first. In this embodiment, when the free space of the data storage area becomes insufficient,
Nothing is written in the free space at the beginning of the data storage area, and the data is overwritten from the last address.However, the history data is divided and data that can be written to the capacity of the free space at the beginning is written, and the remaining data May be written from the last address.
【0044】(実施の形態2)以下、本発明の他の実施
形態について説明する。図3は、本実施形態にかかる履
歴データの内容を示す説明図である。図4は、図3に示
した履歴データの解析結果として得られる、プログラム
の実行履歴のグラフ表示である。(Embodiment 2) Hereinafter, another embodiment of the present invention will be described. FIG. 3 is an explanatory diagram illustrating the contents of the history data according to the present embodiment. FIG. 4 is a graphical representation of a program execution history obtained as a result of analyzing the history data shown in FIG.
【0045】本実施形態では、タスクの実行遷移が発生
したとき、実行遷移が発生した時刻と、実行遷移元のタ
スク識別番号とを含むデータを、実行履歴データとして
データ格納領域に書き込む。また、プログラム停止時に
は、停止直前に実行されていたタスクのタスク識別番号
を含むデータを、実行履歴データとしてデータ格納領域
に書き込む。この他に、関数実行の履歴データなども、
データ格納領域に書き込まれる。In the present embodiment, when a task execution transition occurs, data including the time at which the execution transition occurred and the task identification number of the execution transition source is written to the data storage area as execution history data. When the program is stopped, the data including the task identification number of the task executed immediately before the stop is written to the data storage area as execution history data. In addition, function execution history data, etc.
Written to the data storage area.
【0046】図3において、時刻t1の履歴データは関
数実行の履歴データである。時刻t2〜t5の履歴デー
タはすべてタスク実行遷移の履歴データであり、それぞ
れ、タスク1,タスク3,タスク2,タスク1から別の
タスクへ実行が遷移したことを示す。最終行は、データ
の終了時すなわち、プログラムの履歴データの書き込み
を終了した時点の実行タスクを示し、図3に示す場合は
タスク3がそれに該当する。In FIG. 3, the history data at time t1 is the history data of the function execution. The history data at times t2 to t5 are all history data of task execution transition, and indicate that execution has transitioned from task 1, task 3, task 2, task 1 to another task, respectively. The last line indicates the execution task at the end of the data, that is, at the end of writing the history data of the program. In the case of FIG. 3, task 3 corresponds to this task.
【0047】解析処理においては、これらの履歴データ
を読み出して、図4に示すようなグラフを表示する。従
来の方法では、時刻t1に発生した関数実行はどのタス
クで実行されたかがわからなかったので、グラフ表示で
きなかったが、本実施形態によれば、図4に示すよう
に、時刻t1に発生した関数実行がタスク1で実行され
たことをグラフ表示することができる。In the analysis processing, these pieces of history data are read and a graph as shown in FIG. 4 is displayed. In the conventional method, it was not possible to know which task executed the function executed at the time t1, and it was not possible to display a graph. However, according to the present embodiment, the function execution occurred at the time t1 as shown in FIG. The fact that the function execution has been executed in task 1 can be displayed graphically.
【0048】(実施の形態3)本発明にかかるさらに他
の実施形態について、以下に説明する。(Embodiment 3) Still another embodiment according to the present invention will be described below.
【0049】図5は、解析処理において、履歴データの
グラフ表示画面に、関数実行データの詳細情報を表示し
た例である。関数データの詳細情報は、関数名、時刻、
引数のほか、関数の戻り位置を含む。関数の戻り位置
は、ソースコードのファイル名と行番号とで示される。
すなわち、関数が、どのファイルの何行目に記述された
関数呼び出しで発行されたものであるかが、この情報か
らわかる。FIG. 5 shows an example of displaying detailed information of function execution data on a graph display screen of history data in the analysis processing. Detailed information on function data includes function name, time,
In addition to the arguments, the return position of the function is included. The return position of the function is indicated by the source code file name and line number.
In other words, it can be known from this information that the function was issued by the function call described in which file of which file.
【0050】図6に、関数実行データの詳細情報を取得
するための手順を示す。まず、関数実行データの書き込
みを行う(ステップ400)。このとき、関数実行デー
タ450に示すように、時刻、関数名、関数の戻りアド
レス、および引数値等のその他のデータを、データ格納
領域440に書き込む。関数の戻りアドレスは、関数呼
び出しの際にスタックに書き込まれるので、その内容を
読み出すことで取得が可能である。ステップ400は、
プログラムの実行中、関数が実行されるたびに繰り返さ
れる。FIG. 6 shows a procedure for acquiring detailed information of function execution data. First, function execution data is written (step 400). At this time, as shown in the function execution data 450, other data such as a time, a function name, a function return address, and an argument value are written to the data storage area 440. Since the return address of the function is written on the stack when the function is called, it can be obtained by reading the contents. Step 400 includes:
During the execution of the program, it is repeated each time the function is executed.
【0051】プログラムの終了後、ステップ410でデ
ータ格納領域440から関数実行データを読み出し、ス
テップ420で戻りアドレスをキーにしてソースコード
情報対応表460を検索し、ソースコードファイル名と
行番号とからなるソースコード情報を取得する。ソース
コード情報対応表460は、一般にプログラムのコンパ
イル時に、コンパイラがデバッグ情報として作成するも
のである。After the program ends, the function execution data is read from the data storage area 440 in step 410, the source code information correspondence table 460 is searched in step 420 using the return address as a key, and the source code file name and the line number are searched. Source code information. The source code information correspondence table 460 is generally created by a compiler as debug information when compiling a program.
【0052】そしてステップ430において、ステップ
410で読み出した関数名、時刻、引数値等と、ステッ
プ420で取得した関数の戻り位置とを表示する。プロ
グラム解析者は、関数の戻り位置をみることで、この関
数がソースコード上のどこで発行されたものかを特定す
ることが可能になる。At step 430, the function name, time, argument value, etc. read at step 410 and the return position of the function obtained at step 420 are displayed. By looking at the return position of the function, the program analyst can specify where in the source code the function was issued.
【0053】(実施の形態4)本発明のさらに他の実施
形態について、以下に説明する。(Embodiment 4) Still another embodiment of the present invention will be described below.
【0054】図7に、タスク名を取得する手順と、タス
ク名対応表との関係を示す。図8は、グラフ表示画面に
おいて、タスク名がどのように表示されるかを示す説明
図である。FIG. 7 shows a relationship between a procedure for acquiring a task name and a task name correspondence table. FIG. 8 is an explanatory diagram showing how task names are displayed on the graph display screen.
【0055】図7において、500はタスク生成履歴デ
ータ、510はタスク削除履歴データであり、いずれ
も、時刻、タスク識別番号、およびタスク名を含む。5
20はタスク名対応表の一例である。タスク名対応表5
20は、タスク生成履歴データ500とタスク削除履歴
データ510から作成する。In FIG. 7, reference numeral 500 denotes task generation history data, and 510 denotes task deletion history data, each of which includes a time, a task identification number, and a task name. 5
20 is an example of a task name correspondence table. Task name correspondence table 5
20 is created from the task generation history data 500 and the task deletion history data 510.
【0056】本実施形態では、グラフ表示は、図8に示
すように、横軸に時間をとり、縦軸にはタスクをタスク
識別番号ごとにエントリする。グラフ表示においては、
タスク識別番号を表示するのではなく、グラフの表示領
域の左端の時刻におけるそれぞれのタスク名を表示す
る。In the present embodiment, as shown in FIG. 8, in the graph display, time is taken on the horizontal axis, and tasks are entered for each task identification number on the vertical axis. In the graph display,
Instead of displaying the task identification numbers, the respective task names at the left end time of the graph display area are displayed.
【0057】まず、図7に示すステップ530で基準時
刻を取得した後、ステップ540でタスク識別番号を取
得し、ステップ550でタスク識別番号と基準時間とを
キーとして、タスク名対応表520を検索し、タスク名
を取得する。ステップ560で、前記ステップ550で
取得したタスク名を表示する。そして、ステップ54
0、ステップ550、ステップ560の処理を、全タス
クについて行う。First, after acquiring the reference time in step 530 shown in FIG. 7, the task identification number is acquired in step 540, and the task name correspondence table 520 is searched in step 550 using the task identification number and the reference time as keys. And get the task name. At step 560, the task name obtained at step 550 is displayed. And step 54
0, steps 550 and 560 are performed for all tasks.
【0058】図8において、グラフ580は、履歴デー
タをすべてグラフ表示したものであり、グラフ581は
グラフ580の領域Aを、グラフ582は領域Bを、グ
ラフ583は領域Cをそれぞれ表示したものである。In FIG. 8, a graph 580 shows all the history data in a graph. A graph 581 shows the area A of the graph 580, a graph 582 shows the area B, and a graph 583 shows the area C. is there.
【0059】グラフ581において、基準時刻t1は、
TASK#Aが削除される時刻t100の値より前なので、タ
スク名対応表520より、識別番号1、識別番号2のタ
スク名を、それぞれ“TASK#A”,“TASK#C”と表示す
る。グラフ582において、基準時刻t2では、タスク
名対応表520より、識別番号1のタスクは存在しない
ので、タスク名は存在しないことを示す“NON#EXISTENC
E”と表示する。識別番号2のタスクは“TASK#C”と表
示する。グラフ583において、基準時刻t3では、タ
スク名対応表520より、識別番号1のタスクTASK#Bが
生成された後なので、“TASK#B”と表示する。識別番号
2のタスクは“TASK#C”と表示する。In the graph 581, the reference time t1 is
Since TASK # A is before the value at time t100 when it is deleted, the task names of identification numbers 1 and 2 are displayed as “TASK # A” and “TASK # C” from the task name correspondence table 520, respectively. In the graph 582, at the reference time t2, from the task name correspondence table 520, since the task with the identification number 1 does not exist, “NON # EXISTENC” indicating that the task name does not exist.
The task with the identification number 2 is displayed as “TASK # C.” In the graph 583, after the task TASK # B with the identification number 1 is generated from the task name correspondence table 520 at the reference time t3. Therefore, it is displayed as “TASK # B.” The task with the identification number 2 is displayed as “TASK # C.”
【0060】このようにすれば、基準時刻とタスク識別
番号からタスク名を一意に求めることができるので、任
意の領域においてタスク名つきのグラフ表示が可能にな
り、プログラムの解析者は、番号によりタスクを識別す
る場合に比較して、容易にタスクを識別できる。In this way, the task name can be uniquely obtained from the reference time and the task identification number, so that a graph with the task name can be displayed in an arbitrary area. The task can be easily identified as compared with the case of identifying the task.
【0061】(実施の形態5)本発明にかかるさらに他
の実施形態について、以下に説明する。(Embodiment 5) Still another embodiment according to the present invention will be described below.
【0062】本実施形態では、プログラム実行の履歴デ
ータの書き込み処理中に、データ格納領域の空き領域が
なくなった場合に、プログラムを停止して、データ格納
領域中の履歴データを退避させ、退避後データ格納領域
を初期化してプログラムを再開させる。プログラムの停
止中もタイマーは稼動している。In the present embodiment, if there is no free space in the data storage area during the writing of the history data of the program execution, the program is stopped, the history data in the data storage area is saved, and Initialize the data storage area and restart the program. The timer is running while the program is stopped.
【0063】図9(a)は、プログラム停止区間を含む
タスク遷移を示すグラフである。図9において、タスク
2の実行中の時刻t3で実行を中断し、時刻t4で実行
を再開している。時刻t3からt4の間は、プログラム
が停止している区間で、タスク2の実行区間ではない。
しかし、履歴データ上ではあたかもタスク2の実行区間
のようになってしまい、タスク2の実行時間を計測する
場合など誤差を生じてしまう。FIG. 9A is a graph showing a task transition including a program stop section. In FIG. 9, the execution is interrupted at time t3 during the execution of the task 2 and resumed at time t4. Between the time t3 and the time t4, the program is stopped and not the task 2 execution section.
However, in the history data, it becomes as if it were an execution section of task 2, and an error occurs when the execution time of task 2 is measured.
【0064】そこで、実行を中断した時刻t3と実行を
再開した時刻t4をそれぞれ、中断履歴データ、再開履
歴データとして残す。そして、履歴データの解析におい
て、これらのデータからプログラム中断時間(t4−t
3)を計算し、再開履歴データ後のすべての履歴データ
時刻から、この中断時間を減算する。その結果をグラフ
化すると、図9(b)に示すように、プログラムの中断
区間が削除されたグラフになる。時刻t5と時刻t6で
発生した実行履歴データは、再開履歴データの時刻t4
より後の時刻なので、それぞれ中断時間を減算した、t
5’、t6’に変換される。Therefore, the time t3 at which the execution was interrupted and the time t4 at which the execution was resumed are left as interruption history data and resumption history data, respectively. Then, in the analysis of the history data, the program interruption time (t4-t
3) is calculated, and the interruption time is subtracted from all the history data times after the restart history data. When the result is graphed, as shown in FIG. 9B, a graph in which the interruption section of the program is deleted is obtained. The execution history data generated at time t5 and time t6 is the time t4 of the restart history data.
Since the time is later, t
5 ′ and t6 ′.
【0065】このようにすれば、ユーザが手動でデータ
を退避する手間が省け、さらにあたかも中断時間がなか
ったように解析結果を提示することが可能になり、デー
タ格納領域の容量が小さくても多くの履歴データを扱う
ことが可能になる。This eliminates the need for the user to manually evacuate the data, and allows the analysis result to be presented as if there were no interruption time. Many historical data can be handled.
【0066】(実施の形態6)本発明にかかるさらに他
の実施形態について、以下に説明する。(Embodiment 6) Still another embodiment according to the present invention will be described below.
【0067】本実施形態では、タスクの実行遷移履歴デ
ータに、その時点でのスタックサイズをあわせて記録
し、解析時に各タスクのスタックサイズの最大値を抽出
することにより、各タスクが使用するスタックサイズの
設定を最適化する。In this embodiment, the stack size at the time is recorded together with the execution transition history data of the task, and the maximum value of the stack size of each task is extracted at the time of analysis, so that the stack used by each task is extracted. Optimize size settings.
【0068】図10(a)に、タスク遷移グラフの一例
を示す。また、図10(b)に、タスク遷移グラフ作成
のもとになるタスク遷移履歴データの構成を示す。タス
ク遷移履歴データは、タスク遷移の時刻、タスク遷移元
のタスク識別番号(タスクID)、およびそのタスクが
使用するスタックサイズからなる。FIG. 10A shows an example of the task transition graph. FIG. 10B shows the configuration of task transition history data from which a task transition graph is created. The task transition history data includes a task transition time, a task transition source task identification number (task ID), and a stack size used by the task.
【0069】各タスクごとに最大スタックサイズを抽出
した例を、図10(c)に示す。図10(c)の例で
は、タスクIDが1のタスクについては、データは時刻
t1とt4に存在し、それぞれの時刻の使用スタックサ
イズが100と250なので、最大スタックサイズは2
50となる。タスクIDが2のタスクと3のタスクにお
いては、この例ではデータが1つしかないので、それぞ
れの使用スタックサイズの値である80,230が、そ
のまま最大値として抽出される。FIG. 10C shows an example in which the maximum stack size is extracted for each task. In the example of FIG. 10C, for the task with the task ID of 1, data exists at times t1 and t4, and the used stack sizes at the respective times are 100 and 250, so the maximum stack size is 2
It becomes 50. In the case of the task with the task ID of 2 and the task with the task ID of 3, there is only one data in this example, and the values of the used stack sizes 80 and 230 are extracted as the maximum values as they are.
【0070】このように、タスク遷移履歴データにその
タスクの使用スタックサイズを加えることにより、タス
クが使用するスタックサイズの計測に使用することがで
き、タスクの使用するスタックサイズの定義の最適化が
可能になる。なお、本実施形態では、タスク履歴データ
がタスク遷移元とそのスタックサイズを含む例を示した
が、タスク遷移先とそのスタックサイズを含む場合で
も、同様の効果が得られる。As described above, by adding the used stack size of the task to the task transition history data, it can be used for measuring the stack size used by the task, and the definition of the stack size used by the task can be optimized. Will be possible. In the present embodiment, an example has been described in which the task history data includes the task transition source and its stack size. However, the same effect can be obtained when the task history data includes the task transition destination and its stack size.
【0071】[0071]
【発明の効果】以上のように、本発明によれば、有効な
履歴データを取得し、その解析処理を適切に行うことに
より、プログラム開発の効率を向上させることができる
プログラム実行履歴解析方法を提供することができる。As described above, according to the present invention, there is provided a program execution history analysis method capable of improving the efficiency of program development by acquiring effective history data and appropriately performing the analysis process. Can be provided.
【図1】 本発明の実施の形態1にかかるプログラム実
行履歴解析方法の手順を示すフローチャートFIG. 1 is a flowchart showing a procedure of a program execution history analysis method according to a first embodiment of the present invention;
【図2】 実施の形態1において、データ格納領域へ書
き込まれた履歴データの様子を示す説明図FIG. 2 is an explanatory diagram showing a state of history data written to a data storage area in the first embodiment.
【図3】 本発明の実施の形態2にかかるプログラム実
行履歴解析方法で用いる履歴データの一例を示す説明図FIG. 3 is an explanatory diagram showing an example of history data used in a program execution history analysis method according to a second embodiment of the present invention;
【図4】 図3に示した履歴データの解析処理結果とし
て得られる、プログラムの実行履歴を表示するグラフ4 is a graph showing a program execution history obtained as a result of analyzing the history data shown in FIG. 3;
【図5】 本発明の実施の形態3にかかるプログラム実
行履歴解析方法により、関数実行データの詳細情報と共
に表示される、プログラム実行履歴のグラフFIG. 5 is a graph of a program execution history displayed together with detailed information of function execution data by the program execution history analysis method according to the third embodiment of the present invention;
【図6】 関数実行データの詳細情報を取得するための
手順を示すフローチャートFIG. 6 is a flowchart showing a procedure for acquiring detailed information of function execution data.
【図7】 本発明の実施の形態4にかかるプログラム実
行履歴解析方法により、タスク名を取得する手順と、タ
スク名対応表との関係を示す説明図FIG. 7 is an explanatory diagram showing a relationship between a procedure for acquiring a task name and a task name correspondence table by the program execution history analysis method according to the fourth embodiment of the present invention;
【図8】 グラフ表示画面における、取得されたタスク
名の表示例を示す説明図FIG. 8 is an explanatory diagram showing a display example of an acquired task name on a graph display screen.
【図9】 (a)は、プログラム停止区間を含むタスク
遷移の一例を示すグラフ、(b)は、本発明の実施の形
態5にかかるプログラム実行履歴解析方法により得られ
る、プログラムの中断区間が削除されたグラフFIG. 9A is a graph showing an example of a task transition including a program suspension section, and FIG. 9B is a graph showing a program interruption section obtained by the program execution history analysis method according to the fifth embodiment of the present invention. Deleted graph
【図10】 (a)は、タスク遷移の一例を示すグラ
フ、(b)は、タスク遷移グラフ作成のもとになるタス
ク遷移履歴データの構成例を示す説明図、(c)は、タ
スク遷移履歴データからの最大スタックサイズを抽出例
を示す説明図10A is a graph showing an example of a task transition, FIG. 10B is an explanatory diagram showing an example of the configuration of task transition history data from which a task transition graph is created, and FIG. Explanatory diagram showing an example of extracting the maximum stack size from history data
440 データ格納領域 450 関数実行データ 460 ソースコード情報対応表 500 タスク生成履歴データ 510 タスク削除履歴データ 520 タスク名対応表の例 580 全履歴データのグラフ表示 581 領域Aのグラフ表示 582 領域Bのグラフ表示 583 領域Cのグラフ表示 440 Data storage area 450 Function execution data 460 Source code information correspondence table 500 Task generation history data 510 Task deletion history data 520 Example of task name correspondence table 580 Graph display of all history data 581 Graph display of area A 582 Graph display of area B 583 Graph display of area C
Claims (11)
納領域に書き込む書き込み処理と、前記データ格納領域
から前記履歴データを読み出して解析する解析処理とを
含むプログラム実行履歴解析方法において、 前記書き込み処理にて、各履歴データを、前回の履歴デ
ータを書き込んだアドレス領域よりも前方のアドレス領
域へ書き込み、書き込むべき履歴データのデータサイズ
に対応する空き領域がないと判断された場合は、前記デ
ータ格納領域の最終アドレスへ戻って履歴データを上書
きし、 前記解析処理にて、前記書き込み処理において最後に書
き込まれた履歴データから、前記データ格納領域の後方
アドレスへ向かって、格納されている履歴データを順次
読み出し、前記データ格納領域の最終アドレスまで履歴
データを読み出してもまだ読み出すべきデータがある場
合は、前記データ格納領域の先頭アドレスへジャンプ
し、前記最後に書き込まれた履歴データより前方アドレ
スに格納されている履歴データを順次読み出すことを特
徴とするプログラム実行履歴解析方法。1. A program execution history analysis method comprising: a writing process of writing program execution history data to a data storage area; and an analysis process of reading and analyzing the history data from the data storage area. If each history data is written to an address area ahead of the address area where the previous history data was written, and it is determined that there is no free area corresponding to the data size of the history data to be written, Return to the last address and overwrite the history data. In the analysis process, sequentially read the stored history data from the last written history data in the write process toward the rear address of the data storage area. The history data is read up to the last address of the data storage area. If there is data to be read, the program jumps to a start address of the data storage area, and sequentially reads history data stored at an address ahead of the last written history data. Method.
き履歴データのデータサイズよりも空き領域の容量が小
さいと判断された場合、当該履歴データのうち、前記空
き領域に書き込める部分を当該空き領域へ書き込み、残
りの部分を前記データ格納領域の最終アドレスから前方
のアドレス領域へ書き込む、請求項1に記載のプログラ
ム実行履歴解析方法。2. When the capacity of the free area is determined to be smaller than the data size of the history data to be written in the writing process, a portion of the history data that can be written to the free area is written to the free area; 2. The program execution history analysis method according to claim 1, wherein the remaining portion is written to an address area ahead of the last address of said data storage area.
納領域に書き込む書き込み処理と、前記データ格納領域
から前記履歴データを読み出して解析する解析処理とを
含むプログラム実行履歴解析方法において、 前記書き込み処理にて、タスクの実行遷移が発生したと
き、当該実行遷移が発生した時刻と、実行遷移元のタス
ク識別子とを含むデータを、前記実行履歴データとして
前記データ格納領域に書き込むことを特徴とするプログ
ラム実行解析方法。3. A program execution history analysis method, comprising: a write process of writing program execution history data to a data storage area; and an analysis process of reading and analyzing the history data from the data storage area. Writing a data including a time at which the execution transition occurs and a task identifier of the execution transition source to the data storage area as the execution history data when the execution transition of the task occurs. Method.
ラム停止時に、停止直前に実行されていたタスクのタス
ク識別子を含むデータを、前記実行履歴データとして前
記データ格納領域に書き込む、請求項3に記載のプログ
ラム実行解析方法。4. The writing process according to claim 3, wherein, when the analysis target program is stopped, data including a task identifier of a task executed immediately before the stop is written to the data storage area as the execution history data. Analysis method of program execution.
納領域に書き込む書き込み処理と、前記データ格納領域
から前記履歴データを読み出して解析する解析処理とを
含むプログラム実行履歴解析方法において、 前記書き込み処理にて、前記プログラムの実行中に関数
が実行されるごとに、当該関数実行が発生した時刻、関
数名、および関数戻りアドレスを含むデータを、前記履
歴データとして前記データ格納領域に書き込み、 前記解析処理にて、前記関数戻りアドレスとソースコー
ド情報との対応を示すソースコード情報対応表から、前
記データ格納領域から読み出した履歴データに含まれる
関数戻りアドレスに対応するソースコード情報を取得
し、取得したソースコード情報を表示することを特徴と
するプログラム実行履歴解析方法。5. A program execution history analysis method comprising: a write process of writing program execution history data to a data storage area; and an analysis process of reading and analyzing the history data from the data storage area. Each time a function is executed during execution of the program, data including a time at which the function is executed, a function name, and a function return address are written to the data storage area as the history data, and the analysis processing is performed. Source code information corresponding to the function return address included in the history data read from the data storage area from the source code information correspondence table indicating the correspondence between the function return address and the source code information. A program execution history analysis method characterized by displaying code information.
ログラムのコンパイル時にコンパイラによって作成され
る、請求項5に記載のプログラム実行履歴解析方法。6. The program execution history analysis method according to claim 5, wherein the source code information correspondence table is created by a compiler when compiling the program.
の際に書き込まれたスタックから取得する、請求項5に
記載のプログラム実行履歴解析方法。7. The program execution history analysis method according to claim 5, wherein the function return address is obtained from a stack written at the time of calling the function.
納領域に書き込む書き込み処理と、前記データ格納領域
から前記履歴データを読み出して解析する解析処理とを
含むプログラム実行履歴解析方法において、 前記書き込み処理にて、(a)タスクが生成されるごと
に、当該タスクが生成された時刻、タスク識別子、およ
びタスク名を含むタスク生成データを、前記履歴データ
として前記データ格納領域に書き込み、(b)タスクが
削除されるごとに、当該タスクが削除された時刻、タス
ク識別子、およびタスク名を含むタスク削除データを、
前記履歴データとして前記データ格納領域に書き込み、
(c)タスク遷移が発生するごとに、当該タスク遷移が
発生した時刻およびタスク識別子を含むタスク遷移デー
タを、前記履歴データとして前記データ格納領域に書き
込み、 前記解析処理にて、前記データ格納領域から読み出した
履歴データのうち、前記タスク生成データおよび前記タ
スク削除データから、タスク識別子、タスク生成時刻、
タスク削除時刻、およびタスク名を含むタスク名対応表
を作成し、前記データ格納領域から読み出した履歴デー
タのうち、前記タスク遷移データからタスクの遷移グラ
フを作成し、前記遷移グラフ上に、基準時刻およびタス
ク識別子に基づき前記タスク名対応表から取得したタス
ク名を表示することを特徴とするプログラム実行履歴解
析方法。8. A program execution history analysis method comprising: a write process of writing program execution history data to a data storage area; and an analysis process of reading and analyzing the history data from the data storage area. (A) Every time a task is generated, task generation data including the time at which the task was generated, a task identifier, and a task name are written to the data storage area as the history data, and (b) the task is deleted. Every time the task is deleted, the task deletion data including the time at which the task was deleted, the task identifier, and the task name
Writing to the data storage area as the history data,
(C) Every time a task transition occurs, task transition data including the time at which the task transition occurred and a task identifier are written as the history data to the data storage area. Among the read history data, a task identifier, a task creation time,
A task name correspondence table including a task deletion time and a task name is created, and among the history data read from the data storage area, a task transition graph is created from the task transition data, and a reference time is set on the transition graph. And displaying a task name acquired from the task name correspondence table based on the task identifier and the task identifier.
納領域に書き込む書き込み処理と、前記データ格納領域
から前記履歴データを読み出して解析する解析処理とを
含むプログラム実行履歴解析方法において、 前記書き込み処理にて、(a)プログラム実行を中断さ
せた時刻のデータを含む中断データを、前記履歴データ
として前記データ格納領域に記録し、(b)プログラム
実行を再開させた時刻のデータを含む再開データを、前
記履歴データとして前記データ格納領域に記録し、 前記解析処理にて、前記中断データおよび前記再開デー
タに基づき、プログラム実行の中断時間を求め、前記再
開データより後の時刻にかかる履歴データの時刻から、
前記中断時間を減算することを特徴とするプログラム実
行履歴解析方法。9. A program execution history analysis method comprising: a write process of writing program execution history data to a data storage area; and an analysis process of reading and analyzing the history data from the data storage area. (A) recording the interruption data including the data of the time when the program execution was suspended in the data storage area as the history data, and (b) resuming the data including the data of the time when the program execution was resumed. Recorded in the data storage area as history data, in the analysis process, based on the interruption data and the resumption data, determine the interruption time of the program execution, from the time of the history data that takes time after the resumption data,
A program execution history analysis method, wherein the interruption time is subtracted.
たとき、プログラム実行を中断させ、 プログラム実行中断後に、前記データ格納領域に格納さ
れているすべての履歴データを待避領域へ待避させ、 前記履歴データの退避後に、プログラム実行を再開さ
せ、 前記解析処理にて、 前記待避領域から前記プログラム実行中断前の履歴デー
タを読み出し、前記データ格納領域から前記プログラム
実行再開後の履歴データを読み出す、請求項9に記載の
プログラム実行履歴解析方法。10. In the writing process, when it is determined that there is not enough free space in the data storage area, the program execution is interrupted, and after the program execution is interrupted, all the history data stored in the data storage area are interrupted. In the save area, resume the program execution after saving the history data, read the history data before the interruption of the program execution from the save area in the analysis processing, and resume the program execution from the data storage area. The program execution history analysis method according to claim 9, wherein the subsequent history data is read.
格納領域に書き込む書き込み処理と、前記データ格納領
域から前記履歴データを読み出して解析する解析処理と
を含むプログラム実行履歴解析方法において、 前記書き込み処理にて、タスク遷移が発生するごとに、
遷移元タスクまたは遷移先タスクのタスク識別子と、前
記タスクが使用しているスタックサイズとを含むデータ
を、前記履歴データとして前記データ格納領域に書き込
み、 前記解析処理にて、前記データ格納領域から読み出した
すべての履歴データから、前記タスク識別子ごとのスタ
ックサイズ最大値を算出することを特徴とするプログラ
ム実行履歴解析方法。11. A program execution history analysis method, comprising: a write process of writing program execution history data to a data storage area; and an analysis process of reading and analyzing the history data from the data storage area. , Every time a task transition occurs,
Data including a task identifier of a transition source task or a transition destination task and a stack size used by the task is written as the history data to the data storage area, and is read from the data storage area in the analysis processing. A program execution history analysis method, wherein a maximum stack size value for each task identifier is calculated from all the history data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001123301A JP2002318712A (en) | 2001-04-20 | 2001-04-20 | Program execution history analysis method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001123301A JP2002318712A (en) | 2001-04-20 | 2001-04-20 | Program execution history analysis method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2002318712A true JP2002318712A (en) | 2002-10-31 |
Family
ID=18972881
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2001123301A Pending JP2002318712A (en) | 2001-04-20 | 2001-04-20 | Program execution history analysis method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2002318712A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007086150A1 (en) * | 2006-01-24 | 2007-08-02 | Matsushita Electric Industrial Co., Ltd. | Memory destruction detection method and device |
JP2011138494A (en) * | 2009-12-23 | 2011-07-14 | Intel Corp | Relational modeling for performance analysis of multi-core processor using virtual task |
CN113626244A (en) * | 2021-08-26 | 2021-11-09 | 广州市百果园网络科技有限公司 | ANR abnormal data collection method, ANR abnormal data display method, ANR abnormal data collection device, ANR abnormal data display device and ANR abnormal data display equipment |
-
2001
- 2001-04-20 JP JP2001123301A patent/JP2002318712A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007086150A1 (en) * | 2006-01-24 | 2007-08-02 | Matsushita Electric Industrial Co., Ltd. | Memory destruction detection method and device |
JP2011138494A (en) * | 2009-12-23 | 2011-07-14 | Intel Corp | Relational modeling for performance analysis of multi-core processor using virtual task |
CN113626244A (en) * | 2021-08-26 | 2021-11-09 | 广州市百果园网络科技有限公司 | ANR abnormal data collection method, ANR abnormal data display method, ANR abnormal data collection device, ANR abnormal data display device and ANR abnormal data display equipment |
CN113626244B (en) * | 2021-08-26 | 2024-05-28 | 广州市百果园网络科技有限公司 | ANR abnormal data collection method, display method, device and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7627857B2 (en) | System and method for visualizing exception generation | |
US7251808B2 (en) | Graphical debugger with loadmap display manager and custom record display manager displaying user selected customized records from bound program objects | |
JP4978432B2 (en) | Business specification understanding support system and method | |
US7086033B2 (en) | Software debugger having a monitor for monitoring conditional statements within a software program | |
JPH10275093A (en) | Program test support device | |
JP2002318712A (en) | Program execution history analysis method | |
US20170277623A1 (en) | Method of ascertaining primary cause of memory consumption in program, and computer system and computer program for the same | |
JP2005339204A (en) | Information processor, and program testing method | |
CN109213526B (en) | Method and apparatus for determining processor operation | |
JP2001331465A (en) | Multi-process display method and apparatus, and recording medium storing display program | |
JPH11224186A (en) | Software analysis device and software analysis method | |
US20060266250A1 (en) | Methods and apparatus enabling diagram customization retention | |
JP2008027283A (en) | Labor recording apparatus, labor record program, and recording medium with stored labor record program and labor recording method | |
JP2002342113A (en) | Program execution status display method, its execution device, and its processing program | |
JP3645452B2 (en) | Program debugging apparatus and recording medium recording program | |
JP3011115B2 (en) | Debug system | |
JP2003208333A (en) | Trace information retrieval apparatus and method | |
JPH07160531A (en) | Program execution route display device | |
JP4802130B2 (en) | Drawing creation program, drawing creation apparatus, and drawing creation method | |
JPH05334135A (en) | Error information display system for abnormal end of program | |
JP3079825B2 (en) | Electronic computer equipment | |
JP2007164532A (en) | Task display device, task display method, and task display program | |
JP4792950B2 (en) | Data management device | |
JP2002073371A (en) | Program debugging method | |
WO2009093220A2 (en) | Sal debugging |