JP4125054B2 - Log acquisition method - Google Patents

Log acquisition method Download PDF

Info

Publication number
JP4125054B2
JP4125054B2 JP2002191128A JP2002191128A JP4125054B2 JP 4125054 B2 JP4125054 B2 JP 4125054B2 JP 2002191128 A JP2002191128 A JP 2002191128A JP 2002191128 A JP2002191128 A JP 2002191128A JP 4125054 B2 JP4125054 B2 JP 4125054B2
Authority
JP
Japan
Prior art keywords
log
log acquisition
function
program
pointer parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2002191128A
Other languages
Japanese (ja)
Other versions
JP2004038312A (en
JP2004038312A5 (en
Inventor
誠 三原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2002191128A priority Critical patent/JP4125054B2/en
Priority to US10/600,843 priority patent/US7086034B2/en
Priority to EP03254035A priority patent/EP1376366A3/en
Priority to CNB031493319A priority patent/CN1251062C/en
Publication of JP2004038312A publication Critical patent/JP2004038312A/en
Publication of JP2004038312A5 publication Critical patent/JP2004038312A5/ja
Application granted granted Critical
Publication of JP4125054B2 publication Critical patent/JP4125054B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、複数にモジュール分けされたソフトウェアの処理ログを取得するための技術に関するものである。
【0002】
【従来の技術】
従来より、再現率の低いソフトウェアの障害に対しては、ソフトウェアの処理ログを取得し、当該処理ログを解析することによって、障害の原因をつきとめ、その対策を講じてきた。
【0003】
【発明が解決しようとする課題】
しかし、上記従来の処理ログの取得には以下のような問題点がある。
(1)ユーザの動作環境でもログを取得しつづけるためには、ソフトウェアのモジュール自体に手を加え、処理ログ取得ルーチンを追加しなければならず、処理ログ取得のための作業負荷が大きかった。
(2)処理ログ取得はモジュール毎に行うため、生成されたログはモジュール単位のものとなってしまい、ソフトウェア全体の処理を、完全に時間順のログとして取得するのが困難である。このため、全体の処理ログとしての見通しが悪く、ログを解析して障害の原因を発見するまでのプロセスに工数がかかっていた。
【0004】
本発明は、上記課題を鑑みてなされたものであり、複数にモジュール分けされたソフトウェアの処理ログを容易に取得でき、かつ、ソフトウェアの障害の原因の解析のための工数を削減することが可能なログ取得方法、ならびに該方法をコンピュータによって実現させるためのプログラム、および該プログラムを格納した記憶媒体を提供することを目的とする。
【0005】
【課題を解決するための手段】
上記の目的を達成するために本発明に係るログ取得方法は以下のような構成を備える。即ち、
関数を記憶したダイナミックリンクライブラリと、該関数のアドレスを記憶したインポート関数アドレステーブルと、該ダイナミックリンクライブラリ内の関数を呼び出して実行する対象プログラムと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記ダイナミックリンクライブラリ内の各関数に対応するログ取得のための関数を当該ダイナミックリンクライブラリ内にロードし、前記インポート関数アドレステーブル上に記憶された各関数のアドレスを、対応する前記ログ取得のための関数のアドレスに書き換える工程と、
前記呼び出し手段が、前記対象プログラムが呼び出そうとする呼び出し対象の関数に対する前記インポート関数アドレステーブル上の書き換え後の前記対応するログ取得のための関数のアドレスに基づいて、前記ログ取得のための関数を呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、前記プログラム記憶手段を指すポインタ・パラメータに対して所定の設定が存在するか否かを判断する工程と、
前記ログ取得手段が、前記ポインタ・パラメータに対して所定の設定が存在する場合、該ポインタ・パラメータの定義方法に基づいて該ポインタ・パラメータの指す前記プログラム記憶手段の内容をログとして前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のための関数に対応する前記呼び出し対象の関数を呼び出して、該呼び出し対象の関数を前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、前記プログラム記憶手段を指すポインタ・パラメータに対して所定の設定が存在するか否かを判断する工程と、
前記ログ取得手段が、前記ポインタ・パラメータに対して所定の設定が存在する場合、該ポインタ・パラメータの定義方法に基づいて該ポインタ・パラメータの指す前記プログラム記憶手段の内容をログとして前記ディスク装置に記録する工程と
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程とを備える。
【0006】
【発明の実施の形態】
【第1の実施形態】
本実施形態は、あるモジュールから別のモジュール内に存在する関数の呼び出しが行われる際の仕組みである、メモリに保持されたインポート関数アドレス、または仮想関数アドレステーブル(Virtual Address Table)を利用して、モジュール間の関数呼び出しをフックしてログに記録することで、ソフトウェアのモジュール自体に手を加えることなく、ソフトウエア全体の処理を、時間順のログとして取得することを可能にするものである。以下に具体的に説明する。
【0007】
<システム構成>
図1は、本発明の各実施形態にかかるログ取得方法を実現するコンピュータ(ソフトウェア評価システム)の構成をあらわす図である。説明を簡略化するために、本実施形態では、本ソフトウェア評価システムが1台のPC内部に構築されるものとするが、本発明のログ取得方法の特徴は1台のPC内部に構築されるか、あるいは複数のPCにネットワークシステムとして構築されるかによらず有効である。
【0008】
本ソフトウェア評価システムを搭載するコンピュータには、CPU1、チップセット2、RAM3、ハードディスクコントローラ4、ディスプレイコントローラ5、ハードディスクドライブ6、CD−ROMドライブ7、ディスプレイ8が搭載されている。また、CPUとチップセットを繋ぐ信号線11、チップセット2とRAM3とを繋ぐ信号線12、チップセット2と各種周辺機器とを繋ぐ周辺機器バス13、ハードディスクコントローラ4とハードディスクドライブ6とを繋ぐ信号線14、ハードディスクコントローラ4とCD−ROMドライブ7とを繋ぐ信号線15、ディスプレイコントローラ5とディスプレイ8とを繋ぐ信号線16が搭載されている。
【0009】
<関数処理に対する処理ログ取得>
本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムを説明するために、まず図2によって、複数のモジュールに分かれたソフトウェアが、通常の状態でどのようにメモリにロードされるかを説明する。
【0010】
通常、複数のモジュールに分かれたソフトウェアは、全体の制御を行う実行ファイルEXE(23)と、モジュールとして存在しEXEの補完的な役割を担うダイナミックリンクライブラリDLL(27)とに分かれており、メモリにはEXEとDLLの両方がロードされる。EXEはコードセグメント(28)とデータセグメント(29)、そしてインポート関数アドレステーブル(22)から成っている。更に、インポート関数アドレステーブルは、関数の所属するDLLによって分かれており(21, 24)、DLLごとにそれぞれの関数がロードされたアドレスが書かれている(30〜35)。DLLの関数の実体は、DLLごとに分かれて(25, 26)ロードされ、それぞれの関数は該当するDLLの一部としてロードされる(36〜41)。この図では、1本のEXEがA.DLL及びB.DLLの2つのダイナミックリンクライブラリ内の関数を使用している例を示しており、実際に使用される関数はFunc AA, Func AB, Func AC, Func BA, Func BB, Func BCの6個となっている。
【0011】
EXEのコードセグメント内にあるコードが関数Func AAを呼び出す場合には、まずインポート関数アドレステーブル内に書かれたFunc AAのアドレス(30)が読み込まれる。ここには実際にはA.DLLの一部として読み込まれたFunc AAコード(36)のアドレスが書かれており、そのアドレスをコールすることによって、EXEのコードはA.DLLのFunc AAを呼び出すことができる。
【0012】
図3は、本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのメモリ構成をあらわす図であり、図2とは、ログ取得用のコードに対してIAT Patch(Import Address Table Patch)という手法を用いて、関数呼び出しをリダイレクトしているという点で異なっている。
【0013】
ログ取得が開始されると、メモリ内にはIAT Patch用のDLLであるC.DLL(58)がロードされる。C.DLLはインポート関数アドレステーブル(52)内に書かれた関数のアドレスを、C.DLL内のログ取得コードであるFunc CAA, Func CAB, Func CAC, Func CBA,Func CBB, Func CBCのアドレスに書き換える(61〜66)。C.DLL内のFunc CAA, Func CAB, Func CAC, Func CBA, Func CBB, Func CBCのコード(73〜78)は、ログを記録すると共に、元々の関数呼び出しを受けるべくメモリにロードされている、該当する関数であるFunc AA, Func AB, Func AC, Func BA, Func BB, Func BC(67〜72)を呼び出す。
【0014】
図4Aは、図3におけるIAT Patchの処理をあらわす図、図4Bはログ取得処理の流れを示すフローチャートである。説明を簡略化するために、この図ではEXEがA.DLL内のFunc AAを呼び出す際に、IAT Patchによるログ取得コードがどのように動作するかの例をあらわしている。
【0015】
EXE(図4Aの91)がFunc AAをコールすると(図4Aの94)、C.DLL内にあるログ取得コードがDLL名/関数名をメモリに保存し(図4BのステップS402)、呼び出し時刻をメモリに保存し、呼び出し時のパラメータをメモリに保存し、呼び出し時のポインタパラメータの指すメモリ内容を、別メモリに保存する(図4Aの95、図4BのステップS403)。その後C.DLLは本来呼び出されるはずであった、A.DLL(図4Aの93)内のFunc AAをコールする(図4Aの96、図4BのステップS404)。A.DLLのFunc AA処理(図4Aの97)が終了し、C.DLLに制御がリターンすると(図4Aの98)、C.DLLはリターン時の時刻をメモリに保存し、戻り値をメモリに保存し、リターン時にポインタパラメータが指すメモリ内容を、別メモリに保存する(図4Aの99)。その後、C.DLLは保存したログ情報をファイルに書き込み(図4Aの100、図4BのステップS405)、あたかもA.DLLのFunc AAが通常通りに終了したかのように、EXEにリターンする(101)。
【0016】
図5は、本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの内部構成をあらわす図である。通常は実行形式のEXE(113)が、DLL−1(116)やDLL−2(117)内の関数を呼び出すが、ここではAPIトレーサと呼ばれるログ取得コードを埋め込み(114)、処理ログを生成している(115)。APIトレーサは、DLL−1やDLL−2の関数定義を記述したファイル(111)と、どのDLLのどの関数のインポート関数テーブルを書き換えてログを取得するかの設定シナリオ(トレースシナリオ112)を元に動作する。
【0017】
<メソッド処理に対する処理ログ取得>
次に、本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、実行ファイルEXE(118)がCOM(Component Object Model)サーバでエクスポートされているインターフェースのインスタンス作成時に、どのようにメモリにロードされるかを説明するために、まず、図6によって、通常の状態でどのようにメモリにロードされるかを説明する。
【0018】
通常、インターフェースのインスタンス作成を行うと、COMサーバ内で、要求されたインターフェース(121, 122)と、そのメソッド(:オブジェクト指向プログラミングにおいて、オブジェクトの実行する手続きを記述したプログラム、130〜135)が作成され、それらは、メモリ上に両方がロードされる。ここで、virtual address table(仮想アドレステーブル)は作成された各インターフェース毎に作られ(118, 120)、作成要求を行ったEXEに渡される。このvirtual addres tableには各メソッドの作成されたアドレスが書かれている(124〜129)。EXEはこれら情報を利用し、各インターフェースに対して呼び出しを行う。この図では、1本のEXEがInterface A及びInterface Bの2つのインターフェースのインスタンスを作成しており、そのインターフェース内部のメソッドを使用している例を示しており、実際に使用されているメソッドは、Method AA, Method AB, Method AC, Method BA, Method BB, Method BCとなっている。
【0019】
EXEのコードが関数Method AAを呼び出す場合には、まずvirtual address table内に書かれたMethod AAのアドレス(124)が読み込まれる。ここには実際にはCOMサーバのInterface Aの一部として作成されたMethod AAコード(130)のアドレスが書かれており、そのアドレスをコールすることによって、EXEのコードはInterface AのMethod AAを呼び出すことができる。
【0020】
図7は、本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのメモリ構成をあらわす図であり、図6とは、ログ取得用のコードに対してVTable Patch(virtual address table Patch)という手法を用いて、メソッド呼び出しをリダイレクトしているという点で異なっている。
【0021】
ログ取得が開始されると、メモリ内にはVTable Patch用のDLL(143)がロードされる。このDLLはvirtual address table(136, 138)内に書かれたメソッドのアドレスを、DLL内のログ取得コードであるMethod A'A, Method A'B, MethodA'C, Method B'A, Method B'B, Method B'Cのアドレスに書き換える(145〜150)。DLL内のMethod A'A,Method A'B, Method A'C, Method B'A, Method B'B, Method B'Cのコード(157〜162)は、ログを記録すると共に、元々のメソッド呼び出しを受けるべくメモリにロードされている、該当するメソッドであるMethod AA, Method AB, Method AC, Method BA, Method BB, MethodBC(157〜162)を呼び出す。
【0022】
図8Aは、図7におけるVTable Patchの処理をあらわす図、図8Bはログ取得処理の流れを示すフローチャートである。説明を簡略化するために、この図ではEXEがCOMサーバ内のInterface AのMethodAAを呼び出す際に、VTable Patchによるログ取得コードがどのように動作するかの例をあらわしている。
【0023】
EXE(図8Aの163)がMethod AAをコールすると(図8Aの166)、DLL内にあるログ取得コードがモジュール名/インターフェース名/メソッド名をメモリに保存し(図8BのステップS802)、呼び出し時刻をメモリに保存し、呼び出し時のパラメータをメモリに保存し、呼び出し時のポインタパラメータの指すメモリ内容を、別メモリに保存する(図8Aの167、図8BのステップS803))。その後DLLは本来呼び出されるはずであった、COMサーバ(図8Aの165)内のMethod AAをコールする(図8Aの168、図8BのステップS804))。COMサーバのMethod AA処理(図8Aの169)が終了し、DLLに制御がリターンすると(図8Aの170)、DLLはリターン時の時刻をメモリに保存し、戻り値をメモリに保存し、リターン時にポインタパラメータが指すメモリ内容を、別メモリに保存する(図8Aの171)。その後、DLLは保存したログ情報をファイルに書き込み(図8Aの172、図8BのステップS805)、あたかもCOMサーバのMethod AAが通常通りに終了したかのように、EXEにリターンする(図8Aの173)。
【0024】
図9は、本発明の第1の実施形態にかかるソフトウェア評価システムの内部構成をあらわす図である。通常は実行形式のEXE(176)が、COMサーバ1(179)やCOMサーバ2(180)内のメソッドを呼び出すが、ここではAPIトレーサと呼ばれるログ取得コードを埋め込み(177)、処理ログを生成している(178)。APIトレーサは、COMサーバ1(179)やCOMサーバ2の関数定義を記述したファイル(174)と、どのCOMサーバのどのインターフェースのどのメソッドのvirtual address tableを書き換えてログを取得するかの設定シナリオ(175)を元に動作する。
【0025】
以上の説明から明らかなように、本実施形態にかかるログ取得方法によれば、複数にモジュール分けされたソフトウエアの処理ログの取得において、モジュール自体に変更を加えることなく、モジュール内に用意された関数/メソッドの呼び出しをログとして記録することが可能となり、処理ログ取得のための作業負荷を低減することが可能となる。また、生成されるログは、時間順のログとして取得することができ、ログの解析が容易となるため、ソフトウェアの障害の原因の解析のための工数を削減することが可能となる。
【0026】
【第2の実施形態】
本実施形態では、通常では、取得しきれないポインタ・パラメータのデータをバイナリとしてログ取得する場合について述べる。
【0027】
図10は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義の一例であり、一般的に広く用いられているIDLにより、記述されている。本実施形態にかかるログ取得方法を実現するソフトウェア評価システムに於いては、このIDLをトークン化したタイプライブラリファイルを関数定義ファイルとして使用する。
【0028】
図11は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて、ポインタ・パラメータに対してバイナリ取得を指定することで、ポインタ・パラメータのデータの実体をログとして取得する為のIDLによる記述である。
【0029】
FuncBinidId関数の定義に於いて、long* lplParamに対してcustum(PAT_PARAM_ATTR_ID, "binid_is()")と宣言している(201)。ここで、PAT_PARAM_ATTR_ID(200)はIDLの中で本ソフトウェア評価システムが利用するための識別子である。ここで、"binid_is()"と定義することにより、このパラメータが指すポインタからパラメータのデータ型サイズ(ここではlong型)分のデータを、バイナリデータとしてログに保存する。
【0030】
FuncSizeIs関数の定義に於いて、int* lplParamに対してcustum(PAT_PARAM_ATTR_ID, "size_is(dwCount)")と宣言している(202)。ここで、"size_is(dwCount)"と定義することにより、このパラメータは第一パラメータであるdwCount個分のデータが有ると扱われる。そして、このパラメータが指すポインタから、(dwCount×パラメータのデータ型サイズ(ここでは、int型))分のデータをバイナリデータとしてログに保存する。
【0031】
FuncLengthIs関数の定義に於いて、char* lpszParamに対してcustum(PAT_PARAM_ATTR_ID, "length_is(dwLength)")と宣言している(203)。ここで、"length_is(dwLength)"と定義することにより、このパラメータは第一パラメータであるdwLength個分のデータが有ると扱われる。そして、このパラメータが指すポインタから、(dwLength×パラメータのデータ型サイズ(ここではchar型))分のデータをバイナリデータとしてログに保存する。
【0032】
FuncBytesIs関数の定義に於いて、void* lpParamに対してcustum(PAT_PARAM_ATTR_ID, "bytes_is(dwSize)")と宣言している(204)。ここで、"bytes_is(dwSize)"と定義することにより、このパラメータは第一パラメータであるdwSizesバイト分のデータが有ると扱われる。そして、このパラメータが指すポインタから、dwSizeバイト分のデータをバイナリデータとしてログに保存する。
【0033】
FuncBytesIs1関数の定義に於いて、void* lpParamに対してcustum(PAT_PARAM_ATTR_ID, "bytes_is(12)")と宣言している(205)。ここで、"bytes_is(12)"と定義することにより、このパラメータは指定された12バイト分のデータが有ると扱われる。そして、このパラメータが指すポインタから、12バイト分のデータをバイナリデータとしてログに保存する。
【0034】
図12は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図11の様に関数定義されている時のログを取得する場合の流れを示す図である。
【0035】
処理が開始されると(ステップS1)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をHDDに保存する(ステップS2)。次にログ取得コードは、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS3)。そして、関数定義にバイナリ取得の設定が存在するか判別し(ステップS4)、存在する場合には、保存するメモリサイズを各定義方法(binid_is, size_is, length_is, bytes_is)毎に計算し(ステップS5)、ポインタ・パラメータの指すメモリの内容を算出したサイズ分HDDに保存する(ステップS6)。続いて、元の関数を呼び出す(ステップS7)。関数からリターンすると、ログ取得コードはリターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS8)。そして、関数定義にバイナリ取得の設定が存在するか判別し(ステップS9)、存在する場合には、保存するメモリサイズを各定義方法(binid_is, size_is, length_is, bytes_is)毎に計算し(ステップS10)、ポインタ・パラメータの指すメモリの内容を算出したサイズ分HDDに保存する(ステップS11)。この処理はユーザから終了の命令があると(ステップS12)終了される。
【0036】
図13は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図11の定義により取得されたログデータの図である。
【0037】
関数定義により、バイナリ取得の設定がない場合に取得できるログ(210)は、DataIDを除いた部分である。そして、バイナリ取得の設定を行った場合には、DataID及び、バイナリデータのログ(211)が取得できる。例えばFuncSizeIsのログを比較すると、バイナリ取得の設定がない場合には、ポインタ・パラメータlpParamが指し示すデータをint型で1個分だけは取得可能である。しかし、実際にはこのデータは10個のint型データの配列を指し示す。そのためバイナリ取得の設定を行った場合には、int型データのサイズである4バイト×10個分、計40バイトのデータを取得可能となる。
【0038】
以上の説明から明らかなように、本実施形態によれば、サイズとポインタ・パラメータを関連付けることにより、通常では、取得しきれないポインタ・パラメータのデータをバイナリとしてログ取得可能となる。
【0039】
【第3の実施形態】
本実施形態では、コールバック関数等のエクスポートされていない関数をログとして取得する場合について述べる。
【0040】
図14は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いてコールバック関数等のエクスポートされていない関数をログとして取得するためのIDLによる記述である。
【0041】
FuncSetCallBack関数の定義に於いて、DWORD pfnFuncCallBackに対してcustom(PAT_PARAM_ATTR_ID, "funcname_is(FuncCallBack)")と宣言している(221)。FuncSetCallBack関数は、モジュールに対してコールバック関数を設定する関数であり、DWORD pfnFuncCallBackは、そのコールバック関数のアドレスを設定するためのパラメータである。ここで、"funcname_is(FuncCallBack)"と定義することにより、ログ取得処理は、このパラメータに渡された値をFuncCallBack関数(222)のアドレスとして認識し、ログ取得処理のアドレスに置換する。また、ログ取得処理時に本来のコールバック関数を呼ぶためにオリジナルの値を保存する。これにより、エクスポートされていないコールバック関数のログが取得可能となる。
【0042】
GetFuncPointer関数の定義に於いて、DWORD pfnFuncInternalに対してcustom(PAT_PARAM_ATTR_ID, "funcname_is(FuncInternal")と宣言している(223)。GetFuncPointer関数は、モジュール内部のエクスポートされていない関数のポインタを取得する関数であり、DWORD pfnFuncInternalは、その非エクスポート関数のポインタをを取得するためのパラメータである。ここで、"funcname_is(FuncInternal)"と定義することにより、ログ取得処理は、このパラメータに渡された値をFuncInternal関数(224)のアドレスとして認識し、ログ取得処理のアドレスに置換する。また、ログ取得処理時に本来の非エクスポート関数を呼ぶためにオリジナルの値を保存する。これにより、エクスポートされていないモジュール内部の関数のログが取得可能となる。
【0043】
GetFuncPointeArray関数(225)は、モジュール内部のエクスポートされていない関数群のアドレスをFUNCPOINTERARRAY構造体(220)に取得するための関数である。ここで、FUNCPOINTERARRAYの各メンバの定義に対してcustom(PAT_PARAM_ATTR_ID, "funcname_is(FuncInternal1〜4)")と宣言している。ここで、"funcname_is(FuncInternal1〜4)")と定義することにより、この構造体のメンバに渡された値をFuncInternal1〜4関数(226)のアドレスとして認識し、ログ取得処理のアドレスに置換する。また、ログ取得処理時に本来の非エクスポート関数を呼ぶためにオリジナルの値を保存する。これにより、エクスポートされていないモジュール内部の関数群のログを取得可能となる。
【0044】
図15は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムのメモリ構成をあらわす図であり、図3とは、隠し関数のログ取得用のコードが追加されている点で異なっている。A.DLLにある、FuncAD(231)は、エクスポートされていない関数であり、そのため、Import Address Table(230)にも、存在しない。この時funcname_isをFuncADに対して定義すると、C.DLLにログ取得のためのFuncCAD(232)が生成され、本来FuncADのアドレスが返されるfuncname_isで定義されたパラメータの値を置換する場合に、FuncCADのアドレスが使用される。
【0045】
図16は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【0046】
処理が開始されると(ステップS21)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をHDDに保存する(ステップS22)。次にログ取得コードは、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS23)。そして、関数定義にfuncname_isの設定が存在するか判別し(ステップS24)、存在する場合には、funcname_isによって定義されている関数定義を関数定義ファイルから取得し、その定義に基づいてログ取得処理用のコードを生成する(ステップS25)。そして、funcname_isが定義されている値を保存し、生成したログ取得コードのアドレスに置換する(ステップS26)。
【0047】
続いて、元の関数を呼び出す(ステップS27)。関数からリターンすると、ログ取得コードはリターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS28)。そして、関数定義にfuncname_isの設定が存在するか判別し(ステップS29)、存在する場合には、funcname_isによって定義されている関数の定義を関数定義ファイルから取得し、その定義に基づいてログ取得処理用のコードを生成する(ステップS30)。そして、funcname_isが定義されている値を保存し、生成したログ取得コードのアドレスに置換する(ステップS31)。この処理はユーザから終了の命令があると(ステップS32)終了される。
【0048】
funcname_isで設定されているパラメータが生成されたログ取得コードのアドレスに置換されると、その後そのアドレスを使用して呼び出される元の関数は、通常のログと同様に処理されるようになる(つまり、生成されたログ取得コードは、エクスポートされていない関数を呼び出し、処理を実行させ、受け取った実行結果を渡すとともに、エクスポートされていない関数を呼び出す際の所定の情報と、実行結果を受け取った際の所定の情報とをログとして記録する)。
【0049】
図17は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の定義を行わない場合に取得されたログデータの図である。関数定義ファイルに於いて設定を行わない場合は、コールバック関数、エクスポートされていない内部関数のログは取得できない。
【0050】
図18は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の定義より取得されたログデータの図である。関数定義ファイルに於いて、コールバック関数、エクスポートされていない内部関数を取得するように設定しているので、FuncCallBack関数や、FuncInternal関数、FuncInternal4関数等の非エクスポート関数のログが取得可能となる。
【0051】
このように本実施形態によれば、通常の方法では取得できない非エクスポート関数のログを取得可能になるという効果が得られる。
【0052】
【第4の実施形態】
本実施形態では、通常の方法では取得できない関数のログとして、可変長配列のパラメータのログを取得する場合について述べる。
【0053】
図19は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて可変長配列のパラメータをログとして取得するためのIDLによる記述である。
【0054】
FuncArrayIs関数の定義に於いて、int* lpnParamに対してcustum(PAT_PARAM_ATTR_ID, "array_is(dwCount)")と宣言している(240)。ここで、" array_is(dwCount)"と定義することにより、このポインタ・パラメータは第一パラメータであるdwCount個分のint型配列であると扱われる。そして、このポインタ・パラメータが指すポインタをint型のdwCount個の配列とし、データをログに保存する。
【0055】
図20は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図19の様に関数が定義されている時のログを取得する場合の流れ図である。
【0056】
処理が開始されると(ステップS41)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をHDDに保存する(ステップS42)。次に関数定義に可変長配列取得(array_is)の設定が存在するか判別し(ステップS43)、存在する場合には、ポインタ・パラメータで定義されているパラメータを配列の定義として扱い(ステップS44)、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS45)。そして、続いて、元の関数を呼び出す(ステップS46)。関数からリターンすると、ログ取得コードは関数定義に可変長配列取得(array_is)の設定が存在するか判別し(S47)、存在する場合には、ポインタ・パラメータで定義されているパラメータを配列の定義として扱い(ステップS48)、リターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS49)。この処理はユーザから終了の命令があると(ステップS50)終了される。
【0057】
図21は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図19の定義を行わない場合に取得されたログデータ(250)と、図19の定義により取得されたログデータ(251)の図である。関数定義ファイルに於いて設定を行わない場合は、ポインタ・パラメータは配列としては扱えないので、先頭のデータのみが取得されているが、関数定義ファイルに於いて設定が行われている場合では、ポインタ・パラメータは配列として扱われるため、配列の全データが取得されている。
【0058】
このように本実施形態によれば、通常の方法では取得できない関数のログとして、可変長配列のパラメータのログが取得可能になるという効果が得られる。
【0059】
【第5の実施形態】
本実施形態では、通常の関数定義では、パラメータを取得できない関数について、ログを取得する場合について説明する。
【0060】
図22は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、通常の関数定義では、パラメータを取得できない関数の例である。
【0061】
構造体として、STRUCTSIZE1, STRUCTSIZE2, STRUCTSIZE3の3種類が定義されており、各構造体のDWORD dwSizeメンバには、自分自身の構造体のサイズを入れる必要がある。FuncGetData関数は、第一パラメータdwKindと、第二パラメータlpBufに上記3種類のどの構造体のポインタが渡されているかを設定する。FuncGetData関数は、第一パラメータが1の場合には、lpBufをSTRUCTSIZE1のポインタとして扱って処理を行い、第一パラメータが2の場合には、lpBufをSTRUCTSIZE2のポインタとして扱って処理を行い、第一パラメータが3の場合には、lpBufをSTRUCTSIZE3のポインタとして扱って処理を行う。この場合、通常の関数定義により、FuncGetDataを定義すると、lpBufはvoid型のポインタとなり、データを取得することはできない。
【0062】
図23は、図22に於いて、STRUCTSIZE1, STRUCTSIZE2, STRUCTSIZE3の各構造体がどのようにメモリを使用するかのメモリ図である。構造体STRUCTSIZE1(260)の、各メンバは、オフセット0x000にDWORD dwSize(261)、0x0004にDWORD dwParam1(262)、0x0008にDWORD dwParam2、0x000CにDWORD dwParam3が存在する。構造体STRUCTSIZE2(265)はDWORD dwSize〜DWORD dwParam3(266〜269)までは、STRUCTSIZE1と同様であり、0x0010にDWORD dwParam4(270)が存在する。STRUCTSIZE3(271)はDWORD dwSize〜DWORD dwParam4(272〜276)までは、STRUCTSIZE2と同様であり、0x0014にDWORD dwParam5(277)が存在する。このように、STRUCTSIZE3のdwSize〜dwParam4までのメモリ配置は、STRUCTSIZE2と同様であり、STRUCTSIZE2のdwSize〜dwParam3までのメモリ配置は、STRUCTSIZE1と同様になっている。
【0063】
図24は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図22の様な関数のパラメータのログを取得するためのIDLによる記述である。
【0064】
本来の関数では、STRUCTSIZE1, STRUCTSIZE2, STRUCTSIZE3と分かれていた構造体をSTRUCTSIZEという1個の構造体として定義する(291)。この定義はSTRUCTSIZE3と同様であり、これは、図23でのメモリ配置から、STRUCTSIZE3は、STRUCTSIZE1、STRUCTSIZE2と同様のメモリ配置部分を持つからである。そして、この構造体のメンバであり、構造体のサイズを表す、DWORD dwSizeに対して、[custum(PAT_PARAM_ID, "structsize_is()")]を設定する。この事で、ログ取得処理は構造体のデータ解析を行う場合に、構造体のサイズを知ることが可能となる。また、FuncGetData関数において、第二パラメータのlpBufをSTRUCTSIZE型として定義しておく。こうすることで、このパラメータをログとして保存する場合には、STRUCTSIZE型として処理が行われる。仮に、本手法を用いず、STRUCTSIZE3のデータを取得するように関数定義ファイルに記述した場合には、GetFuncDataがdwKind=1や2で呼ばれた場合には、STRUCTSIZE1やSTRUCTSIZE2のデータが存在することになり、dwParam3やdwParam4のデータをログに取得しようとしてしまうために、メモリ例外が発生する。
【0065】
図25は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【0066】
処理が開始されると(ステップS61)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をHDDに保存する(ステップS62)。次に関数定義に構造体のサイズ指定(structsize_is)の設定が存在するか判別し(ステップS63)、存在する場合には、設定されている構造体パラメータのデータをサイズ指定(structsize_is)の設定で定義されているデータサイズ範囲内で解析する(ステップS64)。そして、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS65)。そして、続いて、元の関数を呼び出す(ステップS66)。関数からリターンすると、関数定義に構造体のサイズ指定(structsize_is)の設定が存在するか判別し(ステップS67)、存在する場合には、設定されている構造体パラメータのデータをサイズ指定(structsize_is)の設定で定義されているデータサイズ範囲内で解析する(ステップS68)。そして、リターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をHDDに保存する(ステップS69)。この処理はユーザから終了の命令があると(ステップS70)終了される。
【0067】
図26は、図25で行われる構造体パラメータ解析の詳細をメモリ配置を基に表した図である。
【0068】
実際のプログラムでGetFuncDataがdwKind=1で使用された場合には、STRUCTSIZE1構造体(300)が使用され、その時の各メンバ(301〜304)のメモリ使用は、図のようになっている。図24の様に関数定義がなされている場合には、本ソフトウェア評価システムでは、STRUCTSIZE構造体(305)として認識され、その時の各メンバ(306〜311)のメモリ使用は図のようになると推測する。そして、サイズ指定(structsize_is)の設定が存在する場合には、dwSizeの値を調べることで、構造体のサイズがdwSizeバイトであると知ることが可能となり、STRUCTSIZE構造体のうち、dwSizeバイト分(312)のデータのみをログとして取得する。
【0069】
図27は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図24の定義により取得されたログデータの図である。通常の関数定義では、void*となり、ポインタのみしか取得できない構造体のデータが、使用される構造体の種類により、その構造体のデータがログとして取得されている。
【0070】
このように、本実施形態によれば、通常の方法では取得できないパラメータのログを取得可能になるという効果が得られる。
【0071】
【第6の実施形態】
図28は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、通常の関数定義では、パラメータを取得できない関数の例である。
【0072】
構造体として、STRUCTKIND1, STRUCTKIND2, STRUCTKIND3の3種類が定義されている。GetFuncData関数は、第一パラメータdwKindに第二パラメータlpBufに上記3種類のどの構造体のポインタが渡されているかを設定する。FuncGetData関数は、第一パラメータが1の場合には、lpBufをSTRUCTKIND1のポインタとして扱って処理を行い、第一パラメータが2の場合には、lpBufをSTRUCTKIND2のポインタとして扱って処理を行い、第一パラメータが3の場合には、lpBufをSTRUCTKIND3のポインタとして扱って処理を行う。この場合、通常の関数定義により、FuncGetDataを定義すると、lpBufはvoid型のポインタとなり、データを取得することはできない。
【0073】
図29は、図28に於いて、STRUCTKIND1, STRUCTKIND2, STRUCTKIND3の各構造体がどのようなメモリ配置になるかを示した図である。構造体STRUCTKIND1(330)の、各メンバは、オフセット0x0000にchar chParam(331)、0x0001にDWORD dwParam(332)、0x0005にshort shParam(333)が存在する。構造体STRUCTKIND2(334) の、各メンバは、オフセット0x0000にshort shParam(335)、0x0002にDWORD dwParam(336)、0x0006にchar chParam(337)が存在する。構造体STRUCTKIND3(338) の、各メンバは、オフセット0x0000にchar chParam(339)、0x0001にshort shParam(340)、0x0003にDWORD dwParam(341)、0x0007にlong lParam(342)、0x000Bにint nParamが存在する。このように、各構造体にサイズの情報が無く、構造体データのメモリ構造も異なるため、第5の実施形態で示した方法は使用できない。
【0074】
図30は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図28の様な関数のパラメータのログを取得するためのIDLによる記述である。
【0075】
各構造体は、通常の方法で定義されている。FuncGetData関数の第二パラメータvoid* lpBufに対して[custum(PAT_PARAM_ID, "structkind_is(dwKind:1:STRUCTKIND1*, 2:STRUCTKIND2*, 3:STRUCTKIND3*)")]と設定している。これによりlpBufのデータ型は、第一パラメータdwKindの値が1の場合には、STRUCTKIND1*として、2の場合には、STRUCTKIND2*として、3の場合には、STRUCTKIND3*として扱われ、ログとして保存される。
【0076】
図31は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図30の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【0077】
処理が開始されると(ステップS81)、ログ取得を開始し、モジュール名、インターフェース名、関数/メソッド名をメモリに保存する(ステップS82)。次に関数定義に構造体の種類指定(structkind_is)の設定が存在するか判別し(ステップS83)、存在する場合には、設定されている構造体パラメータのデータを種類指定(structkind_is)の設定で定義されているデータ型として解析する(ステップS84)。そして、呼び出し時の時刻、パラメータ及びポインタ・パラメータの指すメモリの内容をメモリに保存する(ステップS85)。そして、続いて、元の関数を呼び出す(ステップS86)。関数からリターンすると、関数定義に構造体の種類指定(structkind_is)の設定が存在するか判別し(ステップS87)、存在する場合には、設定されている構造体パラメータのデータを種類指定(structkind_is)の設定で定義されているデータ型として解析する(ステップS88)。そして、リターン時の時刻、戻り値及びポインタ・パラメータの指すメモリの内容をメモリに保存する(ステップS89)。この処理はユーザから終了の命令があると(ステップS90)終了される。
【0078】
図32は、本実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図30の定義により取得されたログデータの図である。通常の関数定義では、void*となり、ポインタのみしか取得できない構造体のデータが、使用される構造体の種類により、その構造体のデータがログとして取得されている。
【0079】
このように本実施形態によれば、通常の方法では取得できないパラメータのログを取得可能になるという効果が得られる。
【0080】
【他の実施形態】
なお、本発明は、複数の機器(例えばホストコンピュータ,インタフェイス機器、リーダ、プリンタなど)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機、ファクシミリ装置など)に適用してもよい。
【0081】
また、本発明の目的は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読出し実行することによっても、達成されることは言うまでもない。
【0082】
この場合、記憶媒体から読出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。
【0083】
プログラムコードを供給するための記憶媒体としては、例えば、フロッピ(登録商標)ディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、CD−R、磁気テープ、不揮発性のメモリカード、ROMなどを用いることができる。
【0084】
また、コンピュータが読出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているOS(オペレーティングシステム)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0085】
さらに、記憶媒体から読出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0086】
【発明の効果】
以上説明したように本発明によれば、複数にモジュール分けされたソフトウェアの処理ログを容易に取得でき、かつ、ソフトウェアの障害の原因の解析のための工数を削減することが可能となる。
【図面の簡単な説明】
【図1】本発明の第1の実施形態にかかるログ取得方法を実現するコンピュータ(ソフトウェア評価システム)の構成をあらわす図である。
【図2】本発明の第1の実施形態にかかるログ取得方法を説明するためにあらわした、関数ロード時の通常のメモリ構成をあらわす図である。
【図3】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのIAT Patch使用時のメモリ構成をあらわす図である。
【図4A】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのIAT Patchを使用時の状態を示す図である。
【図4B】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのログ取得処理の流れを示す図である。
【図5】本発明の第1の実施形態にかかるソフトウェア評価システムのIAT Patchを使用時の内部構成をあらわす図である。
【図6】本発明の第1の実施形態にかかるログ取得方法を説明するためにあらわした、COMサーバのインターフェースのインスタンス作成時の通常のメモリ構成をあらわす図である。
【図7】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのVTable Patch使用時のメモリ構成をあらわす図である。
【図8A】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのVTable Patchを使用時の状態を示す図である。
【図8B】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのログ取得処理の流れを示す図である。
【図9】本発明の第1の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの、内部構成をあらわす図である。
【図10】本発明の第2の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義の一例を示す図である。
【図11】本発明の第2の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて、ポインタ・パラメータに対してバイナリ取得を指定することで、ポインタ・パラメータのデータの実体をログとして取得する為のIDLによる記述を示す図である。
【図12】本発明の第2の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図11の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図13】本発明の第2の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図11の定義により取得されたログデータの図である。
【図14】本発明の第3の本実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて、コールバック関数等のエクスポートされていない関数をログとして取得するためのIDLによる記述を示す図である。
【図15】本発明の第3の実施形態にかかるログ取得方法を実現するソフトウェア評価システムのメモリ構成をあらわす図である。
【図16】本発明の第3の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図17】本発明の第3の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の定義を行わない場合に取得されたログデータの図である。
【図18】本発明の第3の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図14の定義より取得されたログデータの図である。
【図19】本発明の第4の実施形態にかかるログ取得方法を実現するソフトウェア評価システムの関数定義に於いて、可変長配列のパラメータをログとして取得するためのIDLによる記述を示す図である。
【図20】本発明の第4の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図19の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図21】本発明の第4の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図19の定義を行わない場合に取得されたログデータ(250)と、図19の定義により取得されたログデータ(251)の図である。
【図22】本発明の第5の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、通常の関数定義では、パラメータを取得できない関数の例を示す図である。
【図23】図22に於いて、STRUCTSIZE1, STRUCTSIZE2, STRUCTSIZE3の各構造体がどのようにメモリを使用するかを示す図である。
【図24】本発明の第5の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図22の様な関数のパラメータのログを取得するためのIDLによる記述を示す図である。
【図25】本発明の第5の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図26】図25で行われる構造体パラメータ解析の詳細をメモリ配置をもとに表した図である。
【図27】本発明の第5の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図24の定義により取得されたログデータの図である。
【図28】本発明の第6の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、通常の関数定義では、パラメータを取得できない関数の例を示す図である。
【図29】図28に於いて、STRUCTKIND1, STRUCTKIND2, STRUCTKIND3の各構造体がどのようなメモリ配置になるかを示した図である。
【図30】本発明の第6の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図28の様な関数のパラメータのログを取得するためのIDLによる記述を示す図である。
【図31】本発明の第6の実施形態にかかるログ取得方法を実現するソフトウェア評価システムで、図30の様に関数が定義されている時のログを取得する場合の流れを示す図である。
【図32】本発明の第6の実施形態にかかるログ取得方法を実現するソフトウェア評価システムにおいて、図30の定義により取得されたログデータの図である。
【符号の説明】
1:CPU
2:チップセット
3:RAM
4:ハードディスクコントローラ
5:ディスプレイコントローラ
6:ハードディスクドライブ
7:CD−ROMドライブ
8:ディスプレイ
11:CPUとチップセットを繋ぐ信号線
12:チップセットとRAMを繋ぐ信号線
13:チップセットと各種周辺機器とを繋ぐ周辺機器バス
14:ハードディスクコントローラとハードディスクドライブを繋ぐ信号線
15:ハードディスクコントローラとCD−ROMドライブを繋ぐ信号線
16:ディスプレイコントローラとディスプレイを繋ぐ信号線
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a technique for acquiring a processing log of software divided into a plurality of modules.
[0002]
[Prior art]
In the past, for software failures with low recall, the cause of the failure has been identified by taking a software processing log and analyzing the processing log, and countermeasures have been taken.
[0003]
[Problems to be solved by the invention]
However, the acquisition of the conventional processing log has the following problems.
(1) In order to continue to acquire logs even in the user's operating environment, the software module itself has to be modified and a processing log acquisition routine has to be added, resulting in a heavy workload for acquiring the processing logs.
(2) Since processing log acquisition is performed for each module, the generated log is for each module, and it is difficult to acquire the entire software processing as a log in time order. For this reason, the prospect as the whole processing log was bad, and it took man-hours to analyze the log and discover the cause of the failure.
[0004]
The present invention has been made in view of the above problems, and can easily acquire a software processing log divided into a plurality of modules, and can reduce the number of steps for analyzing the cause of a software failure. An object of the present invention is to provide a simple log acquisition method, a program for realizing the method by a computer, and a storage medium storing the program.
[0005]
[Means for Solving the Problems]
In order to achieve the above object, a log acquisition method according to the present invention has the following configuration. That is,
A dynamic link library storing functions, an import function address table storing addresses of the functions, and a target program that calls and executes the functions in the dynamic link library; , Data and Program storage means for storing A storage medium for storing the program; A log memory for temporarily storing a log; a disk device; and an execution means for executing a program, wherein the execution means Storage media A log acquisition method for acquiring a log during execution of the target program in an information processing apparatus comprising a rewriting means implemented by executing a program stored in the memory and a calling means,
The rewriting means loads a log acquisition function corresponding to each function in the dynamic link library into the dynamic link library and stores it in the import function address table before executing the target program. Rewriting the address of each function to the address of the corresponding function for log acquisition;
The call means is configured to acquire the log based on the address of the corresponding function for log acquisition after rewriting on the import function address table for the function to be called that the target program is to call. Starting a log acquisition means realized by calling a function and causing the execution means to execute;
The log acquisition means storing a log related to a call by the calling means in the log memory;
The log acquisition means is Log acquisition function In the function definition in The program storage means Determining whether a predetermined setting exists for a pointer parameter pointing to
When the log acquisition unit has a predetermined setting for the pointer parameter, the log acquisition unit points to the pointer parameter based on a definition method of the pointer parameter. The program storage means Recording the contents of the disk as a log on the disk device;
The log acquisition unit calls the function to be called corresponding to the log acquisition function called by the calling unit, causes the execution unit to execute the call target function, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The log acquisition means is Log acquisition function In the function definition in The program storage means Determining whether a predetermined setting exists for a pointer parameter pointing to
When the log acquisition unit has a predetermined setting for the pointer parameter, the log acquisition unit points to the pointer parameter based on a definition method of the pointer parameter. The program storage means Recording the contents of the disk as a log on the disk device;
The log acquisition means includes a step of passing the execution result to the target program.
[0006]
DETAILED DESCRIPTION OF THE INVENTION
[First Embodiment]
In this embodiment, an import function address stored in a memory or a virtual function address table (Virtual Address Table), which is a mechanism when a function existing in another module is called from one module, is used. By hooking function calls between modules and recording them in the log, it is possible to acquire the entire software process as a log in time order without modifying the software module itself. . This will be specifically described below.
[0007]
<System configuration>
FIG. 1 is a diagram showing the configuration of a computer (software evaluation system) that implements a log acquisition method according to each embodiment of the present invention. In order to simplify the explanation, in this embodiment, it is assumed that the software evaluation system is built inside one PC, but the feature of the log acquisition method of the present invention is built inside one PC. It is effective regardless of whether it is constructed as a network system on a plurality of PCs.
[0008]
A computer on which this software evaluation system is mounted includes a CPU 1, a chip set 2, a RAM 3, a hard disk controller 4, a display controller 5, a hard disk drive 6, a CD-ROM drive 7, and a display 8. Further, a signal line 11 connecting the CPU and the chip set, a signal line 12 connecting the chip set 2 and the RAM 3, a peripheral device bus 13 connecting the chip set 2 and various peripheral devices, and a signal connecting the hard disk controller 4 and the hard disk drive 6. Line 14, signal line 15 connecting hard disk controller 4 and CD-ROM drive 7, and signal line 16 connecting display controller 5 and display 8 are mounted.
[0009]
<Acquire processing log for function processing>
In order to explain the software evaluation system for realizing the log acquisition method according to the first embodiment of the present invention, first, how the software divided into a plurality of modules is loaded into the memory in a normal state according to FIG. Explain how.
[0010]
Usually, the software divided into a plurality of modules is divided into an executable file EXE (23) that performs overall control and a dynamic link library DLL (27) that exists as a module and plays a complementary role of EXE. Is loaded with both EXE and DLL. EXE consists of a code segment (28), a data segment (29), and an import function address table (22). Furthermore, the import function address table is divided by the DLL to which the function belongs (21, 24), and the address at which each function is loaded is written for each DLL (30-35). The entity of the DLL function is loaded separately for each DLL (25, 26), and each function is loaded as a part of the corresponding DLL (36-41). This figure shows an example in which one EXE uses functions in two dynamic link libraries of A.DLL and B.DLL, and the functions actually used are Func AA, Func AB, and Func. AC, Func BA, Func BB, and Func BC.
[0011]
When the code in the EXE code segment calls the function Func AA, the Func AA address (30) written in the import function address table is first read. Here, the address of the Func AA code (36) actually read as part of A.DLL is written, and by calling that address, the EXE code calls Func AA of A.DLL. be able to.
[0012]
FIG. 3 is a diagram showing a memory configuration of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention. FIG. 2 is different from FIG. 2 in terms of IAT Patch (Import Address) for the log acquisition code. It is different in that the function call is redirected using a technique called “Table Patch”.
[0013]
When log acquisition is started, C.DLL (58), which is a DLL for IAT Patch, is loaded into the memory. C.DLL is the address of the function written in the import function address table (52), and the address of the log acquisition code in C.DLL is Func CAA, Func CAB, Func CAC, Func CBA, Func CBB, Func CBC (61-66). Func CAA, Func CAB, Func CAC, Func CBA, Func CBB, and Func CBC code (73-78) in C. DLL are logged and loaded into memory to receive the original function call The corresponding functions Func AA, Func AB, Func AC, Func BA, Func BB, and Func BC (67 to 72) are called.
[0014]
4A is a diagram showing the processing of the IAT Patch in FIG. 3, and FIG. 4B is a flowchart showing the flow of the log acquisition processing. In order to simplify the explanation, this figure shows an example of how the log acquisition code by IAT Patch operates when EXE calls Fun AA in A.DLL.
[0015]
When EXE (91 in FIG. 4A) calls Func AA (94 in FIG. 4A), the log acquisition code in C.DLL saves the DLL name / function name in memory (step S402 in FIG. 4B), and the call time Is stored in the memory, the parameter at the time of calling is stored in the memory, and the memory content pointed to by the pointer parameter at the time of calling is stored in another memory (95 in FIG. 4A, step S403 in FIG. 4B). After that, C.DLL calls Func AA in A.DLL (93 in FIG. 4A), which was supposed to be called (96 in FIG. 4A, step S404 in FIG. 4B). When the A.DLL Func AA process (97 in FIG. 4A) ends and control returns to C.DLL (98 in FIG. 4A), C.DLL stores the return time in memory and stores the return value in memory. The memory contents pointed to by the pointer parameter at the time of return are stored in another memory (99 in FIG. 4A). Thereafter, C.DLL writes the saved log information to a file (100 in FIG. 4A, step S405 in FIG. 4B), and returns to EXE as if A.DLL Func AA ended normally ( 101).
[0016]
FIG. 5 is a diagram showing the internal configuration of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention. Normally, the executable EXE (113) calls a function in the DLL-1 (116) or DLL-2 (117). Here, a log acquisition code called an API tracer is embedded (114) to generate a processing log. (115). The API tracer is based on a file (111) describing function definitions of DLL-1 and DLL-2, and a setting scenario (trace scenario 112) of rewriting the import function table of which function of which DLL and acquiring the log. To work.
[0017]
<Acquire process log for method process>
Next, in the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention, when an instance of an interface in which the execution file EXE (118) is exported by a COM (Component Object Model) server is created, In order to explain how the data is loaded into the memory, first, how it is loaded into the memory in a normal state will be described with reference to FIG.
[0018]
Normally, when an instance of an interface is created, the requested interface (121, 122) and its method (: a program describing a procedure executed by an object in object-oriented programming, 130 to 135) in the COM server are displayed. They are both loaded into memory. Here, a virtual address table (virtual address table) is created for each created interface (118, 120), and passed to the EXE that made the creation request. In this virtual address table, addresses where each method is created are written (124 to 129). EXE uses these information to make a call to each interface. In this figure, one EXE creates instances of two interfaces, Interface A and Interface B, and shows an example of using the methods inside that interface. , Method AA, Method AB, Method AC, Method BA, Method BB, Method BC.
[0019]
When the EXE code calls the function Method AA, the address (124) of the Method AA written in the virtual address table is first read. Here, the address of the Method AA code (130) created as part of Interface A of the COM server is actually written, and by calling this address, the code of EXE executes Method AA of Interface A. Can be called.
[0020]
FIG. 7 is a diagram showing a memory configuration of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention. FIG. 6 is different from FIG. 6 in terms of VTable Patch (virtual address) for the log acquisition code. This method is different in that the method call is redirected using a method called “table Patch”.
[0021]
When log acquisition is started, a DLL (143) for VTable Patch is loaded in the memory. This DLL uses the address of the method written in the virtual address table (136, 138) as the method A'A, Method A'B, Method A'C, Method B'A, Method B, which is the log acquisition code in the DLL. Rewrite to the address of 'B, Method B'C (145-150). Method A'A, Method A'B, Method A'C, Method B'A, Method B'B, Method B'C code (157-162) in the DLL records the log and the original method Method AA, Method AB, Method AC, Method BA, Method BB, MethodBC (157 to 162), which are the corresponding methods loaded in the memory to receive the call, are called.
[0022]
8A is a diagram showing the processing of the VTable Patch in FIG. 7, and FIG. 8B is a flowchart showing the flow of the log acquisition processing. In order to simplify the explanation, this figure shows an example of how the log acquisition code by VTable Patch operates when EXE calls MethodAA of Interface A in the COM server.
[0023]
When EXE (163 in FIG. 8A) calls Method AA (166 in FIG. 8A), the log acquisition code in the DLL stores the module name / interface name / method name in memory (step S802 in FIG. 8B) and calls The time is saved in the memory, the parameter at the time of calling is saved in the memory, and the memory content pointed to by the pointer parameter at the time of calling is saved in another memory (167 in FIG. 8A, step S803 in FIG. 8B). Thereafter, the DLL calls Method AA in the COM server (165 in FIG. 8A), which was supposed to be called (168 in FIG. 8A, step S804 in FIG. 8B)). When the Method AA process (169 in FIG. 8A) of the COM server ends and control returns to the DLL (170 in FIG. 8A), the DLL stores the return time in the memory, stores the return value in the memory, and returns. The memory content pointed to by the pointer parameter is saved in another memory (171 in FIG. 8A). Thereafter, the DLL writes the saved log information to the file (172 in FIG. 8A, step S805 in FIG. 8B), and returns to EXE as if Method AA of the COM server was terminated normally (in FIG. 8A). 173).
[0024]
FIG. 9 is a diagram showing the internal configuration of the software evaluation system according to the first embodiment of the present invention. Normally, the execution format EXE (176) calls a method in the COM server 1 (179) or the COM server 2 (180). Here, a log acquisition code called an API tracer is embedded (177) to generate a processing log. (178). The API tracer sets a file (174) in which the function definitions of the COM server 1 (179) and the COM server 2 are described, and a virtual address table for which method of which interface of which COM server to acquire a log. Operates based on (175).
[0025]
As is clear from the above description, according to the log acquisition method according to the present embodiment, the acquisition of the processing log of the software divided into a plurality of modules is prepared in the module without changing the module itself. The function / method calls can be recorded as a log, and the work load for acquiring the processing log can be reduced. In addition, the generated log can be acquired as a chronological log and the log can be easily analyzed. Therefore, the number of steps for analyzing the cause of the software failure can be reduced.
[0026]
[Second Embodiment]
In the present embodiment, a case will be described in which pointer parameter data that cannot normally be acquired is acquired as a binary log.
[0027]
FIG. 10 is an example of a function definition of the software evaluation system that implements the log acquisition method according to the present embodiment, and is described using IDL that is generally widely used. In the software evaluation system that implements the log acquisition method according to the present embodiment, a type library file obtained by tokenizing the IDL is used as a function definition file.
[0028]
FIG. 11 is a function definition of the software evaluation system that implements the log acquisition method according to the present embodiment, and by specifying binary acquisition for the pointer parameter, the substance of the pointer parameter data is acquired as a log. It is a description by IDL for this purpose.
[0029]
In the definition of the FuncBinidId function, custum (PAT_PARAM_ATTR_ID, “binid_is ()”) is declared for long * lplParam (201). Here, PAT_PARAM_ATTR_ID (200) is an identifier used by the software evaluation system in IDL. Here, by defining “binid_is ()”, data corresponding to the data type size (long type in this case) of the parameter from the pointer pointed to by the parameter is stored in the log as binary data.
[0030]
In the definition of the FuncSizeIs function, custum (PAT_PARAM_ATTR_ID, “size_is (dwCount)”) is declared for int * lplParam (202). Here, by defining “size_is (dwCount)”, this parameter is handled as having dwCount data as the first parameter. Then, data corresponding to (dwCount × parameter data type size (here, int type)) from the pointer pointed to by this parameter is stored in the log as binary data.
[0031]
In the definition of the FuncLengthIs function, custum (PAT_PARAM_ATTR_ID, “length_is (dwLength)”) is declared for char * lpszParam (203). Here, by defining “length_is (dwLength)”, this parameter is handled as having dwLength data as the first parameter. Then, data corresponding to (dwLength × parameter data type size (here, char type)) is stored in the log as binary data from the pointer pointed to by this parameter.
[0032]
In the definition of the FuncBytesIs function, custum (PAT_PARAM_ATTR_ID, “bytes_is (dwSize)”) is declared for void * lpParam (204). Here, by defining “bytes_is (dwSize)”, this parameter is handled as having dwSizes bytes as the first parameter. Then, dwSize bytes of data are stored in the log as binary data from the pointer pointed to by this parameter.
[0033]
In the definition of the FuncBytesIs1 function, void * lpParam is declared as custum (PAT_PARAM_ATTR_ID, “bytes_is (12)”) (205). Here, by defining “bytes_is (12)”, this parameter is handled as having 12 bytes of designated data. Then, 12 bytes of data are stored in the log as binary data from the pointer indicated by this parameter.
[0034]
FIG. 12 is a diagram showing a flow when acquiring a log when a function is defined as shown in FIG. 11 in the software evaluation system that implements the log acquisition method according to the present embodiment.
[0035]
When the process is started (step S1), log acquisition is started and the module name, interface name, and function / method name are stored in the HDD (step S2). Next, the log acquisition code stores in the HDD the time at the time of calling, the parameter, and the contents of the memory pointed to by the pointer parameter (step S3). Then, it is determined whether there is a binary acquisition setting in the function definition (step S4), and if it exists, the memory size to be stored is calculated for each definition method (binid_is, size_is, length_is, bytes_is) (step S5). The contents of the memory pointed to by the pointer parameter are stored in the HDD for the calculated size (step S6). Subsequently, the original function is called (step S7). When returning from the function, the log acquisition code stores the return time, the return value, and the contents of the memory indicated by the pointer parameter in the HDD (step S8). Then, it is determined whether there is a binary acquisition setting in the function definition (step S9), and if it exists, the memory size to be stored is calculated for each definition method (binid_is, size_is, length_is, bytes_is) (step S10). The contents of the memory pointed to by the pointer parameter are stored in the HDD for the calculated size (step S11). This process is terminated when an end command is issued from the user (step S12).
[0036]
FIG. 13 is a diagram of log data acquired by the definition of FIG. 11 in the software evaluation system that implements the log acquisition method according to the present embodiment.
[0037]
According to the function definition, the log (210) that can be acquired when there is no binary acquisition setting is a part excluding DataID. When the binary acquisition setting is performed, the DataID and the binary data log (211) can be acquired. For example, when comparing the FuncSizeIs logs, if there is no binary acquisition setting, only one int type data indicated by the pointer parameter lpParam can be acquired. However, this data actually points to an array of 10 int data. Therefore, when binary acquisition is set, it is possible to acquire a total of 40 bytes of data of 4 bytes × 10 as the size of int type data.
[0038]
As is clear from the above description, according to the present embodiment, by associating the size with the pointer parameter, it is possible to acquire the log of pointer parameter data that cannot normally be acquired as binary.
[0039]
[Third Embodiment]
In the present embodiment, a case will be described in which a non-exported function such as a callback function is acquired as a log.
[0040]
FIG. 14 is a description in IDL for acquiring, as a log, an unexported function such as a callback function in the function definition of the software evaluation system that implements the log acquisition method according to the present embodiment.
[0041]
In the definition of the FuncSetCallBack function, custom (PAT_PARAM_ATTR_ID, “funcname_is (FuncCallBack)”) is declared for the DWORD pfnFuncCallBack (221). The FuncSetCallBack function is a function for setting a callback function for a module, and DWORD pfnFuncCallBack is a parameter for setting the address of the callback function. Here, by defining “funcname_is (FuncCallBack)”, the log acquisition process recognizes the value passed to this parameter as the address of the FuncCallBack function (222) and replaces it with the address of the log acquisition process. Also, the original value is stored to call the original callback function during the log acquisition process. This makes it possible to obtain a log of callback functions that have not been exported.
[0042]
In the definition of the GetFuncPointer function, custom (PAT_PARAM_ATTR_ID, "funcname_is (FuncInternal") "is declared for DWORD pfnFuncInternal (223) The GetFuncPointer function is a function that obtains a pointer to an unexported function inside the module. DWORD pfnFuncInternal is a parameter for obtaining the pointer of the non-export function, and by defining it as "funcname_is (FuncInternal)", the log acquisition process is the value passed to this parameter. Is recognized as the address of the FuncInternal function (224) and replaced with the address of the log acquisition process, and the original value is saved to call the original non-export function during the log acquisition process. The log of the function inside the module can be acquired.
[0043]
The GetFuncPointeArray function (225) is a function for acquiring, in the FUNCPOINTERARRAY structure (220), the address of a function group that is not exported in the module. Here, custom (PAT_PARAM_ATTR_ID, “funcname_is (FuncInternal1-4)”) is declared for the definition of each member of FUNCPOINTERARRAY. Here, by defining “funcname_is (FuncInternal1 to 4)”), the value passed to the member of this structure is recognized as the address of the FuncInternal1 to 4 function (226) and replaced with the address of the log acquisition process. . Also, the original value is stored to call the original non-export function during the log acquisition process. As a result, it is possible to obtain a log of functions in the module that has not been exported.
[0044]
FIG. 15 is a diagram showing a memory configuration of the software evaluation system that implements the log acquisition method according to the present embodiment, and is different from FIG. 3 in that a code for acquiring a log of a hidden function is added. . FuncAD (231) in A.DLL is a function that has not been exported, and therefore does not exist in Import Address Table (230). At this time, if funcname_is is defined for FuncAD, FuncCAD (232) for log acquisition is generated in C.DLL, and when the value of the parameter defined by funcname_is that originally returns the FuncAD address is replaced, FuncCAD Address is used.
[0045]
FIG. 16 is a diagram showing a flow when acquiring a log when a function is defined as shown in FIG. 14 in the software evaluation system that implements the log acquisition method according to the present embodiment.
[0046]
When the process is started (step S21), log acquisition is started, and the module name, interface name, and function / method name are stored in the HDD (step S22). Next, the log acquisition code saves the time at the time of calling, the parameter, and the contents of the memory pointed to by the pointer parameter in the HDD (step S23). Then, it is determined whether or not the setting of funcname_is exists in the function definition (step S24). If it exists, the function definition defined by funcname_is is acquired from the function definition file, and for log acquisition processing based on the definition Is generated (step S25). Then, the value in which funcname_is is defined is stored and replaced with the address of the generated log acquisition code (step S26).
[0047]
Subsequently, the original function is called (step S27). When returning from the function, the log acquisition code stores the return time, the return value, and the contents of the memory pointed to by the pointer parameter in the HDD (step S28). Then, it is determined whether or not the setting of funcname_is exists in the function definition (step S29). If the function definition exists, the function definition defined by funcname_is is acquired from the function definition file, and log acquisition processing is performed based on the definition. A code is generated (step S30). Then, the value in which funcname_is is defined is stored and replaced with the address of the generated log acquisition code (step S31). This process is terminated when an end command is issued from the user (step S32).
[0048]
If the parameter set by funcname_is is replaced with the address of the generated log acquisition code, the original function called using that address will be processed in the same way as a normal log (that is, The generated log acquisition code calls a function that is not exported, executes the process, passes the received execution result, and receives the execution information and the predetermined information when calling the non-exported function. And record predetermined information).
[0049]
FIG. 17 is a diagram of log data acquired when the definition of FIG. 14 is not performed in the software evaluation system that implements the log acquisition method according to the present embodiment. If settings are not made in the function definition file, the log of callback functions and unexported internal functions cannot be acquired.
[0050]
FIG. 18 is a diagram of log data acquired from the definition of FIG. 14 in the software evaluation system that implements the log acquisition method according to the present embodiment. Since the function definition file is set to acquire callback functions and unexported internal functions, it is possible to acquire logs of non-export functions such as the FuncCallBack function, FuncInternal function, and FuncInternal4 function.
[0051]
As described above, according to the present embodiment, it is possible to obtain a log of a non-export function that cannot be obtained by a normal method.
[0052]
[Fourth Embodiment]
In the present embodiment, a case will be described in which a variable log array parameter log is acquired as a function log that cannot be acquired by a normal method.
[0053]
FIG. 19 is a description in IDL for acquiring a variable length array parameter as a log in the function definition of the software evaluation system that implements the log acquisition method according to the present embodiment.
[0054]
In the definition of the FuncArrayIs function, custum (PAT_PARAM_ATTR_ID, “array_is (dwCount)”) is declared for int * lpnParam (240). Here, by defining “array_is (dwCount)”, this pointer parameter is handled as an int type array corresponding to dwCount first parameters. Then, the pointer pointed to by this pointer parameter is set to an int type dwCount array, and the data is stored in the log.
[0055]
FIG. 20 is a flowchart for acquiring a log when a function is defined as shown in FIG. 19 in the software evaluation system for realizing the log acquisition method according to the present embodiment.
[0056]
When the process is started (step S41), log acquisition is started, and the module name, interface name, and function / method name are stored in the HDD (step S42). Next, it is determined whether or not a variable length array acquisition (array_is) setting exists in the function definition (step S43). If it exists, the parameter defined by the pointer parameter is treated as an array definition (step S44). The call time, parameters, and memory contents pointed to by the pointer parameters are stored in the HDD (step S45). Then, the original function is called (step S46). When returning from the function, the log acquisition code determines whether there is a variable length array acquisition (array_is) setting in the function definition (S47). If so, the parameter defined by the pointer parameter is used to define the array definition. (Step S48), the return time, the return value, and the memory contents pointed to by the pointer parameter are stored in the HDD (step S49). This process is terminated when an end command is issued from the user (step S50).
[0057]
FIG. 21 shows the log data (250) acquired when the definition of FIG. 19 is not performed in the software evaluation system for realizing the log acquisition method according to the present embodiment, and the log data ( 251). If the setting is not made in the function definition file, the pointer parameter cannot be handled as an array, so only the top data is obtained. However, if the setting is made in the function definition file, Since the pointer parameter is treated as an array, all the data of the array has been acquired.
[0058]
As described above, according to the present embodiment, it is possible to obtain a variable length array parameter log as a function log that cannot be obtained by a normal method.
[0059]
[Fifth Embodiment]
In the present embodiment, a case will be described in which a log is acquired for a function whose parameters cannot be acquired in a normal function definition.
[0060]
FIG. 22 is a software evaluation system that implements the log acquisition method according to the present embodiment, and is an example of a function whose parameters cannot be acquired with a normal function definition.
[0061]
Three types of structures, STRUCTSIZE1, STRUCTSIZE2, and STRUCTSIZE3, are defined. The DWORD dwSize member of each structure must contain the size of its own structure. The FuncGetData function sets which of the three types of structures is passed to the first parameter dwKind and the second parameter lpBuf. The FuncGetData function handles lpBuf as a pointer to STRUCTSIZE1 when the first parameter is 1, and treats lpBuf as a pointer to STRUCTSIZE2 when the first parameter is 2. When the parameter is 3, processing is performed by treating lpBuf as a pointer of STRUCTSIZE3. In this case, if FuncGetData is defined by normal function definition, lpBuf becomes a pointer of void type, and data cannot be acquired.
[0062]
FIG. 23 is a memory diagram showing how each structure of STRUCTSIZE1, STRUCTSIZE2, and STRUCTSIZE3 uses memory in FIG. Each member of the structure STRUCTSIZE1 (260) has DWORD dwSize (261) at offset 0x000, DWORD dwParam1 (262) at 0x0004, DWORD dwParam2 at 0x0008, and DWORD dwParam3 at 0x000C. The structure STRUCTSIZE2 (265) is the same as STRUCTSIZE1 from DWORD dwSize to DWORD dwParam3 (266 to 269), and DWORD dwParam4 (270) exists at 0x0010. STRUCTSIZE3 (271) is the same as STRUCTSIZE2 from DWORD dwSize to DWORD dwParam4 (272 to 276), and DWORD dwParam5 (277) exists at 0x0014. Thus, the memory allocation from STRUCTSIZE3 to dwSize to dwParam4 is the same as STRUCTSIZE2, and the memory allocation from STRUCTSIZE2 to dwSize to dwParam3 is the same as STRUCTSIZE1.
[0063]
FIG. 24 is a description in IDL for acquiring a function parameter log as shown in FIG. 22 in the software evaluation system for realizing the log acquisition method according to the present embodiment.
[0064]
In the original function, a structure separated from STRUCTSIZE1, STRUCTSIZE2, and STRUCTSIZE3 is defined as one structure called STRUCTSIZE (291). This definition is the same as that of STRUCTSIZE3, because STRUCTSIZE3 has the same memory arrangement as STRUCTSIZE1 and STRUCTSIZE2 from the memory arrangement in FIG. Then, [custum (PAT_PARAM_ID, “structsize_is ()”)] is set to DWORD dwSize which is a member of this structure and represents the size of the structure. This makes it possible for the log acquisition process to know the size of the structure when analyzing the structure data. In the FuncGetData function, the second parameter lpBuf is defined as a STRUCTSIZE type. In this way, when this parameter is stored as a log, processing is performed as a STRUCTSIZE type. If it is described in the function definition file so that STRUCTSIZE3 data is acquired without using this method, if GetFuncData is called with dwKind = 1 or 2, STRUCTSIZE1 or STRUCTSIZE2 data exists. And dwParam3 and dwParam4 data is going to be acquired in the log and a memory exception occurs.
[0065]
FIG. 25 is a diagram showing a flow when a log is acquired when a function is defined as shown in the figure in the software evaluation system that implements the log acquisition method according to the present embodiment.
[0066]
When the process is started (step S61), log acquisition is started and the module name, interface name, and function / method name are stored in the HDD (step S62). Next, it is determined whether or not a structure size specification (structsize_is) setting exists in the function definition (step S63). If there is a structure size data, the structure parameter data is set by the size specification (structsize_is) setting. Analysis is performed within the defined data size range (step S64). Then, the calling time, the parameter, and the contents of the memory pointed to by the pointer parameter are stored in the HDD (step S65). Then, the original function is called (step S66). When the function returns, it is determined whether or not the structure size specification (structsize_is) setting exists in the function definition (step S67). If there is, the structure parameter data set is specified as the size specification (structsize_is). The analysis is performed within the data size range defined in the setting (step S68). Then, the return time, return value, and memory contents pointed to by the pointer parameter are stored in the HDD (step S69). This process is terminated when an end command is issued from the user (step S70).
[0067]
FIG. 26 is a diagram showing details of the structure parameter analysis performed in FIG. 25 based on the memory arrangement.
[0068]
When GetFuncData is used with dwKind = 1 in an actual program, the STRUCTSIZE1 structure (300) is used, and the memory usage of each member (301 to 304) at that time is as shown in the figure. If the function is defined as shown in FIG. 24, this software evaluation system recognizes it as a STRUCTSIZE structure (305), and estimates that the memory usage of each member (306-311) at that time is as shown in the figure. To do. If there is a setting for size specification (structsize_is), it is possible to know that the size of the structure is dwSize bytes by examining the value of dwSize, and dwSize bytes of the STRUCTSIZE structure ( Only the data 312) is acquired as a log.
[0069]
FIG. 27 is a diagram of log data acquired by the definition of FIG. 24 in the software evaluation system that implements the log acquisition method according to the present embodiment. In a normal function definition, it becomes void *, and data of a structure that can be obtained only by a pointer is obtained as a log depending on the type of structure used.
[0070]
As described above, according to the present embodiment, it is possible to obtain a log of parameters that cannot be obtained by a normal method.
[0071]
[Sixth Embodiment]
FIG. 28 is an example of a function that cannot acquire parameters in a normal function definition in the software evaluation system that implements the log acquisition method according to the present embodiment.
[0072]
Three types of structures, STRUCTKIND1, STRUCTKIND2, and STRUCTKIND3, are defined. The GetFuncData function sets which of the three types of structures is passed to the second parameter lpBuf to the first parameter dwKind. The FuncGetData function handles lpBuf as a pointer to STRUCTKIND1 when the first parameter is 1, and treats lpBuf as a pointer to STRUCTKIND2 when the first parameter is 2. When the parameter is 3, processing is performed by treating lpBuf as a STRUCTKIND3 pointer. In this case, if FuncGetData is defined by normal function definition, lpBuf becomes a pointer of void type, and data cannot be acquired.
[0073]
FIG. 29 is a diagram showing the memory arrangement of each structure of STRUCTKIND1, STRUCTKIND2, and STRUCTKIND3 in FIG. Each member of the structure STRUCTKIND1 (330) has a char chParam (331) at an offset 0x0000, a DWORD dwParam (332) at 0x0001, and a short shParam (333) at 0x0005. Each member of the structure STRUCTKIND2 (334) has short shParam (335) at offset 0x0000, DWORD dwParam (336) at 0x0002, and char chParam (337) at 0x0006. Each member of structure STRUCTKIND3 (338) has char chParam (339) at offset 0x0000, short shParam (340) at 0x0001, DWORD dwParam (341) at 0x0003, long lParam (342) at 0x0007, and int nParam at 0x000B Exists. As described above, since there is no size information in each structure and the memory structure of the structure data is different, the method shown in the fifth embodiment cannot be used.
[0074]
FIG. 30 is a description in IDL for acquiring a function parameter log as shown in FIG. 28 in the software evaluation system for realizing the log acquisition method according to the present embodiment.
[0075]
Each structure is defined in the usual way. [Custum (PAT_PARAM_ID, "structkind_is (dwKind: 1: STRUCTKIND1 *, 2: STRUCTKIND2 *, 3: STRUCTKIND3 *)"]] is set for the second parameter void * lpBuf of the FuncGetData function. As a result, the data type of lpBuf is treated as STRUCTKIND1 * when the value of the first parameter dwKind is 1, as STRUCTKIND2 * when 2 and as STRUCTKIND3 * when 3, and saved as a log Is done.
[0076]
FIG. 31 is a diagram showing a flow when a log is acquired when a function is defined as shown in FIG. 30 in the software evaluation system that implements the log acquisition method according to the present embodiment.
[0077]
When the process is started (step S81), log acquisition is started, and the module name, interface name, and function / method name are stored in the memory (step S82). Next, it is determined whether or not a structure type specification (structkind_is) setting exists in the function definition (step S83). If there is a structure type, the structure parameter data is set by the type specification (structkind_is) setting. Analysis is performed as a defined data type (step S84). Then, the time at the time of calling, the parameter, and the contents of the memory pointed to by the pointer parameter are stored in the memory (step S85). Then, the original function is called (step S86). When returning from the function, it is determined whether or not a structure type specification (structkind_is) setting exists in the function definition (step S87). If it exists, the data of the set structure parameter is specified (structkind_is). It is analyzed as a data type defined in the setting (step S88). Then, the return time, the return value, and the contents of the memory indicated by the pointer parameter are stored in the memory (step S89). This process is terminated when an end command is issued from the user (step S90).
[0078]
FIG. 32 is a diagram of log data acquired by the definition of FIG. 30 in the software evaluation system that implements the log acquisition method according to the present embodiment. In a normal function definition, it becomes void *, and data of a structure that can be obtained only by a pointer is obtained as a log depending on the type of structure used.
[0079]
As described above, according to the present embodiment, it is possible to obtain a log of parameters that cannot be obtained by a normal method.
[0080]
[Other Embodiments]
Note that the present invention can be applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, and a printer), and a device (for example, a copying machine and a facsimile device) including a single device. You may apply to.
[0081]
Another object of the present invention is to supply a storage medium storing software program codes for implementing the functions of the above-described embodiments to a system or apparatus, and the computer (or CPU or MPU) of the system or apparatus stores the storage medium. Needless to say, this can also be achieved by reading and executing the program code stored in the.
[0082]
In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiment, and the storage medium storing the program code constitutes the present invention.
[0083]
As a storage medium for supplying the program code, for example, a floppy (registered trademark) disk, hard disk, optical disk, magneto-optical disk, CD-ROM, CD-R, magnetic tape, nonvolatile memory card, ROM, or the like is used. be able to.
[0084]
Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an OS (operating system) operating on the computer based on the instruction of the program code. It goes without saying that a case where the function of the above-described embodiment is realized by performing part or all of the actual processing and the processing is included.
[0085]
Further, after the program code read from the storage medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. It goes without saying that the CPU or the like provided in the board or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.
[0086]
【The invention's effect】
As described above, according to the present invention, it is possible to easily obtain a processing log of software divided into a plurality of modules, and to reduce the man-hours for analyzing the cause of software failure.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of a computer (software evaluation system) that implements a log acquisition method according to a first embodiment of the present invention.
FIG. 2 is a diagram showing a normal memory configuration at the time of loading a function, for explaining a log acquisition method according to the first embodiment of the present invention;
FIG. 3 is a diagram showing a memory configuration when using the IAT Patch of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention;
FIG. 4A is a diagram showing a state when using the IAT Patch of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention;
FIG. 4B is a diagram showing a flow of log acquisition processing of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention;
FIG. 5 is a diagram showing an internal configuration when using the IAT Patch of the software evaluation system according to the first embodiment of the present invention.
FIG. 6 is a diagram showing a normal memory configuration at the time of creating an instance of a COM server interface, for explaining a log acquisition method according to the first embodiment of the present invention;
FIG. 7 is a diagram showing a memory configuration when using the VTable Patch of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention;
FIG. 8A is a diagram showing a state when using the VTable Patch of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention;
FIG. 8B is a diagram showing a flow of log acquisition processing of the software evaluation system that implements the log acquisition method according to the first embodiment of the present invention;
FIG. 9 is a diagram showing an internal configuration of a software evaluation system that implements a log acquisition method according to the first embodiment of the present invention;
FIG. 10 is a diagram illustrating an example of a function definition of a software evaluation system that implements a log acquisition method according to a second embodiment of the present invention.
FIG. 11 is a function definition of the software evaluation system that implements the log acquisition method according to the second embodiment of the present invention. By specifying binary acquisition for the pointer parameter, It is a figure which shows the description by IDL for acquiring an entity as a log.
FIG. 12 is a diagram showing a flow when acquiring a log when a function is defined as shown in FIG. 11 in the software evaluation system that implements the log acquisition method according to the second embodiment of the present invention; .
FIG. 13 is a diagram of log data acquired according to the definition of FIG. 11 in the software evaluation system that implements the log acquisition method according to the second embodiment of the present invention;
FIG. 14 is an example of IDL for acquiring an unexported function such as a callback function as a log in the function definition of the software evaluation system that implements the log acquisition method according to the third embodiment of the present invention; It is a figure which shows description.
FIG. 15 is a diagram showing a memory configuration of a software evaluation system that implements a log acquisition method according to a third embodiment of the present invention;
FIG. 16 is a diagram showing a flow when acquiring a log when a function is defined as shown in FIG. 14 in the software evaluation system that implements the log acquisition method according to the third embodiment of the present invention; .
FIG. 17 is a diagram of log data acquired when the definition of FIG. 14 is not performed in the software evaluation system that implements the log acquisition method according to the third embodiment of the present invention;
FIG. 18 is a diagram of log data acquired from the definition of FIG. 14 in the software evaluation system that implements the log acquisition method according to the third embodiment of the present invention;
FIG. 19 is a diagram showing a description by IDL for acquiring a variable length array parameter as a log in the function definition of the software evaluation system for realizing the log acquisition method according to the fourth embodiment of the present invention; .
FIG. 20 is a diagram showing a flow when acquiring a log when a function is defined as shown in FIG. 19 in the software evaluation system that implements the log acquisition method according to the fourth embodiment of the present invention; .
21 is a software evaluation system that implements a log acquisition method according to the fourth embodiment of the present invention. Log data (250) acquired when the definition of FIG. 19 is not performed, and acquired according to the definition of FIG. It is the figure of the done log data (251).
FIG. 22 is a diagram illustrating an example of a function in which a parameter cannot be acquired with a normal function definition in a software evaluation system that implements a log acquisition method according to a fifth embodiment of the present invention;
FIG. 23 is a diagram showing how each structure of STRUCTSIZE1, STRUCTSIZE2, and STRUCTSIZE3 uses memory in FIG. 22;
FIG. 24 is a diagram showing a description by IDL for acquiring a function parameter log as shown in FIG. 22 in the software evaluation system for realizing the log acquisition method according to the fifth embodiment of the present invention;
FIG. 25 is a diagram showing a flow when acquiring a log when a function is defined as shown in the figure in the software evaluation system that implements the log acquisition method according to the fifth embodiment of the present invention;
FIG. 26 is a diagram showing details of the structure parameter analysis performed in FIG. 25 based on the memory arrangement.
FIG. 27 is a diagram of log data acquired according to the definition of FIG. 24 in the software evaluation system that implements the log acquisition method according to the fifth embodiment of the present invention;
FIG. 28 is a diagram illustrating an example of a function in which a parameter cannot be acquired with a normal function definition in a software evaluation system that implements a log acquisition method according to a sixth embodiment of the present invention;
FIG. 29 is a diagram showing the memory arrangement of each structure of STRUCTKIND1, STRUCTKIND2, and STRUCTKIND3 in FIG.
FIG. 30 is a diagram showing description by IDL for acquiring a function parameter log as shown in FIG. 28 in the software evaluation system for realizing the log acquisition method according to the sixth embodiment of the present invention;
FIG. 31 is a diagram showing a flow when acquiring a log when a function is defined as shown in FIG. 30 in a software evaluation system for realizing a log acquisition method according to a sixth embodiment of the present invention; .
FIG. 32 is a diagram of log data acquired by the definition of FIG. 30 in the software evaluation system that implements the log acquisition method according to the sixth embodiment of the present invention;
[Explanation of symbols]
1: CPU
2: Chipset
3: RAM
4: Hard disk controller
5: Display controller
6: Hard disk drive
7: CD-ROM drive
8: Display
11: Signal line connecting CPU and chipset
12: Signal line connecting chipset and RAM
13: Peripheral device bus connecting chipset and various peripheral devices
14: Signal line connecting hard disk controller and hard disk drive
15: Signal line connecting hard disk controller and CD-ROM drive
16: Signal line connecting display controller and display

Claims (10)

関数を記憶したダイナミックリンクライブラリと、該関数のアドレスを記憶したインポート関数アドレステーブルと、該ダイナミックリンクライブラリ内の関数を呼び出して実行する対象プログラムと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記ダイナミックリンクライブラリ内の各関数に対応するログ取得のための関数を当該ダイナミックリンクライブラリ内にロードし、前記インポート関数アドレステーブル上に記憶された各関数のアドレスを、対応する前記ログ取得のための関数のアドレスに書き換える工程と、
前記呼び出し手段が、前記対象プログラムが呼び出そうとする呼び出し対象の関数に対する前記インポート関数アドレステーブル上の書き換え後の前記対応するログ取得のための関数のアドレスに基づいて、前記ログ取得のための関数を呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、前記プログラム記憶手段を指すポインタ・パラメータに対して所定の設定が存在するか否かを判断する工程と、
前記ログ取得手段が、前記ポインタ・パラメータに対して所定の設定が存在する場合、該ポインタ・パラメータの定義方法に基づいて該ポインタ・パラメータの指す前記プログラム記憶手段の内容をログとして前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のための関数に対応する前記呼び出し対象の関数を呼び出して、該呼び出し対象の関数を前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、前記プログラム記憶手段を指すポインタ・パラメータに対して所定の設定が存在するか否かを判断する工程と、
前記ログ取得手段が、前記ポインタ・パラメータに対して所定の設定が存在する場合、該ポインタ・パラメータの定義方法に基づいて該ポインタ・パラメータの指す前記プログラム記憶手段の内容をログとして前記ディスク装置に記録する工程と
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程と
を備えることを特徴とするログ取得方法。
A dynamic link library that stores functions, an import function address table that stores addresses of the functions, a target program that calls and executes functions in the dynamic link library, program storage means that stores data, and a program A storage medium for storing, a log memory for temporarily storing a log, a disk device, and an execution means for executing a program are implemented, and the execution means executes the program stored in the storage medium. In the information processing apparatus comprising the rewriting means and the calling means, a log acquisition method for acquiring a log during execution of the target program,
The rewriting means loads a log acquisition function corresponding to each function in the dynamic link library into the dynamic link library and stores it in the import function address table before executing the target program. Rewriting the address of each function to the address of the corresponding function for log acquisition;
The call means is configured to acquire the log based on the address of the corresponding function for log acquisition after rewriting on the import function address table for the function to be called that the target program is to call. Starting a log acquisition means realized by calling a function and causing the execution means to execute;
The log acquisition means storing a log related to a call by the calling means in the log memory;
The log acquisition means determining whether a predetermined setting exists for a pointer parameter indicating the program storage means in the function definition in the function for log acquisition ; and
When the log acquisition unit has a predetermined setting for the pointer parameter, the contents of the program storage unit pointed to by the pointer parameter are stored in the disk device as a log based on the pointer parameter definition method. Recording process;
The log acquisition unit calls the function to be called corresponding to the log acquisition function called by the calling unit, causes the execution unit to execute the call target function, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The log acquisition means determining whether a predetermined setting exists for a pointer parameter indicating the program storage means in the function definition in the function for log acquisition ; and
When the log acquisition unit has a predetermined setting for the pointer parameter, the contents of the program storage unit pointed to by the pointer parameter are stored in the disk device as a log based on the pointer parameter definition method. A log acquisition method comprising: a step of recording; and the log acquisition unit includes a step of passing the execution result to the target program.
前記ログ取得手段が、前記定義方法に基づいてメモリサイズを算出する工程を更に備え、前記記録する工程では、前記ポインタ・パラメータの指す前記プログラム記憶手段の内容を、該算出したメモリサイズ分、前記ディスク装置に記録することを特徴とする請求項1に記載のログ取得方法。The log acquisition unit further includes a step of calculating a memory size based on the definition method, and in the recording step, the content of the program storage unit pointed to by the pointer parameter is the amount of the calculated memory size, The log acquisition method according to claim 1, wherein recording is performed in a disk device. 関数を記憶したダイナミックリンクライブラリと、該関数のアドレスを記憶したインポート関数アドレステーブルと、該ダイナミックリンクライブラリ内の関数を呼び出して実行する対象プログラムと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記ダイナミックリンクライブラリ内の各関数に対応するログ取得のための関数を当該ダイナミックリンクライブラリ内にロードし、前記インポート関数アドレステーブル上に記憶された各関数のアドレスを、対応する前記ログ取得のための関数のアドレスに書き換える工程と、
前記呼び出し手段が、前記対象プログラムが呼び出そうとする呼び出し対象の関数に対する前記インポート関数アドレステーブル上の書き換え後の前記対応するログ取得のための関数のアドレスに基づいて、前記ログ取得のための関数を呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、可変長配列としてポインタ・パラメータが定義されているか否かを判断する工程と、
前記ログ取得手段が、可変長配列として前記ポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容を該定義された配列で前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のための関数に対応する前記呼び出し対象の関数を呼び出して、該呼び出し対象の関数を前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、可変長配列としてポインタ・パラメータが定義されているか否かを判断する工程と、
前記ログ取得手段が、可変長配列として前記ポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容を該定義された配列で前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程と
を備えることを特徴とするログ取得方法。
A dynamic link library that stores functions, an import function address table that stores addresses of the functions, a target program that calls and executes functions in the dynamic link library, program storage means that stores data, and a program A storage medium for storing, a log memory for temporarily storing a log, a disk device, and an execution means for executing a program are implemented, and the execution means executes the program stored in the storage medium. In the information processing apparatus comprising the rewriting means and the calling means, a log acquisition method for acquiring a log during execution of the target program,
The rewriting means loads a log acquisition function corresponding to each function in the dynamic link library into the dynamic link library and stores it in the import function address table before executing the target program. Rewriting the address of each function to the address of the corresponding function for log acquisition;
The call means is configured to acquire the log based on the address of the corresponding function for log acquisition after rewriting on the import function address table for the function to be called that the target program is to call. Starting a log acquisition means realized by calling a function and causing the execution means to execute;
The log acquisition means storing a log related to a call by the calling means in the log memory;
The step of determining whether the log acquisition means defines a pointer parameter as a variable length array in the function definition in the function for acquiring the log ; and
The log acquisition means, when the pointer parameter is defined as a variable length array, the contents of the program storage means pointed to by the pointer parameter is recorded in the disk device in the defined array;
The log acquisition unit calls the function to be called corresponding to the log acquisition function called by the calling unit, causes the execution unit to execute the call target function, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The step of determining whether the log acquisition means defines a pointer parameter as a variable length array in the function definition in the function for acquiring the log ; and
The log acquisition means, when the pointer parameter is defined as a variable length array, the contents of the program storage means pointed to by the pointer parameter is recorded in the disk device in the defined array;
The log acquisition unit includes a step of passing the execution result to the target program.
関数を記憶したダイナミックリンクライブラリと、該関数のアドレスを記憶したインポート関数アドレステーブルと、該ダイナミックリンクライブラリ内の関数を呼び出して実行する対象プログラムと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記ダイナミックリンクライブラリ内の各関数に対応するログ取得のための関数を当該ダイナミックリンクライブラリ内にロードし、前記インポート関数アドレステーブル上に記憶された各関数のアドレスを、対応する前記ログ取得のための関数のアドレスに書き換える工程と、
前記呼び出し手段が、前記対象プログラムが呼び出そうとする呼び出し対象の関数に対する前記インポート関数アドレステーブル上の書き換え後の前記対応するログ取得のための関数のアドレスに基づいて、前記ログ取得のための関数を呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、構造体としてポインタ・パラメータが指定されているか否かを判断する工程と、
前記ログ取得手段が、構造体として前記ポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容について、前記プログラム内の関数定義において定義された構造体のサイズ分ログとして前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のための関数に対応する前記呼び出し対象の関数を呼び出して、該呼び出し対象の関数を前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、構造体としてポインタ・パラメータが指定されているか否かを判断する工程と、
前記ログ取得手段が、構造体として前記ポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容について、前記プログラム内の関数定義において定義された構造体のサイズ分ログとして前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程と
を備えることを特徴とするログ取得方法。
A dynamic link library that stores functions, an import function address table that stores addresses of the functions, a target program that calls and executes functions in the dynamic link library, program storage means that stores data, and a program A storage medium for storing, a log memory for temporarily storing a log, a disk device, and an execution means for executing a program are implemented, and the execution means executes the program stored in the storage medium. In the information processing apparatus comprising the rewriting means and the calling means, a log acquisition method for acquiring a log during execution of the target program,
The rewriting means loads a log acquisition function corresponding to each function in the dynamic link library into the dynamic link library and stores it in the import function address table before executing the target program. Rewriting the address of each function to the address of the corresponding function for log acquisition;
The call means is configured to acquire the log based on the address of the corresponding function for log acquisition after rewriting on the import function address table for the function to be called that the target program is to call. Starting a log acquisition means realized by calling a function and causing the execution means to execute;
The log acquisition means storing a log related to a call by the calling means in the log memory;
The log acquisition means determining whether a pointer parameter is specified as a structure in the function definition in the function for log acquisition ; and
When the pointer parameter is defined as a structure, the log acquisition unit logs the contents of the program storage unit pointed to by the pointer parameter by the size of the structure defined in the function definition in the program. Recording on the disk device as
The log acquisition unit calls the function to be called corresponding to the log acquisition function called by the calling unit, causes the execution unit to execute the call target function, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The log acquisition means determining whether a pointer parameter is specified as a structure in the function definition in the function for log acquisition ; and
When the pointer parameter is defined as a structure, the log acquisition unit logs the contents of the program storage unit pointed to by the pointer parameter by the size of the structure defined in the function definition in the program. Recording on the disk device as
The log acquisition unit includes a step of passing the execution result to the target program.
関数を記憶したダイナミックリンクライブラリと、該関数のアドレスを記憶したインポート関数アドレステーブルと、該ダイナミックリンクライブラリ内の関数を呼び出して実行する対象プログラムと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記ダイナミックリンクライブラリ内の各関数に対応するログ取得のための関数を当該ダイナミックリンクライブラリ内にロードし、前記インポート関数アドレステーブル上に記憶された各関数のアドレスを、対応する前記ログ取得のための関数のアドレスに書き換える工程と、
前記呼び出し手段が、前記対象プログラムが呼び出そうとする呼び出し対象の関数に対する前記インポート関数アドレステーブル上の書き換え後の前記対応するログ取得のための関数のアドレスに基づいて、前記ログ取得のための関数を呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、構造体として種類指定がなされたポインタ・パラメータが定義されているか否かを判断する工程と、
前記ログ取得手段が、構造体として前記種類指定がなされたポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容を、種類指定がなされたデータ型として前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のための関数に対応する前記呼び出し対象の関数を呼び出して、該呼び出し対象の関数を前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のための関数内の関数定義において、構造体として種類指定がなされたポインタ・パラメータが定義されているか否かを判断する工程と、
前記ログ取得手段が、構造体として前記種類指定がなされたポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指すプログラム記憶手段の内容を、種類指定がなされたデータ型として前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程と
を備えることを特徴とするログ取得方法。
A dynamic link library that stores functions, an import function address table that stores addresses of the functions, a target program that calls and executes functions in the dynamic link library, program storage means that stores data, and a program A storage medium for storing, a log memory for temporarily storing a log, a disk device, and an execution means for executing a program are implemented, and the execution means executes the program stored in the storage medium. In the information processing apparatus comprising the rewriting means and the calling means, a log acquisition method for acquiring a log during execution of the target program,
The rewriting means loads a log acquisition function corresponding to each function in the dynamic link library into the dynamic link library and stores it in the import function address table before executing the target program. Rewriting the address of each function to the address of the corresponding function for log acquisition;
The call means is configured to acquire the log based on the address of the corresponding function for log acquisition after rewriting on the import function address table for the function to be called that the target program is to call. Starting a log acquisition means realized by calling a function and causing the execution means to execute;
The log acquisition means storing a log related to a call by the calling means in the log memory;
The step of determining whether the log acquisition means defines a pointer parameter whose type is specified as a structure in the function definition in the function for acquiring the log ;
When the log acquisition means defines a pointer parameter for which the type is specified as a structure, the contents of the program storage means pointed to by the pointer parameter are used as the data type for which the type is specified. The process of recording in
The log acquisition unit calls the function to be called corresponding to the log acquisition function called by the calling unit, causes the execution unit to execute the call target function, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The step of determining whether the log acquisition means defines a pointer parameter whose type is specified as a structure in the function definition in the function for acquiring the log ;
When the log acquisition means defines a pointer parameter for which the type is specified as a structure, the contents of the program storage means pointed to by the pointer parameter are stored in the disk device as a data type for which the type is specified. Recording process;
The log acquisition unit includes a step of passing the execution result to the target program.
メソッドを記憶したインターフェースと、該メソッドのアドレスを記憶した仮想アドレステーブルと、該インターフェース内のメソッドを呼び出して実行する対象プログラムと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記インターフェース内の各メソッドに対応するログ取得のためのメソッドをインターフェース内にロードし、前記仮想アドレステーブル上に記憶されたメソッドのアドレスを、対応する前記ログ取得のためのメソッドのアドレスに書き換える工程と、
前記呼び出し手段が、前記対処プログラムが呼び出そうとする呼び出し対象のメソッドに対する前記仮想アドレステーブル上の書き換え後の前記対応するログ取得のためのメソッドのアドレスに基づいて、前記ログ取得のためのメソッドを呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のためのメソッド内のメソッド定義において、前記プログラム記憶手段を指すポインタ・パラメータに対して所定の設定が存在するか否かを判断する工程と、
前記ログ取得手段が、前記ポインタ・パラメータに対して所定の設定が存在する場合、該ポインタ・パラメータの定義方法に基づいて該ポインタ・パラメータの指す前記プログラム記憶手段の内容をログとして前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のためのメソッドに対応する前記呼び出し対象のメソッドを呼び出して、該呼び出し対象のメソッドを前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のためのメソッド内のメソッド定義において、メモリを指すポインタ・パラメータに対して所定の設定が存在するか否かを判断する工程と、
前記ログ取得手段が、前記ポインタ・パラメータに対して所定の設定が存在する場合、該ポインタ・パラメータの定義方法に基づいて該ポインタ・パラメータの指す前記プログラム記憶手段の内容をログとして前記ディスク装置に記録する工程と
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程と
を備えることを特徴とするログ取得方法。
An interface storing a method, a virtual address table storing an address of the method, a target program to call and execute a method in the interface, program storage means for storing data, and a storage medium for storing the program , a log memory for temporarily storing the log, a disk device, and an execution unit for executing a program, and rewriting means for the execution unit is realized by executing a program stored in the storage medium A log acquisition method for acquiring a log during execution of the target program in an information processing apparatus comprising a calling unit,
Before executing the target program, the rewriting means loads a method for log acquisition corresponding to each method in the interface into the interface, and corresponds the method address stored in the virtual address table. Rewriting the address of the method for acquiring the log,
The method for acquiring the log based on the address of the corresponding method for acquiring the log after the rewriting on the virtual address table for the method to be called by the handling program to be called by the handling program Starting log acquisition means realized by calling and causing the execution means to execute,
The log acquisition means storing a log related to a call by the calling means in the log memory;
The log acquisition means determining whether or not a predetermined setting exists for a pointer parameter indicating the program storage means in a method definition in the method for log acquisition ; and
When the log acquisition unit has a predetermined setting for the pointer parameter, the contents of the program storage unit pointed to by the pointer parameter are stored in the disk device as a log based on the pointer parameter definition method. Recording process;
The log acquisition unit calls the method to be called corresponding to the method for log acquisition called by the calling unit, causes the execution unit to execute the method to be called, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The step of determining whether the log acquisition unit has a predetermined setting for a pointer parameter indicating a memory in a method definition in the method for acquiring the log ; and
When the log acquisition unit has a predetermined setting for the pointer parameter, the contents of the program storage unit pointed to by the pointer parameter are stored in the disk device as a log based on the pointer parameter definition method. A log acquisition method comprising: a step of recording; and the log acquisition unit includes a step of passing the execution result to the target program.
前記ログ取得手段が、前記定義方法に基づいてメモリサイズを算出する工程を更に備え、前記記録する工程では、前記ポインタ・パラメータの指す前記プログラム記憶手段の内容を、該算出したメモリサイズ分、前記ディスク装置に記録することを特徴とする請求項6に記載のログ取得方法。The log acquisition unit further includes a step of calculating a memory size based on the definition method, and in the recording step, the content of the program storage unit pointed to by the pointer parameter is the amount of the calculated memory size, The log acquisition method according to claim 6, wherein recording is performed on a disk device. メソッドを記憶したインターフェースと、該メソッドのアドレスを記憶した仮想アドレステーブルと、該インターフェース内のメソッドを呼び出して実行する対象プログラムと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記インターフェース内の各メソッドに対応するログ取得のためのメソッドをインターフェース内にロードし、前記仮想アドレステーブル上に記憶されたメソッドのアドレスを、対応する前記ログ取得のためのメソッドのアドレスに書き換える工程と、
前記呼び出し手段が、前記対象プログラムが呼び出そうとする呼び出し対象のメソッドに対する前記仮想アドレステーブル上の書き換え後の前記対応するログ取得のためのメソッドのアドレスに基づいて、前記ログ取得のためのメソッドを呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のためのメソッド内のメソッド定義において、可変長配列としてポインタ・パラメータが定義されているか否かを判断する工程と、
前記ログ取得手段が、可変長配列として前記ポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容を該定義された配列で前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のためのメソッドに対応する前記呼び出し対象のメソッドを呼び出して、該呼び出し対象のメソッドを前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のためのメソッド内のメソッド定義において、可変長配列としてポインタ・パラメータが定義されているか否かを判断する工程と、
前記ログ取得手段が、可変長配列として前記ポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容を該定義された配列で前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程と
を備えることを特徴とするログ取得方法。
An interface storing a method, a virtual address table storing an address of the method, a target program to call and execute a method in the interface, program storage means for storing data, and a storage medium for storing the program , a log memory for temporarily storing the log, a disk device, and an execution unit for executing a program, and rewriting means for the execution unit is realized by executing a program stored in the storage medium A log acquisition method for acquiring a log during execution of the target program in an information processing apparatus comprising a calling unit,
Before executing the target program, the rewriting means loads a method for log acquisition corresponding to each method in the interface into the interface, and corresponds the method address stored in the virtual address table. Rewriting the address of the method for acquiring the log,
The method for acquiring the log based on the address of the corresponding method for acquiring the log after the rewriting on the virtual address table for the method to be called that the target program is to call by the target program Starting log acquisition means realized by calling and causing the execution means to execute,
The log acquisition means storing a log related to a call by the calling means in the log memory;
The log acquisition means determining whether a pointer parameter is defined as a variable-length array in a method definition in the method for acquiring the log ; and
The log acquisition means, when the pointer parameter is defined as a variable length array, the contents of the program storage means pointed to by the pointer parameter is recorded in the disk device in the defined array;
The log acquisition unit calls the method to be called corresponding to the method for log acquisition called by the calling unit, causes the execution unit to execute the method to be called, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The log acquisition means determining whether a pointer parameter is defined as a variable-length array in a method definition in the method for acquiring the log ; and
The log acquisition means, when the pointer parameter is defined as a variable length array, the contents of the program storage means pointed to by the pointer parameter is recorded in the disk device in the defined array;
The log acquisition unit includes a step of passing the execution result to the target program.
メソッドを記憶したインターフェースと、該メソッドのアドレスを記憶した仮想アドレステーブルと、該インターフェース内のメソッドを呼び出して実行する対象プログラムと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記インターフェース内の各メソッドに対応するログ取得のためのメソッドをインターフェース内にロードし、前記仮想アドレステーブル上に記憶されたメソッドのアドレスを、対応する前記ログ取得のためのメソッドのアドレスに書き換える工程と、
前記呼び出し手段が、前記対象プログラムが呼び出そうとする呼び出し対象のメソッドに対する前記仮想アドレステーブル上の書き換え後の前記対応するログ取得のためのメソッドのアドレスに基づいて、前記ログ取得のためのメソッドを呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のためのメソッド内のメソッド定義において、構造体としてポインタ・パラメータが指定されているか否かを判断する工程と、
前記ログ取得手段が、構造体として前記ポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容について、前記プログラム内のメソッド定義において定義された構造体のサイズ分ログとして前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のためのメソッドに対応する前記呼び出し対象のメソッドを呼び出して、該呼び出し対象のメソッドを前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のためのメソッド内のメソッド定義において、構造体としてポインタ・パラメータが指定されているか否かを判断する工程と、
前記ログ取得手段が、構造体として前記ポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容について、前記プログラム内のメソッド定義において定義された構造体のサイズ分ログとして前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程と
を備えることを特徴とするログ取得方法。
An interface storing a method, a virtual address table storing an address of the method, a target program to call and execute a method in the interface, program storage means for storing data, and a storage medium for storing the program , a log memory for temporarily storing the log, a disk device, and an execution unit for executing a program, and rewriting means for the execution unit is realized by executing a program stored in the storage medium A log acquisition method for acquiring a log during execution of the target program in an information processing apparatus comprising a calling unit,
Before executing the target program, the rewriting means loads a method for log acquisition corresponding to each method in the interface into the interface, and corresponds the method address stored in the virtual address table. Rewriting the address of the method for acquiring the log,
The method for acquiring the log based on the address of the corresponding method for acquiring the log after the rewriting on the virtual address table for the method to be called that the target program is to call by the target program Starting log acquisition means realized by calling and causing the execution means to execute,
The log acquisition means storing a log related to a call by the calling means in the log memory;
The log acquisition means determining whether a pointer parameter is specified as a structure in a method definition in the method for acquiring the log ; and
When the pointer parameter is defined as a structure, the log acquisition unit logs the contents of the program storage unit pointed to by the pointer parameter by the size of the structure defined in the method definition in the program. Recording on the disk device as
The log acquisition unit calls the method to be called corresponding to the method for log acquisition called by the calling unit, causes the execution unit to execute the method to be called, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The log acquisition means determining whether a pointer parameter is specified as a structure in a method definition in the method for acquiring the log ; and
When the pointer parameter is defined as a structure, the log acquisition unit logs the contents of the program storage unit pointed to by the pointer parameter by the size of the structure defined in the method definition in the program. Recording on the disk device as
The log acquisition unit includes a step of passing the execution result to the target program.
メソッドを記憶したインターフェースと、該メソッドのアドレスを記憶した仮想アドレステーブルと、該インターフェース内のメソッドを呼び出して実行する対象プログラムとと、データとを記憶するプログラム記憶手段と、プログラムを記憶する記憶媒体と、ログを一時格納するためのログメモリと、ディスク装置と、プログラムを実行する実行手段とを有し、前記実行手段が前記記憶媒体に記憶されたプログラムを実行することにより実現される書き換え手段と、呼び出し手段とを備えた情報処理装置において、前記対象プログラムの実行中のログを取得するログ取得方法であって、
前記書き換え手段が、前記対象プログラムの実行前に、前記インターフェース内の各メソッドに対応するログ取得のためのメソッドをインターフェース内にロードし、前記仮想アドレステーブル上に記憶されたメソッドのアドレスを、対応する前記ログ取得のためのメソッドのアドレスに書き換える工程と、
前記呼び出し手段が、前記対象プログラムが呼び出そうとする呼び出し対象のメソッドに対する前記仮想アドレステーブル上の書き換え後の前記対応するログ取得のためのメソッドのアドレスに基づいて、前記ログ取得のためのメソッドを呼び出して前記実行手段に実行させることで実現されるログ取得手段を起動する工程と、
前記ログ取得手段が、前記呼び出し手段による呼び出しに関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のためのメソッド内のメソッド定義において、構造体として種類指定がなされたポインタ・パラメータが定義されているか否かを判断する工程と、
前記ログ取得手段が、構造体として前記種類指定がなされたポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容を、種類指定がなされたデータ型として前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記呼び出し手段により呼び出された前記ログ取得のためのメソッドに対応する前記呼び出し対象のメソッドを呼び出して、該呼び出し対象のメソッドを前記実行手段に実行させ、実行結果を受け取る工程と、
前記ログ取得手段が、前記実行結果に関わるログを前記ログメモリに格納する工程と、
前記ログ取得手段が、前記ログ取得のためのメソッド内のメソッド定義において、構造体として種類指定がなされたポインタ・パラメータが定義されているか否かを判断する工程と、
前記ログ取得手段が、構造体として前記種類指定がなされたポインタ・パラメータが定義されていた場合、該ポインタ・パラメータの指す前記プログラム記憶手段の内容を、種類指定がなされたデータ型として前記ディスク装置に記録する工程と、
前記ログ取得手段が、前記実行結果を前記対象プログラムに渡す工程と
を備えることを特徴とするログ取得方法。
Interface storing method, virtual address table storing method address, target program for calling and executing method in the interface, program storage means for storing data, and storage medium for storing program When the log memory for temporarily storing the log, a disk device, and an execution means for executing a program, rewriting means for the execution unit is realized by executing a program stored in the storage medium And a log acquisition method for acquiring a log during execution of the target program in an information processing apparatus comprising a calling unit,
Before executing the target program, the rewriting means loads a method for log acquisition corresponding to each method in the interface into the interface, and corresponds the method address stored in the virtual address table. Rewriting the address of the method for acquiring the log,
The method for acquiring the log based on the address of the corresponding method for acquiring the log after the rewriting on the virtual address table for the method to be called that the target program is to call by the target program Starting log acquisition means realized by calling and causing the execution means to execute,
The log acquisition means storing a log related to a call by the calling means in the log memory;
The step of determining whether the log acquisition means defines a pointer parameter whose type is specified as a structure in the method definition in the method for acquiring the log ;
When the log acquisition means defines a pointer parameter for which the type is specified as a structure, the contents of the program storage means pointed to by the pointer parameter are used as the data type for which the type is specified. The process of recording in
The log acquisition unit calls the method to be called corresponding to the method for log acquisition called by the calling unit, causes the execution unit to execute the method to be called, and receives an execution result When,
The log acquisition means storing a log related to the execution result in the log memory;
The step of determining whether the log acquisition means defines a pointer parameter whose type is specified as a structure in the method definition in the method for acquiring the log ;
When the log acquisition means defines a pointer parameter for which the type is specified as a structure, the contents of the program storage means pointed to by the pointer parameter are used as the data type for which the type is specified. The process of recording in
The log acquisition unit includes a step of passing the execution result to the target program.
JP2002191128A 2002-06-28 2002-06-28 Log acquisition method Expired - Fee Related JP4125054B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2002191128A JP4125054B2 (en) 2002-06-28 2002-06-28 Log acquisition method
US10/600,843 US7086034B2 (en) 2002-06-28 2003-06-23 Method, program, and storage medium for acquiring logs
EP03254035A EP1376366A3 (en) 2002-06-28 2003-06-25 Method for acquiring logs for program debugging
CNB031493319A CN1251062C (en) 2002-06-28 2003-06-27 Operating journal obtaining method, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002191128A JP4125054B2 (en) 2002-06-28 2002-06-28 Log acquisition method

Publications (3)

Publication Number Publication Date
JP2004038312A JP2004038312A (en) 2004-02-05
JP2004038312A5 JP2004038312A5 (en) 2007-03-01
JP4125054B2 true JP4125054B2 (en) 2008-07-23

Family

ID=31700842

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002191128A Expired - Fee Related JP4125054B2 (en) 2002-06-28 2002-06-28 Log acquisition method

Country Status (1)

Country Link
JP (1) JP4125054B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6441803B2 (en) 2012-10-04 2018-12-19 アルカテル−ルーセント Data log management in a multi-client architecture

Also Published As

Publication number Publication date
JP2004038312A (en) 2004-02-05

Similar Documents

Publication Publication Date Title
US8959490B2 (en) Optimizing heap memory usage
US9727436B2 (en) Adding a profiling agent to a virtual machine to permit performance and memory consumption analysis within unit tests
US7478282B2 (en) Log acquisition method and its control program and storage medium
US7743228B2 (en) Information processing apparatus and method for obtaining software processing log
US7086034B2 (en) Method, program, and storage medium for acquiring logs
WO2019134223A1 (en) Log generation method and apparatus, computer device and storage medium
US7188279B2 (en) Method, program, and storage medium for acquiring logs
US7426660B2 (en) Method, program, and storage medium for acquiring logs
JP4280749B2 (en) Log acquisition method, program, and storage medium
CN101196848B (en) Method for acquiring operation log
JP4125055B2 (en) Log acquisition method
JP4125054B2 (en) Log acquisition method
JP4125056B2 (en) Log acquisition method
JP4125053B2 (en) Log acquisition method
US7519868B2 (en) Information processing apparatus, information processing method, computer program, and storage medium
US8191050B2 (en) Information processor, control method therefor, computer program and storage medium
CN114048125A (en) Test case determination method and device, computing equipment and storage medium
JP4886188B2 (en) Information processing apparatus and control method therefor, computer program, and storage medium
JP2006031248A (en) Software evaluation system for generating log by hooking function call
CN116881086B (en) Method and device for monitoring memory during application running, computing equipment and storage medium
CN114297044A (en) Method and device for storing BIOS log of electronic device
CN114510375A (en) Flash chip data area dynamic sharing system and method
CN117472624A (en) Operation track establishment method and related device for zero-copy memory
JP2003140921A (en) Data processing system, data processing method, and storage medium
CN117591322A (en) Abnormality processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050615

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070117

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071001

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071225

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080225

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: 20080414

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080507

R150 Certificate of patent or registration of utility model

Ref document number: 4125054

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110516

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130516

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140516

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees