CN106126384A - A kind of method and device of acquisition performance monitor unit PMU event - Google Patents
A kind of method and device of acquisition performance monitor unit PMU event Download PDFInfo
- Publication number
- CN106126384A CN106126384A CN201610412058.6A CN201610412058A CN106126384A CN 106126384 A CN106126384 A CN 106126384A CN 201610412058 A CN201610412058 A CN 201610412058A CN 106126384 A CN106126384 A CN 106126384A
- Authority
- CN
- China
- Prior art keywords
- pmu
- enumerator
- event
- register file
- task
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3024—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording 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/3466—Performance evaluation by tracing or monitoring
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
A kind of method that the invention provides acquisition performance monitor unit PMU event, width and the quantity of PMU enumerator of PMU enumerator are set, wherein, the width of PMU enumerator can be reduced, and increase the quantity of PMU enumerator, the quantity of PMU enumerator can be arranged according to the width of PMU enumerator, to improve data acquisition efficiency, when receiving mission bit stream and performing the task of correspondence, triggering PMU enumerator is that this task gathers PMU event, to gather the performance indications corresponding when performing this task.Present invention also offers the device of a kind of acquisition performance monitor unit PMU event, use the present invention, be conducive to improving the collecting efficiency of performance indications.
Description
Technical field
The present invention relates to electronic technology field, particularly relate to method and the dress of a kind of acquisition performance monitor unit PMU event
Put.
Background technology
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 also gathers the property that CPU is reflected for monitor task
Can index.As it is shown in figure 1, PMU in figure uses 6 PMU enumerators, can 6 performance indications of acquisition monitoring task simultaneously, or
The mode that person uses interval to gather obtains the more performance indications of monitor task.And compared with the mode that interval gathers, gather simultaneously
The performance indications of monitor task can guarantee that the comparability of monitor task performance indications in the process of implementation, the performance indications collected
In precision the highest.But, owing to by PMU enumerator number quantitative limitation, may not necessarily once gather monitor task
All of performance indications, need that this monitor task is run multiple times and just can complete the collection of data corresponding to all properties index, disappear
Time-consuming is long, inefficient.If in monitor task running, the load change of the CPU that monitor task causes is fluctuated the most greatly,
This monitor task true row within certain moment or certain period just cannot be accurately reflected by the data collected are run multiple times
For.
Summary of the invention
The present invention provides the method and device of a kind of acquisition performance monitor unit PMU event, adopts in can increasing 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 monitor unit PMU event, first arranges PMU enumerator
Width and the quantity of PMU enumerator, wherein, the number of PMU enumerator can be increased by reducing the width of PMU enumerator
Amount, the quantity of PMU enumerator can be arranged according to the width of PMU enumerator, to improve data acquisition efficiency, is receiving task letter
When ceasing and perform corresponding task, triggering PMU enumerator is that this task gathers PMU event, to gather when this task of execution
Corresponding performance indications, are conducive to improving the collecting efficiency of performance indications.
In conjunction with first aspect, in the first implementation of first aspect, read PMU in order to reduce from PMU enumerator
The frequency of event, can the count value of poll each PMU enumerator, when the count value finding PMU enumerator reaches preset value, read
Take out the PMU event that this PMU enumerator gathers, and the PMU event of collection is stored in the register file of correspondence.At needs
When reading PMU event, can obtain in time by accessing register file, decrease system consumption.
In conjunction with first aspect, in the second implementation of first aspect, when count value reaches preset value, can confirm that
PMU counter overflow, now can obtain the PMU event that this PMU enumerator gathers.
In conjunction with first aspect, in the third implementation of first aspect, obtain the time of the count value of PMU enumerator
Cycle is less than or equal to the spilling time of PMU enumerator.Automatic regular polling PMU enumerator within the spilling time of PMU enumerator, anti-
Only after PMU counter overflow, the content of storage in PMU enumerator is emptied.
In conjunction with 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 acquisition frequency of the PMU event of register file storage according to the size of register file, deposit
The spilling time of the width of the PMU enumerator that device file is corresponding and PMU enumerator corresponding to register file determines.
In conjunction with first aspect, in the 5th kind of implementation of first aspect, the quantity of register file counts according to PMU
The quantity of device determines, the size of register file determines according to the width of corresponding PMU enumerator.
In conjunction with first aspect, in the 6th kind of implementation of first aspect, the size of register file is according to correspondence
Width and the default value of PMU enumerator determine, are obtaining the time cycle of the PMU event that register file stores with corresponding
PMU enumerator the spilling time between the remainder of ratio be zero in the case of, preset value and deposit more than or equal to acquisition
Ratio between time cycle and the spilling time of corresponding PMU enumerator of the PMU event of device file storage, deposits in acquisition
The remainder of the ratio between time cycle and the spilling time of corresponding PMU enumerator of the PMU event of device file storage is not
In the case of zero, preset value more than or equal to obtaining the time cycle of the PMU event that register file stores and corresponding PMU
Ratio between the spilling time of enumerator and 1 and.
The second aspect of the application, it is provided that the device of a kind of acquisition performance monitor unit PMU event, this device is used for setting
Put width and the quantity of performance monitoring unit PMU enumerator, and to trigger PMU enumerator be that task gathers PMU event.This device bag
Include and module, receiver module, execution module and trigger module are set.Wherein, module is set for arranging performance monitoring unit PMU
The width of enumerator, and the quantity of PMU enumerator is set according to the width of PMU enumerator, receiver module is used for receiving task letter
Breath, performs module and is used for performing task according to mission bit stream, and it is that task gathers PMU thing that trigger module is used for triggering PMU enumerator
Part, to gather the performance indications corresponding when performing this task, is conducive to improving the collecting efficiency of performance indications.
In conjunction with second aspect, in the first implementation of second aspect, this device also includes determining module, obtaining mould
Block and memory module.Wherein it is determined that module is for determining size and the quantity of register file, register file is used for storing
PMU enumerator is the PMU event that task gathers, and acquisition module is for obtaining when the count value of PMU enumerator reaches preset value
The PMU event that PMU enumerator gathers, the PMU event of the memory module PMU enumerator collection for being got by acquisition module is deposited
Store up in corresponding register file.
In conjunction with second aspect, in the second implementation of second aspect, acquisition module is in the count value of PMU enumerator
When reaching to obtain, during preset value, the PMU event that PMU enumerator gathers, concrete, the count value of acquisition PMU enumerator, if count value
Reach preset value, determine PMU counter overflow, and obtain the PMU event that PMU enumerator gathers.
In conjunction with second aspect, in the third implementation of second aspect, acquisition module obtains the counting of PMU enumerator
The time cycle of value is less than or equal to the spilling time of PMU enumerator.
In conjunction with second aspect, in the 4th kind of implementation of second aspect, acquisition module is additionally operable to obtain depositor literary composition
The PMU event of part storage, obtains the frequency size according to register file of the PMU event that register file stores, depositor
The spilling time of the width of the PMU enumerator that file is corresponding and PMU enumerator corresponding to register file determines.
In conjunction with second aspect, in the 5th kind of implementation of second aspect, the quantity of register file counts according to PMU
The quantity of device determines, the size of register file determines according to the width of corresponding PMU enumerator.
In conjunction with second aspect, in the 6th kind of implementation of second aspect, the size of register file is according to correspondence
Width and the default value of PMU enumerator determine, are obtaining the time cycle of the PMU event that register file stores with corresponding
PMU enumerator the spilling time between the remainder of ratio be zero in the case of, preset value and deposit more than or equal to acquisition
Ratio between time cycle and the spilling time of corresponding PMU enumerator of the PMU event of device file storage, deposits in acquisition
The remainder of the ratio between time cycle and the spilling time of corresponding PMU enumerator of the PMU event of device file storage is not
In the case of zero, preset value more than or equal to obtaining the time cycle of the PMU event that register file stores and corresponding PMU
Ratio between the spilling time of enumerator and 1 and.
The third aspect of the application, it is provided that the device of another kind of acquisition performance monitor unit PMU event, the knot of this device
Structure includes that processor, processor are configured to support that this device performs the acquisition performance monitor unit PMU that first aspect provides
Corresponding function in the method for event.Processor is for arranging width and the quantity of performance monitoring unit PMU enumerator, and triggers
PMU enumerator is that task gathers PMU event.This device also includes memorizer, and memorizer is for coupling with processor, and it preserves should
The programmed instruction of device necessity and data.This device also includes communication bus and communication interface, and communication bus is deposited for realization
Connection communication between reservoir and processor.Communication interface communicates with other devices for this device.
Use the present invention, by arranging width and the quantity of PMU enumerator of PMU enumerator, wherein, can pass through to reduce
The width of PMU enumerator increases the quantity of PMU enumerator, and the quantity of PMU enumerator can set according to the width of PMU enumerator
Put, to improve data acquisition efficiency, when receiving mission bit stream and performing the task of correspondence, trigger PMU enumerator for being somebody's turn to do
Task gathers PMU event, to gather the performance indications corresponding when performing this task, is conducive to improving the collection of performance indications
Efficiency.
Accompanying drawing explanation
In order to be illustrated more clearly that the technical scheme of the embodiment of the present invention, required use in embodiment being described below
Accompanying drawing be briefly described, it should be apparent that, below describe in accompanying drawing be some embodiments of the present invention, for this area
From the point of view of those of ordinary skill, on the premise of not paying creative work, it is also possible to obtain the attached of other according to these accompanying drawings
Figure.
Fig. 1 is the structural representation of existing PMU;
Fig. 2 is the structural representation of the device of a kind of acquisition performance monitor unit PMU event;
Fig. 3 is the flow process of an embodiment of the method for a kind of acquisition performance monitor unit PMU event of the embodiment of the present invention
Schematic diagram;
Fig. 4 is the stream of another embodiment of the method for a kind of acquisition performance monitor unit PMU event of the embodiment of the present invention
Journey schematic diagram;
Fig. 5 is that the structure of the processor of the method for a kind of acquisition performance monitor unit PMU event of the embodiment of the present invention is shown
It is intended to;
Fig. 6 is the knot of another embodiment of the device of a kind of acquisition performance monitor unit PMU event of the embodiment of the present invention
Structure schematic diagram.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Describe, it is clear that described embodiment is a part of embodiment of the present invention rather than whole embodiments wholely.Based on this
Embodiment in bright, the every other enforcement that those of ordinary skill in the art are obtained under not making creative work premise
Example, broadly falls into the scope of protection of the invention.
The invention provides the method and device of a kind of acquisition performance monitor unit PMU event, by using PMU to count
Device, hardware state machine and register file increase the quantity of PMU enumerator, and in the case of PMU counter widths reduces
Also will not increase the frequency of software sampling, finally realize gathering in same amount of time in the case of software collection expense is less
The purpose of more PMU event, thus data acquisition efficiency is greatly improved.It addition, the property to running on a processor of task
Energy is analyzed in needing substantial amounts of PMU event, same time the most, to this task by the PMU event of hardware PMU enumerator collection
The accuracy and precision of performance evaluation will be the highest.Use the present invention, be not only advantageous to improve the collection effect of performance indications
Rate, moreover it is possible to improve the accuracy and precision of performance evaluation.
Use the embodiment of the present invention, the quantity of the PMU event of collection can be increased, improve data acquisition efficiency.
Term " first ", " second ", " the 3rd " and " in description and claims of this specification and above-mentioned accompanying drawing
Four " it is etc. for distinguishing different object rather than for describing particular order.Additionally, term " includes " and " having " and it
Any deformation, it is intended that cover non-exclusive comprising.Such as contain series of steps or the process of unit, method, be
System, product or equipment are not limited to step or the unit listed, but the most also include step or the list do not listed
Unit, or the most also include other step intrinsic for these processes, method, product or equipment or unit.
Fig. 2 is the structural representation of the device of a kind of acquisition performance monitor unit PMU event, is applied to data acquisition scenarios
In.The device of acquisition performance monitor unit PMU event as shown in Figure 2 includes memorizer 100 and processor 101, it is also possible to
Including communication bus 102 and communication interface 103.
Wherein, memorizer 100 stores batch processing code, and processor calls the program generation of storage in memorizer 100
Code, for the method performing the acquisition performance monitor unit PMU event of Fig. 3 to Fig. 4.Communication bus 102 is used for realizing memorizer
Connection communication between 100 and processor 101, the device of acquisition performance monitor unit PMU event is connect by communication interface 103
Receive mission bit stream, processor 101 perform the task of this mission bit stream instruction.
Memorizer 100 can include volatile memory (English: volatile memory), such as random access memory
Device (English: random-access memory, abbreviation: RAM);Memorizer 100 can also include nonvolatile memory (English
Literary composition: non-volatile memory), such as 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 disc (English:
Solid state drive, abbreviation: SSD);Memorizer 100 can also be the combination of the memorizer of mentioned kind.By soft
When part realizes the technical scheme that the application provides, for realizing the acquisition performance monitor unit that the application Fig. 3 to Fig. 4 provides
The program code of the method for PMU event is saved in memorizer 100, and is performed by processor 101.
Processor 101 can be central processing unit (English: central processing unit, abbreviation: CPU).
Processor 101 first arrange PMU enumerator in PMU counter unit 1010 in PMU unit 104 width and
The quantity of PMU enumerator, wherein, it is possible to decrease the width of PMU enumerator, and increases the quantity of PMU enumerator, to improve data acquisition
Collection efficiency, when processor 101 receives mission bit stream and performs the task of this mission bit stream instruction, processor 101 triggers
PMU counter unit 1010 in PMU unit 104 gathers PMU event for this task, is performing this with Acquisition Processor 101
Performance indications corresponding during business, are conducive to improving the collecting efficiency of performance indications.
Optionally, PMU counter unit 1010, hardware state machine unit 1011 and register file cell 1012 can be
Functional module independent of processor 101, it is possible to be integrated in the middle of processor 101.In FIG by PMU counter unit 1010,
Hardware state machine unit 1011 and register file cell 1012 is integrated is illustrated in the processor 101.Wherein, firmly
Part state machine unit 1011 is for the count value of poll each PMU enumerator, when the count value instruction finding PMU enumerator is overflowed
Time, read out the PMU event that this PMU enumerator gathers.Register file cell 1012 is used for storing register file, depositor
The quantity of file is determined by the quantity of PMU enumerator, the PMU event that in register file, the corresponding PMU enumerator of storage collects.
Refer to method one real that Fig. 3, Fig. 3 are a kind of acquisition performance monitor unit PMU events of the embodiment of the present invention
Execute the flow chart of example.The method shown in Fig. 3 is performed during the plant running of the acquisition performance monitor unit PMU event shown in Fig. 2.
As it is shown on figure 3, an embodiment of the method for a kind of acquisition performance monitor unit PMU event of the embodiment of the present invention can
To comprise the following steps.
S100, arranges the width of performance monitoring unit PMU enumerator.
In implementing, such as, task A is the optimal path that processor calculates from A point to B point.For analysis task A
Performance indications, need to gather PMU event.In the prior art, processor operation task A once can only gather 6 events, if
Analysis to task A needs to gather more than 6 PMU events, such as 30 events, it is necessary to task A that reruns (30/6)=5
Secondary just can complete all of collecting work.In order to improve data acquisition efficiency, the width of setting energy monitor unit PMU enumerator
Degree.Wherein, the width of PMU enumerator 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.
S101, arranges the quantity of described PMU enumerator according to the width of described PMU enumerator.
In implementing, in order to improve data acquisition efficiency, the width of PMU enumerator and PMU enumerator can be set
Quantity.Further, since the width of PMU enumerator can reduce, therefore can count according to PMU in the case of not increasing cpu resource
The width of device determines the quantity of PMU enumerator, thus realizes the expansion of the quantity of PMU enumerator.By changing PMU enumerator
The quantity of width and PMU enumerator improves PMU unit entirety and gathers the efficiency of data.
S102, receives mission bit stream, and described mission bit stream indicates need to performing of task.
In implementing, processor can receive mission bit stream, the task that this mission bit stream need to perform for indicating processor.
S103, performs described task according to described mission bit stream.
In implementing, processor can start to perform this task at Preset Time.
S104, triggering described PMU enumerator is that described task gathers PMU event.
In implementing, the performance indications that described PMU event is corresponding when performing described task for indicating.Hold at processor
During this task of row, PMU enumerator can be triggered and perform, for processor, the performance indications that this task showed and be acquired,
To the PMU event for this task.Owing to width and the quantity of PMU enumerator determine, therefore processor can count according to PMU
The width of device and quantity trigger PMU enumerator and gather the PMU event of this task.By reducing the width of PMU enumerator and opening up
The quantity of exhibition PMU enumerator is conducive to the quantity of PMU event acquisition, improves data acquisition efficiency.
Use the embodiment of the present invention, first width and the quantity of PMU enumerator of PMU enumerator are set, wherein, can lead to
Cross reduce PMU enumerator width to increase the quantity of PMU enumerator, the quantity of PMU enumerator can be according to the width of PMU enumerator
Degree is arranged, and to improve data acquisition efficiency, when receiving mission bit stream and performing the task of correspondence, triggers PMU enumerator
Gather PMU event for this task, to gather the performance indications corresponding when performing this task, be conducive to improving performance indications
Collecting efficiency.
Refer to another of method that Fig. 4, Fig. 4 are a kind of acquisition performance monitor unit PMU events of the embodiment of the present invention
The schematic flow sheet of embodiment.Perform shown in Fig. 4 during the plant running of the acquisition performance monitor unit PMU event shown in Fig. 2
Method.Fig. 4 causes the spilling time of PMU enumerator in order to make up because of the reduction of the width of PMU enumerator on the basis of Fig. 3
The shortcoming shortened, prevents processor from obtaining the frequency of PMU event from register file too high and increase the expense of resource, Fig. 4
Embodiment passes through hardware state machine unit 1011 and the introducing of register file cell 1012, controls processor and reads PMU meter
The frequency of number device, thus reduce the resource overhead of processor.Additionally, also alleviate because the width of PMU enumerator is too small, count in short-term
Number increases too soon and processor fails to read the loss of data that the PMU event of PMU enumerator collection causes in time, it is ensured that
Gather reliability and the accuracy of PMU event.
As shown in Figure 4, another embodiment of the method for a kind of acquisition performance monitor unit PMU event of the embodiment of the present invention
May comprise steps of.
S200, arranges the width of performance monitoring unit PMU enumerator.
S201, arranges the quantity of described PMU enumerator according to the width of described PMU enumerator.
In implementing, in order to improve data acquisition efficiency, the width of PMU enumerator and PMU enumerator can be set
Quantity.Wherein, the width of PMU enumerator 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 service behaviour determines.Further, since the width of PMU enumerator can reduce, therefore do not increasing cpu resource
In the case of can determine the quantity of PMU enumerator according to the width of PMU enumerator, thus realize the expansion of the quantity of PMU enumerator.
The quantity of width and PMU enumerator by changing PMU enumerator improves PMU unit entirety and gathers the efficiency of data.Such as Fig. 5
It show PMU counter unit 1010, hardware state machine unit 1011 and register file cell 1012 and be integrated in processor
The structural representation of processor time internal.Wherein, PMU counter unit 1010 includes at least one PMU enumerator 216, and N represents
The quantity of PMU enumerator 216, n represents the bit wide width of PMU enumerator 216.Additionally can arrange and count for each PMU
Device 216 arranges the PMU event interface 100 of correspondence, is responsible for each PMU enumerator 216 and gathers PMU event.PMU event interface
The quantity of 100 is equal to the quantity of PMU enumerator 216, i.e. the quantity of PMU event interface 100 is also N.
S202, determines size and the quantity of register file.
In implementing, the quantity of described register file 610 determines according to the quantity of described PMU enumerator 216, described
Register file 610 is the PMU event that described task gathers for storing described PMU enumerator 216.In the present embodiment, as
Shown in Fig. 5, register file cell 1012 can store multiple register file 610, and the quantity of register file 610 can be more than
Or the quantity equal to PMU enumerator 216, each register file 610 has the PMU enumerator 216 of correspondence.
Optionally, the size of described register file 610 determines according to the width of corresponding PMU enumerator 216.
In implementing, the big I of each register file 610 is directly according to the width of corresponding PMU enumerator 216
Determine.
Optionally, the size of described register file 610 takes according to the width of corresponding PMU enumerator 216 and presetting
Value determines, in the spilling of the time cycle with described corresponding PMU enumerator obtaining the PMU event that described register file stores
In the case of the remainder of the ratio between the time is zero, described default value is more than or equal to obtaining the storage of described register file
PMU event time cycle and the spilling time of described corresponding PMU enumerator 216 between ratio, obtain described in posting
Ratio between time cycle and the spilling time of described corresponding PMU enumerator 216 of the PMU event of register file storage
In the case of remainder is not zero, described default value more than or equal to obtain described register file storage PMU event time
Between ratio between cycle and the spilling time of described corresponding PMU enumerator 216 and 1 and.
In implementing, the size of each register file 610 can be also that (n*NUM)-bit, n represents corresponding PMU counting
The width of device 216, NUM is the integer more than or equal to 1.Therefore, the capacity of register file cell 1012 be N* (n*NUM)-
Bit, wherein, N represents the quantity of PMU enumerator 216.In the present embodiment, the quantity of PMU enumerator 216 can be equal to depositor
The quantity of the register file 610 of storage in file unit 1012.As it is shown in figure 5, post to set the PMU of PMU enumerator 0 correspondence
The capacity of register file 0 is illustrated, if the PMU depositor literary composition that the width of PMU enumerator 0 is n-bit, PMU enumerator 0 correspondence
The capacity of part 0 is then (n*NUM)-bit.Wherein, the value of NUM is determined by concrete demand.Such as, post if processor reads
The cycle of register file 610 is T (T >=T0), then the value of NUM can be: if the remainder of T/T0 is 0, then NUM >=T/T0, otherwise
NUM≥([T/T0]+1)。
Optionally, execution sequence the present embodiment of step S200 and step S201 is not construed as limiting, and step S201 both can be
Perform before step S200, it is possible to perform after step S200.
S203, receives mission bit stream, and described mission bit stream indicates need to performing of task.
In implementing, processor can receive mission bit stream, the task that this mission bit stream need to perform for indicating processor.
S204, performs described task according to described mission bit stream.
In implementing, processor can start to perform this task at Preset Time.
S205, triggering described PMU enumerator is that described task gathers PMU event.
In implementing, the performance indications that described PMU event is corresponding when performing described task for indicating.Hold at processor
During this task of row, PMU enumerator 216 can be triggered and perform, for processor, the performance indications that this task showed and adopt
Collection, obtains the PMU event for this task.Owing to width and the quantity of PMU enumerator 216 determine, therefore processor can root
Width and quantity according to PMU enumerator 216 trigger PMU enumerator 216 and utilize the PMU event interface 100 of correspondence to gather this
The PMU event of business.By reducing the width of PMU enumerator 216 and expanding the quantity beneficially PMU event of PMU enumerator 216 and adopt
The quantity of collection, improves data acquisition efficiency.
S206, when the count value of described PMU enumerator reaches preset value, obtains the PMU thing that described PMU enumerator gathers
Part.
In implementing, cause the spilling of PMU enumerator 216 in order to make up because of the reduction of the width of PMU enumerator 216
The shortcoming that time shortens, prevents processor from obtaining the frequency of PMU event from register file 610 too high and increase opening of resource
Pin, can be by the state of hardware state machine unit 1011 poll each PMU enumerator 216, when the count value finding PMU enumerator
When reaching preset value, determine that there is PMU enumerator 216 overflows, then read the PMU event that this PMU enumerator 216 gathers, and will
Result is saved in the register file of correspondence.
Optionally, S206 specifically includes S2061 (not shown) and S2062 (not shown):
S2061, obtains the count value of described PMU enumerator.
In implementing, hardware state machine unit 1011 can be by the count value 212 of poll each PMU enumerator 216
Determine the state of each PMU enumerator 216.Reach as it is shown in figure 5, the present embodiment can arrange count value 212 (for example, OVFL value)
Determine during to preset value that the PMU enumerator 216 of correspondence overflows, such as, determine this when the count value 212 of PMU enumerator 216 is 1
PMU enumerator 216 overflows.Therefore, by configuring hardware state machine unit 1011, trigger hardware state machine unit 1011 and inquire about
The OVFL value that PMU enumerator 216 is current, and judge whether the current OVFL value of PMU enumerator 216 reaches preset value.
Optionally, the time cycle of the count value 212 of described acquisition described PMU enumerator 216 is less than or equal to described PMU
The spilling time of enumerator 216.In order to the content of storage in PMU enumerator 216 being emptied after preventing PMU enumerator 216 from overflowing,
Hardware state machine unit 1011 needs automatic regular polling PMU enumerator 216 within the spilling time of PMU enumerator 216.Therefore, firmly
The time of the count value 212 of part state machine unit 1011 poll PMU enumerator 216 is less than or equal to the spilling of PMU enumerator 216
Time.The spilling time of PMU enumerator 216 can the performance by real-time statistics or by PMU enumerator 216 determine, this reality
Execute example to be not construed as limiting.
Optionally, the time of the count value 212 of hardware state machine unit 1011 poll PMU enumerator 216 be also smaller than or
Equal to overflowing the time the soonest of PMU enumerator 216.The time of overflowing the soonest of PMU enumerator 216 can pass through real-time statistics or lead to
The performance crossing PMU enumerator 216 determines, the present embodiment is not construed as limiting.
S2062, if described count value reaches described preset value, determines described PMU counter overflow, and obtains described PMU
The PMU event that enumerator gathers.
In implementing, when hardware state machine unit 1011 determines that the current OVFL value of PMU enumerator 216 reaches preset value
Time, showing that count value 212 indicates PMU enumerator 216 to overflow, then hardware state machine unit 1011 reads this PMU enumerator 216 and adopts
The PMU event of collection.
S207, is stored in the PMU event of the described PMU enumerator collection got in the file of correspondence.
In implementing, the PMU event that this PMU enumerator 216 gathers is stored in and deposits by hardware state machine unit 1011
In the register file 610 of device file unit 1012 correspondence.Finally, hardware state machine unit 1011 continues the next PMU of inquiry
The OVFL value of the count value 212 of enumerator 216.
S208, obtains the PMU event of described register file storage.
In implementing, when processor needs the PMU event obtaining register file storage, processor interface can be passed through
The 700 PMU events reading register file 610 storage.Processor can determine that the PMU event obtaining register file 610 storage
Sampling period, i.e. obtain the frequency of PMU event of register file 610 storage.Such as, if the sampling period is 100ms, then locate
Reason device is the PMU event of all register files 610 storage in 100ms reads register file cell 1012.Such as Fig. 5 institute
Showing, processor obtains PMU register file 0 to PMU register file in register file cell 1012 in each sampling period
(N-1) the PMU event stored.
Optionally, the frequency of the PMU event of described acquisition described register file 610 storage is according to described register file
The size of 610, the width of the PMU enumerator 216 of described register file 610 correspondence and described register file 610 are corresponding
Spilling time of PMU enumerator 216 determine.Specifically, if the size of register file 610 is 512Bytes, PMU counting
The width of device 216 be the spilling time of 32-bit, PMU enumerator 216 be 1 second, represent that each second PMU enumerator 216 can be by
32-bit data that is 4 Bytes writes in register file 610, after 512/4=128 second, and register file 610 meeting
Writing full, writing full pre-treating device in register file 610 needs to read out content therein, and the now reading of processor is deposited
The frequency of device file unit should be less than or equal to 128 seconds/time.By hardware state machine unit 1011 and register file cell
The introducing of 1012, it is possible to effectively reduce processor and read the frequency of PMU enumerator 216, reduce the resource overhead of processor.This
Outward, also alleviate because the width of PMU enumerator 216 is too small, short count increases too soon and processor fails to read in time PMU
The loss of data that the PMU event that enumerator 216 gathers causes, the reliability that ensure that collection PMU event and accuracy.
Optionally, the sampling cumulative time F0 of the PMU event that processor obtains the storage of described register file 610 can be:
T0≤F0≤(T0*NUM).Wherein, T0 represents the spilling time of PMU enumerator 216 or overflows the time the soonest, and NUM is for being more than
Or the integer equal to 1.
Use the embodiment of the present invention, first width and the quantity of PMU enumerator of PMU enumerator are set, wherein, can lead to
Cross reduce PMU enumerator width to increase the quantity of PMU enumerator, the quantity of PMU enumerator can be according to the width of PMU enumerator
Degree is arranged, and to improve data acquisition efficiency, when receiving mission bit stream and performing the task of correspondence, triggers PMU enumerator
Gather PMU event for this task, to gather the performance indications corresponding when performing this task, be conducive to improving performance indications
Collecting efficiency.
Refer to another of device that Fig. 6, Fig. 6 are a kind of acquisition performance monitor unit PMU events of the embodiment of the present invention
The structural representation of embodiment.Device shown in Fig. 6 is realized by the device shown in Fig. 2, it is also possible to pass through special IC
(English: Application-specific Integrated Circuit, abbreviation: ASIC) realize, or PLD
(English: Programmable Logic Device, abbreviation: PLD) realize.Above-mentioned PLD can be CPLD
(English: Complex Programmable Logic Device, abbreviation: CPLD), FPGA, GAL (English:
Generic Array Logic, GAL) or its combination in any abbreviation:.Device shown in Fig. 6 is for realizing as shown in Figure 3 to Figure 4
The method of collection PMU event.When being realized the method for collection PMU event as shown in Figure 3 to Figure 4 by software, this device is also
It can be software module.
This device includes arranging module 600, receiver module 601, execution module 602, trigger module 603, determining module
604, acquisition module 605 and memory module 606.Module 600 is set when working, perform step S100 shown in Fig. 3 and S101,
Perform step S200 shown in Fig. 4 and S201.When receiver module 601 works, perform step S102 shown in Fig. 3, perform Fig. 4
Shown step S203.When execution module 602 works, perform step S103 shown in Fig. 3, perform step S204 shown in Fig. 4.
When trigger module 603 works, perform step S104 shown in Fig. 3, perform step S205 shown in Fig. 4.Determine that module 604 works
Time, perform step S202 shown in Fig. 4.When acquisition module 605 works, perform step S206 shown in Fig. 4, step S2061 (not
Diagram), step S2062 (not shown).When memory module 606 works, perform step S207 shown in Fig. 4.
Optionally, this device may also include acquisition module 607, when acquisition module 607 works, performs the step shown in Fig. 4
S208。
Use the embodiment of the present invention, first width and the quantity of PMU enumerator of PMU enumerator are set, wherein, can lead to
Cross reduce PMU enumerator width to increase the quantity of PMU enumerator, the quantity of PMU enumerator can be according to the width of PMU enumerator
Degree is arranged, and to improve data acquisition efficiency, when receiving mission bit stream and performing the task of correspondence, triggers PMU enumerator
Gather PMU event for this task, to gather the performance indications corresponding when performing this task, be conducive to improving performance indications
Collecting efficiency.
Device embodiment described above is only schematically, and the wherein said unit illustrated as separating component can
To be or to may not be physically separate, the parts shown as unit can be or may not be physics list
Unit, i.e. may be located at a place, or can also be distributed on multiple NE.Can be selected it according to the actual needs
In some or all of module realize the purpose of the present embodiment scheme.Those of ordinary skill in the art are not paying creativeness
Work in the case of, be i.e. appreciated that and implement.
Step in embodiment of the present invention method can carry out order according to actual needs and adjust, merges and delete.
Module or unit in embodiment of the present invention device can merge according to actual needs, divide and delete.
The module of the embodiment of the present invention or module, can be with universal integrated circuit (such as central processor CPU), or with special
Integrated circuit (ASIC) realizes.
Through the above description of the embodiments, those skilled in the art it can be understood that to each embodiment can
The mode adding required general hardware platform by software realizes, naturally it is also possible to pass through hardware.Based on such understanding, on
State the part that prior art contributes by technical scheme the most in other words to embody with the form of software product, should
Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD etc., including some fingers
Make with so that a computer equipment (can be personal computer, server, or the network equipment etc.) performs each and implements
The method described in some part of example or embodiment.
Embodiments described above, is not intended that the restriction to this technical scheme protection domain.Any in above-mentioned enforcement
Amendment, equivalent and the improvement etc. made within the spirit of mode and principle, should be included in the protection model of this technical scheme
Within enclosing.
Claims (11)
1. the method for an acquisition performance monitor unit PMU event, it is characterised in that including:
The width of performance monitoring unit PMU enumerator is set;
Width according to described PMU enumerator arranges the quantity of described PMU enumerator;
Receiving mission bit stream, described mission bit stream indicates need to performing of task;
Described task is performed according to described mission bit stream;
Triggering described PMU enumerator is that described task gathers PMU event, when described PMU event is used for indicating execution described task
Corresponding performance indications.
Method the most according to claim 1, it is characterised in that before described reception mission bit stream, described method also includes:
Determining size and the quantity of register file, it is described task that described register file is used for storing described PMU enumerator
The PMU event gathered;
Then triggering described PMU enumerator is that after described task gathers PMU event, described method also includes:
When the count value of described PMU enumerator reaches preset value, obtain the PMU event that described PMU enumerator gathers;
The PMU event of the described PMU enumerator collection got is stored in the register file of correspondence.
Method the most according to claim 2, it is characterised in that described reach default when the count value of described PMU enumerator
During value, the PMU event obtaining described PMU enumerator collection includes:
Obtain the count value of described PMU enumerator;
If described count value reaches described preset value, determine described PMU counter overflow, and obtain described PMU enumerator collection
PMU event.
Method the most according to claim 3, it is characterised in that the time of the count value of described acquisition described PMU enumerator
Cycle is less than or equal to the spilling time of described PMU enumerator.
Method the most according to claim 2, it is characterised in that the described PMU that the described PMU enumerator got is gathered
After event is stored in the register file of correspondence, described method also includes:
Obtain the PMU event of described register file storage, the frequency of the PMU event of described acquisition described register file storage
The width of the PMU enumerator that the size according to described register file, described register file are corresponding and described depositor literary composition
The spilling time of the PMU enumerator that part is corresponding determines.
6. the device of an acquisition performance monitor unit PMU event, it is characterised in that including:
Module is set, for arranging the width of performance monitoring unit PMU enumerator;
Described module is set, is additionally operable to the width according to described PMU enumerator and the quantity of described PMU enumerator is set;
Receiver module, is used for receiving mission bit stream, and described mission bit stream indicates need to performing of task;
Perform module, for performing described task according to described mission bit stream;
Trigger module, being used for triggering described PMU enumerator is that described task gathers PMU event, and described PMU event is held for instruction
Performance indications corresponding during the described task of row.
Device the most according to claim 6, it is characterised in that described device also includes:
Determining module, for determining size and the quantity of register file, described register file is used for storing described PMU counting
Device is the PMU event that described task gathers;
Acquisition module, for when the count value of described PMU enumerator reaches preset value, obtains what described PMU enumerator gathered
PMU event;
Memory module, the PMU event of the described PMU enumerator collection for being got by described acquisition module is stored in correspondence
In register file.
Device the most according to claim 7, it is characterised in that described acquisition module, specifically for:
Obtain the count value of described PMU enumerator;
If described count value reaches described preset value, determine described PMU counter overflow, and obtain described PMU enumerator collection
PMU event.
Device the most according to claim 8, it is characterised in that described acquisition module obtains the counting of described PMU enumerator
The time cycle of value is less than or equal to the spilling time of described PMU enumerator.
Device the most according to claim 7, it is characterised in that described acquisition module, is additionally operable to:
Obtain the PMU event of described register file storage, the frequency of the PMU event of described acquisition described register file storage
The width of the PMU enumerator that the size according to described register file, described register file are corresponding and described depositor literary composition
The spilling time of the PMU enumerator that part is corresponding determines.
The device of 11. 1 kinds of acquisition performance monitor unit PMU events, it is characterised in that include memorizer and processor, its
In:
Described memorizer stores batch processing code, and described processor calls the program code of storage in described memorizer,
For the method performing the acquisition performance monitor unit PMU event described in any one of claim 1 to 5.
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 true CN106126384A (en) | 2016-11-16 |
CN106126384B 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) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107153604A (en) * | 2017-05-17 | 2017-09-12 | 北京计算机技术及应用研究所 | Parallel program performance method for monitoring and analyzing based on PMU |
WO2017215557A1 (en) * | 2016-06-12 | 2017-12-21 | 华为技术有限公司 | Method and device for collecting performance monitor unit (pmu) events |
CN108509255A (en) * | 2017-02-24 | 2018-09-07 | 龙芯中科技术有限公司 | The treating method and apparatus of hardware interrupts |
CN108664367A (en) * | 2017-03-28 | 2018-10-16 | 华为技术有限公司 | A kind of processor-based power consumption control method and device |
CN112069029A (en) * | 2020-09-04 | 2020-12-11 | 北京计算机技术及应用研究所 | Performance acquisition monitoring system of domestic platform PMU self-adaptation |
CN112445547A (en) * | 2019-09-02 | 2021-03-05 | 无锡江南计算技术研究所 | Low-disturbance performance data acquisition method for heterogeneous many-core processor |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116701125B (en) * | 2023-07-31 | 2023-10-27 | 太初(无锡)电子科技有限公司 | Performance data acquisition method of AI chip |
Citations (3)
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 |
US20100161867A1 (en) * | 2008-12-24 | 2010-06-24 | International Business Machines Corporation | System and method for distributing signal with efficiency over microprocessor |
CN103838539A (en) * | 2012-11-23 | 2014-06-04 | 三星电子株式会社 | Performance measurement unit, processor core comprising thereof and process profiling method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
-
2016
- 2016-06-12 CN CN201610412058.6A patent/CN106126384B/en active Active
-
2017
- 2017-06-12 WO PCT/CN2017/087907 patent/WO2017215557A1/en active Application Filing
Patent Citations (3)
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 |
US20100161867A1 (en) * | 2008-12-24 | 2010-06-24 | International Business Machines Corporation | System and method for distributing signal with efficiency over microprocessor |
CN103838539A (en) * | 2012-11-23 | 2014-06-04 | 三星电子株式会社 | Performance measurement unit, processor core comprising thereof and process profiling method |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017215557A1 (en) * | 2016-06-12 | 2017-12-21 | 华为技术有限公司 | Method and device for collecting performance monitor unit (pmu) events |
CN108509255A (en) * | 2017-02-24 | 2018-09-07 | 龙芯中科技术有限公司 | The treating method and apparatus of hardware interrupts |
CN108509255B (en) * | 2017-02-24 | 2021-01-22 | 龙芯中科技术股份有限公司 | Method and device for processing hardware interrupt |
CN108664367A (en) * | 2017-03-28 | 2018-10-16 | 华为技术有限公司 | A kind of processor-based power consumption control method and device |
CN107153604A (en) * | 2017-05-17 | 2017-09-12 | 北京计算机技术及应用研究所 | Parallel program performance method for monitoring and analyzing based on PMU |
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 |
CN112069029A (en) * | 2020-09-04 | 2020-12-11 | 北京计算机技术及应用研究所 | Performance acquisition monitoring system of domestic platform PMU self-adaptation |
CN112069029B (en) * | 2020-09-04 | 2023-11-14 | 北京计算机技术及应用研究所 | Domestic platform PMU self-adaptive performance acquisition monitoring system |
Also Published As
Publication number | Publication date |
---|---|
CN106126384B (en) | 2019-02-01 |
WO2017215557A1 (en) | 2017-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106126384A (en) | A kind of method and device of acquisition performance monitor unit PMU event | |
EP3318975A1 (en) | Method and device for detecting slow disk | |
CN103365965B (en) | A kind of aggregation process method and apparatus of data | |
CN109613440B (en) | Battery grading method, device, equipment and storage medium | |
CN105893529A (en) | Data collecting method and ETL assembly | |
CN105956669A (en) | Vehicle maintenance strategy pushing method and device | |
CN108831517A (en) | A kind of method and test device judging flash chip reliability based on operating time or electric current | |
CN111045881A (en) | Slow disk detection method and system | |
CN105843935A (en) | Data acquisition method and ETL (Extraction-Transformation-Loading) assembly | |
CN110322368A (en) | A kind of harmonic data method for detecting abnormality, terminal device and storage medium | |
CN104331328A (en) | Virtual resource scheduling method and virtual resource scheduling device | |
CN111143158A (en) | Monitoring data real-time storage method and system, electronic equipment and storage medium | |
CN101063693B (en) | Singlechip signal sampling apparatus without module converter and sampling method thereof | |
CN106443171A (en) | System and method for metering data of power bus during power failure of power utilization equipment | |
CN109470918A (en) | The electricity data processing method and IR46 electric energy meter of IR46 electric energy meter | |
CN112331249A (en) | Method and device for predicting service life of storage device, terminal equipment and storage medium | |
CN109375146B (en) | Supplementary collection method and system for electricity consumption data and terminal equipment | |
CN111008107A (en) | Big data cluster log storage method, device, equipment and storage medium | |
CN111061802A (en) | Power data management processing method and device and storage medium | |
CN103077080B (en) | Based on parallel program performance collecting method and the device of high performance platform | |
CN107704373A (en) | A kind of data processing method and device | |
CN113885803A (en) | Data storage method and device, electronic equipment and storage medium | |
CN110045924A (en) | It is classified storage method, device, electronic equipment and computer readable storage medium | |
CN112465321B (en) | Task analysis method, device, equipment and storage medium | |
CN113094353A (en) | Database capacity expansion method and device |
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 |