Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
One embodiment of the invention provides a kind of method for supervising from nuclear state, and this method is applied to logical device, and this logical device at least comprises timer module, and logical device is connected with CPU to be measured.N number of passage is put in the main caryogamy of this CPU to be measured, these passages and to be measured from check should, wherein N is natural number and N value is more than or equal to the number from core to be measured.
As shown in Figure 1, the method comprises:
101, timer module setting timing cycle.
What deserves to be explained is, the timing cycle set here is for judging that following passage overflows.
102, when timing cycle expires, the N number of pulse of sequential filming.
Wherein, N number of pulse and N number of passage one_to_one corresponding, N number of pulse for by the monitoring flow process of N number of passage from the time separately, make to carry out condition monitoring to a passage in section at one time.
103, the time divided according to N number of pulse, according to time division multiplex principle, is monitored to be measured from core.
In conjunction with the description of above-mentioned 102, because pulse can be used for regularly, thus N number of time period can be marked off according to N number of pulse, and then according to time division multiplex principle, in section, condition monitoring be carried out to a passage at one time.
What deserves to be explained is, logical device comprises but is not defined as with Block RAM (Block Random Access Memory in embodiments of the present invention, random access memory blocks) CPLD (Complex Programmable Logic Device, CPLD) or FPGA (Field-Programable Gate Array, field programmable gate array), Block RAM is wherein for storing the following numerical value etc. related to from nuclear information and each event.
The method for supervising from nuclear state that the embodiment of the present invention provides, this method is applied to logical device, and this logical device is connected with CPU to be measured, and at least comprises timer module in this logical device, N number of passage is put in the main caryogamy of CPU to be measured, these passages and to be measured from check should.First, setting timing cycle, and when this timing cycle expires, the N number of pulse of sequential filming, the time divided according to N number of pulse, according to time division multiplex principle, is monitored to be measured from core.With prior art, can only be recorded by the main core of CPU, store the information from core thus realize, from core monitoring, in the embodiment of the present invention, being completed by logical device and monitoring from core, thus reduce monitoring from CPU time shared during core and CPU internal memory, significantly improve cpu performance.
Another embodiment of the present invention provides a kind of method for supervising from nuclear state, and this carries out monitoring from core with regard to how treating to survey be described in detail in this process, and as shown in Figure 2, the method comprises:
201, interface normalization module obtains interface event from cpu i/f, and sends to counter controls module.
Wherein, interface event comprises counter refresh events and passage configuration event, and interface normalization module carrys out record interface event by event type and channel number.
In embodiments of the present invention, counter refresh events at least comprises one from nuclear state information, should refer to from nuclear state information, communication interaction should be carried out from core and main core, should from the current state residing for core after performing main core order, this current state comprises this performs main core order processing procedure from core; Passage configuration event comprises that passage is enable joins value and spilling joins value.
202, the timer event of expiring that the interface event that sends of counter controls module receiving interface normalization module and timer module send is gone forward side by side row relax.
In conjunction with the description of above-mentioned embodiment as shown in Figure 1, the corresponding timer of each passage, and each passage has each self-corresponding channel number, then according to the channel number in interface event, can get corresponding timer and to expire event.
What deserves to be explained is, in conjunction with the description of above-mentioned 201,202, expire after event, counter refresh events, passage configuration event getting above-mentioned timer, due to information processing can only be carried out with regard to individual event in the same time, namely perform following 203, then need the event got to be stored in event buffering FIFO (First in first out, first in first out buffer).
203, counter controls module is according to the channel number comprised in interface event, obtains the Counter Value of the passage corresponding with channel number.
What deserves to be explained is, this counter controls module, the Counter Value of the passage corresponding with channel number is obtained according to channel number, this Counter Value represents the number of times that timing cycle occurs, value is joined and spilling joins value by passage configuration event Acquisition channel is enable, obtained from nuclear state information, refreshing frequency by counter refresh events, this refreshing frequency represents the communication interaction number of times from core and main core.
After getting above-mentioned numerical information, further to from the monitoring flow process of core, comprise the process of timer expired event, counter refresh events and passage configuration event, and concrete treatment scheme comprises:
The first, counter controls module receives the timer event of expiring that timer module sends and to go forward side by side row relax, comprising:
Join value represent that passage is enable when passage be enable, and Counter Value according to the value after counting rule increases progressively be less than spilling join value time, Counter Value is updated to Counter Value increase progressively according to counting rule after value.
Wherein, value after Counter Value increases progressively according to counting rule, counting rule wherein can be on the basis of former Counter Value, add a numerical value, this numerical value can be 1 or 2 etc., in embodiments of the present invention, this counting rule can be set by system or user, and is not construed as limiting concrete counting rule.Value after Counter Value increases progressively according to counting rule is less than spilling and joins value and then represent that this counter does not overflow.
What deserves to be explained is, for convenience of description, utilize letter to refer to concrete numerical value in the present embodiment, but do not limit that concrete numerical value adopts refer to form, as long as different numerical value can be distinguished.The enable value of joining of passage wherein comprises but is not defined through " E " expression, as E=0, determines that passage is enable, otherwise determines that passage is not enable.The Counter Value of foregoing description comprises but is not defined through " A " and represents, spilling is joined value and is comprised but be not defined through " B " expression, due to the number of times of the timing cycle appearance that A represents, then and B actual expression duration concept, the preset value of such as B is P, then B just represents the duration of P timing cycle.
Or,
Join value represent that passage is enable when passage be enable, and Counter Value according to the value after counting rule increases progressively be greater than spilling join value time, counter reset value and refreshing frequency, and will treat that cache information sends to and interrupt cushioning FIFO.
Wherein, treat that cache information comprises channel number and from nuclear state information, and this treats that cache information can also comprise numerical value corresponding to counter refreshing frequency.
What deserves to be explained is, the value after Counter Value herein increases progressively according to counting rule describes identical with above-mentioned related content, is not repeated.Value after increasing progressively according to counting rule for Counter Value is herein described for Counter Value adds 1, when being greater than spilling after Counter Value adds 1 and joining value, represent and should not respond for a long time from core, counter overflow, then now store and treat cache information, in conjunction with above-mentioned description, this treats that cache information comprises channel number and from nuclear state information, thus when this is from dyskaryosis, can according to this from nuclear state information analysis abnormal cause, thus for providing analysis foundation from the debugging of core.
The second, counter controls module receiving interface event is gone forward side by side row relax, and when this interface event is counter refresh events, this treatment scheme comprises:
When passage is enable join value represent that passage is enable time, refreshing frequency is updated to according to refresh rule increase progressively after value, and reset Counter Value.
Wherein, refreshing frequency is according to the value refreshed after regular increasing progressively, refreshing rule wherein can be on the basis of former refreshing frequency, add a numerical value, this numerical value can be 1 or 2 etc., in embodiments of the present invention, this refreshing rule can be set by system or user, and is not construed as limiting concrete counting rule.
What deserves to be explained is, when processing this counter refresh events, can also store from nuclear state information.
Three, counter controls module receiving interface event is gone forward side by side row relax, and when this interface event is passage configuration event, this treatment scheme comprises:
Value is joined according to the passage configuration-direct renewal spilling that the main core of CPU to be measured sends.
In the treatment scheme of this passage configuration event, there is an initial spilling and join value in the counter of each passage, and the passage configuration-direct that the main core of CPU sends comprises spilling joins value, this spilling joins the task setting that value will be performed from core according to correspondence by the main core of CPU, and then after receive the passage configuration-direct that the main core of CPU sends from core, initial spilling is joined value and be updated to the spilling of carrying in this passage configuration-direct and join value.This spilling joins value and the spilling obtained above by passage configuration event, and to join value identical.
What deserves to be explained is, do not limit the execution sequence of above-mentioned first, second, third treatment scheme stated in embodiments of the present invention, as long as after obtaining the numerical value performed needed for corresponding event, the treatment scheme of this event just can be performed.And first, second kind of above-mentioned execution flow process performs when passage is enable, when the non-enabled state of passage process, then ignores this event.
Another embodiment of the present invention provides a kind of method for supervising from nuclear state, what the present embodiment described is the overall realization flow of method for supervising, in the present embodiment, value after counter increases progressively according to counting rule is that original Counter Value adds 1, refreshing frequency is that original refreshing frequency adds 1 according to the value refreshed after regular increasing progressively, as shown in Figure 3, the method comprises:
301, N number of passage is put in the main caryogamy of CPU to be measured.
302, logical device is by timer module, setting timing cycle.
303, when the timer has lapsed, logical device produces N number of pulse by timer module.
In conjunction with the description of above-mentioned 301, in the optional implementation of the one of the present embodiment, logical device is provided with channel number counter, the generation of each pulse synchronously changes from 0 to N-1 along with channel number counter, makes the corresponding pulse of each passage.
304, the main core collocation channel of CPU to be measured is enable joins value and spilling joins value.
What deserves to be explained is, this 304 method flow described, is configured by cpu i/f by the main core of CPU to be measured, thus completes each from the passage configuration corresponding to core.
Further after completing passage configuration, the counter of this passage starts counting, the timer value that this counter relates to for recording foregoing description.
305, often after a timing cycle, the Counter Value of this counter records adds 1.
What deserves to be explained is, the corresponding above-mentioned timer of the renewal of this Counter Value expires event, can be used in judging whether channel counter overflows.
306, carry out from core and main core once mutual after, the refreshing frequency in counter refresh events adds 1, and obtains from nuclear state information.
What deserves to be explained is, this 306 describe carry out a communication interaction from core and main core, refer to from carrying out an efficient communication between core and main core, but the embodiment of the present invention does not limit this communication mode, identical with above-mentioned associated description from the particular content of nuclear state information, be not repeated.
307, when being less than spilling after Counter Value adds 1 and joining value, Counter Value is updated to Counter Value and adds 1.
This is 307 corresponding with the first treatment scheme in above-mentioned steps 203, and associated description is identical, is not repeated.
308, when being greater than spilling after Counter Value adds 1 and joining value, will treat that cache information is sent to and interrupt storing in buffering FIFO.
Wherein this is 308 corresponding with the second treatment scheme in above-mentioned steps 203, and associated description is identical, is not repeated.
In the optional implementation of the one of the embodiment of the present invention, the situation being channel counter spilling of step 308 description, now logical device sends to CPU and interrupts instruction, and CPU master endorses to get accordingly from nuclear state information, and then carries out anomaly analysis to from core.
Another embodiment of the present invention provides a kind of supervising device from nuclear state, this device comprises logical device, and this logical device is connected with central processor CPU to be measured, wherein N number of passage is put in the main caryogamy of CPU to be measured, these passages and to be measured from check should, and N value is more than or equal to the number from core to be measured.
As shown in Figure 4, this device comprises: timer module 41, monitoring module 42.
Timer module 41, for setting timing cycle, and when timing cycle expires, the N number of pulse of sequential filming.
Wherein, N number of pulse and N number of passage one_to_one corresponding.
Monitoring module 42, the time that the N number of pulse for launching according to timer module 41 divides, according to time division multiplex principle, monitors to be measured from core.
In the optional constituted mode of the one of this device, as shown in Figure 5, this device also comprises: interface normalization module 43, counter controls module 44; Counter controls module 44 comprises: the first process submodule 441, second processes submodule 442 and/or the 3rd process submodule 443.What deserves to be explained is, the counter controls module 44 with this device in this accompanying drawing 5 comprises: the first process submodule 441, second processes submodule 442 and the 3rd process submodule 443 is example explanation.
Interface normalization module 43, for obtaining interface event from cpu i/f and sending to counter controls module 44.
Wherein, interface event comprises counter refresh events and passage configuration event.
Counter controls module 44, the interface event sent for receiving interface normalization module 43 is gone forward side by side row relax; The timer event of expiring also sent for receiving timer module 41 is gone forward side by side row relax.
Counter controls module 44, also for the channel number that basis comprises from the interface event that interface normalization module 43 obtains, obtain the Counter Value of the passage corresponding with this channel number, this Counter Value represents the number of times that timing cycle occurs; Also for joining value and spilling joins value by passage configuration event Acquisition channel is enable; Also for being obtained from nuclear state information, refreshing frequency by counter refresh events, wherein, refreshing frequency represents the communication interaction number of times from core and main core.
First process submodule 441, for when passage is enable, to join value expression passage enable, and Counter Value according to the value after counting rule increases progressively be less than spilling join value time, Counter Value is updated to Counter Value increase progressively according to counting rule after value; Or, for joining value represent that passage is enable when passage be enable, and Counter Value according to the value after counting rule increases progressively be greater than spilling join value time, counter reset value and refreshing frequency, and will treat that cache information sends to interruption to cushion FIFO.
Wherein, treat that cache information comprises channel number and from nuclear state information.
Second process submodule 442, for when passage is enable join value represent that passage is enable time, refreshing frequency is updated to refreshing frequency according to refreshing is regular increase progressively after value, and reset Counter Value.
3rd process submodule 443, the passage configuration-direct for sending according to the main core of CPU to be measured upgrades spilling and joins value.
What deserves to be explained is, the device as shown in Figure 4,5 that the present embodiment provides, for realizing above-mentioned method flow as shown in Figure 1 to Figure 3.
Embodiments provide a kind of supervising device from nuclear state, this device comprises logical device, and this logical device is connected with CPU to be measured, and at least comprises timer module in this logical device, N number of passage is put in the main caryogamy of CPU to be measured, these passages and to be measured from check should.First, utilize timer module to set timing cycle, and when this timing cycle expires, the N number of pulse of sequential filming, and then the time that monitoring module divides according to N number of pulse is according to time division multiplex principle, monitors to be measured from core.With prior art, can only be recorded by the main core of CPU, store the information from core thus realize, from core monitoring, in the embodiment of the present invention, being completed by logical device and monitoring from core, thus reduce monitoring from CPU time shared during core and CPU internal memory, significantly improve cpu performance.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required common hardware by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better embodiment.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in the storage medium that can read, as the floppy disk of computing machine, hard disk or CD etc., comprise some instructions and perform method described in each embodiment of the present invention in order to make a computer equipment (can be personal computer, server, or the network equipment etc.).
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.