[go: up one dir, main page]

CN100337210C - Method of real time monitoring processor operating load - Google Patents

Method of real time monitoring processor operating load Download PDF

Info

Publication number
CN100337210C
CN100337210C CNB031213901A CN03121390A CN100337210C CN 100337210 C CN100337210 C CN 100337210C CN B031213901 A CNB031213901 A CN B031213901A CN 03121390 A CN03121390 A CN 03121390A CN 100337210 C CN100337210 C CN 100337210C
Authority
CN
China
Prior art keywords
processor
hardware timer
time
current
load
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB031213901A
Other languages
Chinese (zh)
Other versions
CN1534482A (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 CNB031213901A priority Critical patent/CN100337210C/en
Publication of CN1534482A publication Critical patent/CN1534482A/en
Application granted granted Critical
Publication of CN100337210C publication Critical patent/CN100337210C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention discloses a method for monitoring the operating loads of processors in real time, which comprises the following steps: a hardware timer begins to count; the current number value of the hardware timer is read out after that the waiting process of programs to be processed by a processor is finished; the current number value is stored as idle time of the processor, and the counting of the hardware timer is cleared; the processor executes the current program; the current number value of the timer is read out after that the execution of the current program is finished, and the current number value of the timer is stored as the working time of the processor; the working time is divided by the sum of the working time and the idle time, the division result is stored as the percentage occupied by the current operating load of the processor and is read by a host, the number value of the counter is cleared, and then, the steps are returned. The method can accurately monitor the operational load of processors in real time, and further, the present invention can take corresponding methods to control operational loads of processors.

Description

Monitor the method for processor calculating load in real time
Technical field
The present invention relates to a kind of monitoring technology, be meant a kind of method of real-time monitoring processor calculating load especially processor.
Background technology
Increase along with the processor processing amount, also urgent day by day to the demand that makes full use of the existing processing power of processor, therefore need to adopt a kind of method of effectively real-time monitoring processor calculating load, come the computational load of processor is monitored, the Prevention Processing device exceeds the generation of ld. lmt situation.Under this background, the computational load that reflects processor that these methods can be more accurate the method for some monitoring processor calculating loads appearred at present.
Introduce two kinds of processor calculating duty control methods relatively more commonly used below: a kind of scheme is by using simulated environment that the computational load of processor is monitored.In this method, the main frame that simulation software has been installed need link to each other with processor by emulator, carry out mark by the user at the reference position and the end position of algorithm routine, when carrying out these positions, program will temporarily delay the operation of program, and the count value that processor clock is current passes to main frame by emulator, main frame compares the back to count value just can obtain peak load, minimum load and the average load that processor program is carried out, and this method can be monitored the ruuning situation of processor more accurately.
But the shortcoming of this scheme is that simulated environment is had very large dependence, therefore under the actual operating conditions that breaks away from simulated environment, just can't realize the monitoring to the processor program computational load, whether the user can only exceed load according to the data-speculative program that test in simulated environment obtains.This method need delay the program of processor in operational process simultaneously, the count value of clock is sent to main frame, restart again program implementation after finishing the transmission of count value, therefore influenced real-time and correctness significantly the processor calculating load monitoring.
Another kind of scheme is to adopt the method monitoring processor calculating load of load prediction.This method requires the user to pre-estimate out the various algorithm operation quantities that processor will be carried out, behind algorithm of every increase in the program of processor processing, processor is just according to the estimated value of this algorithm operation quantity, current computing total load is added up, and the computational load of current processor reported main frame, after the total load of processor calculating has reached its peak load, main frame will not allow processor to continue to increase computing, to prevent the situation that exceeds peak load.This method does not rely on the simulated environment of processor, can be applied in the actual working environment.
But the shortcoming of this method is the estimation that the data of processor load rely on the user, these estimated values are taken from the result of test in early stage, but these results estimated can not be represented the computational load of current processor accurately, and therefore the general situation of expression processor load that can only be rough has inevitably introduced bigger error.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of method of real-time monitoring processor calculating load, makes it to break away from the dependence to simulated environment or data estimation, can monitor the computational load of processor real-time and accurately.
Further aim of the present invention is to make main frame can in time take corresponding measure that the computational load of processor is controlled.
According to above-mentioned purpose, technical scheme of the present invention specifically is achieved in that
A kind of method of real-time monitoring processor calculating load is characterized in that utilize each state time information corresponding of hardware timer recording processor of processor self, this method may further comprise the steps at least:
A) processor start or on a program carry out finish after, with the hardware timer zero clearing in the processor and begin counting, after processor finishes the wait process, read the current numerical value of hardware timer and preserve as the free time of processor;
B) with the counting zero clearing of this hardware timer and restart counting, present procedure carry out finish after, read the current numerical value of hardware timer and preserve as the working time of processor;
C) the free time sum that is obtained divided by this working time and step a) with working time that step b) obtained, obtain the percent that the current computational load of processor takies, preserve the fraction values that the current computational load of this processor takies and read, return step a) then for main frame.
The described hardware timer of this method is counted by the dominant frequency of processor.
This method further comprises: main frame regularly reads the percent that the current computational load of the processor of being preserved takies and carries out analyzing and processing.
From such scheme as can be seen, the free time and the working time of the hardware timer real time record processor of the inventive method by utilizing processor self, realized the computational load of processor is monitored in real time, the operand of monitoring facilities that can either be accurate, real-time, the situation that the processor calculating load exceeds its processing power appears in prevention, can break away from dependence again, thereby can be applied in the actual motion environment of processor simulated environment.This method does not need to produce and interrupts owing to very little with the shared processor resource of hardware timer counting simultaneously, does not influence the real-time of program run and the correctness of operation result fully.
Description of drawings
Fig. 1 is the workflow diagram of the embodiment of the invention.
Embodiment
The present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
The present invention program is: adopt the hardware counter of processor to note the time that program is carried out preceding stand-by period and program execution respectively, program is carried out the free time of preceding stand-by period as processor, with the working time of program execution time as processor, again with working time of processor free time and working time sum divided by processor, obtain the percent that the processor calculating load takies, it is preserved for main frame read.
Main frame is according to the time parameter of the processor current state of being obtained, the computational load situation that analysis processor is current, and then take corresponding measure that the workload of processor is controlled.
The concrete testing process of processor current state referring to shown in Figure 1, be may further comprise the steps:
Step 1: the hardware timer to processor carries out initialization in advance, and initialization procedure mainly is that the parameter to hardware timer is configured so that its dominant frequency according to processor is counted.
Step 2: processor start or on a program complete after, processor enters the wait process, hardware timer is counted zero clearing and begin counting, after current wait process finishes, read the current numerical value of hardware timer, its free time as processor is stored in the processor memory.
Step 3: when processor begins to carry out present procedure, hardware timer is counted zero clearing and restart counting, after present procedure is carried out end, read the current numerical value of hardware timer, its working time of carrying out this program as processor is stored in the processor memory.
Step 4: processor with the numerical value of working time divided by the working time and free time sum, thereby obtain the percent that the current computational load of processor takies, and result's storage is read for main frame, return step 2.
Based on said process, main frame regularly by with the internal interface read processor internal memory of processor in the percent that takies of computational load, and it is carried out analyzing and processing, if the computational load of processor exceeds the scope of permission, main frame takes appropriate measures horse back for preventing the processor overload operation, as: report to the police, restart processor, adjust processor stand-by period, reduce performed algorithm of processor or the like.Here, main frame time interval of regularly reading can be according in advance the estimation of processor calculating amount and the working condition of main frame being determined.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (3)

1, a kind of method of real-time monitoring processor calculating load is characterized in that utilize each state time information corresponding of hardware timer recording processor of processor self, this method may further comprise the steps at least:
A) processor start or on a program carry out finish after, with the hardware timer zero clearing in the processor and begin counting, after processor finishes the wait process, read the current numerical value of hardware timer and preserve as the free time of processor;
B) with the counting zero clearing of this hardware timer and restart counting, present procedure carry out finish after, read the current numerical value of hardware timer and preserve as the working time of processor;
C) the free time sum that is obtained divided by this working time and step a) with working time that step b) obtained, obtain the percent that the current computational load of processor takies, preserve the fraction values that the current computational load of this processor takies and read, return step a) then for main frame.
According to the described method of claim 1, it is characterized in that 2, described hardware timer is counted by the dominant frequency of processor.
According to the described method of claim 1, it is characterized in that 3, this method further comprises: main frame regularly reads the percent that the current computational load of the processor of being preserved takies and carries out analyzing and processing.
CNB031213901A 2003-03-27 2003-03-27 Method of real time monitoring processor operating load Expired - Fee Related CN100337210C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031213901A CN100337210C (en) 2003-03-27 2003-03-27 Method of real time monitoring processor operating load

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031213901A CN100337210C (en) 2003-03-27 2003-03-27 Method of real time monitoring processor operating load

Publications (2)

Publication Number Publication Date
CN1534482A CN1534482A (en) 2004-10-06
CN100337210C true CN100337210C (en) 2007-09-12

Family

ID=34285688

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031213901A Expired - Fee Related CN100337210C (en) 2003-03-27 2003-03-27 Method of real time monitoring processor operating load

Country Status (1)

Country Link
CN (1) CN100337210C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101026437B (en) * 2007-02-07 2012-03-28 建汉科技股份有限公司 Device and method for measuring dynamic bandwidth
CN102662822B (en) 2012-04-26 2015-02-04 华为技术有限公司 Load monitoring device and load monitoring method
CN104123098B (en) * 2013-04-23 2018-09-21 华为技术有限公司 A kind of method and apparatus of data processing
CN104810920A (en) * 2014-12-04 2015-07-29 国家电网公司 Measurement-control device and method of intelligent transformer station with accurate calculation of CPU utilization rate

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4905171A (en) * 1987-11-09 1990-02-27 International Business Machines Corporation Workstation controller performance monitor
CN1014101B (en) * 1987-12-08 1991-09-25 北方电信有限公司 Digital signal processor idle is measured and indicating equipment
CN1403912A (en) * 2001-09-06 2003-03-19 Lg电子株式会社 Method and apparatus for measuring task occupancy of centhal processor in real-time system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4905171A (en) * 1987-11-09 1990-02-27 International Business Machines Corporation Workstation controller performance monitor
CN1014101B (en) * 1987-12-08 1991-09-25 北方电信有限公司 Digital signal processor idle is measured and indicating equipment
CN1403912A (en) * 2001-09-06 2003-03-19 Lg电子株式会社 Method and apparatus for measuring task occupancy of centhal processor in real-time system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种高精度定时器的设计及应用 刘钦彦,李勇,电测与仪表,第9卷 2001 *

Also Published As

Publication number Publication date
CN1534482A (en) 2004-10-06

Similar Documents

Publication Publication Date Title
Hoste et al. Performance prediction based on inherent program similarity
US7802236B2 (en) Method and apparatus for identifying similar regions of a program's execution
Basmadjian et al. Evaluating and modeling power consumption of multi-core processors
US7272517B1 (en) Method and system for providing performance estimations for a specified power budget
US8260603B2 (en) Scaling a prediction model of resource usage of an application in a virtual environment
US20060190596A1 (en) Bottleneck detection system, measurement object server, bottleneck detection method and program
US20090083717A1 (en) Benchmark profiling for distributed systems
Shen et al. Reference-driven performance anomaly identification
US20080168445A1 (en) Measuring processor use in a hardware multithreading processor environment
Suganuma et al. An Empirical Study of Method In-lining for a Java {Just-in-Time} Compiler
US6807522B1 (en) Methods for predicting instruction execution efficiency in a proposed computer system
US6651153B1 (en) Methods for predicting cache memory performance in a proposed computer system
Huang et al. Software reliability modeling and cost estimation incorporating testing-effort and efficiency
Lim et al. Computationally efficient multiplexing of events on hardware counters
Machida et al. Analysis of an optimal stopping problem for software rejuvenation in a deteriorating job processing system
Eismann et al. Modeling of parametric dependencies for performance prediction of component-based software systems at run-time
JP6790913B2 (en) Information processing equipment, information processing methods and programs
CN100337210C (en) Method of real time monitoring processor operating load
Imtiaz et al. Automatic platform-independent monitoring and ranking of hardware resource utilization
Gokhale et al. Effect of repair policies on software reliability
Subramaniam et al. Towards energy-proportional computing using subsystem-level power management
Shen Request behavior variations
Dimpsey et al. Performance prediction and tuning on a multiprocessor
Larysch Fine-grained estimation of memory bandwidth utilization
JP2715904B2 (en) Computer system performance evaluation 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
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070912

Termination date: 20150327

EXPY Termination of patent right or utility model