JPH113250A - Thread information collection method and recording medium recorded with thread information collection program - Google Patents
Thread information collection method and recording medium recorded with thread information collection programInfo
- Publication number
- JPH113250A JPH113250A JP9156575A JP15657597A JPH113250A JP H113250 A JPH113250 A JP H113250A JP 9156575 A JP9156575 A JP 9156575A JP 15657597 A JP15657597 A JP 15657597A JP H113250 A JPH113250 A JP H113250A
- Authority
- JP
- Japan
- Prior art keywords
- thread
- program
- executed
- information
- function call
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 30
- 230000008569 process Effects 0.000 claims description 13
- 230000001960 triggered effect Effects 0.000 claims description 7
- 230000006870 function Effects 0.000 description 64
- 238000012545 processing Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 238000003780 insertion Methods 0.000 description 2
- 230000037431 insertion Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、CPUを割り当て
られる最小単位であるスレッドが複数存在する、いわゆ
るマルチスレッドによりプログラムの実行を行う計算機
システムにおいて、スレッドの切り替え動作に関する情
報を採取するスレッド情報採取方法及びスレッド情報採
取プログラムを記録した記録媒体に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a thread system for collecting information related to a thread switching operation in a computer system in which a plurality of threads, each of which is a minimum unit to which a CPU can be assigned, are executed. The present invention relates to a method and a recording medium on which a thread information collection program is recorded.
【0002】[0002]
【従来の技術】従来、マルチスレッドによりプログラム
の実行を行う計算機システムにおけるスレッドの状態の
採取は、特開昭63−211031号公報に記載された
ように、システムプログラム内にスレッドの状態情報を
収集する箇所を設けたり、あるいは、特開昭64−14
643号公報に記載されたように、オペレーティングシ
ステム固有の機能を用いてスレッドの状態情報を入手し
たり、さらには、特開平3−288941号公報に記載
されたように、オペレーティングシステムと対象のプロ
グラムとの間に専用のインタフェースを組み込んだりす
ることにより、すなわち、オペレーティングシステムに
特化した機能を用いたり改造を加えたりすることにより
実現していた。2. Description of the Related Art Conventionally, in a computer system that executes a program by multi-threading, a thread state is collected by collecting thread state information in a system program as described in Japanese Patent Application Laid-Open No. 63-211031. To be provided, or as disclosed in
As described in Japanese Unexamined Patent Publication No. 643/643, the state information of a thread is obtained by using a function unique to an operating system. This is realized by incorporating a dedicated interface between the two, that is, by using a function specialized for the operating system or adding a modification.
【0003】[0003]
【発明が解決しようとする課題】しかしながら、上記従
来の技術には、スレッド情報の採取のために対象のプロ
グラムの実行環境であるオペレーティングシステムなど
が、スレッドの切り替え動作を通知する機能を持ってい
ることが必要であり、そのような機能を持っていない場
合にはオペレーティングシステムなどにそれを提供する
よう改造を加える必要があるという問題点があった。However, in the above-mentioned conventional technology, an operating system or the like, which is an execution environment of a target program, for collecting thread information has a function of notifying a thread switching operation. There is a problem that if such a function is not provided, it is necessary to modify the operating system to provide the function.
【0004】本発明の目的は、マルチスレッドによりプ
ログラムの実行を行う計算機システムにおいて、そのプ
ログラムの実行環境であるオペレーティングシステムに
特化した機能を利用することも、オペレーティングシス
テムの改造を行うこともなく、スレッドの切り替え動作
の情報を採取できるスレッド情報採取方法及びスレッド
情報採取プログラムを記録した記録媒体を提供すること
にある。An object of the present invention is to provide a computer system that executes a program by multi-threading without using a function specialized for an operating system, which is an execution environment of the program, and without modifying the operating system. Another object of the present invention is to provide a thread information collecting method capable of collecting information on a thread switching operation and a recording medium storing a thread information collecting program.
【0005】[0005]
【課題を解決するための手段】本発明の第1のスレッド
情報採取方法は、複数のスレッドのうちのいずれかのス
レッドで実行される部分からなるマルチスレッドプログ
ラムにおける関数呼び出し又は関数呼び出しからの戻り
又はその両方を契機として、該マルチスレッドプログラ
ムが実行されているスレッドの状態に関する情報を採取
することを特徴とする。A first thread information collecting method according to the present invention is directed to a function call or a return from a function call in a multithread program including a portion executed by any one of a plurality of threads. Alternatively, the information about the state of the thread in which the multi-thread program is being executed is collected at the timing of both.
【0006】本発明の第2のスレッド情報採取方法は、
複数のスレッドのうちのいずれかのスレッドで実行され
る部分からなるマルチスレッドプログラムにおける関数
呼び出し又は関数呼び出しからの戻り又はその両方を契
機として、該マルチスレッドプログラムが実行されてい
るスレッドの識別子を取得し、該取得したスレッドの識
別子と前回記録したスレッドの識別子とが異なればスレ
ッドの状態に関する情報をトレースデータとして記録
し、さらに、該取得したスレッドの識別子を記録するこ
とを特徴とする。A second thread information collecting method according to the present invention comprises:
Obtain an identifier of a thread in which the multi-thread program is being executed, triggered by a function call or a return from a function call or both in a multi-thread program including a portion executed by any one of a plurality of threads If the acquired thread identifier is different from the previously recorded thread identifier, information on the state of the thread is recorded as trace data, and the acquired thread identifier is recorded.
【0007】本発明の第3のスレッド情報採取方法は、
上記第1及び第2のスレッド情報採取方法において、前
記マルチスレッドプログラムにおける関数呼び出し又は
関数呼び出しからの戻りを、予め用意された特定のプロ
グラムの実行により検出することを特徴とする。[0007] A third thread information collecting method of the present invention comprises:
In the first and second thread information collecting methods, a function call or a return from the function call in the multithread program is detected by executing a specific program prepared in advance.
【0008】本発明の第4のスレッド情報採取方法は、
複数のスレッドのうちのいずれかのスレッドで実行され
る部分からなるマルチスレッドプログラムに記述された
スレッド情報採取命令の実行を契機として、該マルチス
レッドプログラムが実行されているスレッドの状態に関
する情報を採取することを特徴とする。[0008] A fourth thread information collecting method of the present invention comprises:
Triggered by execution of a thread information collection instruction described in a multi-thread program composed of a part executed by any one of a plurality of threads, information about a state of a thread in which the multi-thread program is being executed is collected. It is characterized by doing.
【0009】本発明の第5のスレッド情報採取方法は、
複数のスレッドのうちのいずれかのスレッドで実行され
る部分からなるマルチスレッドプログラムに記述された
スレッド情報採取命令の実行を契機として、該マルチス
レッドプログラムが実行されているスレッドの識別子を
取得し、該取得したスレッドの識別子と前回記録したス
レッドの識別子とが異なればスレッドの状態に関する情
報をトレースデータとして記録し、さらに、該取得した
スレッドの識別子を記録することを特徴とする。A fifth thread information collecting method according to the present invention comprises:
Triggered by execution of a thread information collection instruction described in a multi-thread program including a portion executed by any one of the plurality of threads, an identifier of a thread in which the multi-thread program is being executed is acquired, If the acquired thread identifier is different from the previously recorded thread identifier, information on the thread state is recorded as trace data, and the acquired thread identifier is recorded.
【0010】本発明の第1の記録媒体は、複数のスレッ
ドのうちのいずれかのスレッドで実行される部分からな
るマルチスレッドプログラムにおける関数呼び出し又は
関数呼び出しからの戻り又はその両方を契機として、該
マルチスレッドプログラムが実行されているスレッドの
状態に関する情報を採取する処理をコンピュータに実行
させるプログラムを記録している。[0010] The first recording medium of the present invention is characterized in that a function call and / or a return from a function call in a multi-thread program composed of a portion executed by any one of a plurality of threads is used as a trigger. It records a program that causes a computer to execute a process of collecting information on the state of a thread in which a multi-thread program is being executed.
【0011】本発明の第2の記録媒体は、複数のスレッ
ドのうちのいずれかのスレッドで実行される部分からな
るマルチスレッドプログラムにおける関数呼び出し又は
関数呼び出しからの戻り又はその両方を契機として、該
マルチスレッドプログラムが実行されているスレッドの
識別子を取得し、該取得したスレッドの識別子と前回記
録したスレッドの識別子とが異なればスレッドの状態に
関する情報をトレースデータとして記録し、さらに、該
取得したスレッドの識別子を記録する処理をコンピュー
タに実行させるプログラムを記録している。[0011] The second recording medium of the present invention is characterized in that a function call or a return from a function call or both of them is triggered by a multi-thread program composed of a portion executed by any one of a plurality of threads. Acquiring the identifier of the thread in which the multi-thread program is being executed, and if the acquired identifier of the thread is different from the identifier of the previously recorded thread, records information on the state of the thread as trace data; And a program for causing a computer to execute a process of recording the identifier of the computer.
【0012】本発明の第3の記録媒体は、上記第1及び
第2の記録媒体において、前記マルチスレッドプログラ
ムにおける関数呼び出し又は関数呼び出しからの戻り
を、予め用意された特定のプログラムの実行により検出
する処理をコンピュータに実行させるプログラムを記憶
している。A third recording medium according to the present invention, in the first and second recording media, detects a function call or a return from the function call in the multithread program by executing a specific program prepared in advance. A program that causes a computer to execute the processing to be performed is stored.
【0013】本発明の第4の記録媒体は、複数のスレッ
ドのうちのいずれかのスレッドで実行される部分からな
るマルチスレッドプログラムに記述されたスレッド情報
採取命令の実行を契機として、該マルチスレッドプログ
ラムが実行されているスレッドの状態に関する情報を採
取する処理をコンピュータに実行させるプログラムを記
録している。A fourth recording medium according to the present invention is characterized in that the multi-thread program is executed by executing a thread information collection instruction described in a multi-thread program including a portion executed by any one of a plurality of threads. It records a program that causes a computer to execute a process of collecting information on the state of a thread in which the program is being executed.
【0014】本発明の第5の記録媒体は、複数のスレッ
ドのうちのいずれかのスレッドで実行される部分からな
るマルチスレッドプログラムに記述されたスレッド情報
採取命令の実行を契機として、該マルチスレッドプログ
ラムが実行されているスレッドの識別子を取得し、該取
得したスレッドの識別子と前回記録したスレッドの識別
子とが異なればスレッドの状態に関する情報をトレース
データとして記録し、さらに、該取得したスレッドの識
別子を記録する処理をコンピュータに実行させるプログ
ラムを記録している。A fifth recording medium according to the present invention is characterized in that the multi-thread program is executed by executing a thread information collection instruction described in a multi-thread program including a portion executed by any one of a plurality of threads. Acquiring the identifier of the thread in which the program is being executed, and if the acquired identifier of the thread is different from the identifier of the previously recorded thread, records information on the state of the thread as trace data; And a program for causing a computer to execute a process of recording the information.
【0015】[0015]
【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して詳細に説明する。Next, embodiments of the present invention will be described in detail with reference to the drawings.
【0016】図1を参照すると、本発明の第1の実施の
形態が適用される環境は、マルチスレッドにより実行さ
れる対象のプログラム(以下、「マルチスレッドプログ
ラム」という)1と、このマルチスレッドプログラム1
の実行を監視してトレースデータ3を作成するスレッド
情報採取プログラム2とを含んでいる。Referring to FIG. 1, an environment to which the first embodiment of the present invention is applied includes a program to be executed by multi-threads (hereinafter referred to as a “multi-thread program”) 1 and a multi-thread program. Program 1
And a thread information collection program 2 for monitoring the execution of the program and creating the trace data 3.
【0017】また、図2において、11はマルチスレッ
ドプログラム1の構造の一部を、12はスレッド情報採
取プログラムを表し、通常、マルチスレッドプログラム
1の関数Aから関数Bへは、13で示すような移行を行
うが、スレッド情報を採取する場合には、マルチスレッ
ドプログラム11からスレッド情報採取プログラム12
へ14で示すように移行し、スレッド情報採取プログラ
ム12からマルチスレッドプログラム11へ15で示す
ように移行する。In FIG. 2, reference numeral 11 denotes a part of the structure of the multi-thread program 1, and reference numeral 12 denotes a thread information collection program. However, when thread information is collected, the thread information collection program 12
Then, the process proceeds from the thread information collection program 12 to the multi-thread program 11 as shown by 15.
【0018】より詳細に説明すると、関数Aにおいて、
時刻T1で関数Bへの関数呼び出しがなされスレッド情
報採取プログラム12が呼ばれ、次の関数呼び出しとし
て関数Xにおいて、時刻T2で関数Yへの関数呼び出し
がなされスレッド情報採取プログラム12が呼ばれた場
合、時刻T2でのスレッド情報採取プログラム12は図
3のフローチャートに示す処理を行う。すなわち、ま
ず、スレッド情報採取プログラム12では、時刻T2で
のスレッドを識別するためのスレッドIDを取得する
(ステップS1)。なお、このスレッドIDの取得は、
本発明が適用されるような複数のスレッドが存在する実
行環境において用意されている情報を用いることにより
実現される。そして、この時刻T2でのスレッドIDと
時刻T1で記憶されていたスレッドIDとを比較するこ
とにより、スレッドの切り替わりの有無を判定し(ステ
ップS2)、スレッドの切り替わりがあればその旨をト
レースデータとして記録する(ステップS3)。本実施
の形態では、トレースデータとして、少なくともトレー
スの採取時刻と、切り替え前のスレッドIDと切り替え
後のスレッドIDとが含まれていればよいが、スレッド
が切り替った時のプログラムの実行位置やスレッドの走
行時間などの情報を採取するようにしてもよい。また、
時刻T2でのスレッドを識別するためのスレッドID
は、次回のスレッドの切り替わりの有無の判定に備えて
保存しておく(ステップS4)。More specifically, in the function A,
When a function call is made to the function B at time T1 and the thread information collection program 12 is called, and as a next function call, a function call to the function Y is made at time T2 and the thread information collection program 12 is called at function T The thread information collection program 12 at time T2 performs the processing shown in the flowchart of FIG. That is, first, the thread information collection program 12 acquires a thread ID for identifying the thread at the time T2 (step S1). This thread ID is obtained by
The present invention is realized by using information prepared in an execution environment in which a plurality of threads exist, to which the present invention is applied. By comparing the thread ID at the time T2 with the thread ID stored at the time T1, it is determined whether or not the thread has been switched (step S2). (Step S3). In this embodiment, the trace data only needs to include at least the trace collection time, the thread ID before switching, and the thread ID after switching. However, the execution position of the program when the thread is switched, Information such as the running time of the thread may be collected. Also,
Thread ID for identifying the thread at time T2
Is stored in preparation for the determination of the next thread switching (step S4).
【0019】なお、ここでは関数呼び出しを契機として
スレッド情報採取プログラム12を呼び出す方法を示し
たが、関数呼び出しの戻り、あるいは関数呼び出しとそ
の戻りの両方を契機としてスレッド情報採取プログラム
12を呼び出し採取することも可能である。Here, the method of calling the thread information collection program 12 in response to a function call has been described. It is also possible.
【0020】次に、本実施の形態における変形例を図面
を参照して詳細に説明する。Next, a modification of this embodiment will be described in detail with reference to the drawings.
【0021】図4を参照すると、この変形例は、マルチ
スレッドプログラム21と、スレッド情報採取プログラ
ム22とに加え、マルチスレッドプログラム21の実行
環境が「Just In Time Compile
r」(Java(米国等における米国Sun Micr
osystems Inc.の商標又は登録商標)など
のインタプリタ実行環境において、実行時に中間言語を
機械語に翻訳し、以後は変換した機械語を実行すること
により、高速実行を可能とするコンパイラ)などの実現
のために用意された「関数呼び出し時に呼ばれるルーチ
ン」23を含んでいる。なお、「関数呼び出し時に呼ば
れるルーチン」23が「Just InTime Co
mpiler」のために用意されたルーチンである場合
には、「関数呼び出し時に呼ばれるルーチン」23には
「Just In Time Compiler」のた
めの処理も実装されている。Referring to FIG. 4, in this modification, in addition to the multi-thread program 21 and the thread information collecting program 22, the execution environment of the multi-thread program 21 is "Just In Time Compile".
r "(Java (United States Sun Micro
osystems Inc. (Trademark or registered trademark)), an intermediate language is translated into a machine language at the time of execution, and thereafter the converted machine language is executed to realize a high-speed execution. A prepared “routine called at the time of function call” 23 is included. The “routine called at the time of calling the function” 23 is “Just InTime Co.
In the case of a routine prepared for “compiler”, the processing for “Just In Time Compiler” is also implemented in “routine called at the time of function call” 23.
【0022】この場合、通常、関数Aにおける関数Bの
呼び出しは、24で「関数呼び出し時に呼ばれるルーチ
ン」23へ移行し、25で関数Bの先頭へ移行すること
により行われるが、スレッド情報を採取する場合には、
「関数呼び出し時に呼ばれるルーチン」23から26で
スレッド情報採取プログラム22を呼び出し、スレッド
情報採取のための処理を施したのち、27で本来の処理
への移行を行う。In this case, the call of the function B in the function A is normally performed by shifting to the "routine called at the time of calling the function" 23 at 24 and shifting to the head of the function B at 25. If you do
The "routine called at the time of calling the function" 23 to 26 calls the thread information collection program 22 to perform processing for collecting thread information, and then performs the transition to the original processing at 27.
【0023】なお、この変形例では、「Just In
Time Compiler」のために用意されたル
ーチンを用いて、関数呼び出しを契機にスレッド情報採
取プログラム22を呼び出す方法を示したが、「関数呼
び出しの戻り時に呼ばれるルーチン」が用意されている
場合は、このルーチンからスレッド情報採取プログラム
22を呼び出すようにすれば、関数呼び出しの戻り、あ
るいは関数呼び出しとその戻りの両方を契機にスレッド
情報を採取することも可能である。また、「Just
In Time Compiler」のために用意され
たルーチンだけでなく、関数呼び出し時に呼ばれるルー
チンを備えた実行環境であれば、その実行環境自身に手
を入れることなくスレッド情報採取プログラム22を呼
び出すことができるので、このようなルーチンを用いる
ことにより、同様の採取が可能となる。In this modification, "Just In
The method for calling the thread information collection program 22 in response to a function call using the routine prepared for the “Time Compiler” has been described. If the thread information collection program 22 is called from a routine, it is also possible to collect thread information upon return of a function call or both of a function call and its return. Also, "Just
If the execution environment includes not only the routine prepared for “In Time Compiler” but also a routine called at the time of function call, the thread information collection program 22 can be called without changing the execution environment itself. By using such a routine, similar sampling can be performed.
【0024】本発明の第1の実施の形態は、マルチスレ
ッドプログラムにおける関数呼び出し時又は関数呼び出
しからの戻り時に呼ばれるルーチンからスレッド情報採
取プログラムを呼び出すなどして、マルチスレッドプロ
グラムにおける関数呼び出し又は関数呼び出しからの戻
りあるいはその両方を契機としたスレッド情報の採取を
行うようにしたことにより、マルチスレッドプログラム
の実行環境であるオペレーティングシステムに特化した
機能を利用することも、オペレーティングシステムの改
造を行うこともなく、スレッドの切り替え動作の情報を
採取することができるという効果を有している。In the first embodiment of the present invention, a function call or a function call in a multithread program is performed by calling a thread information collection program from a routine called when a function is called or returned from the function call in the multithread program. By collecting thread information in response to returning from or both, it is possible to use functions specific to the operating system that is the execution environment of the multi-thread program, and to modify the operating system In addition, there is an effect that information on thread switching operation can be collected.
【0025】また、本発明の第2の実施の形態は、図1
に示したものと同様の環境において、図5に示すよう
に、マルチスレッドプログラム31中に、スレッド情報
採取プログラム32を呼び出す命令33を記述したもの
である。この命令33をプログラム中の関数Aから関数
Bへの関数呼び出しの直前に直接挿入することにより、
34で関数Aから関数Bの先頭へと処理が移行する直前
に35でスレッド情報採取プログラム32を呼び出し、
スレッド情報採取のための処理を施したのち、36で関
数Aに処理が戻り、その後、34で関数Bの先頭へ処理
を移行することを実現する。Further, a second embodiment of the present invention is shown in FIG.
As shown in FIG. 5, an instruction 33 for calling a thread information collection program 32 is described in a multi-thread program 31 in an environment similar to that shown in FIG. By inserting this instruction 33 directly before the function call from the function A to the function B in the program,
Immediately before the processing shifts from the function A to the beginning of the function B in 34, the thread information collection program 32 is called in 35,
After performing the process for collecting thread information, the process returns to the function A at 36, and then the process is shifted to the beginning of the function B at 34.
【0026】なお、本実施の形態ではプログラム中の関
数呼び出しの直前にスレッド情報採取プログラム32を
呼び出す命令を挿入する方法を示したが、関数呼び出し
の戻りの直後、あるいは関数呼び出しの直前とその戻り
の直後の両方でスレッド情報採取プログラム32を呼び
出す命令を挿入することで採取することも可能である。
また、本実施例でのコードの挿入は、ソースプログラ
ム、実行プログラムあるいは中間コードへの挿入など、
挿入対象プログラムの形態は問わない。In this embodiment, the method of inserting an instruction for calling the thread information collection program 32 immediately before a function call in a program is described. However, immediately after the return of the function call, or immediately before the function call and its return. It is also possible to collect the thread information by inserting an instruction that calls the thread information collecting program 32 immediately after the instruction.
In addition, the insertion of the code in the present embodiment includes insertion into a source program, an execution program or intermediate code, and the like.
The form of the program to be inserted does not matter.
【0027】本発明の第2の実施の形態は、マルチスレ
ッドプログラムにおける関数呼び出しの直前又は関数呼
び出しからの戻りの直後あるいはその両方にスレッド情
報採取プログラムを呼び出す命令を挿入するようにした
ことにより、マルチスレッドプログラムにおける関数呼
び出し時又は関数呼び出しからの戻り時に呼ばれるルー
チンが用意されていない場合でも、マルチスレッドプロ
グラムの実行環境であるオペレーティングシステムに特
化した機能を利用することも、オペレーティングシステ
ムの改造を行うこともなく、スレッドの切り替え動作の
情報を採取することができるという効果を有している。According to the second embodiment of the present invention, an instruction for calling a thread information collection program is inserted immediately before a function call in a multithread program, immediately after a return from a function call, or both. Even if a routine that is called when a function is called or returned from a function call in a multi-threaded program is not prepared, it is possible to use a function that is specific to the operating system that is the execution environment of the multi-threaded program, or to modify the operating system. This has the effect that the information of the thread switching operation can be collected without performing it.
【0028】さらに、図6を参照すると、本発明の第3
の実施の形態は、スレッド情報採取プログラム42を記
録した記録媒体4を備える。この記録媒体4は、磁気デ
ィスク、半導体メモリその他の記録媒体であってよい。Still referring to FIG. 6, the third embodiment of the present invention
The embodiment has a recording medium 4 on which a thread information collection program 42 is recorded. The recording medium 4 may be a magnetic disk, a semiconductor memory, or another recording medium.
【0029】スレッド情報採取プログラム42は記録媒
体4から読み込まれ、前記第1の実施の形態におけるス
レッド情報採取プログラム2と同様の処理を行う。The thread information collection program 42 is read from the recording medium 4, and performs the same processing as the thread information collection program 2 in the first embodiment.
【0030】本発明の第3の実施の形態は、マルチスレ
ッドプログラムにおける関数呼び出し又は該関数呼び出
しからの戻りあるいはその両方を契機として、もしく
は、マルチスレッドプログラムにおける関数呼び出し又
は該関数呼び出しからの戻りあるいはその両方の直前に
スレッド情報を採取するようにしたことにより、マルチ
スレッドプログラムの実行環境であるオペレーティング
システムに特化した機能を利用することも、オペレーテ
ィングシステムの改造を行うこともなく、スレッドの切
り替え動作の情報を採取することができるという効果を
有している。In the third embodiment of the present invention, a function call in a multi-thread program and / or a return from the function call are triggered, or a function call in a multi-thread program or a return from the function call or Since thread information is collected immediately before both, thread switching can be performed without using functions specific to the operating system, which is the execution environment of the multi-thread program, and without modifying the operating system. This has the effect that operation information can be collected.
【0031】[0031]
【発明の効果】本発明には、マルチスレッドプログラム
の実行環境であるオペレーティングシステムに特化した
機能を利用することも、オペレーティングシステムの改
造を行うこともなく、スレッドの切り替え動作の情報を
採取することができるという効果がある。According to the present invention, information on a thread switching operation is collected without using a function specialized for an operating system which is an execution environment of a multi-thread program and without modifying the operating system. There is an effect that can be.
【図1】図1は本発明の第1及び第2の実施の形態が適
用される環境を示す図である。FIG. 1 is a diagram illustrating an environment to which first and second embodiments of the present invention are applied;
【図2】図2は本発明の第1の実施の形態におけるスレ
ッド情報の採取の仕組みの例を示す図である。FIG. 2 is a diagram illustrating an example of a mechanism for collecting thread information according to the first embodiment of the present invention.
【図3】図3は本発明の第1の実施の形態におけるスレ
ッド情報採取プログラムの動作を示す流れ図である。FIG. 3 is a flowchart showing an operation of a thread information collection program according to the first embodiment of the present invention.
【図4】図4は本発明の第1の実施の形態の変形例にお
けるスレッド情報の採取の仕組みの例を示す図である。FIG. 4 is a diagram illustrating an example of a mechanism for collecting thread information according to a modification of the first embodiment of the present invention;
【図5】図5は本発明の第2の実施の形態におけるスレ
ッド情報の採取の仕組みの例を示す図である。FIG. 5 is a diagram illustrating an example of a mechanism for collecting thread information according to a second embodiment of the present invention.
【図6】図6は本発明の第3の実施の形態が適用される
環境を示す図である。FIG. 6 is a diagram illustrating an environment to which a third embodiment of the present invention is applied;
1、11、21、31、41 マルチスレッドプログ
ラム 2、12、22、32、42 スレッド情報採取プロ
グラム 3 トレースデータ1, 11, 21, 31, 41 Multithread program 2, 12, 22, 32, 42 Thread information collection program 3 Trace data
Claims (10)
ッドで実行される部分からなるマルチスレッドプログラ
ムにおける関数呼び出し又は関数呼び出しからの戻り又
はその両方を契機として、該マルチスレッドプログラム
が実行されているスレッドの状態に関する情報を採取す
ることを特徴とするスレッド情報採取方法。A multi-thread program is executed by a function call, a return from a function call, or both in a multi-thread program consisting of a part executed by any one of a plurality of threads. A method for collecting thread information, comprising collecting information on a thread state.
ッドで実行される部分からなるマルチスレッドプログラ
ムにおける関数呼び出し又は関数呼び出しからの戻り又
はその両方を契機として、該マルチスレッドプログラム
が実行されているスレッドの識別子を取得し、該取得し
たスレッドの識別子と前回記録したスレッドの識別子と
が異なればスレッドの状態に関する情報をトレースデー
タとして記録し、さらに、該取得したスレッドの識別子
を記録することを特徴とするスレッド情報採取方法。2. The multi-thread program is executed by a function call in a multi-thread program including a portion executed by any one of a plurality of threads, a return from a function call, or both. Acquiring an identifier of the thread, if the acquired identifier of the thread is different from the identifier of the previously recorded thread, records information on the state of the thread as trace data, and further records the identifier of the acquired thread. Method of collecting thread information.
関数呼び出し又は関数呼び出しからの戻りを、予め用意
された特定のプログラムの実行により検出することを特
徴とする請求項1又は2に記載のスレッド情報採取方
法。3. The method according to claim 1, wherein a function call or a return from the function call in the multi-thread program is detected by executing a specific program prepared in advance.
ッドで実行される部分からなるマルチスレッドプログラ
ムに記述されたスレッド情報採取命令の実行を契機とし
て、該マルチスレッドプログラムが実行されているスレ
ッドの状態に関する情報を採取することを特徴とするス
レッド情報採取方法。4. An execution of a thread information collection instruction described in a multi-thread program including a portion executed by any one of a plurality of threads triggers the execution of the thread in which the multi-thread program is executed. A method for collecting thread information, comprising collecting information on a state.
ッドで実行される部分からなるマルチスレッドプログラ
ムに記述されたスレッド情報採取命令の実行を契機とし
て、該マルチスレッドプログラムが実行されているスレ
ッドの識別子を取得し、該取得したスレッドの識別子と
前回記録したスレッドの識別子とが異なればスレッドの
状態に関する情報をトレースデータとして記録し、さら
に、該取得したスレッドの識別子を記録することを特徴
とするスレッド情報採取方法。5. An execution of a thread information collection instruction described in a multi-thread program composed of a part executed by any one of a plurality of threads triggers the execution of the thread in which the multi-thread program is being executed. Acquiring an identifier, if the acquired identifier of the thread is different from the previously recorded thread identifier, records information relating to the state of the thread as trace data, and further records the acquired identifier of the thread. Thread information collection method.
ッドで実行される部分からなるマルチスレッドプログラ
ムにおける関数呼び出し又は関数呼び出しからの戻り又
はその両方を契機として、該マルチスレッドプログラム
が実行されているスレッドの状態に関する情報を採取す
る処理をコンピュータに実行させるプログラムを記録し
たことを特徴とする記録媒体。6. A multi-thread program which is executed by a function call, a return from a function call, or both in a multi-thread program including a portion executed by any one of a plurality of threads. A recording medium on which a program for causing a computer to execute a process of collecting information on a thread state is recorded.
ッドで実行される部分からなるマルチスレッドプログラ
ムにおける関数呼び出し又は関数呼び出しからの戻り又
はその両方を契機として、該マルチスレッドプログラム
が実行されているスレッドの識別子を取得し、該取得し
たスレッドの識別子と前回記録したスレッドの識別子と
が異なればスレッドの状態に関する情報をトレースデー
タとして記録し、さらに、該取得したスレッドの識別子
を記録する処理をコンピュータに実行させるプログラム
を記録したことを特徴とする記録媒体。7. The multi-thread program is executed by a function call in a multi-thread program including a portion executed by any one of a plurality of threads, a return from the function call, or both. A process of acquiring an identifier of the thread, recording the information on the state of the thread as trace data if the acquired identifier of the thread is different from the identifier of the previously recorded thread, and further recording the acquired identifier of the thread. A recording medium having recorded thereon a program to be executed.
関数呼び出し又は関数呼び出しからの戻りを、予め用意
された特定のプログラムの実行により検出する処理をコ
ンピュータに実行させるプログラムを記憶したことを特
徴とする請求項6又は7に記載の記録媒体。8. A program for causing a computer to execute a process of detecting a function call or a return from the function call in the multi-thread program by executing a specific program prepared in advance. Or the recording medium according to 7.
ッドで実行される部分からなるマルチスレッドプログラ
ムに記述されたスレッド情報採取命令の実行を契機とし
て、該マルチスレッドプログラムが実行されているスレ
ッドの状態に関する情報を採取する処理をコンピュータ
に実行させるプログラムを記録したことを特徴とする記
録媒体。9. Triggered by execution of a thread information collection instruction described in a multi-thread program including a portion executed by any one of a plurality of threads, the thread in which the multi-thread program is executed is executed. A recording medium on which a program for causing a computer to execute a process of collecting information on a state is recorded.
レッドで実行される部分からなるマルチスレッドプログ
ラムに記述されたスレッド情報採取命令の実行を契機と
して、該マルチスレッドプログラムが実行されているス
レッドの識別子を取得し、該取得したスレッドの識別子
と前回記録したスレッドの識別子とが異なればスレッド
の状態に関する情報をトレースデータとして記録し、さ
らに、該取得したスレッドの識別子を記録する処理をコ
ンピュータに実行させるプログラムを記録したことを特
徴とする記録媒体。10. Triggered by execution of a thread information collection instruction described in a multi-thread program including a portion executed by any one of a plurality of threads, the thread in which the multi-thread program is being executed is executed. If the identifier of the acquired thread is different from the identifier of the previously recorded thread, information on the state of the thread is recorded as trace data, and the process of recording the acquired identifier of the thread is executed on the computer. A recording medium characterized by recording a program for causing a program to be executed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9156575A JPH113250A (en) | 1997-06-13 | 1997-06-13 | Thread information collection method and recording medium recorded with thread information collection program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9156575A JPH113250A (en) | 1997-06-13 | 1997-06-13 | Thread information collection method and recording medium recorded with thread information collection program |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH113250A true JPH113250A (en) | 1999-01-06 |
Family
ID=15630769
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP9156575A Pending JPH113250A (en) | 1997-06-13 | 1997-06-13 | Thread information collection method and recording medium recorded with thread information collection program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH113250A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006018477A (en) * | 2004-06-30 | 2006-01-19 | Canon Software Inc | SEQUENCE INFORMATION GENERATION DEVICE, SEQUENCE INFORMATION GENERATION METHOD, PROGRAM, AND RECORDING MEDIUM |
| JP2010182237A (en) * | 2009-02-09 | 2010-08-19 | Nec Corp | System, method and program for sampling stack trace |
| CN109240899A (en) * | 2017-07-10 | 2019-01-18 | 北京京东尚科信息技术有限公司 | Information acquisition method and device |
-
1997
- 1997-06-13 JP JP9156575A patent/JPH113250A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006018477A (en) * | 2004-06-30 | 2006-01-19 | Canon Software Inc | SEQUENCE INFORMATION GENERATION DEVICE, SEQUENCE INFORMATION GENERATION METHOD, PROGRAM, AND RECORDING MEDIUM |
| JP2010182237A (en) * | 2009-02-09 | 2010-08-19 | Nec Corp | System, method and program for sampling stack trace |
| CN109240899A (en) * | 2017-07-10 | 2019-01-18 | 北京京东尚科信息技术有限公司 | Information acquisition method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6593940B1 (en) | Method for finding errors in multithreaded applications | |
| JP4436036B2 (en) | Information processing apparatus, trace processing method, program, and recording medium | |
| US7415699B2 (en) | Method and apparatus for controlling execution of a child process generated by a modified parent process | |
| JPH06222952A (en) | Debug support device | |
| CN114860586B (en) | A binary multi-executable software plug-in method based on dynamic plug-in | |
| KR20060021839A (en) | Program execution control device | |
| EP0933706B1 (en) | Language processing system and language processing method enabling reduction of memory region and overhead in profile information collection of computer | |
| EP1652094A1 (en) | Method and apparatus for improving the performance of garbage collection using stack trace cache | |
| JP4005724B2 (en) | Method and apparatus for realizing a multiple return site | |
| JP4681491B2 (en) | Profiling program and profiling method | |
| JPH113250A (en) | Thread information collection method and recording medium recorded with thread information collection program | |
| US8719772B2 (en) | Programming library usage capturing and representation | |
| JPH11102310A (en) | Program tracer and trace data compressing and recording method | |
| JP2000076095A (en) | Program trace device, program trace method, and storage medium storing the program | |
| JPH11265278A (en) | Operating system dynamic function management method | |
| CN121580403A (en) | Task-selective instruction-level kernel vulnerability triggering process tracing method | |
| JP2004078750A (en) | Object management apparatus and method and program | |
| JP2002149417A (en) | Register save / recovery method | |
| JP3110391B2 (en) | Program re-execution method | |
| CA2459123C (en) | Method and system for detecting potential deadlocks in computer programs | |
| JP3185873B2 (en) | Timing recording device for program execution | |
| JPH0667942A (en) | Log extraction system | |
| JP2002297416A (en) | Profile information acquisition device and profile information acquisition program | |
| JPS6249546A (en) | Logical language processor | |
| JPH03132823A (en) | Stacking system for data peculiar to procedure |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20000704 |