WO2013145298A1 - 情報処理装置、及びプログラム解析情報収集方法 - Google Patents

情報処理装置、及びプログラム解析情報収集方法 Download PDF

Info

Publication number
WO2013145298A1
WO2013145298A1 PCT/JP2012/058703 JP2012058703W WO2013145298A1 WO 2013145298 A1 WO2013145298 A1 WO 2013145298A1 JP 2012058703 W JP2012058703 W JP 2012058703W WO 2013145298 A1 WO2013145298 A1 WO 2013145298A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
program memory
unit
information processing
memory
Prior art date
Application number
PCT/JP2012/058703
Other languages
English (en)
French (fr)
Inventor
高利 福田
修司 高田
健司郎 森
Original Assignee
富士通株式会社
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 富士通株式会社 filed Critical 富士通株式会社
Priority to PCT/JP2012/058703 priority Critical patent/WO2013145298A1/ja
Publication of WO2013145298A1 publication Critical patent/WO2013145298A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3612Software analysis for verifying properties of programs by runtime analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/865Monitoring of software

Definitions

  • the present invention relates to an information processing apparatus and a program analysis information collection method.
  • microcomputer for designating an address of a program memory and outputting address data indicated by an address counter to an external device.
  • address data is divided and output using a clock having a frequency higher than that of the clock on which the microcomputer operates.
  • microprogram coverage measurement circuit that stores the number of times that each microprogram address is passed for each address.
  • sampling type profiler that checks the program counter of a target program at regular intervals using an operating system interrupt is known.
  • the conventional microcomputer uses a clock having a higher frequency than the clock on which the microcomputer operates, considering the recent trend of increasing the speed of computers, it is not feasible. Further, since all the address counters indicated by the address counter are sampled, excessive information is collected as information for grasping the execution status of the program. For this reason, there may be a problem that a large amount of memory area is consumed or power consumption is increased.
  • the conventional microprogram coverage rate measuring circuit stores the number of times of passing through each address, excessive information is collected as information for grasping the execution state of the program.
  • the program counter is checked by using the interrupt of the operating system, so that the sampling interval becomes too long. For this reason, the conventional sampling profiler may not be able to grasp the execution status of the program with sufficient accuracy. In addition, it is necessary to modify the operating system, resulting in a burden of software correction.
  • the analysis target program may be different from the original operation. Is not preferable.
  • an object of the present invention is to collect information for program analysis at an appropriate frequency.
  • One embodiment of the present invention is based on an execution unit that executes an instruction, a program memory that stores an instruction and data executed by the execution unit, and a clock signal for the execution unit to operate.
  • a generation unit that generates a low-frequency sampling clock signal; an address of the program memory that operates according to the sampling clock signal and is specified by an address that excludes lower bits from among addresses output to the program memory
  • An information processing apparatus comprising: a counting unit that counts the number of times an instruction or data in an area is read out for a plurality of address areas.
  • information for program analysis can be collected at an appropriate frequency.
  • 3 is an internal configuration example of a frequency divider circuit 21. It is a figure which shows the time change of the total instruction
  • 3 is an internal configuration example of an address latch unit 22; 5 is an internal configuration example of a number adding unit 24.
  • 3 is a diagram schematically showing an address relationship between a main memory 13 and a measurement memory 23.
  • FIG. It is a figure which shows a mode that the address A output by MMU14 is converted into the address A * by the address latch part 22 and the address conversion part 25.
  • FIG. It is an example of a system configuration
  • 2 is a diagram showing a peripheral configuration of a cache memory 17.
  • FIG. It is an example of a system configuration
  • FIG. 1 is a system configuration example of an information processing apparatus 1 according to a first embodiment of the present invention.
  • the information processing apparatus 1 includes a program counter 11, an execution unit 12 including an instruction decoder, an instruction issuing unit, a calculator, an LSU (Load Store Unit), a main memory 13, a frequency dividing circuit 21, and an address latch unit 22. And a measurement memory 23 and a number-of-times adding unit 24.
  • the execution unit 12 reads the instruction stored at the address indicated by the program counter 11 in the main memory 13, and decodes and executes the read instruction.
  • the address latch unit 22 and the number adding unit 24 collect the aggregated data for analyzing the execution state of the program according to the sampling clock signal CLK ⁇ b> 2 generated by the frequency dividing circuit 21. To store. Such processing is started when execution of a program to be analyzed is started. The measurement memory 23 is cleared at the timing when execution of the program to be analyzed is started.
  • the frequency dividing circuit 21 generates a sampling clock CLK2 having a frequency that is 1/2 n of the CPU clock CLK1 supplied to the program counter 11 and the execution unit 12.
  • FIG. 2 shows an example of the internal configuration of the frequency dividing circuit 21.
  • T-type FFs (flip-flops) 21A_1, 21A_2, 21A_3,... are connected in series, and the AND circuits 21B_2, 21B_3,.
  • FIG. 3 is a diagram illustrating temporal changes of the aggregation instruction signal Sys, the CPU clock CLK1, the output FO1 of the T-type FF 21A_1, the output FO2 of the T-type FF 21A_2, the input FI3 and the output FO3 of the T-type FF 21A_3.
  • the aggregation instruction signal Sys is a signal that is maintained at Hi (1) while the information processing apparatus 1 executes program analysis, for example.
  • the frequency dividing circuit 21 is a CPU clock CLK1 or an output of each T-type FF and a signal indicating a frequency dividing ratio (in the figure, 2 0 , 2 1 , 2 2 , AND circuit 21C_1, 21C_2, 21C_3,... To which 2 3 ,.
  • a signal indicating a frequency dividing ratio in the figure, 2 0 , 2 1 , 2 2 , AND circuit 21C_1, 21C_2, 21C_3,... To which 2 3 ,.
  • minutes only those circumferential signal indicating the ratio has been inputted, (if 2 0 is input CPU clock CLK1 itself) divided clock signal and outputs to the OR circuit 21D.
  • FIG. 4 is an internal configuration example of the address latch unit 22.
  • the address latch unit 22 includes D-type FFs 22_n, 22_n + 1,.
  • the arguments m and n are integers, and m> n> 1.
  • the argument m is, for example, the most significant bit number of the address indicated by the program counter 11. Here, the number of bits is counted from 0.
  • the sampling clock signal CLK2 and the nth bit of the address indicated by the program counter 11 are input to the D-type FF 22_n.
  • the sampling clock signal CLK2 and the (n + 1) th bit of the address indicated by the program counter 11 are input to the D-type FF 22_n + 1.
  • the address latch unit 22 acquires the m-th to n-th bits of the address indicated by the program counter 11 in response to, for example, the rise of the sampling clock CLK2, and outputs it to the measurement memory 23.
  • the address latch unit 22 acquires an address in which n bits from the 0th to (n-1) th bits are omitted from the address indicated by the program counter 11 in response to, for example, rising of the sampling clock CLK2, and the measurement memory 23 Output to.
  • the measurement memory 23 outputs the value stored at the address input from the address latch unit 22 to the number adding unit 24.
  • the value stored in the measurement memory 23 is the cumulative number that the number adding unit 24 adds from 0 to 1.
  • the measurement memory 23 outputs the value stored in the address input from the address latch unit 22, the number adding unit 24 adds 1 to the value and overwrites the address.
  • the number adding unit 24 performs such an operation until the program to be analyzed is completed.
  • FIG. 5 is an internal configuration example of the number adding unit 24.
  • the number adding unit 24 includes a NOT circuit 24 ⁇ / b> A that inverts the 0th bit of the value stored in the address of the measurement memory 23 input from the address latch unit 22.
  • the number adding unit 24 includes an XOR circuit 24B for carrying (carrying), an AND circuit 24Ca and an XOR circuit 24Cb, an AND circuit 24Da and an XOR circuit 24Db, an AND circuit 24Ea, an XOR circuit 24Eb,.
  • D0 is the 0th bit of the value stored in the address of the measurement memory 23 input from the address latch unit 22
  • D1 is the 1st bit
  • D2 is the 2nd bit
  • D3 is the 3rd bit.
  • D4 respectively indicate the fourth bit.
  • FIG. 6 is a diagram schematically showing the address relationship between the main memory 13 and the measurement memory 23.
  • [h] in FIG. 6 indicates that the display is hexadecimal. Since n, which represents the division ratio and represents the number of lower bits omitted from the address indicated by the program counter 11, is 4, the measurement memory 23 has one hexadecimal digit equivalent to 2 4 , the main memory 13. The grain size becomes coarser than that.
  • the total value stored in 100 [h] of the measurement memory 23 is the number of times the program counter 11 indicates 1000 to 100F [h] of the main memory 13, that is, the instruction stored in the area, It indicates the number of times data has been read.
  • a word at an address 110 to 10D [h] in the measurement memory 23 is incremented once every 16 clocks.
  • the analysis based on the value stored in the measurement memory 23 is performed by an operator or the like. Specifically, first, the sum of each word in the measurement memory 23 is obtained, and this value is set as the operation time of the evaluation target program. Next, the sum of the word portions of the measurement memory 23 corresponding to each subroutine, function, etc. in the analysis target program is calculated for each subroutine, function, and this value is used as the running time for each subroutine, function, etc. By such analysis processing, it is grasped which subroutine or function spends time in the whole program.
  • Subroutines and functions in the program are not only called once, but may be called many times from the main routine, and jump and loop instructions may be executed in the function, so you just saw the program Therefore, it is difficult to measure the execution frequency and frequency.
  • the information processing apparatus 1 if all the contents of 100 to 10D [h] are added and multiplied by 16 after the analysis target program ends, the clock required by the function A in the program is obtained. The number can be calculated almost accurately.
  • the program analysis can be performed on the spot by an operator or the like.
  • the information processing apparatus 1 is used as a personal computer for general users, the data stored in the measurement memory 23 is transmitted to the center server for analysis via a network such as the Internet or a LAN. It is conceivable to be done.
  • a compiler / linker in which each subroutine or function of the program to be analyzed is arranged at 2 n boundary addresses. Is preferred.
  • the information processing apparatus 1 may be controlled not to write to the measurement memory 23 during a period when the analysis target program is not operating due to an OS (operating system) interrupt or the like.
  • OS operating system
  • the information processing apparatus 1 when the data stored in the measurement memory 23 overflows, the information processing apparatus 1 preferably generates an interrupt and records the cause. In this way, the information processing apparatus 1 can enable accurate analysis even for a program that is executed for a long time.
  • the information processing apparatus 1 Since the information processing apparatus 1 according to the present embodiment described above generates the sampling clock CLK2 in which the frequency of the CPU clock CLK1 is changed to a desired frequency by the frequency dividing circuit 21, the operation cycle of the address latch unit 22 and the number adding unit 24 is performed. Can be set freely. As a result, the information processing apparatus 1 according to the present embodiment can collect information for program analysis at an appropriate frequency.
  • the information processing apparatus 1 does not need to add software for performing such processing, and can execute a program to be analyzed in an original execution state.
  • the information processing apparatus 1 counts the number of times instructions and data in the address area specified by the upper bits of the address indicated by the program counter 11 are read. can do. In addition, since the information processing apparatus 1 according to the present embodiment matches the ratio of dividing the CPU clock CLK1 with the number of bits omitting the lower bits, the number of words in the measurement memory 23 can be reduced. .
  • the ratio for dividing the CPU clock CLK1 may be different from the number of bits for omitting the lower bits.
  • Such a configuration is suitable, for example, when the execution unit 12 uses a cache memory and the measurement memory 23 is an external memory. This is because the access to the cache memory is often faster than the access to the external memory by the address latch unit 22 or the number adding unit 24, and the frequency of the sampling clock CLK2 may need to be sufficiently low. .
  • “Generator” in the claims corresponds to, for example, the frequency divider 21 in the present embodiment.
  • the “aggregating unit” in the claims corresponds to, for example, the address latch unit 22, the measurement memory 23, and the number adding unit 24 in the present embodiment.
  • FIG. 7 is a system configuration example of the information processing apparatus 2 according to the second embodiment of the present invention.
  • the information processing apparatus 2 includes an MMU (Memory Management Unit) 14 and an address conversion unit 25 in addition to the components included in the information processing apparatus 1 of the first embodiment.
  • MMU Memory Management Unit
  • the measurement memory 23 is integrated into the main memory 13 and is handled as the measurement memory area 13A.
  • description of components having the same functions as those in the first embodiment among the components having the same reference numerals as those in the first embodiment in the information processing apparatus 2 will be omitted.
  • the address latch unit 22 acquires the m-th to n-th bits of the address output by the MMU 1 and outputs it to the address conversion unit 25 in response to, for example, the rise of the sampling clock CLK2.
  • the address conversion unit 25 sets the m to n bits of the address output from the MMU 1 as the lower bits from the 0th bit to the mn bit, and n bits of data from the most significant m bit to the mn + 1 bit Generate an address with.
  • FIG. 8 is a diagram illustrating a state where the address A output by the MMU 14 is converted into the address A * by the address latch unit 22 and the address conversion unit 25.
  • Am indicates the mth bit (most significant bit) of address A
  • An indicates the nth bit
  • An-1 indicates the n-1th bit
  • A0 indicates the 0th bit.
  • a * m indicates the mth bit (most significant bit) of the address A *
  • a * m ⁇ n + 1 indicates the mn + 1th bit
  • a * mn ⁇ indicates the mnth bit
  • a * 0 indicates the 0th bit.
  • the n-bit data from the m-th bit to the (m ⁇ n + 1) -th bit in the converted address A * determines the position of the measurement memory area 13A in the main memory 13, and the designer of the information processing apparatus 2 Can be arbitrarily determined. For example, when the measurement memory area 13A is to be set to F000 to FFFF [h], the address conversion unit 25 sets 1 to the upper 4 bits of the converted address A * and sets the actual address 0000 [h] to F000 [h]. Can be converted to. Such processing eliminates the need for the information processing apparatus 2 to provide a dedicated measurement memory.
  • the main memory 13 outputs the instruction and data stored in the address output from the MMU 14 to the address bus 15 to the data bus 16. Such instructions and data are used by the execution unit 12.
  • the main memory 13 outputs the data stored at the address in the measurement memory area 13A output from the address conversion unit 25 to the address bus 15 to the data bus 16.
  • the data stored at the address in the measurement memory area 13A is the same total value as the data stored in the measurement memory in the first embodiment.
  • the number adding unit 24 adds 1 to the value and overwrites the address.
  • the contents described in the first embodiment with reference to FIG. 6 are used.
  • the total value stored in F100 [h] of the measurement memory area 13A is the number of times that the MMU 14 outputs 1000 to 100F [h] of other areas, that is, instructions and data stored in the area. It indicates the number of times that has been read.
  • the information processing apparatus 2 Since the information processing apparatus 2 according to the present embodiment described above generates the sampling clock CLK2 in which the frequency of the CPU clock CLK1 is changed to a desired frequency by the frequency dividing circuit 21, the operation cycle of the address latch unit 22 and the number adding unit 24 is performed. Can be set freely. As a result, the information processing apparatus 2 of the present embodiment can collect information for program analysis at an appropriate frequency.
  • the information processing apparatus 2 does not need to add software for performing such processing, and can execute the analysis target program in an original execution state.
  • the information processing apparatus 2 counts the number of times instructions and data in the address area specified by the upper bits of the address output from the MMU 14 are read, so the size of the total data is reduced. be able to.
  • the information processing apparatus 2 according to the present embodiment makes the number of words in the measurement memory area 13A not excessive or insufficient in order to match the ratio of dividing the CPU clock CLK2 with the number of bits that omit the lower bits. it can.
  • the “counting unit” in claim 3 corresponds to, for example, the address latch unit 22, the number adding unit 24, and the measurement memory area 13A in the present embodiment.
  • FIG. 9 is a system configuration example of the information processing apparatus 3 according to the third embodiment of the present invention.
  • the information processing apparatus 3 includes a cache memory 17, a measurement cache memory 26, and an AND circuit 27 in addition to the components included in the information processing apparatus 2 of the second embodiment.
  • description of components having the same functions as those of the second embodiment among the components having the same reference numerals as those of the second embodiment of the information processing device 3 will be omitted.
  • the cache memory 17 is, for example, a direct-mapped cache memory that caches instructions and data that the execution unit 12 reads from the main memory 13.
  • FIG. 10 is a diagram showing a peripheral configuration of the cache memory 17.
  • the cache memory 17 receives middle bits of the address output from the program counter 11, and the TAG unit 17A is accessed with the middle bits.
  • the cache memory 17 inputs the data output as a result of accessing the TAG unit 17A with the middle number of bits and the upper bits of the address output from the program counter 11 to the comparator 17C for comparison. If they match, a cache hit occurs, and the output data of the DATA unit 17B is transmitted to the execution unit 12, where it is decoded and executed.
  • a cache hit signal CH indicating a cache hit is output from the comparator 17C to the control circuit of the cache memory 17 (not shown) and the AND circuit 27.
  • the address of the measurement cache memory 26 is accessed with the same address as the address that accessed the TAG unit 17A of the cache memory 17.
  • the clock signal supplied to the address latch unit 22 is a logical sum of the sampling clock CLK2 and the cache hit signal CH. Therefore, if the cache memory 17 is a cache hit, a new address is output to the measurement cache 26. If the cache memory 17 is a miss hit, the clock supplied to the address latch unit 22 is stopped, and the address latch unit 22 Holds the address. In the measurement cache memory 26, the corresponding value is read according to the address held in the address latch unit 22, and the read value is incremented by the number adding unit 24 and written back according to the sampling clock CLK. .
  • the content of the measurement cache memory 26 is written to the address converted by the address conversion unit 25 in the main memory 13. Then, a newly required word is read from the measurement memory area 13A of the main memory 13 and written into the measurement cache memory 26.
  • the cache memory 17 has a cache miss, the address converted in the measurement memory area 13A is read, and the value stored in the corresponding address is stored in the measurement cache memory 26. Written.
  • the information processing apparatus 3 Since the information processing apparatus 3 according to the present embodiment described above generates the sampling clock CLK2 in which the frequency of the CPU clock CLK1 is changed to a desired frequency by the frequency dividing circuit 21, the operation cycle of the address latch unit 22 and the number adding unit 24 is performed. Can be set freely. As a result, the information processing apparatus 3 according to the present embodiment can collect information for program analysis at an appropriate frequency.
  • the information processing apparatus 3 does not need to add software for performing such processing, and can execute the analysis target program in an original execution state.
  • the information processing apparatus 3 controls writing to the measurement cache memory 26 in response to a cache hit or cache miss in the cache memory 17, and thus reflects information that reflects processing performed in the cache memory 17. Can be collected.
  • FIG. 11 is a system configuration example of the information processing apparatus 4 according to the fourth embodiment of the present invention.
  • the information processing apparatus 4 is configured such that the information processing apparatus 2 of the second embodiment includes a plurality of CPUs 10A and 10B.
  • the plurality of CPUs 10 ⁇ / b> A and 10 ⁇ / b> B employ a centralized shared memory system (SMP: Symmetric Multiprocessing) that shares the main memory 13.
  • SMP Symmetric Multiprocessing
  • the measurement memory area 13A for the CPU 10A and the measurement memory area 13B for the CPU 10B are secured on the main memory 13.
  • FIG. 12 is a diagram schematically showing the relationship between all addresses in the main memory 13 and the measurement memory area.
  • the address conversion unit 25A of the CPU 10A performs the same operation as in the second embodiment (see FIG. 8 and related description).
  • the address conversion unit 25B of the CPU 10B sets the m to n bits of the address output from the MMU 14B as the lower bits, sets 1110 as the upper 4 bits of the converted address, and sets the real address 0000 [h] to E000 [h ].
  • the counting result by the CPU 10A and the counting result by the CPU 10B are stored in different areas of the main memory 13.
  • the information processing apparatus 4 generates the sampling clock CLK2 in which the frequency of the CPU clock CLK1 is changed to a desired frequency by the frequency dividing circuits 21A and 21B. Accordingly, the information processing apparatus 4 according to the present embodiment can freely set the operation cycle of the address latch units 22A and 22B and the number adding units 24A and 24B. As a result, the information processing apparatus 4 of the present embodiment can collect information for program analysis at an appropriate frequency.
  • the information processing apparatus 4 does not need to add software for performing such processing, and can execute the analysis target program in the original execution state.
  • FIG. 13 is a system configuration example of the information processing apparatus 5 according to the fifth embodiment of the present invention.
  • the information processing apparatus 5 includes a selector 28 instead of the frequency dividing circuit 21 included in the information processing apparatus 1 of the first embodiment.
  • description of components having the same functions as those of the first embodiment among components having the same reference numerals as those of the first embodiment of the information processing apparatus 5 will be omitted.
  • a signal corresponding to an event occurring in the information processing device 5 such as a cache miss signal CM indicating that a cache miss has occurred, a TLB miss signal TLBM indicating that a TLB (Translation Lookaside Buffer) error has occurred, and the like. Is entered.
  • the selector 28 outputs the increment control signal I to the number adding unit 24 when a desired signal among these signals is input.
  • the number adding unit 24 increments the value stored in the address of the measurement memory 23 acquired by the address latch unit 22 and writes it back.
  • the information processing apparatus 5 includes a plurality of measurement memories 23A, 23B,.
  • the selector 28 when the selector 28 is set to output the increment control signal I to the number adding unit 24 when the cache miss signal CM is input, the number adding unit 24 is stored in the measurement memory 23A corresponding to the cache miss. Increment the value and write it back.
  • the selector 28 is set to output the increment control signal I to the number adding unit 24 when the TLB miss signal TLBM is input, the number adding unit 24 is stored in the measurement memory 23B corresponding to the TLB miss. Increment the value and write it back.
  • Such use of the measurement memory may be realized by an internal circuit of the number adding unit 24 or the address latch unit 22 may change an address designated according to the setting of the selector 28 ( In this case, a plurality of areas can be set in the measurement memory).
  • the information processing apparatus 5 of the present embodiment described above can collect information for program analysis in response to the occurrence of the event that is the source of the signal selected by the selector 28.
  • the information processing apparatus 5 of the present embodiment can perform detailed analysis of a program by including a measurement memory corresponding to an event.
  • the information processing apparatus 5 of the present embodiment does not need to add software for performing such processing, and can execute the analysis target program in the original execution state.
  • the information processing apparatus 5 counts the number of times instructions and data in the address area specified by the upper bits of the address indicated by the program counter 11 are read. can do.
  • the information processing apparatus 5 includes the frequency dividing circuit 21 and may add that the sampling clock signal CLK2 is in a specific state to the condition that the address latch unit 22 and the number adding unit 24 operate. .
  • the information processing apparatus further includes a high-speed memory that can be accessed at high speed for measurement.
  • a high-speed memory that can be accessed at high speed for measurement.
  • the total results stored in the high-speed memory at a desired timing can be stored in the main memory It may be transferred to a memory for use.
  • the high-speed memory in addition to the cache memory described in the third embodiment, various memories that can be accessed at a higher speed than the main memory 13 can be used.
  • the present invention can be used in computer manufacturing industry, computer software manufacturing industry, various service industries using computers.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

 命令を実行する実行部と、前記実行部が実行する命令及びデータが格納されたプログラムメモリと、前記実行部が動作するためのクロック信号に基づき、該クロック信号よりも低周波なサンプリングクロック信号を生成する生成部と、前記サンプリングクロック信号に応じて動作し、前記プログラムメモリに出力されるアドレスのうち下位のビットを除外したアドレスにより特定される、前記プログラムメモリのアドレス領域内の命令又はデータが読み出された回数を、複数のアドレス領域について集計する集計部と、を備える情報処理装置。

Description

情報処理装置、及びプログラム解析情報収集方法
 本発明は、情報処理装置、及びプログラム解析情報収集方法に関する。
 従来、情報処理装置において、プログラムの実行状況を解析するための情報を収集する技術が知られている。
 例えば、プログラムメモリのアドレスを指定する、アドレスカウンタが示すアドレスデータを、外部機器に出力するマイクロコンピュータが知られている。このマイクロコンピュータでは、マイクロコンピュータが動作するクロックよりも高い周波数のクロックを用いて、アドレスデータを分割して出力している。
 また、マイクロプログラムの各々のアドレスを通過した回数を、各々のアドレスについて記憶するマイクロプログラム網羅率測定回路が知られている。
 また、オペレーティングシステムの割り込みを使って、対象プログラムのプログラムカウンタを一定間隔で調べるサンプリング型プロファイラが知られている。
特開2004-199334号公報 特開昭63-204340号公報
「性能解析」/ウィキペディア(URL:http://ja.wikipedia.org/wiki/%E6%80%A7%E8%83%BD%E8%A7%A3%E6%9E%90)
 しかしながら、上記従来のマイクロコンピュータは、マイクロコンピュータが動作するクロックよりも高い周波数のクロックを用いるため、近年のコンピュータの高速化傾向を考慮すると、実現性に乏しいものである。また、アドレスカウンタが示す全てのアドレスカウンタをサンプリングするため、プログラムの実行状況を把握する情報としては過剰な情報を収集することになる。このため、メモリ領域を多く消費したり、電力消費が増大したりする問題が生じうる。
 上記従来のマイクロプログラム網羅率測定回路も同様に、各々のアドレスを通過した回数を記憶するため、プログラムの実行状況を把握する情報としては過剰な情報を収集することになる。
 逆に、従来のサンプリング型プロファイラでは、オペレーティングシステムの割り込みを使ってプログラムカウンタを調べるため、サンプリング間隔が長くなり過ぎるという問題が生じる。このため、従来のサンプリング型プロファイラは、十分な精度でプログラムの実行状況を把握することができない場合がある。また、オペレーティングシステムに改変を施す必要があり、ソフトウェア修正の負担が生じる。
 なお、上記従来の手法の他、例えばソースプログラム内にサンプリングを行うためのコード等を埋め込む手法が考えられるが、この場合、解析対象のプログラムが本来の動作とは異なる動作をしてしまう可能性があり、好ましくない。
 一つの側面では、本発明は、プログラム解析のための情報を適切な頻度で収集することを目的とする。
 本発明の一態様は、命令を実行する実行部と、前記実行部が実行する命令及びデータが格納されたプログラムメモリと、前記実行部が動作するためのクロック信号に基づき、該クロック信号よりも低周波なサンプリングクロック信号を生成する生成部と、前記サンプリングクロック信号に応じて動作し、前記プログラムメモリに出力されるアドレスのうち下位のビットを除外したアドレスにより特定される、前記プログラムメモリのアドレス領域内の命令又はデータが読み出された回数を、複数のアドレス領域について集計する集計部と、を備える情報処理装置である。
 一実施態様によれば、プログラム解析のための情報を適切な頻度で収集することができる。
本発明の第1実施例に係る情報処理装置1のシステム構成例である。 分周回路21の内部構成例である。 集計指示信号Sys、CPUクロックCLK1、T型FF21A_1の出力FO1、T型FF21A_2の出力FO2、T型FF21A_3の入力FI3及び出力FO3の時間的変化を示す図である。 アドレスラッチ部22の内部構成例である。 回数加算部24の内部構成例である。 メインメモリ13と測定用メモリ23の間のアドレスの関係を模式的に示す図である。 本発明の第2実施例に係る情報処理装置2のシステム構成例である。 MMU14によって出力されたアドレスAが、アドレスラッチ部22及びアドレス変換部25によってアドレスA*に変換される様子を示す図である。 本発明の第3実施例に係る情報処理装置3のシステム構成例である。 キャッシュメモリ17の周辺構成を示す図である。 本発明の第4実施例に係る情報処理装置4のシステム構成例である。 メインメモリ13における全アドレスと、測定用メモリ領域との関係を模式的に示す図である。 本発明の第5実施例に係る情報処理装置5のシステム構成例である。
 以下、本発明を実施するための形態について、添付図面を参照しながら実施例を挙げて説明する。
 以下、図面を参照し、本発明の第1実施例に係る情報処理装置、及びそのプログラム解析情報収集方法について説明する。
 [全体構成]
 図1は、本発明の第1実施例に係る情報処理装置1のシステム構成例である。情報処理装置1は、プログラムカウンタ11と、命令デコーダ、命令発行部、演算器、LSU(Load Store Unit)等を含む実行部12と、メインメモリ13と、分周回路21と、アドレスラッチ部22と、測定用メモリ23と、回数加算部24とを備える。
 実行部12は、メインメモリ13におけるプログラムカウンタ11が示すアドレスに格納された命令を読み出し、読み出した命令をデコード及び実行する。
 [集計データの取得]
 一方、情報処理装置1では、分周回路21が生成するサンプリングクロック信号CLK2に応じて、アドレスラッチ部22及び回数加算部24が、プログラムの実行状況を解析するための集計データを測定用メモリ23に格納する。係る処理は、解析対象となるプログラムの実行が開始されたときに開始される。なお、測定用メモリ23は、解析対象となるプログラムの実行が開始されたタイミングでクリアされる。
 分周回路21は、例えば、プログラムカウンタ11や実行部12に与えられるCPUクロックCLK1の1/2nの周波数のサンプリングクロックCLK2を生成する。図2は、分周回路21の内部構成例である。分周回路21は、T型FF(フリップフロップ)21A_1、21A_2、21A_3、…が直列に接続されると共に、T型FF21A_2以降については、間にAND回路21B_2、21B_3、…が接続される。
 図3は、集計指示信号Sys、CPUクロックCLK1、T型FF21A_1の出力FO1、T型FF21A_2の出力FO2、T型FF21A_3の入力FI3及び出力FO3の時間的変化を示す図である。集計指示信号Sysは、例えば情報処理装置1がプログラムの解析を実行する間、Hi(1)に維持される信号である。各T型FFは、例えば、入力信号がHi(1)である間、CPUクロックCLK1の立ち上がり(立ち下がりでもよい)に応じて出力を反転させる。従って、図3に示すように、T型FF21A_n(n=1、2、3、…)の出力は、CPUクロックCLK1を、周波数1/2nに分周したものとなる。
 また、図2に示すように、分周回路21は、CPUクロックCLK1、又は各T型FFの出力と、周波数を分周する比率を示す信号(図中、20、21、22、23、…)が入力されるAND回路21C_1、21C_2、21C_3、…を備える。これらのAND回路のうち、分周比率を示す信号が入力されたもののみが、分周されたクロック信号(20が入力された場合はCPUクロックCLK1そのもの)をOR回路21Dに出力する。
 係る構成によって、所望の分周比率nを示す信号が分周回路21に入力されると、CPUクロックCLK1が周波数1/2nに分周されたサンプリングクロック信号CLK2が生成され、アドレスラッチ部22及び回数加算部24に出力される。
 図4は、アドレスラッチ部22の内部構成例である。アドレスラッチ部22は、D型FF22_n、22_n+1、…、22_mを備える。ここで、引数m、nは、整数であり、m>n>1である。引数mは、例えばプログラムカウンタ11が示すアドレスの最上位のビット数である。ここで、ビット数は0から数えるものとする。
 D型FF22_nには、サンプリングクロック信号CLK2と、プログラムカウンタ11が示すアドレスのnビット目が入力される。D型FF22_n+1には、サンプリングクロック信号CLK2と、プログラムカウンタ11が示すアドレスのn+1ビット目が入力される。以下同様であり、D型FF22_mには、サンプリングクロック信号CLK2と、プログラムカウンタ11が示すアドレスのmビット目(=最上位ビット)が入力される。
 係る構成によって、アドレスラッチ部22は、サンプリングクロックCLK2の例えば立ち上がりに応じて、プログラムカウンタ11が示すアドレスのm~nビット目を取得して測定用メモリ23に出力する。換言すると、アドレスラッチ部22は、サンプリングクロックCLK2の例えば立ち上がりに応じて、プログラムカウンタ11が示すアドレスから、0~n-1ビット目までのnビットを省略したアドレスを取得して測定用メモリ23に出力する。
 測定用メモリ23は、アドレスラッチ部22から入力されたアドレスに格納された値を、回数加算部24に出力する。測定用メモリ23に格納された値は、回数加算部24が0から1ずつ加算していった累積数である。回数加算部24は、測定用メモリ23がアドレスラッチ部22から入力されたアドレスに格納された値を出力すると、その値に1を加算して、当該アドレスに上書き保存する。回数加算部24は、このような動作を、解析対象のプログラムが終了するまで実行する。
 図5は、回数加算部24の内部構成例である。回数加算部24は、アドレスラッチ部22から入力された測定用メモリ23のアドレスに格納された値の0ビット目を反転させるNOT回路24Aを備える。また、回数加算部24は、キャリー(桁上げ)を行うためのXOR回路24B、AND回路24Ca及びXOR回路24Cb、AND回路24Da及びXOR回路24Db、AND回路24Ea及びXOR回路24Eb、…を備える。図中、D0はアドレスラッチ部22から入力された測定用メモリ23のアドレスに格納された値の0ビット目を、D1は1ビット目を、D2は2ビット目を、D3は3ビット目を、D4は4ビット目をそれぞれ示す。
 図6は、メインメモリ13と測定用メモリ23の間のアドレスの関係を模式的に示す図である。図6は、n=4である場合のアドレスの関係を示し、メインメモリ13上に関数Aと関数Bが配置されている様子を示している。また、図6における[h]は、16進数表示であることを示す。分周の比率を表すと共にプログラムカウンタ11が示すアドレスから省略される下位ビット数を表すnが4であるため、測定用メモリ23は、24に相当する16進数の1桁分、メインメモリ13よりも粒度が荒いものとなる。
 この結果、例えば測定用メモリ23の100[h]に格納される集計値は、メインメモリ13の1000~100F[h]をプログラムカウンタ11が示した回数、すなわち当該領域内に格納された命令やデータが読み出された回数を示すものとなる。
 解析対象のプログラムが実行され、関数Aが呼び出されると、測定用メモリ23内のアドレス110~10D[h]のどこかのワードが16クロックに1回インクリメントされる。解析対象のプログラムの実行が終了すると、測定用メモリ23に格納された値に基づく解析が、オペレータ等により行われる。具体的には、まず測定用メモリ23の各ワードの総和が求められ、この値が評価対象プログラムの動作時間とされる。次に解析対象のプログラム内の各サブルーチン、関数等に該当する測定用メモリ23のワード部分の総和が、サブルーチンや関数毎に算出され、この値が各サブルーチン、関数等の走行時間とされる。このような解析処理によって、プログラム全体の中で、どのサブルーチンや関数に時間を費やしているのかが把握される。
 プログラムにおけるサブルーチンや関数は、1回呼び出されるだけでなく、メインルーチンから何回も呼ばれる可能性もあり、また関数内でジャンプやループの命令が実行される場合もあるため、プログラムを見ただけでは実行頻度や回数を測るのが困難である。これに対し、本実施例の情報処理装置1の場合、解析対象のプログラムが終了した後に、100~10D[h]の内容を全て加算して16倍すれば、プログラムにおいて関数Aが所要したクロック数を、ほぼ正確に算出することができる。
 プログラムの解析は、情報処理装置1がプログラム開発の現場で使用される場合は、その場でオペレータ等によって行われ得る。これと異なり、情報処理装置1が一般ユーザ用のパーソナルコンピュータとして使用される場合は、例えばインターネットやLAN等のネットワークを介して、測定用メモリ23に格納されたデータがセンターサーバに送信され解析が行われることが考えられる。特に前者の場合、プログラムにおいてサブルーチンや関数が所要したクロック数を更に正確に算出するために、解析対象のプログラムの各サブルーチンや関数を2nバウンダリアドレスに配置するようにしたコンパイラ・リンカを用いると好適である。
 また、情報処理装置1は、OS(オペレーティングシステム)の割り込み等により解析対象のプログラムが動作していない期間には、測定用メモリ23への書き込みを行わないように制御されてもよい。
 また、情報処理装置1は、測定用メモリ23に格納されたデータがオーバフローした場合は、割り込みを発生してその原因を記録すると、好適である。こうすれば、情報処理装置1は、長時間実行されるプログラムに対しても正確な解析を可能にすることができる。
 [まとめ]
 以上説明した本実施例の情報処理装置1は、分周回路21によってCPUクロックCLK1の周波数を所望の周波数に変更したサンプリングクロックCLK2を生成するため、アドレスラッチ部22や回数加算部24の動作周期を自由に設定することができる。この結果、本実施例の情報処理装置1は、プログラム解析のための情報を適切な頻度で収集することができる。
 また、本実施例の情報処理装置1は、こうした処理を行うためのソフトウェアを追加する必要がなく、解析対象のプログラムを本来の実行状態で実行させることができる。
 また、本実施例の情報処理装置1は、プログラムカウンタ11が示すアドレスの上位ビットにより特定されるアドレス領域内の命令やデータが読み出された回数を集計するため、集計データのサイズをコンパクトにすることができる。また、本実施例の情報処理装置1は、CPUクロックCLK1を分周する比率と下位ビットを省略するビット数を一致させるため、測定用メモリ23のワード数を過不足無いものにすることができる。
 なお、本実施例の情報処理装置1において、CPUクロックCLK1を分周する比率と下位ビットを省略するビット数を異なるものとしても構わない。こうした構成は、例えば実行部12がキャッシュメモリを使用し、測定用メモリ23が外部メモリである場合に好適である。キャッシュメモリへのアクセスは、アドレスラッチ部22や回数加算部24による外部メモリへのアクセスに比して高速であることが多く、サンプリングクロックCLK2の周波数を十分に低くする必要があり得るからである。
 特許請求の範囲における「生成部」は、例えば本実施例における分周回路21に対応する。また、特許請求の範囲における「集計部」は、例えば本実施例におけるアドレスラッチ部22、測定用メモリ23、及び回数加算部24に対応する。
 <第2実施例>
 以下、図面を参照し、本発明の第2実施例に係る情報処理装置、及びそのプログラム解析情報収集方法について説明する。
 図7は、本発明の第2実施例に係る情報処理装置2のシステム構成例である。情報処理装置2は、第1実施例の情報処理装置1が備える構成要素に加えて、MMU(Memory Management Unit)14と、アドレス変換部25とを備える。また、情報処理装置2では、測定用メモリ23がメインメモリ13に統合され、測定用メモリ領域13Aとして扱われる。以下、情報処理装置2における第1実施例と符号が共通する構成要素のうち、機能が第1実施例と同様であるものについては説明を省略する。
 MMU14は、実行部12の実行するプログラムが認識する仮想アドレスを、メインメモリ13上の実アドレスに変換する。より具体的には、MMU14は、プログラムカウンタ11の示す値を実アドレスに変換し、アドレスバス15及びラッチ部22に出力する。MMU14は、例えばメインメモリ13のワード数が64K(0000~FFFF[h])、n=4とすると、仮想アドレス0000[h]を実アドレス1000[h]に変換する。
 アドレスラッチ部22は、サンプリングクロックCLK2の例えば立ち上がりに応じて、MMU1が出力したアドレスのm~nビット目を取得してアドレス変換部25に出力する。アドレス変換部25は、MMU1が出力したアドレスのm~nビット目を0ビット目~m-nビットまでの下位ビットとし、最上位のmビット目からm-n+1ビット目までにnビットのデータを付加したアドレスを生成する。図8は、MMU14によって出力されたアドレスAが、アドレスラッチ部22及びアドレス変換部25によってアドレスA*に変換される様子を示す図である。図中、AmはアドレスAのmビット目(最上位ビット)を示し、Anはnビット目を示し、An-1はn-1ビット目を示し、A0は0ビット目を示す。同様に、A*mはアドレスA*のmビット目(最上位ビット)を示し、A*m-n+1はm-n+1ビット目を示し、A*m-nはm-nビット目を示し、A*0は0ビット目を示す。
 変換後のアドレスA*におけるmビット目~m-n+1ビット目までのnビット分のデータは、メインメモリ13における測定用メモリ領域13Aの位置を決定するものであり、情報処理装置2の設計者が任意に決定することができる。例えば測定用メモリ領域13AをF000~FFFF[h]としたい場合、アドレス変換部25は、変換後のアドレスA*の上位4ビットに1を設定し、実アドレス0000[h]をF000[h]に変換すればよい。係る処理によって、情報処理装置2は、専用の測定用メモリを設ける必要が無くなる。
 メインメモリ13は、MMU14がアドレスバス15に出力したアドレスに格納された命令やデータをデータバス16に出力する。係る命令やデータは、実行部12によって使用される。
 また、メインメモリ13は、アドレス変換部25がアドレスバス15に出力した、測定用メモリ領域13A内のアドレスに格納されたデータを、データバス16に出力する。測定用メモリ領域13A内のアドレスに格納されたデータは、第1実施例における測定用メモリに格納されるデータと同様の集計値である。回数加算部24は、メインメモリ13がアドレス変換部25から入力されたアドレスに格納された値をデータバス16に出力すると、その値に1を加算して、当該アドレスに上書き保存する。
 メインメモリ13における測定用メモリ領域13A以外の部分と、測定用メモリ領域13Aの関係については、第1実施例で図6を用いて説明した内容を援用する。測定用メモリ領域は、例えばn=4とすると、24に相当する16進数の1桁分、他の領域よりも粒度が荒いものとなる(粒度差に起因する桁数の差は、例えば先頭の「F」で埋められている)。
 この結果、例えば測定用メモリ領域13AのF100[h]に格納される集計値は、他の領域の1000~100F[h]をMMU14が出力した回数、すなわち当該領域内に格納された命令やデータが読み出された回数を示すものとなる。
 係る構成によって、第1実施例と同様に、プログラム全体の中で、どのサブルーチンや関数に時間を費やしているのかが把握される。
 以上説明した本実施例の情報処理装置2は、分周回路21によってCPUクロックCLK1の周波数を所望の周波数に変更したサンプリングクロックCLK2を生成するため、アドレスラッチ部22や回数加算部24の動作周期を自由に設定することができる。この結果、本実施例の情報処理装置2は、プログラム解析のための情報を適切な頻度で収集することができる。
 また、本実施例の情報処理装置2は、こうした処理を行うためのソフトウェアを追加する必要がなく、解析対象のプログラムを本来の実行状態で実行させることができる。
 また、本実施例の情報処理装置2は、MMU14が出力するアドレスの上位ビットにより特定されるアドレス領域内の命令やデータが読み出された回数を集計するため、集計データのサイズをコンパクトにすることができる。また、本実施例の情報処理装置2は、CPUクロックCLK2を分周する比率と下位ビットを省略するビット数を一致させるため、測定用メモリ領域13Aのワード数を過不足無いものにすることができる。
 請求項3における「集計部」は、例えば本実施例におけるアドレスラッチ部22、回数加算部24、測定用メモリ領域13Aに対応する。
 <第3実施例>
 以下、図面を参照し、本発明の第3実施例に係る情報処理装置、及びそのプログラム解析情報収集方法について説明する。
 図9は、本発明の第3実施例に係る情報処理装置3のシステム構成例である。情報処理装置3は、第2実施例の情報処理装置2が備える構成要素に加えて、キャッシュメモリ17と、測定用キャッシュメモリ26と、AND回路27とを備える。以下、情報処理装置3における第2実施例と符号が共通する構成要素のうち、機能が第2実施例と同様であるものについては説明を省略する。
 キャッシュメモリ17は、実行部12がメインメモリ13から読み出す命令やデータをキャッシュする、例えばダイレクトマップ方式のキャッシュメモリである。図10は、キャッシュメモリ17の周辺構成を示す図である。キャッシュメモリ17には、プログラムカウンタ11が出力するアドレスの中位の数ビットが入力され、この中位の数ビットでTAG部17Aがアクセスされる。キャッシュメモリ17は、この中位の数ビットでTAG部17Aがアクセスされた結果として出力されるデータと、プログラムカウンタ11の出力するアドレスの上位ビットとを比較器17Cに入力して比較する。これらが一致する場合、キャッシュヒットとなり、DATA部17Bの出力データが実行部12に送信され、デコード、実行等される。上記データが一致しない場合、MMU14を介してメインメモリ13がアクセスされ、該当するデータが読み出されて実行部12に送信され、キャッシュメモリ17の内容が書き換えられる。キャッシュヒットを示すキャッシュヒット信号CHは、比較器17Cから、図示しないキャッシュメモリ17の制御回路、及びAND回路27に出力される。
 測定用キャッシュメモリ26のアドレスは、キャッシュメモリ17のTAG部17Aをアクセスしたアドレスと同一アドレスでアクセスされる。またアドレスラッチ部22に与えられるクロック信号は、サンプリングクロックCLK2とキャッシュヒット信号CHとの論理和である。従って、キャッシュメモリ17でキャッシュヒットであった場合、新たなアドレスが測定用キャッシュ26に出力され、ミスヒットであった場合、アドレスラッチ部22に与えられるクロックが止められ、アドレスラッチ部22は前アドレスを保持する。測定用キャッシュメモリ26は、アドレスラッチ部22に保持されているアドレスに従って該当する値が読み出され、サンプリングクロックCLKに応じて、読み出された値が回数加算部24によりインクリメントされて書き戻される。
 情報処理装置3では、キャッシュメモリ17でキャッシュヒットであった場合、測定用キャッシュメモリ26の内容が、メインメモリ13におけるアドレス変換部25により変換されたアドレスに書き込まれる。そして、新たに必要となるワードがメインメモリ13の測定用メモリ領域13Aから読み出され、測定用キャッシュメモリ26に書き込まれる。一方、情報処理装置3では、キャッシュメモリ17でキャッシュミスであった場合、測定用メモリ領域13Aのアドレス変換されたアドレスが読み出され、該当するアドレスに格納された値が測定用キャッシュメモリ26に書き込まれる。
 係る構成によって、第1実施例と同様に、プログラム全体の中でどのサブルーチンや関数に時間を費やしているのかが把握される。
 以上説明した本実施例の情報処理装置3は、分周回路21によってCPUクロックCLK1の周波数を所望の周波数に変更したサンプリングクロックCLK2を生成するため、アドレスラッチ部22や回数加算部24の動作周期を自由に設定することができる。この結果、本実施例の情報処理装置3は、プログラム解析のための情報を適切な頻度で収集することができる。
 また、本実施例の情報処理装置3は、こうした処理を行うためのソフトウェアを追加する必要がなく、解析対象のプログラムを本来の実行状態で実行させることができる。
 また、本実施例の情報処理装置3は、キャッシュメモリ17におけるキャッシュヒット、キャッシュミスに応じて測定用キャッシュメモリ26への書き込みを制御するため、キャッシュメモリ17において行われた処理を反映した情報を収集することができる。
 <第4実施例>
 以下、図面を参照し、本発明の第4実施例に係る情報処理装置、及びそのプログラム解析情報収集方法について説明する。
 図11は、本発明の第4実施例に係る情報処理装置4のシステム構成例である。情報処理装置4は、第2実施例の情報処理装置2を、複数のCPU10A、10Bを有する構成としたものである。複数のCPU10A、10Bは、メインメモリ13を共有する集中共有メモリ方式(SMP;Symmetric Multiprocessing)を採用している。
 各CPUにおける動作は、それぞれ第2実施例と同様であるため、詳細な説明を省略する。
 第4実施例に係る情報処理装置4では、CPU10A用の測定用メモリ領域13Aと、CPU10B用の測定用メモリ領域13Bとが、メインメモリ13上に確保される。
 例えばメインメモリ13のワード数が64K(0000~FFFF[h])、n=4とすると、測定用メモリ領域13Aは、F000~FFFF[h]に設定され、測定用メモリ領域13Bは、E000~EFFF[h]に設定される。図12は、メインメモリ13における全アドレスと、測定用メモリ領域との関係を模式的に示す図である。CPU10Aのアドレス変換部25Aは、第2実施例と同様の動作を行う(図8及び関連する説明を参照)。一方、CPU10Bのアドレス変換部25Bは、MMU14Bが出力したアドレスのm~nビット目を下位ビットとし、変換後のアドレスの上位4ビットに1110を設定し、実アドレス0000[h]をE000[h]に変換する。
 このような構成により、CPU10Aによる集計結果と、CPU10Bによる集計結果は、メインメモリ13の異なる領域に格納されることになる。
 以上説明した本実施例の情報処理装置4は、分周回路21A、21BによってCPUクロックCLK1の周波数を所望の周波数に変更したサンプリングクロックCLK2を生成する。これによって、本実施例の情報処理装置4は、アドレスラッチ部22A、22Bや回数加算部24A、24Bの動作周期を自由に設定することができる。この結果、本実施例の情報処理装置4は、プログラム解析のための情報を適切な頻度で収集することができる。
 また、本実施例の情報処理装置4は、こうした処理を行うためのソフトウェアを追加する必要がなく、解析対象のプログラムを本来の実行状態で実行させることができる。
 <第5実施例>
 以下、図面を参照し、本発明の第5実施例に係る情報処理装置、及びそのプログラム解析情報収集方法について説明する。
 図13は、本発明の第5実施例に係る情報処理装置5のシステム構成例である。情報処理装置5は、第1実施例の情報処理装置1が備える分周回路21に代えて、セレクタ28を備える。以下、情報処理装置5における第1実施例と符号が共通する構成要素のうち、機能が第1実施例と同様であるものについては説明を省略する。
 セレクタ28には、キャッシュミスが発生したことを示すキャッシュミス信号CM、TLB(Translation Lookaside Buffer)ミスが発生したことを示すTLBミス信号TLBM等、情報処理装置5内で発生したイベントに応じた信号が入力される。セレクタ28は、これらの信号のうち所望の信号が入力されてときに、インクリメント制御信号Iを回数加算部24に出力する。
 回数加算部24は、CPUクロックCLK1及びインクリメント制御信号Iが入力されたときに、アドレスラッチ部22が取得した測定用メモリ23のアドレスに格納された値を1インクリメントして書き戻す。
 また、本実施例に係る情報処理装置5は、複数の測定用メモリ23A、23B、…を備える。例えば、セレクタ28が、キャッシュミス信号CMが入力されたときにインクリメント制御信号Iを回数加算部24に出力する設定である場合、回数加算部24はキャッシュミスに対応した測定用メモリ23Aに格納された値をインクリメントし書き戻す。また、セレクタ28が、TLBミス信号TLBMが入力されたときにインクリメント制御信号Iを回数加算部24に出力する設定である場合、回数加算部24はTLBミスに対応した測定用メモリ23Bに格納された値をインクリメントし書き戻す。このような測定用メモリの使い訳は、回数加算部24の内部回路等によって実現されてもよいし、アドレスラッチ部22が、セレクタ28の設定に応じて指定するアドレスを変更してもよい(この場合、測定用メモリ内に複数の領域を設定することができる)。
 以上説明した本実施例の情報処理装置5は、セレクタ28によって選択された信号の元となったイベントの発生に応じて、プログラム解析のための情報を収集することができる。
 また、本実施例の情報処理装置5は、イベントに応じた測定用メモリを備えることにより、プログラムの詳細な解析を行うことができる。
 また、本実施例の情報処理装置5は、こうした処理を行うためのソフトウェアを追加する必要がなく、解析対象のプログラムを本来の実行状態で実行させることができる。
 また、本実施例の情報処理装置5は、プログラムカウンタ11が示すアドレスの上位ビットにより特定されるアドレス領域内の命令やデータが読み出された回数を集計するため、集計データのサイズをコンパクトにすることができる。
 なお、本実施例の情報処理装置5は、分周回路21を備え、アドレスラッチ部22や回数加算部24が動作する条件に、サンプリングクロック信号CLK2が特定の状態であることを加えてもよい。
 以上、本発明を実施するための最良の形態について実施例を用いて説明したが、本発明はこうした実施例に何等限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々の変形及び置換を加えることができる。
 例えば、第1実施例や第2実施例の情報処理装置が、更に、高速アクセス可能な高速メモリを測定用に備え、例えば所望のタイミングで、高速メモリに格納された集計結果をメインメモリや測定用メモリ等に転送してもよい。高速メモリとしては、第3実施例に記載したキャッシュメモリの他、メインメモリ13に比して高速アクセス可能な種々のメモリを用いることができる。
 本発明は、コンピュータ製造業、コンピュータソフトウェア製造業、コンピュータを使用した各種サービス業等に利用することができる。
 1、2、3、4、5 情報処理装置
 11  プログラムカウンタ
 12  実行部
 13  メインメモリ
 13A 測定用メモリ領域
 14  MMU
 15  アドレスバス
 16  データバス
 17  キャッシュメモリ
 21  分周回路
 22  アドレスラッチ部
 23  測定用メモリ
 24  回数加算部
 25  アドレス変換部
 26  測定用キャッシュメモリ
 27  AND回路
 28  セレクタ

Claims (8)

  1.  命令を実行する実行部と、
     前記実行部が実行する命令及びデータが格納されたプログラムメモリと、
     前記実行部が動作するためのクロック信号に基づき、該クロック信号よりも低周波なサンプリングクロック信号を生成する生成部と、
     前記サンプリングクロック信号に応じて動作し、前記プログラムメモリに出力されるアドレスのうち下位のビットを除外したアドレスにより特定される、前記プログラムメモリのアドレス領域内の命令又はデータが読み出された回数を、複数のアドレス領域について集計する集計部と、
     を備える情報処理装置。
  2.  前記集計部は、測定用のメモリにおける、前記プログラムメモリに出力されるアドレスのうち下位のビットを除外したアドレスに格納された値を、該下位のビットを除外したアドレスに対応付けられた前記プログラムメモリのアドレス領域内の命令又はデータが読み出された回数に応じて加算することにより前記集計を行う、
     請求項1記載の情報処理装置。
  3.  前記集計部は、前記プログラムメモリに出力されるアドレスを、前記プログラムメモリに出力されるアドレスのうち下位のビットを除外したアドレスを下位ビットとし、所望の上位ビットを付加した前記プログラムメモリのアドレスに変換する機能を有し、前記プログラムメモリにおける前記変換されたアドレスに格納された値を、該変換されたアドレスに対応付けられた前記プログラムメモリのアドレス領域内の命令又はデータが読み出された回数に応じて加算することにより前記集計を行う、
     請求項1記載の情報処理装置。
  4.  前記実行部が実行する命令及びデータをキャッシュするキャッシュメモリと、
     前記集計部が前記集計に使用する測定用キャッシュメモリと、を備え、
     前記集計部は、前記キャッシュメモリにおいてキャッシュヒットがあり且つサンプリングクロック信号が特定の状態である場合に、前記測定用キャッシュメモリに格納された値をインクリメントし、該インクリメントした値を測定用のメモリ領域に書き込む、
     請求項1記載の情報処理装置。
  5.  前記実行部と前記集計部の組み合わせを複数組備え、
     各集計部は、前記プログラムメモリに出力されるアドレスを、前記プログラムメモリに出力されるアドレスのうち下位のビットを除外したアドレスを下位ビットとし、該当する実行部及び集計部に固有の上位ビットを付加した前記プログラムメモリのアドレスに変換する機能を有し、前記プログラムメモリにおける前記変換されたアドレスに格納された値を、該変換されたアドレスに対応付けられた前記プログラムメモリのアドレス領域内の命令又はデータが読み出された回数に応じて加算することにより前記集計を行う、
     請求項1記載の情報処理装置。
  6.  前記プログラムメモリに出力されるアドレスは、プログラムカウンタが示す仮想アドレスをMMU(Memory Management Unit)が変換した実アドレスである、
     請求項1ないし5のいずれか1項記載の情報処理装置。
  7.  命令を実行する実行部と、
     前記実行部が実行する命令及びデータが格納されたプログラムメモリと、
     イベントに対応付けられた複数の信号のうち、特定の信号を選択する選択部と、
     前記選択部により選択された信号が前記選択部に入力された場合に、前記プログラムメモリに出力されるアドレスのうち下位のビットを除外したアドレスにより特定される、前記プログラムメモリのアドレス領域内の命令又はデータが読み出された回数を、複数のアドレス領域について集計する集計部と、
     を備える情報処理装置。
  8.  命令を実行する実行部と、前記実行部が実行する命令及びデータが格納されたプログラムメモリと、を備える情報処理装置が、
     前記実行部が動作するためのクロック信号に基づき、該クロック信号よりも低周波なサンプリングクロック信号を生成し、
     前記サンプリングクロック信号に応じて、前記プログラムメモリに出力されるアドレスのうち下位のビットを除外したアドレスにより特定される、前記プログラムメモリのアドレス領域内の命令又はデータが読み出された回数を、複数のアドレス領域について集計する、
     プログラム解析情報収集方法。
PCT/JP2012/058703 2012-03-30 2012-03-30 情報処理装置、及びプログラム解析情報収集方法 WO2013145298A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2012/058703 WO2013145298A1 (ja) 2012-03-30 2012-03-30 情報処理装置、及びプログラム解析情報収集方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2012/058703 WO2013145298A1 (ja) 2012-03-30 2012-03-30 情報処理装置、及びプログラム解析情報収集方法

Publications (1)

Publication Number Publication Date
WO2013145298A1 true WO2013145298A1 (ja) 2013-10-03

Family

ID=49258660

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/058703 WO2013145298A1 (ja) 2012-03-30 2012-03-30 情報処理装置、及びプログラム解析情報収集方法

Country Status (1)

Country Link
WO (1) WO2013145298A1 (ja)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5378738A (en) * 1976-12-23 1978-07-12 Toshiba Corp Memory control system
JPS6346549A (ja) * 1986-08-15 1988-02-27 Toshiba Corp デバッグ装置
JPS63204340A (ja) * 1987-02-18 1988-08-24 Nec Corp マイプログラム網羅率測定回路
JPH10240571A (ja) * 1997-02-21 1998-09-11 Nec Corp アドレストレース回路
JP2000267876A (ja) * 1999-03-17 2000-09-29 Toshiba Corp エミュレータ及びマイクロコンピュータ
JP2008123130A (ja) * 2006-11-09 2008-05-29 Nec Corp カバレッジ測定方法及び装置、モジュールのトレース方法及び装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5378738A (en) * 1976-12-23 1978-07-12 Toshiba Corp Memory control system
JPS6346549A (ja) * 1986-08-15 1988-02-27 Toshiba Corp デバッグ装置
JPS63204340A (ja) * 1987-02-18 1988-08-24 Nec Corp マイプログラム網羅率測定回路
JPH10240571A (ja) * 1997-02-21 1998-09-11 Nec Corp アドレストレース回路
JP2000267876A (ja) * 1999-03-17 2000-09-29 Toshiba Corp エミュレータ及びマイクロコンピュータ
JP2008123130A (ja) * 2006-11-09 2008-05-29 Nec Corp カバレッジ測定方法及び装置、モジュールのトレース方法及び装置

Similar Documents

Publication Publication Date Title
US8818760B2 (en) Modular re-configurable profiling core for multiprocessor systems-on-chip
US7433803B2 (en) Performance monitor with precise start-stop control
CN108475236B (zh) 测量地址转换延迟
JP2007293424A (ja) パフォーマンスモニタ装置、データ収集方法及びそのプログラム
US9465680B1 (en) Method and apparatus for processor performance monitoring
JP6090327B2 (ja) ボトルネック検出装置、方法及びプログラム
Pieper et al. High level cache simulation for heterogeneous multiprocessors
US20190235864A1 (en) Generating and verifying hardware instruction traces including memory data contents
Sheikh et al. Efficient load value prediction using multiple predictors and filters
US7051177B2 (en) Method for measuring memory latency in a hierarchical memory system
Satyanarayanan et al. Design trade-offs in VAX-11 translation buffer organization
Mutlu et al. Understanding the effects of wrong-path memory references on processor performance
EP4198741A1 (en) System, method and apparatus for high level microarchitecture event performance monitoring using fixed counters
Kejariwal et al. Comparative architectural characterization of SPEC CPU2000 and CPU2006 benchmarks on the intel® Core™ 2 Duo processor
WO2013145298A1 (ja) 情報処理装置、及びプログラム解析情報収集方法
Genbrugge et al. Memory data flow modeling in statistical simulation for the efficient exploration of microprocessor design spaces
Yang et al. Data cache prefetching via context directed pattern matching for coarse-grained reconfigurable arrays
Zhang et al. DELTA: Validate GPU Memory Profiling with Microbenchmarks
Bird Software knows best: A case for hardware transparency and measurability
Ryan et al. Automated diagnosis of VLSI failures
Krishnamurthy et al. Evaluating dusty caches on general workloads
US20230315453A1 (en) Forward conditional branch event for profile-guided-optimization (pgo)
EP4020233B1 (en) Automated translation lookaside buffer set rebalancing
US20230205251A1 (en) On-chip clock frequency analysis techniques
US20220100626A1 (en) Monitoring performance cost of events

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12872416

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12872416

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP