CN102722431B - process monitoring method and device - Google Patents

process monitoring method and device Download PDF

Info

Publication number
CN102722431B
CN102722431B CN201210123817.9A CN201210123817A CN102722431B CN 102722431 B CN102722431 B CN 102722431B CN 201210123817 A CN201210123817 A CN 201210123817A CN 102722431 B CN102722431 B CN 102722431B
Authority
CN
China
Prior art keywords
information
request
monitoring
asynchronous
monitored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210123817.9A
Other languages
Chinese (zh)
Other versions
CN102722431A (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.)
XFusion Digital 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 CN201210123817.9A priority Critical patent/CN102722431B/en
Publication of CN102722431A publication Critical patent/CN102722431A/en
Application granted granted Critical
Publication of CN102722431B publication Critical patent/CN102722431B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the present invention provides a kind of process monitoring method and device, this process monitoring method comprises: be monitored course allocation monitoring thread, if monitoring thread knows that system resource is not enough, queue then to monitored process sends asynchronous notifications information, with make monitored process when detect in queue there is asynchronous notifications information time, transmission processing request, wherein, carries asynchronous notifications information in process request; According to process request, call the progress information that process function corresponding to asynchronous notifications information obtains monitored process, progress information is sent to monitoring thread.The process monitoring method that the embodiment of the present invention provides and device, achieve and obtain progress information in monitored process normal course of operation, for debugging and rejuvenation provide sufficient foundation, improves the reliability of systematic analysis.

Description

Process monitoring method and device
Technical field
The embodiment of the present invention relates to computer technology, particularly relates to a kind of process monitoring method and device.
Background technology
In prior art, operating system (Operating System, be called for short OS) usually all can use dump information when process exception exits to the monitoring of process, recovery and debugging, the partial memory that dump information can comprise when process stops maps and stack information.But, for large-scale application, process is run for a long time, adds influencing each other of multithreading, single dump information for the backtracking of problem and tracking effect very little, and the many reasons causing it finally to terminate in very difficult analysis process operational process.The information such as the register of process cannot be got at the end of process simultaneously, make troubles also to debugging and rejuvenation.
Summary of the invention
The embodiment of the present invention provides a kind of process monitoring method and device, to realize obtaining progress information in process operational process, for debugging and recovery provide foundation, improves the reliability of systematic analysis.
The embodiment of the present invention provides a kind of process monitoring method, comprising:
For monitored course allocation monitoring thread, if described monitoring thread knows that system resource is not enough, queue then to described monitored process sends asynchronous notifications information, with make described monitored process when detect in described queue there is described asynchronous notifications information time, transmission processing request, wherein, described asynchronous notifications information is carried in described process request;
According to described process request, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
The embodiment of the present invention provides a kind of process monitoring device, comprising:
Monitoring unit, for being monitored course allocation monitoring thread, if described monitoring thread knows that system resource is not enough, queue then to described monitored process sends asynchronous notifications information, with make described monitored process when detect in described queue there is described asynchronous notifications information time, transmission processing request, wherein, carries described asynchronous notifications information in described process request;
Progress information processing unit, for according to described process request, calls the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
As shown from the above technical solution, the process monitoring method that the embodiment of the present invention provides and device, for monitored course allocation monitoring thread, if monitoring thread to know system resource not enough, then the queue to monitored process sends asynchronous notifications information, with make monitored process when detect in queue there is asynchronous notifications information time, transmission processing request, according to process request, call the progress information that process function corresponding to asynchronous notifications information obtains process, progress information is sent to monitoring thread.Based on the asynchronous event treatment mechanism of operating system, when system resource is not enough, monitoring thread will send asynchronous notifications message to monitored process, just can obtain progress information like this in the process of process asynchronous notifications message.The acquisition process of progress information does not cause any interference to the normal operation of monitored process, can analyze, to safeguard in time according to the ruuning situation of progress information to monitored process.When process exception stops, progress information includes this monitored state of a process in system risk process, for debugging and rejuvenation provide sufficient foundation, improves the reliability of systematic analysis.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The process monitoring method process flow diagram that Fig. 1 provides for the embodiment of the present invention;
A kind of process monitoring processing flow chart that Fig. 2 provides for the embodiment of the present invention;
The another kind of process monitoring processing flow chart that Fig. 3 provides for the embodiment of the present invention;
Another process monitoring processing flow chart that Fig. 4 provides for the embodiment of the present invention;
The process monitoring apparatus structure schematic diagram that Fig. 5 provides for the embodiment of the present invention.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is 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.
The process monitoring method process flow diagram that Fig. 1 provides for the embodiment of the present invention.As shown in Figure 1, the process monitoring method that the present embodiment provides specifically can be applied to the monitor procedure of operating system to process especially critical processes, operating system can be Unix/Linux or Windows, the process monitoring method that the present embodiment provides can be performed by process monitoring device, this process monitoring device can be realized by the form of hardware and/or software, can be integrated in the control device of operating system.
Critical processes is specifically as follows the process running outbalance program, the critical processes run on an operating system may consume a large amount of system resource, also, after may occupying a large amount of system resource because of other processes in operating system, affect the normal operation of this critical processes simultaneously.When system resource occurs that nervous, system running environment exists risk time, the process monitoring method that the present embodiment can be adopted to provide is monitored critical processes, to obtain progress information, once critical processes stops because of system risk really, keeper or commissioning staff just can using progress information as debugging or follow the tracks of daily record to ascertain the reason.
The process monitoring method that the present embodiment provides specifically comprises:
Step 10, be monitored course allocation monitoring thread, if described monitoring thread knows that system resource is not enough, queue then to described monitored process sends asynchronous notifications information, with make described monitored process when detect in described queue there is described asynchronous notifications information time, transmission processing request, wherein, described asynchronous notifications information is carried in described process request;
Step 20, according to described process request, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
May there is multiple critical processes in operating system, user can preset the critical processes of required monitoring, i.e. monitored process.For each monitored course allocation monitoring thread, monitoring thread is monitored this monitored process situation that takies of system resource in operational process, also can take situation by special monitoring resource thread to system resource and monitor.When system resource is not enough, monitoring resource thread can notify monitoring thread.Monitoring thread sends asynchronous notifications message to the queue of this process.If system resource is not enough, situation exists always, then monitoring thread timing can send asynchronous notifications information to monitored process.This monitored process when detect in queue there is this asynchronous notifications information time, to kernel thread or the request of driver transmission processing.In Unix/Linux operating system, can be processed this process request by kernel thread, in Windows operating system, can be processed this process request by driver.
Under a kind of implementation, in Unix/Linux operating system, asynchronous notifications information is specially signal or asynchronous event, and signal or asynchronous event are based on asynchronous event treatment mechanism.Be divided into kernel spacing and user's space under Unix/Linux operating system, monitoring thread or monitoring resource thread specifically can realize at user's space the testing process of system resource, can reduce the operating pressure of system.Monitored process all realizes at user's space usually when executive utility, when needing calling system function in implementation, then enter kernel spacing, after system function is finished, monitored process can detect in queue whether there is pending signal or asynchronous event, when this signal or asynchronous event being detected, sending the process carrying this signal or asynchronous event asks to kernel thread, now, this monitored process does not process signal or asynchronous event, and monitored process turns back to user's space and continues executive utility.Kernel thread receives this process request, call this signal or process function corresponding to asynchronous event obtains progress information, the corresponding relation of signal or asynchronous event and process function can registered in advance, and progress information can comprise memory headroom information, the register information and stack information etc. of distribution.Progress information is sent to monitoring thread by kernel thread, and progress information can export by monitoring thread in the form of text, can be provided with the system management software in system, to manage this progress information.Also progress information can be sent to other watch-dogs to analyze further.
Under another kind of implementation, in Windows operating system, asynchronous notifications information is specially asynchronous procedure call (Asynchronous Procedure Call is called for short APC) request, and APC request is also based on asynchronous event treatment mechanism.Also be divided into kernel spacing and user's space under Windows operating system, monitoring thread or monitoring resource thread specifically can realize at user's space the testing process of system resource, can reduce the operating pressure of system.Monitored process all realizes at user's space usually when executive utility, when needing calling system function in implementation, then enter kernel spacing, after system function is finished, whether monitored process can detect in queue exists pending APC request, when detecting that this APC asks, sending the process carrying this APC request asks to driver, driver receives this process request, call and ask corresponding APC process function to obtain progress information with this APC, progress information is sent to monitoring thread by driver, progress information can export by monitoring thread in the form of text, also progress information can be sent to other watch-dogs to analyze further.
The process monitoring method that the present embodiment provides, for monitored course allocation monitoring thread, if monitoring thread knows that system resource is not enough, queue then to monitored process sends asynchronous notifications information, with make monitored process when detect in queue there is asynchronous notifications information time, transmission processing request, according to process request, call the progress information that process function corresponding to asynchronous notifications information obtains process, progress information is sent to monitoring thread.Based on the asynchronous event treatment mechanism of operating system, when system resource is not enough, monitoring thread will send asynchronous notifications message to monitored process, just can obtain progress information like this in the process of process asynchronous notifications message.The acquisition process of progress information does not cause any interference to the normal operation of monitored process, can analyze, to safeguard in time according to the ruuning situation of progress information to monitored process.When process exception stops, progress information includes this monitored state of a process in system risk process, for debugging and rejuvenation provide sufficient foundation, improves the reliability of systematic analysis.
In the present embodiment, in step 10, after monitored course allocation monitoring thread, can also comprise the steps:
Described monitoring thread is registered described asynchronous notifications information, to make described asynchronous notifications information corresponding with described process function.
Particularly, asynchronous notifications information can be self-defined information, by by asynchronous notifications information registering, this asynchronous notifications information is corresponding with process function.
In the present embodiment, in step 10, be monitored course allocation monitoring thread, specifically can comprise the steps:
Receive the monitoring request carrying process identification (PID) that watch-dog sends, determine described monitored process according to described process identification (PID).
Can arrange independently watch-dog and arrange the process needing monitoring, process identification (PID) is specifically as follows title or the numbering of process, can uniquely determine corresponding process according to process identification (PID), is this course allocation monitoring thread.
In the present embodiment, in step 10, if after described monitoring thread knows system resource deficiency, can also to comprise the steps:
Send risk notification message to described watch-dog, set up daily record to make described watch-dog according to described risk notification message; Correspondingly,
In step 20, after described progress information is sent to described monitoring thread, also comprise:
Described progress information is sent to described watch-dog by step 30, described monitoring thread, is recorded in described daily record by described progress information to make described watch-dog.
When monitoring thread judges to know that system resource is not enough, risk notification message can be sent to watch-dog, watch-dog sets up daily record according to this risk notification message, and progress information is sent to watch-dog by monitoring thread, and progress information is recorded in this daily record by watch-dog again.User just can analyze monitored state of a process according to log content.
In the present embodiment, in step 10, described monitored process is when described asynchronous notifications information being detected, and transmission processing request, specifically can comprise the steps:
Calling system function in described monitored process executive utility process, after system function is finished, detects whether there is described asynchronous notifications information, when described asynchronous notifications information being detected, sends described process request.
In the present embodiment, described asynchronous notifications information is signal or asynchronous event; Correspondingly, step 20, according to described process request, calls the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread, specifically comprises the steps:
By described kernel thread, the described process request that described monitored process sends is processed, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described monitoring thread is hung up, after described progress information write/proc file system, recover described monitoring thread, from described/proc file system, read described progress information to make described monitoring thread.
A kind of process monitoring processing flow chart that Fig. 2 provides for the embodiment of the present invention.As shown in Figure 2, particularly, under a kind of implementation, operating system is Unix/Linux, can arrange Monitor module, and this Monitor module can be realized by of a user's space monitoring process.This monitoring process comprises the monitoring thread for monitored course allocation, when there is multiple monitored process, can be monitoring thread corresponding to each monitored course allocation.Monitoring thread can be monitored system resource, monitoring process can also comprise a monitoring resource thread, to monitor system resource specially, when this monitoring resource thread monitor is not enough to system resource, thread internal alarm can be produced, to inform monitoring thread.
Can also arrange KAgent module, this KAgent module can be realized by of a kernel spacing kernel thread.Monitoring thread in advance will be corresponding with process function proc_status_capture by SIGPROCSTAT to KAgent Module registers self-defined signal SIGPROCSTAT, KAgent module.When monitoring thread knows that system resource is not enough, this signal SIGPROCSTAT is sent to monitored process, this signal SIGPROCSTAT enters in pending signal queue, and sends risk notification message to watch-dog, and watch-dog sets up daily record according to this risk notification message.After monitored process executes system function in kernel spacing, detect in this pending signal queue to there is signal SIGPROCSTAT, then send the process request carrying this signal SIGPROCSTAT to KAgent module.KAgent module receives process request, and the process function proc_status_capture that call signal SIGPROCSTAT is corresponding obtains the progress information of monitored process.The storehouse of monitored process is re-set as the stack information that normal signal/asynchronous event process completes by KAgent module.Monitored process returns the follow-up flow process that user's space continues to perform former application program.
The passing through alternately of the monitoring thread of KAgent module and user's space/proc file system realizes.Monitoring thread is first hung up by KAgent module, with stop monitoring thread right/read operation of proc file system, KAgent module by after progress information write/proc file system, then recovers this monitoring thread, and monitoring thread reads progress information from/proc file system.Progress information is sent to watch-dog by monitoring thread again, and progress information is recorded in corresponding daily record by watch-dog.
In the present embodiment, described asynchronous notifications information is the request of user's asynchronous procedure call; Correspondingly, step 20, according to described process request, calls the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread, specifically can comprise the steps:
By driver, the described process request that described monitored process sends is processed, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
The another kind of process monitoring processing flow chart that Fig. 3 provides for the embodiment of the present invention.As shown in Figure 3, particularly, under another kind of implementation, operating system is Windows, can arrange Monitor module and KAgent module, and the implementation of Monitor module and similar in Unix/Linux operating system, this repeats no more.KAgent module can be realized by the driver of kernel spacing.When monitoring resource thread monitor is not enough to system resource, produce thread internal alarm, to inform monitoring thread.Monitoring thread in advance in KAgent module registered user APC ask, by user APC ask corresponding with user APC process function proc_status_capture.When knowing that system resource is not enough, the pending request queue to monitored process is linked into this user APC and asks, and sends risk notification message to watch-dog, and watch-dog sets up daily record according to this risk notification message.After monitored process executes system function in kernel spacing, detect in this pending request queue that there is this user APC asks, then send the process request carrying this user APC and ask to KAgent module.KAgent module receives process request, calls this user APC and asks corresponding user APC process function proc_status_capture to obtain the progress information of monitored process.After having processed, proceed to the flow process that in normal APC treatment scheme, APC processing procedure returns, so that it arranges user's space storehouse, normally return user's space and perform.Monitored process returns the follow-up flow process that user's space continues to perform former application program.Progress information is sent to the monitoring thread of user's space by KAgent module.Progress information is sent to watch-dog by monitoring thread again, and progress information is recorded in corresponding daily record by watch-dog.
In the present embodiment, described asynchronous notifications information is the request of kernel asynchronous procedure call; Correspondingly, in step 10, if described monitoring thread knows that system resource is not enough, then send asynchronous notifications information to described monitored process, specifically can comprise the steps:
If described monitoring thread knows that system resource is not enough, then generate the Asynchronous Request information carrying the request of described kernel asynchronous procedure call and send to driver, according to described Asynchronous Request information, the queue of described monitored process being linked into the request of described kernel asynchronous procedure call to make described driver;
Step 20, according to described process request, calls the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread, specifically can comprise the steps:
By described driver, the described process request that described monitored process sends is processed, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
Another process monitoring processing flow chart that Fig. 4 provides for the embodiment of the present invention.As shown in Figure 4, particularly, under another implementation, operating system is Windows, can arrange Monitor module and KAgent module, and the implementation of Monitor module and similar in Unix/Linux operating system, this repeats no more.KAgent module can be realized by the driver of kernel spacing.When monitoring resource thread monitor is not enough to system resource, produce thread internal alarm, to inform monitoring thread.Monitoring thread registers core A PC request in advance in KAgent module, by corresponding with core A PC process function proc_status_capture for core A PC request.When monitoring thread knows that system resource is not enough, generate the Asynchronous Request information carrying core A PC request, and this Asynchronous Request message is sent to KAgent module, and send risk notification message to watch-dog, watch-dog sets up daily record according to this risk notification message, and KAgent module is asked being linked into this core A PC in the pending request queue of monitored process.After monitored process executes system function in kernel spacing, detect in this pending request queue that there is this core A PC asks, then send the process request carrying this core A PC and ask to KAgent module.KAgent module receives process request, calls this core A PC and asks corresponding core A PC process function proc_status_capture to obtain the progress information of monitored process.After having processed, proceed to the flow process that in normal APC treatment scheme, APC processing procedure returns, so that it arranges user's space storehouse, normally return user's space and perform.Monitored process returns the follow-up flow process that user's space continues to perform former application program.Progress information is sent to the monitoring thread of user's space by KAgent module.Progress information is sent to watch-dog by monitoring thread again, and progress information is recorded in corresponding daily record by watch-dog.
The process monitoring apparatus structure schematic diagram that Fig. 5 provides for the embodiment of the present invention.As shown in Figure 5, the process monitoring device that the present embodiment provides specifically can realize each flow process of the process monitoring method that any embodiment of the present invention provides, and this repeats no more.The process monitoring device that the present embodiment provides specifically comprises monitoring unit 11 and progress information processing unit 12.Monitoring unit 11 is for being monitored course allocation monitoring thread, if described monitoring thread knows that system resource is not enough, queue then to described monitored process sends asynchronous notifications information, with make described monitored process when detect in described queue there is described asynchronous notifications information time, transmission processing request, wherein, described asynchronous notifications information is carried in described process request.Progress information processing unit 12, for according to described process request, calls the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.Monitoring unit 11 and progress information processing unit 12 can be realized by the central processing unit of operation system.
The process monitoring device that the present embodiment provides, monitoring unit 11 is monitored course allocation monitoring thread, if monitoring thread knows that system resource is not enough, queue then to monitored process sends asynchronous notifications information, with make monitored process when detect in queue there is asynchronous notifications information time, transmission processing request, progress information processing unit 12 according to process request, call the progress information that process function corresponding to asynchronous notifications information obtains process, progress information is sent to monitoring thread.Based on the asynchronous event treatment mechanism of operating system, when system resource is not enough, monitoring thread will send asynchronous notifications message to monitored process, just can obtain progress information like this in the process of process asynchronous notifications message.The acquisition process of progress information does not cause any interference to the normal operation of monitored process, can analyze, to safeguard in time according to the ruuning situation of progress information to monitored process.When process exception stops, progress information includes this monitored state of a process in system risk process, for debugging and rejuvenation provide sufficient foundation, improves the reliability of systematic analysis.
In the present embodiment, described monitoring unit 11 can also be used for described monitoring thread and register described asynchronous notifications information, to make described asynchronous notifications information corresponding with described process function.Asynchronous notifications information can be self-defined information, by by asynchronous notifications information registering, this asynchronous notifications information is corresponding with process function.
In the present embodiment, described monitoring unit 11 can also be used for the monitoring request carrying process identification (PID) receiving watch-dog transmission, determines described monitored process according to described process identification (PID).By the instruction according to checkout equipment, corresponding process is monitored, the specific aim of process monitoring can be improved.
In the present embodiment, described monitoring unit 11 can also be used for sending risk notification message to described watch-dog, sets up daily record to make described watch-dog according to described risk notification message; Correspondingly, described process monitoring device also comprises information transmitting unit, and information transmitting unit is used for described monitoring thread and described progress information is sent to described watch-dog, is recorded in described daily record by described progress information to make described watch-dog.By the setting of daily record, the progress information of monitored process can carry out record, for user's subsequent analysis and debugging provide basis.
In the present embodiment, operating system is Unix/Linux, and described asynchronous notifications information is signal or asynchronous event; Correspondingly, described progress information processing unit 12 can also be used for being processed the described process request that described monitored process sends by described kernel thread, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described monitoring thread is hung up, after described progress information write/proc file system, recover described monitoring thread, from described/proc file system, read described progress information to make described monitoring thread.
In the present embodiment, operating system is Windows, and described asynchronous notifications information is the request of user's asynchronous procedure call; Correspondingly, described progress information processing unit 12 can also be used for being processed the described process request that described monitored process sends by driver, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
In the present embodiment, operating system is Windows, and described asynchronous notifications information is the request of kernel asynchronous procedure call; Correspondingly, if described monitoring unit 11 can also be used for described monitoring thread know that system resource is not enough, then generate the Asynchronous Request information carrying the request of described kernel asynchronous procedure call and send to driver, according to described Asynchronous Request information, the queue of described monitored process being linked into the request of described kernel asynchronous procedure call to make described driver.Described progress information processing unit 12 can also be used for being processed the described process request that described monitored process sends by described driver, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
The process monitoring method that the embodiment of the present invention provides and device, in time there is risk in system resource allocation, the monitoring thread of user's space will timed sending asynchronous notifications information, so just regularly can perform process function corresponding to asynchronous notifications information, thus the information of the monitored critical processes of timing acquisition.Like this when therefore monitored process stops really, keeper or commissioning staff just can obtain many parts of process status information in whole Risk Process, obtain more debugging or trace information.And in the process, the normal operation of monitored process should not be disturbed.In the technical program, achieved the function obtaining progress information by the asynchronous event treatment mechanism of operating system oneself.This just adds a pending asynchronous notifications information on the one hand in the asynchronous event processing procedure of monitored process, does not therefore affect the whole flow process of monitored process.On the other hand, because monitor procedure all completes in the Monitor module of user's space, therefore the system of alignment under resource progress, also greatly reduces the pressure of operation.Information dropout when simultaneously sending to the system management software or watch-dog that main frame operation can be avoided to collapse the integrated information of monitored process by monitoring thread, also facilitates the remote diagnosis of keeper and commissioning staff simultaneously.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer read/write memory medium, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.

Claims (13)

1. a process monitoring method, is characterized in that, comprising:
For monitored course allocation monitoring thread, if described monitoring thread knows that system resource is not enough, queue then to described monitored process sends asynchronous notifications information, with make described monitored process when detect in described queue there is described asynchronous notifications information time, transmission processing request, wherein, described asynchronous notifications information is carried in described process request;
According to described process request, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread;
Wherein, described be monitored course allocation monitoring thread after, also comprise:
Described monitoring thread is registered described asynchronous notifications information, to make described asynchronous notifications information corresponding with described process function.
2. process monitoring method according to claim 1, is characterized in that, is monitored course allocation monitoring thread, comprises:
Receive the monitoring request carrying process identification (PID) that watch-dog sends, determine described monitored process according to described process identification (PID).
3. process monitoring method according to claim 2, is characterized in that, if after described monitoring thread knows system resource deficiency, also comprise:
Send risk notification message to described watch-dog, set up daily record to make described watch-dog according to described risk notification message; Correspondingly,
After described progress information is sent to described monitoring thread, also comprise:
Described progress information is sent to described watch-dog by described monitoring thread, is recorded in described daily record by described progress information to make described watch-dog.
4. process monitoring method according to claim 1, is characterized in that, described monitored process is when described asynchronous notifications information being detected, and transmission processing request, comprising:
Calling system function in described monitored process executive utility process, after system function is finished, detects whether there is described asynchronous notifications information, when described asynchronous notifications information being detected, sends described process request.
5. process monitoring method according to claim 1, is characterized in that: described asynchronous notifications information is signal or asynchronous event; Correspondingly,
According to described process request, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information sent to described monitoring thread, comprising:
By kernel thread, the described process request that described monitored process sends is processed, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described monitoring thread is hung up, after described progress information write/proc file system, recover described monitoring thread, from described/proc file system, read described progress information to make described monitoring thread.
6. process monitoring method according to claim 1, is characterized in that: described asynchronous notifications information is the request of user's asynchronous procedure call; Correspondingly,
According to described process request, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information sent to described monitoring thread, comprising:
By driver, the described process request that described monitored process sends is processed, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
7. process monitoring method according to claim 1, is characterized in that: described asynchronous notifications information is the request of kernel asynchronous procedure call; Correspondingly,
If described monitoring thread knows that system resource is not enough, then send asynchronous notifications information to described monitored process, comprising:
If described monitoring thread knows that system resource is not enough, then generate the Asynchronous Request information carrying the request of described kernel asynchronous procedure call and send to driver, according to described Asynchronous Request information, the queue of described monitored process being linked into the request of described kernel asynchronous procedure call to make described driver;
According to described process request, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information sent to described monitoring thread, comprising:
By described driver, the described process request that described monitored process sends is processed, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
8. a process monitoring device, is characterized in that, comprising:
Monitoring unit, for being monitored course allocation monitoring thread, if described monitoring thread knows that system resource is not enough, queue then to described monitored process sends asynchronous notifications information, with make described monitored process when detect in described queue there is described asynchronous notifications information time, transmission processing request, wherein, carries described asynchronous notifications information in described process request;
Progress information processing unit, for according to described process request, calls the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread;
Wherein, described monitoring unit is also registered described asynchronous notifications information for described monitoring thread, to make described asynchronous notifications information corresponding with described process function.
9. process monitoring device according to claim 8, is characterized in that: described monitoring unit also for receiving the monitoring request carrying process identification (PID) that watch-dog sends, determines described monitored process according to described process identification (PID).
10. process monitoring device according to claim 9, is characterized in that:
Described monitoring unit also for sending risk notification message to described watch-dog, sets up daily record to make described watch-dog according to described risk notification message; Correspondingly,
Described process monitoring device also comprises:
Information transmitting unit, sends to described watch-dog for described monitoring thread by described progress information, is recorded in described daily record by described progress information to make described watch-dog.
11. process monitoring devices according to claim 8, is characterized in that: described asynchronous notifications information is signal or asynchronous event; Correspondingly,
Described progress information processing unit is also for processing the described process request that described monitored process sends by kernel thread, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described monitoring thread is hung up, after described progress information write/proc file system, recover described monitoring thread, from described/proc file system, read described progress information to make described monitoring thread.
12. process monitoring devices according to claim 8, is characterized in that: described asynchronous notifications information is the request of user's asynchronous procedure call; Correspondingly,
Described progress information processing unit is also for processing the described process request that described monitored process sends by driver, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
13. process monitoring devices according to claim 8, is characterized in that: described asynchronous notifications information is the request of kernel asynchronous procedure call; Correspondingly,
If for described monitoring thread, described monitoring unit also knows that system resource is not enough, then generate the Asynchronous Request information carrying the request of described kernel asynchronous procedure call and send to driver, according to described Asynchronous Request information, the queue of described monitored process being linked into the request of described kernel asynchronous procedure call to make described driver;
Described progress information processing unit is also for processing the described process request that described monitored process sends by described driver, call the progress information that process function corresponding to described asynchronous notifications information obtains described monitored process, described progress information is sent to described monitoring thread.
CN201210123817.9A 2012-04-25 2012-04-25 process monitoring method and device Active CN102722431B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210123817.9A CN102722431B (en) 2012-04-25 2012-04-25 process monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210123817.9A CN102722431B (en) 2012-04-25 2012-04-25 process monitoring method and device

Publications (2)

Publication Number Publication Date
CN102722431A CN102722431A (en) 2012-10-10
CN102722431B true CN102722431B (en) 2015-09-30

Family

ID=46948206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210123817.9A Active CN102722431B (en) 2012-04-25 2012-04-25 process monitoring method and device

Country Status (1)

Country Link
CN (1) CN102722431B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104065626B (en) * 2013-03-21 2018-03-23 杭州海康威视数字技术股份有限公司 The update method and device of web camera logging status
CN103365758B (en) * 2013-08-05 2016-03-16 北京搜狐新媒体信息技术有限公司 Process monitoring method under a kind of virtualized environment and system
CN104298563B (en) * 2014-10-13 2018-08-21 中国外汇交易中心 A kind of method and system for managing process
CN104536871B (en) * 2015-01-05 2017-06-30 中国农业银行股份有限公司 A kind of information flow methods of exhibiting and device
CN105975384B (en) * 2016-04-28 2018-10-26 北京小米移动软件有限公司 The monitoring method and device of distributed process
CN106909477A (en) * 2017-02-25 2017-06-30 郑州云海信息技术有限公司 A kind of storage server IO stack internal storage data guard methods and device
CN107038373A (en) * 2017-04-28 2017-08-11 北京洋浦伟业科技发展有限公司 A kind of Process Debugging detection method and device
CN107483288A (en) * 2017-08-18 2017-12-15 郑州云海信息技术有限公司 A kind of monitoring service intelligent dispatching method and device
CN109992425B (en) * 2017-12-29 2022-03-15 Oppo广东移动通信有限公司 Information processing method, information processing device, computer equipment and computer readable storage medium
CN111970224B (en) * 2019-05-20 2023-08-22 奇安信科技集团股份有限公司 Environment state sensing method and device of terminal equipment and computer equipment
CN113448794A (en) * 2020-03-26 2021-09-28 青岛海信传媒网络技术有限公司 Process positioning method, device and equipment and computer storage medium
CN113032207A (en) * 2021-03-02 2021-06-25 广州虎牙科技有限公司 Application process monitoring method and device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101268447A (en) * 2005-05-26 2008-09-17 美国联合包裹服务公司 Software process monitor

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156786A1 (en) * 2005-12-22 2007-07-05 International Business Machines Corporation Method and apparatus for managing event logs for processes in a digital data processing system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101268447A (en) * 2005-05-26 2008-09-17 美国联合包裹服务公司 Software process monitor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄可杰 等.Linux环境下I/O重定向与异步通信的实现.《计算机应用与软件》.2011,第28卷(第3期),第57-60页. *

Also Published As

Publication number Publication date
CN102722431A (en) 2012-10-10

Similar Documents

Publication Publication Date Title
CN102722431B (en) process monitoring method and device
CN104022904B (en) Distributed computer room information technoloy equipment management platform
US10545807B2 (en) Method and system for acquiring parameter sets at a preset time interval and matching parameters to obtain a fault scenario type
CN103500133A (en) Fault locating method and device
CN101997925A (en) Server monitoring method with early warning function and system thereof
CN104809030A (en) Android-based exception handling system and method
CN110688280B (en) Management system, method, equipment and storage medium for alarm event
CN103713981A (en) Database server performance detection and early warning method
CN106528372B (en) Program operation monitoring system and method
CN103268277A (en) Method and system for outputting log information
CN103729291A (en) Synchrony relation based parallel dynamic data race detection system
WO2018040968A1 (en) Method and device for facilitating on-site failure tracing and identification of payment terminal
CN102620948B (en) Intelligent pump storage machine set fault analysis method and system thereof
CN103927244B (en) A kind of method of the plug-in unit scheduling process monitoring realized based on dynamic proxy
CN104750041B (en) Abnormality monitoring method and system in WinCE system
CN110943865A (en) Method and device for diagnosing equipment fault time and related equipment
CN110377136A (en) A kind of PSU original value log recording method and device
CN105760281A (en) Method for monitoring and analyzing performance data of Linux system server
CN102854857A (en) Station state detection system and method of automobile assembly line
CN110636116B (en) Multidimensional data acquisition system and method
CN111784176A (en) Data processing method, device, server and medium
CN104598202A (en) Command line management device and method
CN106301903A (en) Device, method, system and the server of a kind of Linux Real-time Alarm
CN115543746A (en) Graphics processor monitoring method, system and device and electronic equipment
CN104346233A (en) Fault recovery method and device for computer system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211223

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee after: Super fusion Digital Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.