CN1180551C - Fault location method of program mode - Google Patents

Fault location method of program mode Download PDF

Info

Publication number
CN1180551C
CN1180551C CNB021179271A CN02117927A CN1180551C CN 1180551 C CN1180551 C CN 1180551C CN B021179271 A CNB021179271 A CN B021179271A CN 02117927 A CN02117927 A CN 02117927A CN 1180551 C CN1180551 C CN 1180551C
Authority
CN
China
Prior art keywords
program
record
chained list
track link
link table
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
CNB021179271A
Other languages
Chinese (zh)
Other versions
CN1414711A (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 Service 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 CNB021179271A priority Critical patent/CN1180551C/en
Publication of CN1414711A publication Critical patent/CN1414711A/en
Application granted granted Critical
Publication of CN1180551C publication Critical patent/CN1180551C/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 positioning method of faults for program state, which can quickly position faults in an operating program. The utility model is characterized in that the method at least comprises the following steps: 1) a black-box recording program used for recording operating state and positioning faults of the program is designed; 2) the black-box recording program is planted into a program that can not be shielded or interrupted of the system and a subprogram that can be called by the system; 3) the black-box recording program records the operating state of the subprogram of the system when the subprogram is called, produces a one-way recorded linked list and fills in a preset circular linked list that is in end-to-end connection in a static storage zone; 4) when the black-box recording program reinitializes the output channel of the system, the recorded results for positioning faults are outputted. The present invention is applicable to data communication equipment of which the system program is large and complex, such as routers, etc., and has the advantages that the recorded information of the program is complete, the method basically does not influence the normal operation of the program and the present invention is high in efficiency of positioning program exceptions.

Description

A kind of Fault Locating Method of program state
Technical field
The present invention relates to a kind of Fault Locating Method of program state.
Background of invention
Along with development of Communication Technique, the technology of data communications equipment is more and more advanced at present, and function makes that from strength to strength their system program is day by day huge and complicated.Therefore, in the system program running, tend to occur some abnormal conditions, but but very complicated to the location of abnormal conditions.At present, the location of program exception is used two kinds of methods usually, they are respectively:
1, utilizes simulator or real time operating system, adopt single step to follow the tracks of or the operation of breaking trace routine in program, determine whether program is moved normally.It is exactly that manual control program is carried out that single step is followed the tracks of, and every one step of execution all can be seen the situation etc. of the variable that situation, the situation of storehouse, each content of registers, the user of program are provided with from simulator or real time operating system, comes fault location with this.The method of breaking has been established breakpoint exactly in advance in program in program, the every execution of program once stops to the breakpoint place, can see the situation etc. of the variable that situation, the situation of storehouse, each content of registers, the user of program at that time are provided with equally from simulator or real time operating system, come fault location with this.When this method is used program development in the early stage and test, location to abnormal conditions is very effective, but owing to be not to move at full speed and at full capacity, the abnormal conditions that occur when moving in full speed and at full capacity often die and no longer reproduction slightly in wink, thereby being difficult to capture abnormal conditions, the program mal location efficiency during for the test of later development or finished product is not high.
2, utilize program stack to locate, this method needs the support of simulator or real time operating system equally, in memory, set up special-purpose stack area exactly, when program running, during the value of the variable that pointer, pointer to stack, each content of registers, the user of program is provided with is isobaric stacked.Occur when unusual in program, the content in the stack is checked in the operation of shut down procedure, comes fault location with this.This method program occur unusual after during very fast inspection stack area, can very fast fault location.But tend to occur this situation: program occur unusual after, or the monitor for a long time just discovery procedure occurred unusually, at this time storehouse become changed beyond recognition, be difficult to date back to abnormity point, also just very difficult fault location.
This shows, the various information in the logging program running that these two kinds of Fault Locating Methods commonly used can not be complete in the prior art, the abnormal conditions that occur when therefore moving in full speed and at full capacity for program are difficult to make fault location.
Summary of the invention
In view of this, main purpose of the present invention be to provide a kind of program at full speed, the running status of logging program under the full-load conditions, the parameter of calling, using and the parameter value that comprise program, and can be according to the method for the fault in the quick finder running of record result.
For achieving the above object, technical scheme of the present invention is such:
A kind of Fault Locating Method of program state is characterized by this method and comprises following step at least:
A, black box logging program that is used for logging program running status and fault location of design;
B, respectively the not maskable interrupt routine of system and can be by the subprogram of the system of system call respectively implant a black box logging program with rearmost end foremost;
C, black box logging program write down the running status of subprogram when the subprogram of system is called, generate the single-track link table of the record corresponding with subprogram, and are filled in the end to end belt chained list of the static storage area that sets in advance;
D, when the black box logging program reinitializes the output channel of system, output is used for the record result of fault location.
Wherein the maskable interrupt routine can not be set to the external condition triggering, for example regularly triggers or manual triggers.
The single-track link table of the described record of step c, its structure can be set to comprise at least gauge outfit, chained list content and table tail, and its chained list content has comprised variable name and the variate-value thereof that is provided with by the subroutine pointer of system call, stack pointer, content of registers and at least one user.
The structure of the belt chained list described in this method can be set to: comprise a belt chain table entry that is used for the single-track link table of record is inserted the chained list that goes in ring, single-track link table with record more than, the gauge outfit of the single-track link table of each record order successively links to each other, and the gauge outfit of the single-track link table of last record links to each other with the gauge outfit of the single-track link table of first record.
Steps d wherein can be after having triggered not the maskable interrupt routine, by being implanted in the output channel that the black box logging program of maskable interrupt routine not reinitializes system, finishes record result's output; Its record result can be the content of the single-track link table of all records of being filled into the chained list that goes in ring by the black box logging program or all the elements of system stack; This record is the result export with document form, after the record result output, empties belt chained list.
Black box logging program described in this method, every execution once generate a program state record, and can be filled in the chained list that goes in ring by the sequencing that generates, when belt chained list is filled, from program state recording start covering at first.
By such scheme as can be seen, key of the present invention is: the not maskable interrupt routine of system and each can be by the subprogram of system call add the black box logging program with rearmost end foremost, black box logging program logging program pointer in program running, stack pointer, stack content, each content of registers, the user is provided with the variable name that needs record and variate-value etc., by triggering not maskable interrupt routine, reinitialize the output channel of system by implantation black box logging program wherein, output record result, the monitor staff is according to exporting fault location as a result.
The Fault Locating Method of this program state provided by the present invention, realized program at full speed, the running status and the fault location fast of logging program under the oepration at full load condition, it has following characteristics and advantage:
1, the running status of the present invention program's logging program under program full speed, oepration at full load condition, therefore record accurately, in time.
2, it is end to end that belt chained list is arranged in dedicated memory of the present invention, can the non-volatile recording running state of programs.
3, the present invention program each can be by the subprogram of system call added the black box logging program with rearmost end foremost, make each subprogram be called once just can to generate two and call record, so just write down before this subroutine call and the situation after calling, when fault location, can very clearly see the front and back situation of subroutine call, make the monitor staff find the abnormity point of program very soon, therefore improved the efficient of program exception location, saved the development time.
4, the present invention program adds the black box logging program in systems soft ware, and the black box logging program is not controlled the hardware of system, does not therefore influence the normal operation of program substantially.
5, the present invention program can program at full speed, the running status of complete logging program under the oepration at full load condition, so the present invention program also can be used in the system test before the product export, the tester determines by the analytic record result whether product qualified.
Description of drawings
Fig. 1 is a black box recording processing schematic flow sheet.
Fig. 2 is the structure of the single-track link table of record.
Fig. 3 is the structural representation of the record chained list that goes in ring.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, by the following examples, and with reference to accompanying drawing, the present invention is described in more detail.
The function class that technical scheme of the present invention is finished is similar to the black box that is used for the record-setting flight state on the aircraft, so claim that the technology of the present invention is the black box recording technique, the program that title is used for the logging program running status is the black box logging program.A specific embodiment of the present invention is that it is applied in a kind of program mal location of router.Its concrete implementation content is such:
1, black box logging program of design, this program realizes following function:
When 1) moving in system, the running status of logging program, and will write down the result and insert the static storage area that sets in advance;
2) output channel of initialization system, output record result.
2, the memory block that is exclusively used in the stored program state is set,, half memory size of router after the expansion is still distributed to router use, later half capacity configuration is become the static storage area one times of router memory expansion, and end to end with the chain sheet form that goes in ring.
The dedicated memory that is used for stored record in the present embodiment is half of Installed System Memory.Big like this internal memory makes the recorded information of storage complete, enough is used to the abnormity point of the program that dates back to.Certainly, the capacity of dedicated memory needn't one be decided to be half of Installed System Memory, can be according to the actual conditions setting of system, as long as guarantee that the recorded information of storage is complete, the abnormity point that enough is used to the program that dates back to gets final product.
3, add the black box logging program that is used for the logging program state in the systems soft ware, in the not maskable interrupt routine of router, implant the black box logging program, be used for output record result; Each can by the subprogram of system call foremost and rearmost end, add the black box logging program, be used for the running status of logging program.
4, with the implantation of router the not maskable interrupt routine of black box logging program be arranged to manual triggering.Because router is in when in service, do not detect itself and whether be in malfunction, therefore need external condition to trigger, external condition triggers and comprises manual triggering, regularly triggers and external condition that other can cause that maskable interrupt routine triggers triggers.After finding fault, adopt manual trigger method the simplest, direct, so present embodiment has adopted manual triggering.Adopting the manual purpose that triggers is to guarantee that router data preservation under the situation of not power down is complete.Data also can be stored in the data mediums such as FLASH, like this, though guaranteed that data are not lost under the situation of power down, but data medium capacity such as FLASH are less usually and writing speed is slow, the data volume of record does not enough date back to abnormity point, and the situation of router generation powered-off fault seldom, and therefore, the present invention does not adopt data mediums such as FLASH to store data; Simultaneously, the manual triggering (perhaps regularly triggering) be the maskable interrupt routine not, can also guarantee in unit exception, and the program commentaries on classics flies or is under the endless loop state, and the black box logging program can correct execution.
5, when program compilation, to determine to carry out the black box logging program, the systems soft ware after the compiling is the systems soft ware of commissioning version.
6, router is installed the systems soft ware of commissioning version, when router moves, the black box logging program writes down the running status of each invoked subprogram, with the record result be filled in the end to end belt chained list of the static storage area that sets in advance, its process specifically:
Each can by the subprogram of system call foremost and rearmost end, added the black box logging program, its flow chart is referring to Fig. 1.As shown in Figure 1, elder generation's execution in step 101 was called the black box logging program when subprogram began to call, and execution in step 102 then, the runtime subroutine body, and execution in step 103 before subroutine call finishes is called the black box logging program.Before coming logging program to call with this and program pointer, stack pointer, content of registers, user after calling the variable name and the variate-value thereof of record are set.Since each can by the subprogram of system call all added the black box logging program with rearmost end foremost, therefore, each subprogram is called and once just carries out the black box logging program twice, also just generates the single-track link table of two records.Can be clearly seen that situation before and after the subroutine call from the single-track link table of these two records, can accelerate the speed of fault location.
The structure of the single-track link table of the record of present embodiment is referring to Fig. 2.210 " calling record 1 " are the gauge outfit of this chained list among Fig. 2,230 " NULL " are the table tail of chained list, other parts 220 are chained list contents, and the chained list content has comprised that individual 224 users of 221 program pointers, 222 stack pointers, 223 content of registers and n are provided with the variable name and the variate-value of record.The single-track link table of each record generates the back and is filled in the chained list that goes in ring by the sequencing that generates, and promptly is filled into the static storage area that sets in advance.
Go in ring list structure referring to Fig. 3.As shown in Figure 3, illustrate the gauge outfit of N single-track link table that writes down with N 210 " calling record " among the figure.The table tail of the single-track link table of every record of 230 among the figure " NULL " signal.220 chained list contents among the figure are the chained list content of the single-track link table of every record.As seen from Figure 3, the content of belt chained list is the single-track link table of each record, be about to every record single-track link table gauge outfit successively order link to each other, and the gauge outfit of the single-track link table of last record links to each other with the gauge outfit of the single-track link table of first record and becomes belt chained list.In addition, belt chained list also comprises one 300 belt chain table entry, and the single-track link table that is used for writing down is filled into the chained list that goes in ring.
The purpose of belt chained list is arranged in the static storage area, mainly is can work long hours for the black box logging program.Because some faults need long time integration just can show, but the capacity of internal memory is limited, as is designed to single-track link table record a period of time and will overflows, so be arranged to the chained list that goes in ring.Because the single-track link table of each record is filled in the chained list that goes in ring by the sequencing that generates, therefore when belt chain table record fills up,, can guarantee so up-to-date event is noted from recording start covering the earliest.
When 7, the monitor staff noted abnormalities, by the manual not maskable interrupt routine that triggers, implantation black box logging program wherein reinitialized the output channel of route system, output record result; The record result is the content of all single-track link tables of being filled into the chained list that goes in ring by the black box logging program or all the elements of system stack; What present embodiment was exported is the content of belt chained list, and this record is the result export with document form, after the record result output, empties belt chained list.
The monitor staff is according to the record fault location as a result in the file of output.
Present embodiment according to the data of record, has navigated to the abnormity point of program very soon in the unusual position fixing process of router program operation, saved the development time.
The present invention program's embodiment implements on router, but it not only limits the use of in router, on the more data communications equipment of other application communication agreement, can use as equipment such as Ethernet switches.
The present invention program has realized the running status and the quick fault location of logging program under program full speed, oepration at full load condition.Therefore, the present invention program is applicable to the huge and complicated data communications equipment of system program such as router, have the program recorded information complete, do not influence the normal operation and the high advantage of program exception location efficiency of program substantially.
More than lift preferred embodiment; the purpose, technical solutions and advantages of the present invention are further described; institute is understood that; the above only is preferred embodiment of the present invention; not in order to restriction the present invention; within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (7)

1, a kind of Fault Locating Method of program state is characterized in that, this method comprises following step at least:
A, black box logging program that is used for logging program running status and fault location of design;
B, respectively the not maskable interrupt routine of system and can be by the subprogram of the system of system call respectively implant a black box logging program with rearmost end foremost;
C, black box logging program write down the running status of subprogram when the subprogram of system is called, generate the single-track link table of the record corresponding with subprogram, and are filled in the end to end belt chained list of the static storage area that sets in advance;
D, when the black box logging program reinitializes the output channel of system, output is used for the record result of fault location.
2, the Fault Locating Method of program state as claimed in claim 1 is characterized in that: the not maskable interrupt routine described in the step b is set to external condition and triggers, and comprises regularly and triggering.
3, the Fault Locating Method of program state as claimed in claim 1, it is characterized in that: the single-track link table of the described record of step c, its structure comprises gauge outfit, chained list content and table tail at least, and its chained list content has comprised variable name and the variate-value thereof that is provided with by the subroutine pointer of system call, stack pointer, content of registers and at least one user.
4, the Fault Locating Method of program state as claimed in claim 1 is characterized in that: the structure of described belt chained list comprises that one is used for the single-track link table of record is inserted the single-track link table that goes in ring the belt chain table entry of chained list and write down more than; The gauge outfit of the single-track link table of each record order successively links to each other, and the gauge outfit of the single-track link table of last record links to each other with the gauge outfit of the single-track link table of first record.
5, the Fault Locating Method of program state as claimed in claim 1 is characterized in that: steps d is after having triggered not the maskable interrupt routine, by being implanted in the output channel that the black box logging program of maskable interrupt routine not reinitializes system.
6, the Fault Locating Method of program state as claimed in claim 1 is characterized in that: the described record result of steps d is the content of all single-track link tables of being filled into the chained list that goes in ring by the black box logging program or all the elements of system stack; This record is the result export with document form, after the record result output, empties belt chained list.
7, the Fault Locating Method of program state as claimed in claim 1 is characterized in that: the single-track link table of described record is filled in the chained list that goes in ring by the sequencing that generates, and when belt chained list is filled, begins to cover from the single-track link table that writes down at first.
CNB021179271A 2002-05-23 2002-05-23 Fault location method of program mode Expired - Fee Related CN1180551C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB021179271A CN1180551C (en) 2002-05-23 2002-05-23 Fault location method of program mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB021179271A CN1180551C (en) 2002-05-23 2002-05-23 Fault location method of program mode

Publications (2)

Publication Number Publication Date
CN1414711A CN1414711A (en) 2003-04-30
CN1180551C true CN1180551C (en) 2004-12-15

Family

ID=4744575

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB021179271A Expired - Fee Related CN1180551C (en) 2002-05-23 2002-05-23 Fault location method of program mode

Country Status (1)

Country Link
CN (1) CN1180551C (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1329836C (en) * 2004-05-26 2007-08-01 华为技术有限公司 Method for locating program abnormity
CN100344204C (en) * 2004-09-30 2007-10-17 华为技术有限公司 Monitoring method and fault positioning method for hand-held apparatus
CN101175109B (en) * 2006-10-31 2011-05-11 中兴通讯股份有限公司 System abnormal information processing method and device
CN101060686B (en) * 2007-06-15 2011-05-11 中兴通讯股份有限公司 A method and device for the anomaly diagnosis and error playback in a mobile terminal
CN101118626B (en) * 2007-09-13 2011-12-28 中兴通讯股份有限公司 Electronic worksheets automatic construction system and electric electronic worksheets processing method
CN101231599B (en) * 2008-02-02 2010-07-14 中兴通讯股份有限公司 Method for positioning specific memory illegally rewritten by function
CN104572417B (en) * 2015-01-20 2018-02-23 天津市英贝特航天科技有限公司 Operating system failure trace analysis method based on CMOS memory
CN110620698A (en) * 2018-06-19 2019-12-27 杭州海康威视数字技术股份有限公司 Software abnormity diagnosis method, device, equipment and system

Also Published As

Publication number Publication date
CN1414711A (en) 2003-04-30

Similar Documents

Publication Publication Date Title
Zaharia An architecture for fast and general data processing on large clusters
US5870607A (en) Method and apparatus for selective replay of computer programs
US7167870B2 (en) Software development test case maintenance
US20040098707A1 (en) Generic wrapper scheme
Phang et al. Expositor: Scriptable time-travel debugging with first-class traces
US20030212924A1 (en) Software development test case analyzer and optimizer
Olsson et al. A dataflow approach to event‐based debugging
US20020138788A1 (en) Computer software run-time analysis systems and methods
US8005794B2 (en) Mechanism for data aggregation in a tracing framework
US20080134148A1 (en) Method and Apparatus for Tracing Execution of Computer Programming Code Using Dynamic Trace Enablement
US10175983B2 (en) Branch trace compression
CN1180551C (en) Fault location method of program mode
CN1540517A (en) Just-My-Code modulation tech
US11922168B2 (en) Stack traces using shadow stack
US20220100638A1 (en) Diffing of replayable execution traces
CN1728106A (en) Method for positioning malfunction of application program
US20230124327A1 (en) Cross-thread memory indexing in time-travel debugging traces
Ezzati-Jivan et al. A framework to compute statistics of system parameters from very large trace files
EP4091057B1 (en) Diffing a subject replayable execution trace against a comparison replayable execution trace
US5379407A (en) Error handling in a state-free system
CN1470992A (en) Positioning method of recording general progress anomal recede using sharing core-object
CN1632759A (en) Method capable of smartly implementing EEPROM simulation function in chip
CN1905076A (en) Method for implementing dynamic storage error static detecting of embedded system
US11068378B2 (en) Memory value exposure in time-travel debugging traces
CN111026764B (en) Data storage method and device, electronic product and storage medium

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
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
ASS Succession or assignment of patent right

Owner name: HUAWEI TECHNOLOGIES SERVICES CO., LTD.

Free format text: FORMER OWNER: HUAWEI TECHNOLOGY CO., LTD.

Effective date: 20081010

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20081010

Address after: West of Wangjing Road, Langfang economic and Technological Development Zone, Hebei

Patentee after: Huawei Technoloy Service Co., Ltd.

Address before: Shenzhen HUAWEI service building, science and Technology Park, Guangdong

Patentee before: Huawei Technologies Co., Ltd.

C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20041215

Termination date: 20110523