CN106126384B - A kind of method and device of acquisition performance monitoring unit PMU event - Google Patents

A kind of method and device of acquisition performance monitoring unit PMU event Download PDF

Info

Publication number
CN106126384B
CN106126384B CN201610412058.6A CN201610412058A CN106126384B CN 106126384 B CN106126384 B CN 106126384B CN 201610412058 A CN201610412058 A CN 201610412058A CN 106126384 B CN106126384 B CN 106126384B
Authority
CN
China
Prior art keywords
pmu
counter
event
acquisition
register file
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.)
Active
Application number
CN201610412058.6A
Other languages
Chinese (zh)
Other versions
CN106126384A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610412058.6A priority Critical patent/CN106126384B/en
Publication of CN106126384A publication Critical patent/CN106126384A/en
Priority to PCT/CN2017/087907 priority patent/WO2017215557A1/en
Application granted granted Critical
Publication of CN106126384B publication Critical patent/CN106126384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • 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

Abstract

The present invention provides a kind of methods of acquisition performance monitoring unit PMU event, the width of PMU counter and the quantity of PMU counter are set, wherein, the width of PMU counter can be reduced, and increase the quantity of PMU counter, the quantity of PMU counter can be arranged according to the width of PMU counter, to improve data acquisition efficiency, when receiving mission bit stream and executing corresponding task, triggering PMU counter is that the task acquires PMU event, to acquire the performance indicator corresponding when executing the task.The present invention also provides a kind of devices of acquisition performance monitoring unit PMU event, using the present invention, are conducive to the collecting efficiency for improving performance indicator.

Description

A kind of method and device of acquisition performance monitoring unit PMU event
Technical field
The present invention relates to electronic technology field more particularly to a kind of methods and dress of acquisition performance monitoring unit PMU event It sets.
Background technique
PMU (Performance Monitor Unit, performance monitoring unit) is CPU (Central Processing Unit, central processing unit) the electric logic unit that provides, it is responsible for monitoring and simultaneously acquires CPU and be directed to the property that is reflected of monitor task It can index.As shown in Figure 1, the PMU in figure uses 6 PMU counters, 6 performance indicators of monitor task can be acquired simultaneously, or Person obtains the more performance indicators of monitor task by the way of the acquisition of interval.Compared with the mode of interval acquisition, acquire simultaneously The performance indicator of monitor task can guarantee the comparativity of monitor task performance indicator in the process of implementation, collected performance indicator Also higher in precision.However, due to being limited by the quantity of PMU counter, it may not necessarily one acquisition completion monitor task All performance indicators, the acquisition of the corresponding data of all properties index could be completed by needing to be run multiple times the monitor task, be disappeared Time-consuming is long, and efficiency is lower.If the load variation fluctuation of CPU caused by monitor task is larger in monitor task operational process, True row of the monitor task at a certain moment or in certain time can not be accurately reflected by the way that collected data are run multiple times just For.
Summary of the invention
The present invention provides a kind of method and device of acquisition performance monitoring unit PMU event, can increase and adopt in the same time The quantity of the PMU event of collection improves data acquisition efficiency.
First aspect present invention provides a kind of method of acquisition performance monitoring unit PMU event, first setting PMU counter Width and PMU counter quantity, wherein the number of PMU counter can be increased by reducing the width of PMU counter Amount, the quantity of PMU counter can be arranged according to the width of PMU counter, to improve data acquisition efficiency, receive task letter When ceasing and executing corresponding task, triggering PMU counter is that the task acquires PMU event, to acquire when executing the task Corresponding performance indicator is conducive to the collecting efficiency for improving performance indicator.
With reference to first aspect, in the first implementation of first aspect, PMU is read in order to reduce from PMU counter The frequency of event, can each PMU counter of poll count value, when find PMU counter count value reach preset value when, read The PMU event of PMU counter acquisition is taken out, and the PMU event of acquisition is stored in corresponding register file.It is needing When reading PMU event, it can be obtained in time by accessing register file, reduce system consumption.
With reference to first aspect, in second of implementation of first aspect, when count value reaches preset value, can confirm PMU counter overflow can obtain the PMU event of PMU counter acquisition at this time.
With reference to first aspect, in the third implementation of first aspect, the time of the count value of PMU counter is obtained Period is less than or equal to the spilling time of PMU counter.The automatic regular polling PMU counter within the spilling time of PMU counter is prevented Only the content stored in PMU counter is emptied after PMU counter overflow.
With reference to first aspect, in the 4th kind of implementation of first aspect, processor can obtain register file at any time The PMU event of storage.Wherein, the acquisitions frequency of the PMU event of register file storage according to the size of register file, deposit The width of the corresponding PMU counter of device file and the spilling time of the corresponding PMU counter of register file determine.
With reference to first aspect, in the 5th kind of implementation of first aspect, the quantity of register file is counted according to PMU The quantity of device determines that the size of register file is determined according to the width of corresponding PMU counter.
With reference to first aspect, in the 6th kind of implementation of first aspect, the size of register file is according to corresponding The width of PMU counter and default value determine, the PMU event for obtaining register file storage time cycle with it is corresponding PMU counter the spilling time between ratio remainder be zero in the case where, preset value be greater than or equal to obtain deposit The ratio of the time cycle of the PMU event of device file storage and corresponding PMU counter overflowed between the time, is deposited obtaining The remainder of ratio between the time cycle of PMU event and the spilling time of corresponding PMU counter of the storage of device file is not In the case where zero, presets value and be greater than or equal to time cycle and the corresponding PMU for obtaining the PMU event of register file storage Counter overflow the time between ratio and 1 and.
The second aspect of the application provides a kind of device of acquisition performance monitoring unit PMU event, and the device is for setting The width and quantity of performance monitoring unit PMU counter are set, and triggering PMU counter is that task acquires PMU event.The device packet Include setup module, receiving module, execution module and trigger module.Wherein, setup module is for being arranged performance monitoring unit PMU The width of counter, and according to the quantity of the width of PMU counter setting PMU counter, receiving module is for receiving task letter Breath, execution module are used to execute task according to mission bit stream, and trigger module is that task acquires PMU thing for triggering PMU counter Part is conducive to the collecting efficiency for improving performance indicator to acquire the performance indicator corresponding when executing the task.
In conjunction with second aspect, in the first implementation of second aspect, which further includes determining module, obtains mould Block and memory module.Wherein it is determined that module is used to determine the size and quantity of register file, register file is for storing PMU counter is the PMU event of task acquisition, obtains module and is used for the acquisition when the count value of PMU counter reaches preset value The PMU event of PMU counter acquisition, the PMU event that memory module is used to will acquire the PMU counter acquisition that module is got are deposited Storage is in corresponding register file.
In conjunction with second aspect, in second of implementation of second aspect, module is obtained in the count value of PMU counter When obtaining the PMU event of PMU counter acquisition when reaching preset value, count value that is specific, obtaining PMU counter, if count value Reach preset value, determine PMU counter overflow, and obtains the PMU event of PMU counter acquisition.
In conjunction with second aspect, in the third implementation of second aspect, the counting that module obtains PMU counter is obtained The time cycle of value is less than or equal to the spilling time of PMU counter.
In conjunction with second aspect, in the 4th kind of implementation of second aspect, obtains module and be also used to obtain register text The PMU event of part storage obtains size of the frequency according to register file, the register of the PMU event of register file storage The width of the corresponding PMU counter of file and the spilling time of the corresponding PMU counter of register file determine.
In conjunction with second aspect, in the 5th kind of implementation of second aspect, the quantity of register file is counted according to PMU The quantity of device determines that the size of register file is determined according to the width of corresponding PMU counter.
In conjunction with second aspect, in the 6th kind of implementation of second aspect, the size of register file is according to corresponding The width of PMU counter and default value determine, the PMU event for obtaining register file storage time cycle with it is corresponding PMU counter the spilling time between ratio remainder be zero in the case where, preset value be greater than or equal to obtain deposit The ratio of the time cycle of the PMU event of device file storage and corresponding PMU counter overflowed between the time, is deposited obtaining The remainder of ratio between the time cycle of PMU event and the spilling time of corresponding PMU counter of the storage of device file is not In the case where zero, presets value and be greater than or equal to time cycle and the corresponding PMU for obtaining the PMU event of register file storage Counter overflow the time between ratio and 1 and.
The third aspect of the application provides the device of another acquisition performance monitoring unit PMU event, the knot of the device It include processor in structure, processor is configured as that the device is supported to execute the acquisition performance monitoring unit PMU that first aspect provides Corresponding function in the method for event.Processor is used to be arranged the width and quantity of performance monitoring unit PMU counter, and triggers PMU counter is that task acquires PMU event.The device further includes memory, and for memory for coupling with processor, saving should The necessary program instruction of device and data.The device further includes communication bus and communication interface, and communication bus is for realizing depositing Connection communication between reservoir and processor.Communication interface is communicated for the device with other devices.
Using the present invention, by the way that the width of PMU counter and the quantity of PMU counter is arranged, wherein reduction can be passed through The width of PMU counter increases the quantity of PMU counter, and the quantity of PMU counter can set according to the width of PMU counter It sets, to improve data acquisition efficiency, when receiving mission bit stream and executing corresponding task, triggering PMU counter is should Task acquires PMU event, to acquire the performance indicator corresponding when executing the task, is conducive to the acquisition for improving performance indicator Efficiency.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, required use in being described below to embodiment Attached drawing be briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, for this field For those of ordinary skill, without any creative labor, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is the structural schematic diagram of existing PMU;
Fig. 2 is a kind of structural schematic diagram of the device of acquisition performance monitoring unit PMU event;
Fig. 3 is a kind of process of an embodiment of the method for acquisition performance monitoring unit PMU event of the embodiment of the present invention Schematic diagram;
Fig. 4 is a kind of stream of another embodiment of the method for acquisition performance monitoring unit PMU event of the embodiment of the present invention Journey schematic diagram;
Fig. 5 is that a kind of structure of the processor of the method for acquisition performance monitoring unit PMU event of the embodiment of the present invention is shown It is intended to;
Fig. 6 is a kind of knot of another embodiment of the device of acquisition performance monitoring unit PMU event of the embodiment of the present invention Structure schematic diagram.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
The present invention provides a kind of method and devices of acquisition performance monitoring unit PMU event, are counted by using PMU Device, hardware state machine and register file increase the quantity of PMU counter, and in the case where PMU counter widths reduce The frequency of software sampling will not be increased, final realize acquires in same amount of time in the smaller situation of software collection expense The purpose of more PMU events, so that data acquisition efficiency be greatly improved.In addition, the property of the task to operation on a processor The a large amount of PMU event that needs can be analyzed, the PMU event acquired in the same time by hardware PMU counter is more, to the task The accuracy and precision of performance evaluation will be higher.Using the present invention, it is not only advantageous to improve the acquisition effect of performance indicator Rate, moreover it is possible to improve the accuracy and precision of performance evaluation.
Using the embodiment of the present invention, the quantity of the PMU event of acquisition can be increased, improve data acquisition efficiency.
Description and claims of this specification and term " first ", " second ", " third " and " in above-mentioned attached drawing Four " etc. are not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and it Any deformation, it is intended that cover and non-exclusive include.Such as it contains the process, method of a series of steps or units, be System, product or equipment are not limited to listed step or unit, but optionally further comprising the step of not listing or list Member, or optionally further comprising other step or units intrinsic for these process, methods, product or equipment.
Fig. 2 is a kind of structural schematic diagram of the device of acquisition performance monitoring unit PMU event, is applied to data acquisition scenarios In.The device of acquisition performance monitoring unit PMU event as shown in Figure 2 includes memory 100 and processor 101, can be with Including communication bus 102 and communication interface 103.
Wherein, batch processing code is stored in memory 100, and processor calls the program generation stored in memory 100 Code, the method for the acquisition performance monitoring unit PMU event for executing Fig. 3 to Fig. 4.Communication bus 102 is for realizing memory The device of connection communication between 100 and processor 101, acquisition performance monitoring unit PMU event is connect by communication interface 103 Mission bit stream is received, the task of mission bit stream instruction is executed by processor 101.
Memory 100 may include volatile memory (English: volatile memory), such as random access memory Device (English: random-access memory, abbreviation: RAM);Memory 100 also may include nonvolatile memory (English Text: non-volatile memory), for example, read-only memory (English: read-only memory, abbreviation: ROM), flash memory Reservoir (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state hard disk (English: Solid state drive, abbreviation: SSD);Memory 100 can also be the combination of the memory of mentioned kind.By soft Part is come the acquisition performance monitoring unit that when realizing technical solution provided by the present application, provides for realizing the application Fig. 3 to Fig. 4 The program code of the method for PMU event is stored in memory 100, and is executed by processor 101.
Processor 101 can be central processing unit (English: central processing unit, abbreviation: CPU).
Processor 101 be arranged in PMU unit 104 first in PMU counter unit 1010 width of PMU counter and The quantity of PMU counter, wherein the width of PMU counter can be reduced, and increase the quantity of PMU counter, adopted with improving data Collect efficiency, when processor 101 receives mission bit stream and executes the task of mission bit stream instruction, processor 101 is triggered PMU counter unit 1010 in PMU unit 104 is that the task acquires PMU event, is executing this with Acquisition Processor 101 Corresponding performance indicator when business is conducive to the collecting efficiency for improving performance indicator.
Optionally, PMU counter unit 1010, hardware state machine unit 1011 and register file cell 1012 can be Independently of the functional module of processor 101, may alternatively be integrated in processor 101.In Fig. 1 by PMU counter unit 1010, Hardware state machine unit 1011 and register file cell 1012 integrate to be illustrated in the processor 101.Wherein, firmly Part state machine unit 1011 is used for the count value of each PMU counter of poll, when the count value indication overflow of discovery PMU counter When, read out the PMU event of PMU counter acquisition.Register file cell 1012 is used for storage register file, register The quantity of file is determined by the quantity of PMU counter, and the corresponding collected PMU event of PMU counter is stored in register file.
Referring to Fig. 3, Fig. 3 is an a kind of reality of the method for acquisition performance monitoring unit PMU event of the embodiment of the present invention Apply the flow chart of example.Method shown in Fig. 3 is executed when the device operation of acquisition performance monitoring unit PMU event shown in Fig. 2.
As shown in figure 3, an a kind of embodiment of the method for acquisition performance monitoring unit PMU event of the embodiment of the present invention can To include the following steps.
The width of performance monitoring unit PMU counter is arranged in S100.
In the specific implementation, for example, task A is optimal path of the processor calculating from A point to B point.In order to analysis task A's Performance indicator needs to acquire PMU event.In the prior art, processor operation task A can only once acquire 6 events, if The analysis of task A is needed to acquire and is more than 6 PMU events, such as 30 events, it is necessary to the task that reruns A (30/6)=5 It is secondary to complete all collecting works.In order to improve data acquisition efficiency, the width of settable performance monitoring unit PMU counter Degree.Wherein, the width of PMU counter may include but be not limited to 32-bit, 16-bit or 8-bit etc., can according to the capacity of CPU or The demand of person's performance determines.
The quantity of the PMU counter is arranged according to the width of the PMU counter by S101.
In the specific implementation, in order to improve data acquisition efficiency, the width of settable PMU counter and PMU counter Quantity.In addition, the width due to PMU counter can reduce, can be counted according to PMU in the case where not increasing cpu resource The width of device determines the quantity of PMU counter, to realize the expansion of the quantity of PMU counter.By changing PMU counter The quantity of width and PMU counter improves the efficiency that PMU unit integrally acquires data.
S102, receives mission bit stream, and the mission bit stream indicates need to executing for task.
In the specific implementation, processor can receive mission bit stream, which is used to indicate the task that processor need to execute.
S103 executes the task according to the mission bit stream.
In the specific implementation, processor can start to execute the task in preset time.
S104, triggering the PMU counter is that the task acquires PMU event.
In the specific implementation, the PMU event is used to indicate corresponding performance indicator when executing the task.It is held in processor When the row task, triggerable PMU counter executes the performance indicator that the task is showed for processor and is acquired, and obtains To the PMU event for being directed to the task.Since the width and quantity of PMU counter determine that processor can be counted according to PMU Width and quantity the triggering PMU counter of device acquire the PMU event of the task.By reducing the width of PMU counter and opening up The quantity of exhibition PMU counter is conducive to the quantity of PMU event acquisition, improves data acquisition efficiency.
Using the embodiment of the present invention, the first quantity of the width of setting PMU counter and PMU counter, wherein can lead to The width of reduction PMU counter is crossed to increase the quantity of PMU counter, the quantity of PMU counter can be according to the width of PMU counter Degree setting, when receiving mission bit stream and executing corresponding task, triggers PMU counter to improve data acquisition efficiency PMU event is acquired for the task, to acquire the performance indicator corresponding when executing the task, is conducive to improve performance indicator Collecting efficiency.
Referring to Fig. 4, Fig. 4 is a kind of the another of the method for acquisition performance monitoring unit PMU event of the embodiment of the present invention The flow diagram of embodiment.It is executed when the device operation of acquisition performance monitoring unit PMU event shown in Fig. 2 shown in Fig. 4 Method.Fig. 4 makes up the spilling time for leading to PMU counter because of the reduction of the width of PMU counter on the basis of Fig. 3 The shortcomings that shortening, the frequency for preventing processor from obtaining PMU event from register file is excessively high and increases the expense of resource, Fig. 4 Introducing of the embodiment by hardware state machine unit 1011 and register file cell 1012, control processor reading PMU meter The frequency of number device, to reduce the resource overhead of processor.In addition, also alleviating because the width of PMU counter is too small, counts in short-term Number increases too fast and processor and fails loss of data caused by reading the PMU event of PMU counter acquisition in time, ensure that Acquire the reliability and accuracy of PMU event.
As shown in figure 4, a kind of another embodiment of the method for acquisition performance monitoring unit PMU event of the embodiment of the present invention It may comprise steps of.
The width of performance monitoring unit PMU counter is arranged in S200.
The quantity of the PMU counter is arranged according to the width of the PMU counter by S201.
In the specific implementation, in order to improve data acquisition efficiency, the width of settable PMU counter and PMU counter Quantity.Wherein, the width of PMU counter may include but be not limited to 32-bit, 16-bit or 8-bit etc., can be according to the capacity of CPU Or the demand of working performance determines.In addition, the width due to PMU counter can reduce, do not increasing cpu resource In the case of the quantity of PMU counter can be determined according to the width of PMU counter, to realize the expansion of the quantity of PMU counter. The efficiency that PMU unit integrally acquires data is improved by the quantity of the width and PMU counter that change PMU counter.Such as Fig. 5 It show PMU counter unit 1010, hardware state machine unit 1011 and register file cell 1012 and is integrated in processor The structural schematic diagram of processor when internal.Wherein, PMU counter unit 1010 includes at least one PMU counter 216, and N is indicated The quantity of PMU counter 216, n indicate the bit wide width of PMU counter 216.It additionally can be set and counted for each PMU Corresponding PMU event interface 100 is arranged in device 216, is responsible for each PMU counter 216 and acquires PMU event.PMU event interface 100 quantity is equal to the quantity of PMU counter 216, i.e. the quantity of PMU event interface 100 is also N.
S202 determines the size and quantity of register file.
In the specific implementation, the quantity of the register file 610 is determined according to the quantity of the PMU counter 216, it is described Register file 610 is used to store the PMU event that the PMU counter 216 is task acquisition.In the present embodiment, such as Shown in Fig. 5, register file cell 1012 can store multiple register files 610, and the quantity of register file 610 can be greater than Or the quantity equal to PMU counter 216, each register file 610 have corresponding PMU counter 216.
Optionally, the size of the register file 610 is determined according to the width of corresponding PMU counter 216.
In the specific implementation, the size of each register file 610 can be directly according to the width of corresponding PMU counter 216 It determines.
Optionally, the size of the register file 610 according to the width of corresponding PMU counter 216 and default takes Value determines, in the time cycle for obtaining the PMU event that the register file stores and the spilling of the corresponding PMU counter In the case that the remainder of ratio between time is zero, the default value, which is greater than or equal to, obtains the register file storage PMU event time cycle and the corresponding PMU counter 216 the ratio overflowed between the time, post described in the acquisition The ratio of the time cycle and corresponding PMU counter 216 for the PMU event that register file stores overflowed between the time In the case that remainder is not zero, the default value be greater than or equal to the PMU event for obtaining register file storage when Between period and the corresponding PMU counter 216 the ratio overflowed between the time and 1 and.
In the specific implementation, the size of each register file 610 can also be (n*NUM)-bit, n indicates that corresponding PMU is counted The width of device 216, NUM are the integer more than or equal to 1.Therefore, the capacity of register file cell 1012 is N* (n*NUM)- Bit, wherein the quantity of N expression PMU counter 216.In the present embodiment, the quantity of PMU counter 216 can be equal to register The quantity of the register file 610 stored in file unit 1012.As shown in figure 5, being posted with setting the corresponding PMU of PMU counter 0 The capacity of register file 0 is illustrated, if the width of PMU counter 0 is n-bit, the corresponding PMU register text of PMU counter 0 The capacity of part 0 is then (n*NUM)-bit.Wherein, the value of NUM is determined by specific demand.For example, if processor reading is posted The period of register file 610 is T (T >=T0), then the value of NUM can are as follows: if the remainder of T/T0 is 0, NUM >=T/T0, otherwise NUM≥([T/T0]+1)。
Optionally, this embodiment is not limited for the execution sequence of step S200 and step S201, and step S201 both can be It executes, can also be executed after step S200 before step S200.
S203, receives mission bit stream, and the mission bit stream indicates need to executing for task.
In the specific implementation, processor can receive mission bit stream, which is used to indicate the task that processor need to execute.
S204 executes the task according to the mission bit stream.
In the specific implementation, processor can start to execute the task in preset time.
S205, triggering the PMU counter is that the task acquires PMU event.
In the specific implementation, the PMU event is used to indicate corresponding performance indicator when executing the task.It is held in processor When the row task, triggerable PMU counter 216 executes the performance indicator that the task is showed for processor and is adopted Collection obtains the PMU event for the task.Since the width and quantity of PMU counter 216 determine that processor can root This is acquired using corresponding PMU event interface 100 according to width and quantity the triggering PMU counter 216 of PMU counter 216 The PMU event of business.Be conducive to PMU event by the quantity for reducing the width of PMU counter 216 and expand PMU counter 216 and adopt The quantity of collection improves data acquisition efficiency.
S206 obtains the PMU thing of the PMU counter acquisition when the count value of the PMU counter reaches preset value Part.
In the specific implementation, in order to make up the spilling for leading to PMU counter 216 because of the reduction of the width of PMU counter 216 The shortcomings that time shortens, the frequency for preventing processor from obtaining PMU event from register file 610 is excessively high and increases opening for resource Pin, can be by the state of each PMU counter 216 of 1011 poll of hardware state machine unit, when the count value of discovery PMU counter When reaching preset value, the PMU event that the PMU counter 216 acquisition is then read there are the spilling of PMU counter 216 is determined, and will As a result it is stored in corresponding register file.
Optionally, S206 specifically includes S2061 (not shown) and S2062 (not shown):
S2061 obtains the count value of the PMU counter.
In the specific implementation, hardware state machine unit 1011 can by the count value 212 of each PMU counter 216 of poll come Determine the state of each PMU counter 216.As shown in figure 5, the settable count value 212 (for example, OVFL value) of the present embodiment reaches Determine that corresponding PMU counter 216 overflows when to preset value, such as determining when the count value 212 of PMU counter 216 is 1 should PMU counter 216 overflows.Therefore, by configuring hardware state machine unit 1011, triggering hardware state machine unit 1011 is inquired The current OVFL value of PMU counter 216, and judge whether the current OVFL value of PMU counter 216 reaches preset value.
Optionally, the time cycle of the count value 212 for obtaining the PMU counter 216 is less than or equal to the PMU The spilling time of counter 216.PMU counter 216 empties the content stored in PMU counter 216 after overflowing in order to prevent, Hardware state machine unit 1011 needs the automatic regular polling PMU counter 216 within the spilling time of PMU counter 216.Therefore, firmly The time of the count value 212 of 1011 poll PMU counter 216 of part state machine unit is less than or equal to the spilling of PMU counter 216 Time.The spilling time of PMU counter 216 can pass through real-time statistics or determining, this reality by the performance of PMU counter 216 Example is applied to be not construed as limiting.
Optionally, the time of the count value 212 of 1011 poll PMU counter 216 of hardware state machine unit be also smaller than or The time is most overflowed fastly equal to PMU counter 216.The time of most overflowing fastly of PMU counter 216 can be by real-time statistics or logical The performance for crossing PMU counter 216 determines that this embodiment is not limited.
S2062 determines the PMU counter overflow, and obtain the PMU if the count value reaches the preset value The PMU event of counter acquisition.
In the specific implementation, when hardware state machine unit 1011 determines that the current OVFL value of PMU counter 216 reaches preset value When, show that count value 212 indicates that PMU counter 216 overflows, then hardware state machine unit 1011 reads the PMU counter 216 and adopts The PMU event of collection.
The PMU event of S207, the PMU counter acquisition that will acquire are stored in corresponding file.
In the specific implementation, the PMU event that the PMU counter 216 acquires is stored in deposit by hardware state machine unit 1011 In the corresponding register file 610 of device file unit 1012.Finally, hardware state machine unit 1011 continues to inquire next PMU The OVFL value of the count value 212 of counter 216.
S208 obtains the PMU event of the register file storage.
In the specific implementation, processor interface can be passed through when processor needs to obtain the PMU event of register file storage 700 read the PMU event that register file 610 stores.Processor can determine the PMU event that register file 610 stores that obtains Sampling period, i.e., acquisition register file 610 store PMU event frequency.For example, locating if the sampling period is 100ms It manages device and reads the PMU event that all register files 610 store in register file cell 1012 every 100ms.Such as Fig. 5 institute Show, processor obtains in register file cell 1012 PMU register file 0 to PMU register file in each sampling period (N-1) the PMU event stored.
Optionally, the frequency for obtaining the PMU event that the register file 610 stores is according to the register file 610 size, the width of the corresponding PMU counter 216 of the register file 610 and the register file 610 are corresponding PMU counter 216 the spilling time determine.Specifically, if the size of register file 610 is 512Bytes, PMU is counted The width of device 216 is 32-bit, and the spilling time of PMU counter 216 is 1 second, indicates that PMU counter 216 can incite somebody to action every second 32-bit data i.e. 4 Bytes writes in register file 610, after 512/4=128 seconds, 610 meeting of register file It writes completely, writes full front processor in register file 610 and need to read out content therein, at this time the reading deposit of processor The frequency of device file unit should be less than or be equal to 128 seconds/time.Pass through hardware state machine unit 1011 and register file cell 1012 introducing can be effectively reduced the frequency that processor reads PMU counter 216, reduce the resource overhead of processor.This Outside, it also alleviates because the width of PMU counter 216 is too small, short count growth is too fast and processor fails to read PMU in time Loss of data caused by the PMU event that counter 216 acquires, the reliability and accuracy that ensure that acquisition PMU event.
Optionally, the sampling cumulative time F0 that processor obtains the PMU event that the register file 610 stores can are as follows: T0≤F0≤(T0*NUM).Wherein, T0 indicate PMU counter 216 the spilling time or most fastly overflow the time, NUM be greater than Or the integer equal to 1.
Using the embodiment of the present invention, the first quantity of the width of setting PMU counter and PMU counter, wherein can lead to The width of reduction PMU counter is crossed to increase the quantity of PMU counter, the quantity of PMU counter can be according to the width of PMU counter Degree setting, when receiving mission bit stream and executing corresponding task, triggers PMU counter to improve data acquisition efficiency PMU event is acquired for the task, to acquire the performance indicator corresponding when executing the task, is conducive to improve performance indicator Collecting efficiency.
Referring to Fig. 6, Fig. 6 is a kind of the another of the device of acquisition performance monitoring unit PMU event of the embodiment of the present invention The structural schematic diagram of embodiment.Device shown in fig. 6 is realized by device shown in Fig. 2, can also pass through specific integrated circuit (English: Application-specific Integrated Circuit, abbreviation: ASIC) is realized or programmable logic device (English: Programmable Logic Device, abbreviation: PLD) is realized.Above-mentioned PLD can be Complex Programmable Logic Devices (English: Complex Programmable Logic Device, abbreviation: CPLD), FPGA, Universal Array Logic (English: Generic Array Logic, abbreviation: GAL) or any combination thereof.Device shown in fig. 6 is for realizing as shown in Figure 3 to Figure 4 Acquisition PMU event method.When by the software realization method for acquiring PMU event as shown in Figure 3 to Figure 4, the device It can be software module.
The device includes setup module 600, receiving module 601, execution module 602, trigger module 603, determining module 604, module 605 and memory module 606 are obtained.When setup module 600 works, execute step S100 and S101 shown in Fig. 3, Execute step S200 and S201 shown in Fig. 4.When receiving module 601 works, executes step S102 shown in Fig. 3, executes Fig. 4 Shown step S203.When execution module 602 works, executes step S103 shown in Fig. 3, executes step S204 shown in Fig. 4. When trigger module 603 works, executes step S104 shown in Fig. 3, executes step S205 shown in Fig. 4.Determining module 604 works When, execute step S202 shown in Fig. 4.When obtaining module 605 and working, step S206 shown in Fig. 4, step S2061 are executed (not Diagram), step S2062 (not shown).When memory module 606 works, step S207 shown in Fig. 4 is executed.
Optionally, which may also include acquisition module 607, when acquisition module 607 works, execute step shown in Fig. 4 S208。
Using the embodiment of the present invention, the first quantity of the width of setting PMU counter and PMU counter, wherein can lead to The width of reduction PMU counter is crossed to increase the quantity of PMU counter, the quantity of PMU counter can be according to the width of PMU counter Degree setting, when receiving mission bit stream and executing corresponding task, triggers PMU counter to improve data acquisition efficiency PMU event is acquired for the task, to acquire the performance indicator corresponding when executing the task, is conducive to improve performance indicator Collecting efficiency.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member It is physically separated with being or may not be, component shown as a unit may or may not be physics list Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness Labour in the case where, it can understand and implement.
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.
Module or unit in the device of that embodiment of the invention can be combined, divided and deleted according to actual needs.
The module or module of the embodiment of the present invention, can be with universal integrated circuit (such as central processor CPU), or with dedicated Integrated circuit (ASIC) is realized.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation Method described in certain parts of example or embodiment.
Embodiments described above does not constitute the restriction to the technical solution protection scope.It is any in above-mentioned implementation Made modifications, equivalent substitutions and improvements etc., should be included in the protection model of the technical solution within the spirit and principle of mode Within enclosing.

Claims (12)

1. a kind of method of acquisition performance monitoring unit PMU event characterized by comprising
The width of performance monitoring unit PMU counter is set;
The quantity of the PMU counter is set according to the width of the PMU counter;
Mission bit stream is received, the mission bit stream indicates need to executing for task;
The task is executed according to the mission bit stream;
Triggering the PMU counter is that the task acquires PMU event, when the PMU event is used to indicate the execution task Corresponding performance indicator.
2. the method according to claim 1, wherein before the reception mission bit stream, the method also includes:
Determine that the size and quantity of register file, the register file are the task for storing the PMU counter The PMU event of acquisition;
After the triggering PMU counter acquires PMU event for the task, the method also includes:
When the count value of the PMU counter reaches preset value, the PMU event of the PMU counter acquisition is obtained;
The PMU event for the PMU counter acquisition that will acquire is stored in corresponding register file.
3. according to the method described in claim 2, it is characterized in that, described when the count value of the PMU counter reaches default When value, the PMU event for obtaining the PMU counter acquisition includes:
Obtain the count value of the PMU counter;
If the count value reaches the preset value, the PMU counter overflow is determined, and obtain the PMU counter acquisition PMU event.
4. according to the method described in claim 3, it is characterized in that, the time of the count value for obtaining the PMU counter Period is less than or equal to the spilling time of the PMU counter.
5. according to the method described in claim 2, it is characterized in that, the PMU of the PMU counter acquisition that will acquire After event is stored in corresponding register file, the method also includes:
Obtain the PMU event of the register file storage, the frequency of the PMU event for obtaining the register file storage According to the size of the register file, the width of the corresponding PMU counter of the register file and register text The spilling time of the corresponding PMU counter of part determines.
6. a kind of device of acquisition performance monitoring unit PMU event characterized by comprising
Setup module, for the width of performance monitoring unit PMU counter to be arranged;
The setup module is also used to be arranged according to the width of the PMU counter quantity of the PMU counter;
Receiving module, for receiving mission bit stream, the mission bit stream indicates need to executing for task;
Execution module, for executing the task according to the mission bit stream;
Trigger module is that the task acquires PMU event for triggering the PMU counter, and the PMU event, which is used to indicate, to be held Corresponding performance indicator when the row task.
7. device according to claim 6, which is characterized in that described device further include:
Determining module, for determining that the size and quantity of register file, the register file are counted for storing the PMU Device is the PMU event of task acquisition;
Module is obtained, for when the count value of the PMU counter reaches preset value, obtaining the PMU counter acquisition PMU event;
Memory module, the PMU event of the PMU counter acquisition for getting the acquisition module are stored in corresponding In register file.
8. device according to claim 7, which is characterized in that the acquisition module is specifically used for:
Obtain the count value of the PMU counter;
If the count value reaches the preset value, the PMU counter overflow is determined, and obtain the PMU counter acquisition PMU event.
9. device according to claim 8, which is characterized in that the counting for obtaining module and obtaining the PMU counter The time cycle of value is less than or equal to the spilling time of the PMU counter.
10. device according to claim 7, which is characterized in that the acquisition module is also used to:
Obtain the PMU event of the register file storage, the frequency of the PMU event for obtaining the register file storage According to the size of the register file, the width of the corresponding PMU counter of the register file and register text The spilling time of the corresponding PMU counter of part determines.
11. a kind of device of acquisition performance monitoring unit PMU event, which is characterized in that including memory and processor, In:
Batch processing code is stored in the memory, and the processor calls the program code stored in the memory, The method for requiring 1 to 5 described in any item acquisition performance monitoring unit PMU events for perform claim.
12. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer soft Part product, some instructions that the computer software product includes, with so that computer equipment perform claim require 1 to 5 described in any item methods.
CN201610412058.6A 2016-06-12 2016-06-12 A kind of method and device of acquisition performance monitoring unit PMU event Active CN106126384B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610412058.6A CN106126384B (en) 2016-06-12 2016-06-12 A kind of method and device of acquisition performance monitoring unit PMU event
PCT/CN2017/087907 WO2017215557A1 (en) 2016-06-12 2017-06-12 Method and device for collecting performance monitor unit (pmu) events

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610412058.6A CN106126384B (en) 2016-06-12 2016-06-12 A kind of method and device of acquisition performance monitoring unit PMU event

Publications (2)

Publication Number Publication Date
CN106126384A CN106126384A (en) 2016-11-16
CN106126384B true CN106126384B (en) 2019-02-01

Family

ID=57270683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610412058.6A Active CN106126384B (en) 2016-06-12 2016-06-12 A kind of method and device of acquisition performance monitoring unit PMU event

Country Status (2)

Country Link
CN (1) CN106126384B (en)
WO (1) WO2017215557A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126384B (en) * 2016-06-12 2019-02-01 华为技术有限公司 A kind of method and device of acquisition performance monitoring unit PMU event
CN108509255B (en) * 2017-02-24 2021-01-22 龙芯中科技术股份有限公司 Method and device for processing hardware interrupt
CN108664367B (en) * 2017-03-28 2022-05-10 华为技术有限公司 Power consumption control method and device based on processor
CN107153604B (en) * 2017-05-17 2020-02-07 北京计算机技术及应用研究所 PMU-based parallel program performance monitoring and analyzing method
CN112445547A (en) * 2019-09-02 2021-03-05 无锡江南计算技术研究所 Low-disturbance performance data acquisition method for heterogeneous many-core processor
CN112069029B (en) * 2020-09-04 2023-11-14 北京计算机技术及应用研究所 Domestic platform PMU self-adaptive performance acquisition monitoring system
CN116701125B (en) * 2023-07-31 2023-10-27 太初(无锡)电子科技有限公司 Performance data acquisition method of AI chip

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236512A (en) * 2006-09-27 2008-08-06 英特尔公司 Enabling multiple instruction stream/multiple data stream extensions on microprocessors
CN103838539A (en) * 2012-11-23 2014-06-04 三星电子株式会社 Performance measurement unit, processor core comprising thereof and process profiling method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8055809B2 (en) * 2008-12-24 2011-11-08 International Business Machines Corporation System and method for distributing signal with efficiency over microprocessor
KR101991687B1 (en) * 2012-11-23 2019-06-24 삼성전자 주식회사 Dynamic library profiling method, computer readable recording medium storing thereof and dynamic library profiling system
CN106126384B (en) * 2016-06-12 2019-02-01 华为技术有限公司 A kind of method and device of acquisition performance monitoring unit PMU event

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236512A (en) * 2006-09-27 2008-08-06 英特尔公司 Enabling multiple instruction stream/multiple data stream extensions on microprocessors
CN103838539A (en) * 2012-11-23 2014-06-04 三星电子株式会社 Performance measurement unit, processor core comprising thereof and process profiling method

Also Published As

Publication number Publication date
CN106126384A (en) 2016-11-16
WO2017215557A1 (en) 2017-12-21

Similar Documents

Publication Publication Date Title
CN106126384B (en) A kind of method and device of acquisition performance monitoring unit PMU event
CN107992401A (en) Performance test evaluation method, device, terminal device and storage medium
EP3318975A1 (en) Method and device for detecting slow disk
CN101520640A (en) Time interval measuring instrument based on FPGA
CN103365965B (en) A kind of aggregation process method and apparatus of data
CN109375151B (en) Monitoring channel scheduling method and device for electric energy meter metering error on-line monitoring technology
CN109470918A (en) The electricity data processing method and IR46 electric energy meter of IR46 electric energy meter
CN107247650B (en) A kind of servo drive system long-range monitoring method
CN113268403A (en) Time series analysis and prediction method, device, equipment and storage medium
CN109375146B (en) Supplementary collection method and system for electricity consumption data and terminal equipment
US10860552B2 (en) Distributed resource parallel-operated data sorting systems and methods
CN103077080B (en) Based on parallel program performance collecting method and the device of high performance platform
CN109905261A (en) Method for diagnosing faults and device
CN111061802A (en) Power data management processing method and device and storage medium
CN106443171A (en) System and method for metering data of power bus during power failure of power utilization equipment
CN201331680Y (en) Time interval measuring instrument based on FPGA
CN111124791A (en) System testing method and device
CN110231894A (en) The determination method and apparatus of the motion profile of object
CN108599147A (en) Combination section prediction technique based on normal state exponential smoothing and Density Estimator
WO2017180415A1 (en) Systems and methods for managing outages in utility systems
CN109560965B (en) Method, device and equipment for acquiring flow of distributed system
CN108830707A (en) Based on data grouping method, apparatus, storage medium and the equipment for maximizing IV
CN108306784B (en) Method for counting total flow of virtual machines in XenServer pool
CN111162968A (en) Cloud resource use efficiency metering method and device, electronic equipment and storage medium
CN109783312B (en) Resource usage metering method, device and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant