CN110221928A - Information recording method, device, terminal and storage medium - Google Patents
Information recording method, device, terminal and storage medium Download PDFInfo
- Publication number
- CN110221928A CN110221928A CN201910502219.4A CN201910502219A CN110221928A CN 110221928 A CN110221928 A CN 110221928A CN 201910502219 A CN201910502219 A CN 201910502219A CN 110221928 A CN110221928 A CN 110221928A
- Authority
- CN
- China
- Prior art keywords
- thread
- target
- track
- information
- target process
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the present application discloses a kind of information recording method, device, terminal and storage medium, belongs to field of terminal technology.The described method includes: track thread obtains at least one target process communicated with SS process, track thread is the thread in SS process;When detecting system exception, house dog thread sends abnormal notification message to track thread, and house dog thread is the thread in SS process;When receiving abnormal notification message, track thread obtains the corresponding goal stack traceback information of each target process;Record goal stack traceback information.In the present embodiment, since the goal stack traceback information before transmission system exception with the target process of SS process communication is recorded, therefore subsequent to be checked out based on goal stack traceback information by the stuck caused system exception of target process, help to improve the investigation efficiency of system exception reason.
Description
Technical field
The invention relates to field of terminal technology, in particular to a kind of information recording method, device, terminal and storage
Medium.
Background technique
Android (Android) system architecture is broadly divided into four parts, respectively Linux inner core, system Runtime Library layer
(Libraries), application framework layer (Application Framework) and application layer (Applications).Wherein, it applies
Ccf layer provides the various interfaces that may be used when building application program, and developer can also carry out structure by using these interfaces
Build the application program of oneself.
In the related technology, house dog is provided in system service (System Server, SS) process of application framework layer
(WatchDog) thread, house dog thread is used to monitor the system exception of application framework layer generation, when detecting system exception,
It grabs and records the thread state of thread and stack traceback information (call stack trace) in SS process, so as to subsequent progress
Anomaly analysis.
Summary of the invention
The embodiment of the present application provides a kind of information recording method, device, terminal and storage medium.The technical solution is such as
Under:
On the one hand, the embodiment of the present application provides a kind of information recording method, which comprises
Track thread obtains at least one target process for being communicated with SS process, the track thread be the SS into
Thread in journey;
When detecting system exception, house dog thread sends abnormal notification message to the track thread, described to guard the gate
Dog thread is the thread in the SS process;
When receiving the abnormal notification message, the track thread obtains the corresponding target of each target process
Stack traceback information;
Record the goal stack traceback information.
On the other hand, the embodiment of the present application provides a kind of information record carrier, and described device includes:
Tracking module, for obtaining at least one target process communicated with SS process, the track thread is institute
State the thread in SS process;
Watchdog module, for when detecting system exception, Xiang Suoshu tracking module to send abnormal notification message, described
House dog thread is the thread in the SS process;
Tracking module is also used to that it is corresponding to obtain each target process when receiving the abnormal notification message
Goal stack traceback information;
Logging modle, for recording the goal stack traceback information.
On the other hand, the embodiment of the present application provides a kind of terminal, and the terminal includes: that terminal includes processor and storage
Device;The memory is stored at least one instruction, and at least one instruction is for being executed by the processor to realize such as
Information recording method described in above-mentioned aspect.
On the other hand, a kind of computer readable storage medium is provided, the storage medium is stored at least one instruction,
At least one instruction is for being executed by processor the information recording method to realize as described in terms of above-mentioned.
On the other hand, a kind of computer program product is additionally provided, which is stored at least one finger
It enables, at least one instruction is loaded as processor and executed to realize information recording method described in above-mentioned aspect.
In the embodiment of the present application, obtained and SS process by creating track thread in SS process, and using track thread
At least one target process communicated, to be obtained each when receiving the abnormal notification message of house dog thread transmission
The corresponding goal stack traceback information of a target process, and the goal stack traceback information is recorded;System is sent due to being recorded
The abnormal preceding goal stack traceback information with the target process of SS process communication of system, therefore subsequent can be based on goal stack traceback information
It checks out by the stuck caused system exception of target process, helps to improve the investigation efficiency of system exception reason.
Detailed description of the invention
Fig. 1 shows the structural block diagram of the terminal of one exemplary embodiment of the application offer;
Fig. 2 shows the flow charts of the information recording method shown in one exemplary embodiment of the application;
Fig. 3 shows the flow chart of the information recording method shown in another exemplary embodiment of the application;
Fig. 4 is the schematic diagram of information recording method implementation process shown in Fig. 3;
Fig. 5 shows the structural block diagram of the information record carrier of the application one embodiment offer.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Referenced herein " multiple " refer to two or more."and/or", the association for describing affiliated partner are closed
System indicates may exist three kinds of relationships, for example, A and/or B, can indicate: individualism A exists simultaneously A and B, individualism
These three situations of B.Character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Referring to fig. 1 and fig. 2, the structure side of the terminal 100 provided it illustrates one exemplary embodiment of the application
Block diagram.The terminal 100 can be mobile phone, tablet computer, laptop and e-book etc..Terminal 100 in the application can be with
Including one or more such as lower component: central processing unit 110, memory 120 and display screen 130.
Processor 110 may include one or more processing core.Processor 110 utilizes various interfaces and connection
Various pieces in entire terminal 100, by running or executing the instruction being stored in memory 120, program, code set or refer to
Collection is enabled, and calls the data being stored in memory 120, executes the various functions and processing data of terminal 100.Optionally,
Processor 110 can use Digital Signal Processing (Digital Signal Processing, DSP), field programmable gate array
(Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic
Array, PLA) at least one of example, in hardware realize.Processor 110 can integrating central processor (Central
Processing Unit, CPU), graphics processor (Graphics Processing Unit, GPU), neural network processor
The combination of one or more of (Neural-network Processing Unit, NPU) and modem etc..Wherein,
The main processing operation system of CPU, user interface and application program etc.;GPU is to be shown needed for touch display screen 130 for being responsible for
The rendering and drafting of content;NPU is for realizing artificial intelligence (Artificial Intelligence, AI) function;Modulation /demodulation
Device is for handling wireless communication.It is understood that above-mentioned modem can not also be integrated into processor 110, individually
It is realized by chip piece.
Memory 120 may include random access memory (Random Access Memory, RAM), also may include read-only
Memory (Read-Only Memory).Optionally, which includes non-transient computer-readable medium (non-
transitory computer-readable storage medium).Memory 120 can be used for store instruction, program, generation
Code, code set or instruction set.Memory 120 may include storing program area and storage data area, wherein storing program area can store
Instruction for realizing operating system, the instruction at least one function (such as touch function, sound-playing function, image
Playing function etc.), for realizing instruction of following each embodiments of the method etc.;Storage data area can be stored according to terminal 100
Use created data (such as audio data, phone directory) etc..
By taking operating system is Android (Android) system as an example, program and data such as Fig. 1 institute for being stored in memory 120
Show, Linux inner core 220, system Runtime Library layer 240, application framework layer 260 and application layer 280 are stored in memory 120.
Linux inner core 220 provides the driving of bottom for the various hardware of terminal 100, such as shows driving, audio driven, camera
Driving, bluetooth driving, Wi-Fi driving, power management etc..System Runtime Library layer 240 is by some libraries C/C++ come for Android
System provides main characteristic and supports.If the library SQLite provides the support of database, the library OpenGL/ES provides 3D drawing
Support, the library Webkit provides the support etc. of browser kernel.Android fortune is also provided in system Runtime Library layer 240
Library 242 (Android Runtime) when row, it mainly provides some core libraries, and developer can allow for use Java language
To write Android application.Application framework layer 260 provides the various API that may be used when building application program, developer
The application program of oneself, such as activity management, window management, view management, notice pipe can be constructed by using these API
Reason, assures reason, call management, resource management, orientation management at content provider.Operation has at least one application in application layer 280
Program, these application programs can be the included contact person's program of operating system, short message program, timing routine, camera applications etc.;
It is also possible to application program that third party developer is developed, such as instant messaging program, photograph pretty program etc..
Display screen 130 is used to show the display component of user interface.Optionally, which also has touch function,
The touch operations of any suitable object on it or nearby such as finger, felt pen are used for receiving user.Display screen 130 is logical
It is normally placed in the front panel of terminal 130.Display screen 130 is designed to shield comprehensively, Curved screen, special-shaped screen, double-sided screen or folding
Folded screen.Display screen 130 is also designed to shield comprehensively and the combination of Curved screen, the combination of abnormal shape screen and Curved screen, this implementation
Example is not limited this.
In addition to this, it will be understood by those skilled in the art that the structure of terminal 100 shown by above-mentioned attached drawing is not constituted
Restriction to terminal 100, terminal may include perhaps combining certain components or difference than illustrating more or fewer components
Component layout.For example, further including radio circuit, input unit, sensor, voicefrequency circuit, Wireless Fidelity in terminal 100
The components such as (Wireless Fidelity, WiFi) module, power supply, bluetooth module, details are not described herein.
In the related technology, in order in generating system exception, determine the abnormal thread in SS process, thus to different
Normal thread carries out problem investigation and amendment, and developer creates house dog thread in SS process, and is remembered using house dog thread
When recording system is abnormal, the thread state of each thread and stack traceback information in SS process are recalled so as to subsequent based on stack
Information carries out thread anomaly analysis.
Using the above method, the abnormal process in SS process can be effectively checked out, but is found in application process, is
It may not be to be caused extremely by thread in SS process, but other processes by being communicated with SS process are stuck leads that system is abnormal
It causes, in this case, can not be determined system exception reason (because thread and without exception in SS process) using the above method, and
It is abnormal by artificial recurrence system since the reproduction probability of system exception is lower, thus the effect of Check System abnormal cause
Rate is lower, and needs to spend vast resources.
In scheme provided by the embodiments of the present application, by creating new thread in SS process --- track thread, using with
Track thread obtains at least one target process communicated with SS process, to obtain each target when generating system exception
The corresponding goal stack traceback information of process, and the goal stack traceback information is recorded, it is returned so as to subsequent based on the goal stack
Whether the information determining system that traces back is caused extremely by target process is stuck.Using scheme provided by the embodiments of the present application, developer
Can quick Check System abnormal cause, it is abnormal without artificial recurrence system, help to improve the effect of Check System abnormal cause
Rate.It is illustrated below using schematical embodiment.
Referring to FIG. 2, it illustrates the flow charts of the information recording method shown in one exemplary embodiment of the application.This
Embodiment is applied to terminal 100 shown in FIG. 1 in this way to illustrate.This method comprises:
Step 201, track thread obtains at least one target process for being communicated with SS process, track thread be SS into
Thread in journey.
Track thread in the embodiment of the present application is newly created thread in SS process, is led to for recording with SS process
Other processes of letter, optionally, in SS process operational process, SS thread remains operational state, thus persistently record and SS process
Other processes communicated.Schematically, the track thread for having entitled trackBinder is increased in SS process newly.
In a kind of possible embodiment, track thread gets the target process mark of at least one target process
(Process ID, PID), target process mark are used for unique identification target process.
Step 202, when detecting system exception, house dog thread sends abnormal notification message to track thread, guards the gate
Dog thread is the thread in SS process.
In a kind of possible embodiment, house dog thread and track thread in SS process have communication function,
When detecting system exception, house dog thread is other than the stack traceback information for needing to grab thread in SS process, it is also necessary to pass through
Inter-thread communication mechanism sends abnormal notification message to track thread, and notice track thread detects that current generating system is abnormal.
For example, house dog thread sends abnormal notification message to track thread by Android message mechanism.
Optionally, house dog thread detects whether to occur according to scheduled detection cycle (for example detection cycle is 30s/ times)
System exception, and including the system exception moment of generating system exception in the abnormal notification message sent to track thread.This Shen
Please embodiment not to house dog thread carry out system anomaly detection concrete mode be defined.
Step 203, when receiving abnormal notification message, track thread obtains the corresponding goal stack of each target process and returns
It traces back information.
For the ease of subsequent Check System abnormal cause, track thread obtains each after receiving abnormal notification message
Target process corresponding goal stack traceback information includes function stack (the function tune in target process in the goal stack traceback information
With).
By the step, track thread can get the process communicated with SS process in generating system exception
Stack traceback information, so as to subsequent based on the stack traceback information is determining and whether the process of SS process communication is abnormal, in turn
It leads to system abnormity.
Step 204, goal stack traceback information is recorded.
Subsequent determining system exception reason for convenience, in a kind of possible embodiment, write-in thread be will acquire
Goal stack traceback information write-in terminal data subregion specified file in, subsequently through read the specified file can analyze
System exception reason.For example, the write-in thread can be signalcatch thread.
In conclusion being obtained in the embodiment of the present application by creating track thread in SS process, and using track thread
At least one target process communicated with SS process, thus in the abnormal notification message for receiving the transmission of house dog thread
When, the corresponding goal stack traceback information of each target process is obtained, and record to the goal stack traceback information;Due to record
To sending goal stack traceback information with the target process of SS process communication before system exception, therefore subsequent it can be based on goal stack
Traceback information is checked out by the stuck caused system exception of target process, and the investigation efficiency of system exception reason is helped to improve.
In a kind of possible embodiment, terminal to server sends goal stack traceback information, so that server is used for
System exception reason is determined according to goal stack traceback information.In addition, terminal can also send the stack backtracking of SS process to server
Information, so that server determines system exception reason based on the stack traceback information of goal stack traceback information and SS process simultaneously.
Optionally, when goal stack traceback information indicates existence function stack exception, determine that target process leads to system extremely
It is abnormal;When goal stack traceback information indicator function stack is normal, and in SS process thread stack traceback information indicator function stack it is abnormal
When, determine that thread leads to system abnormity extremely in SS process.
Below use schematical embodiment, to the interactive process in above- mentioned information recording method between thread, process into
Row explanation.
Referring to FIG. 3, it illustrates the flow charts of the information recording method shown in another exemplary embodiment of the application.
The present embodiment is applied to terminal 100 shown in FIG. 1 in this way to illustrate.This method comprises:
Step 301, track thread obtains the process identification (PID) of SS process.
In order to determine other processes for being communicated with SS process, track thread firstly the need of obtain SS process currently into
Journey mark.
In a kind of possible embodiment, track thread from process control block (PCB) (Process Control Block,
PCB the process identification (PID) of SS process is obtained in), wherein PCB is the structural body of task_struct.The embodiment of the present application is not to obtaining
The concrete mode of process identification (PID) is taken to be defined.
In a schematical example, the process identification (PID) that track thread obtains SS process is $ pid.
Step 302, track thread is inquired and SS process from bonding buffer area (binder buffer) according to process identification (PID)
The target process communicated.
Since the communication mode in Android system, used between process is usually binder communication, therefore track thread
The target process communicated with SS process is inquired from binder buffer.Wherein, binder buffer record has current
Each process of binder process communication is carried out in system.
In a kind of possible embodiment, track thread is according to the process identification (PID) of SS process, in/d/binder/
Target process is inquired in transactions file, should/d/binder/transactions file record current system is all just
In the process collection for carrying out process binder communication.
Step 303, track thread obtains the target process mark of each target process.
In a schematical example, the target process mark that track thread gets target process is respectively as follows:
pid020、pid050、pid0110、pid090、pid030。
Step 304, track thread identifies target process in write-in chained list.
Since in system operation, SS process can be communicated with a large amount of target process, and it is logical to lead to system abnormity
It is often the target process recently with SS process communication, therefore, in order to improve the efficiency of subsequent positioning abnormal object process, tracker wire
The target process mark that Cheng Caiyong storage of linked list is got, wherein this is used to store the nearest n mesh communicated with SS process
The target process of mark process identifies, and the size of the chained list can be set by developer.For example, the chained list is bidirectional circulating chain
Table, the target process for storing nearest 5 target process communicated with SS process identify.
Certainly, other than using double-linked circular list storage target process mark, advanced elder generation can also be met using other
Chained list or storage organization the storage target process mark of principle, the embodiment of the present application do not constitute this and limit out.
In a schematical example, track thread for the first time inquire target process mark include pid020,
Pid050, pid0110, pid090, pid030, since the size of chained list is 5, the five target process marks obtained for the first time
Knowledge is written into chained list;When the target process mark that track thread inquires for the second time includes pid040, pid050, in chained list
Pid020 and pid050 fall out, and pid040 and pid050 are written into chained list, at this time in chained list include pid0110, pid090,
pid030、pid040、pid050。
Optionally, in order under the premise of recording target process, reduce system pressure, track thread is according to predetermined queries week
Phase inquires the target process communicated with SS process from binder buffer, i.e. above-mentioned steps 301 to 304 are each predetermined
Polling cycle executes primary.
Also, when in order to guarantee to be recorded generating system exception, the target process communicated with SS process,
The predetermined queries period is identical as the detection cycle of house dog thread, i.e., track thread record subject thread and house dog thread are examined
Examining system keeps synchronizing extremely.
In a schematical example, the every 30s of house dog thread carries out primary system abnormality detection, the every 30s of SS process
Inquire a target process.
Step 305, when detecting system exception, house dog thread sends abnormal notification message to track thread, guards the gate
Dog thread is the thread in SS process.
In a kind of possible embodiment, house dog thread carries out system anomaly detection according to detection cycle, and is examining
When measuring system exception, abnormal notification message is sent to track thread by inter-thread communication.The embodiment of this step can be with
With reference to above-mentioned steps 202, details are not described herein for the present embodiment.
Step 306, when receiving abnormal notification message, target is written in the target process mark in chained list by track thread
Array.
In order to continue the process of record with SS process communication while grabbing the stack traceback information of target process,
Optionally, track thread is by the target process mark write-in target array in chained list, so as to the subsequent mesh based in target array
It marks process identification (PID) and grabs stack traceback information.
Optionally, the array size of target array and chained list is in the same size, i.e., target array for store n target into
Journey mark.
Optionally, after target process is identified write-in target array by track thread, the data in chained list are emptied, and continues
301 to 304 target process that target process is written into chained list identify through the above steps.
Step 307, track thread sends fetching instruction to backtracking stack crawl process according to target array.
In a kind of possible embodiment, track thread wakes up backtracking stack crawl process first, then according to number of targets
Target process in group identifies to backtracking stack crawl process and sends fetching instruction, and instruction backtracking stack crawl process grabs target process
Goal stack traceback information.
Optionally, backtracking stack crawl process is debuggerd process.
It optionally, include the system exception moment in the fetching instruction that track thread is sent, to recall stack crawl thread base
In the goal stack traceback information of system exception moment crawl target process.
Step 308, backtracking stack crawl process grabs target of each target process in scheduled duration according to fetching instruction
Stack traceback information.
Correspondingly, backtracking stack crawl process grabs corresponding goal stack traceback information according to target process mark.
In a kind of possible embodiment, when in fetching instruction including the system exception moment, backtracking stack grabs process
Based on the goal stack traceback information in system exception moment crawl scheduled duration, wherein the scheduled duration is the system exception moment
A Duan Shichang before.For example, the system exception moment be 10:00:00 when, terminal i.e. obtain 9:59:00 to 10:00:00 this
The goal stack traceback information of target process in period.
Step 309, backtracking stack crawl process is sent completely message to track thread.
After completing the crawl of stack traceback information for target process each in target array, backtracking stack grabs thread to tracker wire
Journey is sent completely message, informs that backtracking stack information scratching is completed in track thread.
Step 310, when receiving completion message, track thread empties target array.
Correspondingly, can normally grab backtracking stack information in order in subsequent generating system exception, track thread is being received
To after completing message, the target process mark in target array is emptied.
Step 311, track thread sends crawl notification message to house dog thread.
The crawl of goal stack traceback information is completed in order to know house dog thread, to grab the stack backtracking letter of SS process
Breath, after track thread receives completion message, it is also necessary to send crawl notification message to house dog thread.
Step 312, when receiving crawl notification message, house dog thread grabs the stack traceback information of SS process.
Certainly, when track thread and the asynchronous crawl of house dog thread, track thread is not necessarily to grab to the transmission of house dog thread
Notification message is taken, house dog thread when detecting system exception, can also automatically grab the stack traceback information of SS process, this Shen
Please embodiment do not limit this.
After the stack traceback information crawl for completing target process and SS process through the above steps, recalls for recording stack and believe
The mode of breath, in a kind of possible embodiment, according to the system exception moment data are written in goal stack traceback information by terminal
First file of subregion, and according to the system exception moment by the second file of the stack traceback information of SS process write-in data subregion
In, wherein the first file and the second file can be same file, be also possible to different files.
Optionally, backtracking stack crawl process grab goal stack traceback information after, by goal stack traceback information write-in/
In the first file under data/tombstone/ catalogue.
When the first file and the second file are different files, since the first file and the second file include system exception
Moment, therefore subsequent can to obtain matched first file and the second file from data subregion according to the system exception moment (same
The stack traceback information recorded under one system exception), to improve the efficiency of backtracking system exception.
In the present embodiment, the target process that track thread is communicated according to predetermined queries cyclic polling with SS process,
Under the premise of realizing record target process, reduce system pressure;Meanwhile the nearest n target process that track thread will inquire
Process identification (PID) write-in chained list in, while ensuring to record target process with SS process communication, reduce in chained list
Data volume.
In addition, according to the system exception moment number is written in goal stack traceback information and the stack traceback information of SS process by terminal
It is subsequent based on the corresponding file of system exception moment acquisition according to facilitating in the file of subregion, to improve system exception reason
Investigation efficiency.
In a schematical example, track thread in SS process be trackBinder thread, backtracking stack grab into
Journey is debuggerd process, and the process of crawl target backtracking stack information is as shown in Figure 4 when generating system exception.
During terminal operating, watchDog thread carries out system anomaly detection according to 30s/ period,
The target process that Trackbinder thread is communicated according to 30s/ periodic recording with SS process, wherein record mesh every time
When mark process, trackbinder thread obtains the process identification (PID) $ PID of SS process, and according to $ PID inquiry/d/binder/
Transactions file 41 obtains the target process that binder communication is currently carried out with SS process, thus by target process
Target process mark write-in double-linked circular list 42.
When watchDog thread detects system exception, i.e., abnormal notification message is sent to trackbinder thread,
After trackbinder thread receives abnormal notification message, by the target process mark write-in array in double-linked circular list 42
43, and fetching instruction is sent to debuggerd process.After debuggerd process receives fetching instruction, according in fetching instruction
Target process mark, the goal stack traceback information of target process is grabbed, and after completing crawl, to trackbinder thread
It is sent completely message.Trackbinder thread receives complete message after, that is, empty the data in array 43, and to
WatchDog thread sends crawl notification message, so as to the stack traceback information of watchDog thread crawl SS process.
Referring to FIG. 5, the structural block diagram of the information record carrier provided it illustrates the application one embodiment.The device
Can by software, hardware or both be implemented in combination with as terminal all or part of.The device includes:
Tracking module 510, for obtaining at least one target process communicated with system service SS process, it is described with
Track thread is the thread in the SS process;
Watchdog module 520, for when detecting system exception, Xiang Suoshu tracking module sends abnormal notification message,
The house dog thread is the thread in the SS process;
Tracking module 510 is also used to when receiving the abnormal notification message, and it is corresponding to obtain each target process
Goal stack traceback information;
Logging modle 530, for recording the goal stack traceback information.
Optionally, the tracking module 510, is used for:
Obtain the process identification (PID) of the SS process;
According to the process identification (PID), inquiry is communicated with the SS process from bonding buffer area binder buffer
The target process, the bonding buffer records have each process that binder process communication is carried out in current system.
Optionally, the tracking module 510, is used for:
According to the predetermined queries period, the target communicated with the SS process is inquired from the bonding buffer area
Process, the predetermined queries period are identical as the detection cycle of the house dog thread.
Optionally, the tracking module 510, is also used to:
Obtain the target process mark of each target process;
The target process is identified in write-in chained list, the chained list is communicated most for storing with the SS process
The target process mark of the nearly n target process.
Optionally, the tracking module 510, is used for:
By the target process mark write-in target array in the chained list;
Fetching instruction is sent to backtracking stack crawl process according to the target array, the backtracking stack crawl process is used for root
The goal stack traceback information of each target process in scheduled duration is grabbed according to the fetching instruction.
Optionally, the tracking module 510, is used for
When receiving the completion message that the backtracking stack crawl process is sent, the target array is emptied, and to described
House dog thread sends crawl notification message;
The watchdog module 520, the stack for when receiving the crawl notification message, grabbing the SS process return
It traces back information.
Optionally, the logging modle 530, is used for
The goal stack traceback information is written to the first file of data subregion according to the system exception moment;
The stack traceback information of the SS process is written to the second text of the data subregion according to the system exception moment
In part.
Optionally, described device further include:
Sending module, for sending the goal stack traceback information to server, the server is used for according to the mesh
Mark stack traceback information determines system exception reason.
In conclusion being obtained in the embodiment of the present application by creating track thread in SS process, and using track thread
At least one target process communicated with SS process, thus in the abnormal notification message for receiving the transmission of house dog thread
When, the corresponding goal stack traceback information of each target process is obtained, and record to the goal stack traceback information;Due to record
To sending goal stack traceback information with the target process of SS process communication before system exception, therefore subsequent it can be based on goal stack
Traceback information is checked out by the stuck caused system exception of target process, and the investigation efficiency of system exception reason is helped to improve.
In the present embodiment, the target process that track thread is communicated according to predetermined queries cyclic polling with SS process,
Under the premise of realizing record target process, reduce system pressure;Meanwhile the nearest n target process that track thread will inquire
Process identification (PID) write-in chained list in, while ensuring to record target process with SS process communication, reduce in chained list
Data volume.
In addition, according to the system exception moment number is written in goal stack traceback information and the stack traceback information of SS process by terminal
It is subsequent based on the corresponding file of system exception moment acquisition according to facilitating in the file of subregion, to improve system exception reason
Investigation efficiency.
The embodiment of the present application also provides a kind of computer-readable medium, which has at least one
Instruction, at least one instruction are loaded as the processor and are executed to realize information record described in as above each embodiment
Method.
The embodiment of the present application also provides a kind of computer program product, which is stored at least one
Instruction, at least one instruction are loaded as processor and are executed to realize information recording method described in as above each embodiment
Method.
Those skilled in the art it will be appreciated that in said one or multiple examples, retouched by the embodiment of the present application
The function of stating can be realized with hardware, software, firmware or their any combination.It when implemented in software, can be by this
A little functions storages in computer-readable medium or as on computer-readable medium one or more instructions or code into
Row transmission.Computer-readable medium includes computer storage media and communication media, and wherein communication media includes convenient for from one
Any medium of the place to another place transmission computer program.Storage medium can be general or specialized computer and can deposit
Any usable medium taken.
The foregoing is merely the preferred embodiments of the application, not to limit the application, it is all in spirit herein and
Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.
Claims (11)
1. a kind of information recording method, which is characterized in that the described method includes:
Track thread obtains at least one target process communicated with system service SS process, and the track thread is described
Thread in SS process;
When detecting system exception, house dog thread sends abnormal notification message, the house dog line to the track thread
Journey is the thread in the SS process;
When receiving the abnormal notification message, the track thread obtains the corresponding goal stack of each target process and returns
It traces back information;
Record the goal stack traceback information.
2. the method according to claim 1, wherein the track thread acquisition communicated with SS process to
A few target process, comprising:
The track thread obtains the process identification (PID) of the SS process;
The track thread according to the process identification (PID) from bonding buffer area binder buffer in inquiry with the SS process into
Row communication the target process, it is described bonding buffer records have in current system carry out binder process communication it is each into
Journey.
3. according to the method described in claim 2, it is characterized in that, the track thread is slow from bonding according to the process identification (PID)
Rush the target process that inquiry is communicated with the SS process in area, comprising:
The track thread is according to the predetermined queries period, and inquiry is communicated with the SS process from the bonding buffer area
The target process, the predetermined queries period are identical as the detection cycle of the house dog thread.
4. method according to any one of claims 1 to 3, which is characterized in that the track thread obtain be SS process into
After at least one target process of row communication, the method also includes:
The track thread obtains the target process mark of each target process;
The track thread identifies the target process in write-in chained list, and the chained list is carried out for storing with the SS process
The target process mark of the nearest n target process of communication.
5. according to the method described in claim 4, it is characterized in that, each target process of track thread acquisition is corresponding
Goal stack traceback information, comprising:
Target array is written in target process mark in the chained list by the track thread;
The track thread according to the target array to backtracking stack crawl process send fetching instruction, the backtracking stack grab into
Journey is used to grab the goal stack traceback information of each target process in scheduled duration according to the fetching instruction.
6. according to the method described in claim 5, it is characterized in that, the track thread according to the target array to backtracking stack
After crawl process sends fetching instruction, the method also includes:
When receiving the completion message that the backtracking stack crawl process is sent, the track thread empties the target array,
And crawl notification message is sent to the house dog thread;
When receiving the crawl notification message, the house dog thread grabs the stack traceback information of the SS process.
7. according to the method described in claim 6, it is characterized in that, described record the goal stack traceback information, comprising:
The goal stack traceback information is written to the first file of data subregion according to the system exception moment;
After the house dog thread grabs the stack traceback information of the SS process, the method also includes:
The stack traceback information of the SS process is written according to the system exception moment in the second file of the data subregion.
8. method according to any one of claims 1 to 3, which is characterized in that it is described record the goal stack traceback information it
Afterwards, the method also includes:
The goal stack traceback information is sent to server, the server, which is used to determine according to the goal stack traceback information, is
System abnormal cause.
9. a kind of information record carrier, which is characterized in that described device includes:
Tracking module, for obtaining at least one target process communicated with system service SS process, the track thread
It is the thread in the SS process;
Watchdog module, for when detecting system exception, Xiang Suoshu tracking module to send abnormal notification message, described to guard the gate
Dog thread is the thread in the SS process;
The tracking module is also used to that it is corresponding to obtain each target process when receiving the abnormal notification message
Goal stack traceback information;
Logging modle, for recording the goal stack traceback information.
10. a kind of terminal, which is characterized in that the terminal includes processor and memory;The memory is stored at least one
Item instruction, at least one instruction is for being executed by the processor to realize information as described in any of the claims 1 to 8
Recording method.
11. a kind of computer readable storage medium, which is characterized in that the storage medium is stored at least one instruction, described
At least one instruction is for being executed by processor to realize information recording method as described in any of the claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910502219.4A CN110221928B (en) | 2019-06-11 | 2019-06-11 | Information recording method, information recording apparatus, terminal, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910502219.4A CN110221928B (en) | 2019-06-11 | 2019-06-11 | Information recording method, information recording apparatus, terminal, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110221928A true CN110221928A (en) | 2019-09-10 |
CN110221928B CN110221928B (en) | 2021-06-04 |
Family
ID=67816388
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910502219.4A Active CN110221928B (en) | 2019-06-11 | 2019-06-11 | Information recording method, information recording apparatus, terminal, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110221928B (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6829729B2 (en) * | 2001-03-29 | 2004-12-07 | International Business Machines Corporation | Method and system for fault isolation methodology for I/O unrecoverable, uncorrectable error |
US7243266B2 (en) * | 2003-10-09 | 2007-07-10 | Hitachi, Ltd. | Computer system and detecting method for detecting a sign of failure of the computer system |
CN104852823A (en) * | 2014-02-18 | 2015-08-19 | 腾讯科技(深圳)有限公司 | Process monitoring method, device and system |
CN105512015A (en) * | 2015-12-15 | 2016-04-20 | 北京奇虎科技有限公司 | Android target application crash calculation method and device |
CN105589807A (en) * | 2015-12-21 | 2016-05-18 | 中国科学院信息工程研究所 | Inter-application component capability leakage dynamic detection method and system |
CN107133167A (en) * | 2017-04-24 | 2017-09-05 | 北京北信源软件股份有限公司 | The abnormal method and device of real-time monitoring process under a kind of linux system |
CN107807861A (en) * | 2017-10-31 | 2018-03-16 | 努比亚技术有限公司 | Freeze screen solution method, mobile terminal and computer-readable recording medium |
CN107818036A (en) * | 2017-10-31 | 2018-03-20 | 努比亚技术有限公司 | Blank screen detection method, mobile terminal and computer-readable recording medium |
CN109039952A (en) * | 2018-06-29 | 2018-12-18 | Oppo(重庆)智能科技有限公司 | A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication |
CN109144741A (en) * | 2017-06-13 | 2019-01-04 | 广东神马搜索科技有限公司 | The method, apparatus and electronic equipment of interprocess communication |
CN109219115A (en) * | 2018-08-20 | 2019-01-15 | 奇酷互联网络科技(深圳)有限公司 | Mobile terminal and the method, apparatus and storage device for freezing end application |
CN109445917A (en) * | 2018-10-16 | 2019-03-08 | Oppo广东移动通信有限公司 | Application processing method and device, electronic equipment, computer readable storage medium |
CN109714202A (en) * | 2018-12-21 | 2019-05-03 | 郑州云海信息技术有限公司 | A kind of client off-line reason method of discrimination and concentrating type safety management system |
-
2019
- 2019-06-11 CN CN201910502219.4A patent/CN110221928B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6829729B2 (en) * | 2001-03-29 | 2004-12-07 | International Business Machines Corporation | Method and system for fault isolation methodology for I/O unrecoverable, uncorrectable error |
US7243266B2 (en) * | 2003-10-09 | 2007-07-10 | Hitachi, Ltd. | Computer system and detecting method for detecting a sign of failure of the computer system |
CN104852823A (en) * | 2014-02-18 | 2015-08-19 | 腾讯科技(深圳)有限公司 | Process monitoring method, device and system |
CN105512015A (en) * | 2015-12-15 | 2016-04-20 | 北京奇虎科技有限公司 | Android target application crash calculation method and device |
CN105589807A (en) * | 2015-12-21 | 2016-05-18 | 中国科学院信息工程研究所 | Inter-application component capability leakage dynamic detection method and system |
CN107133167A (en) * | 2017-04-24 | 2017-09-05 | 北京北信源软件股份有限公司 | The abnormal method and device of real-time monitoring process under a kind of linux system |
CN109144741A (en) * | 2017-06-13 | 2019-01-04 | 广东神马搜索科技有限公司 | The method, apparatus and electronic equipment of interprocess communication |
CN107818036A (en) * | 2017-10-31 | 2018-03-20 | 努比亚技术有限公司 | Blank screen detection method, mobile terminal and computer-readable recording medium |
CN107807861A (en) * | 2017-10-31 | 2018-03-16 | 努比亚技术有限公司 | Freeze screen solution method, mobile terminal and computer-readable recording medium |
CN109039952A (en) * | 2018-06-29 | 2018-12-18 | Oppo(重庆)智能科技有限公司 | A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication |
CN109219115A (en) * | 2018-08-20 | 2019-01-15 | 奇酷互联网络科技(深圳)有限公司 | Mobile terminal and the method, apparatus and storage device for freezing end application |
CN109445917A (en) * | 2018-10-16 | 2019-03-08 | Oppo广东移动通信有限公司 | Application processing method and device, electronic equipment, computer readable storage medium |
CN109714202A (en) * | 2018-12-21 | 2019-05-03 | 郑州云海信息技术有限公司 | A kind of client off-line reason method of discrimination and concentrating type safety management system |
Also Published As
Publication number | Publication date |
---|---|
CN110221928B (en) | 2021-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6643802B1 (en) | Coordinated multinode dump collection in response to a fault | |
JP2019520649A (en) | Process visualization platform | |
CN105589783A (en) | Application program lag problem data obtaining method and device | |
WO2019045838A1 (en) | Logging trace data for program code execution at an instruction level | |
US9529651B2 (en) | Apparatus and method for executing agent | |
US9229715B2 (en) | Method and apparatus for efficient inter-thread synchronization for helper threads | |
CN109614270A (en) | Data read-write method, device, equipment and storage medium based on Hbase | |
CN110851324B (en) | Log-based routing inspection processing method and device, electronic equipment and storage medium | |
CN109359020A (en) | Start time test method and device, computer installation and storage medium | |
CN115016866A (en) | Data processing method during application starting, electronic equipment and storage medium | |
CN102541661A (en) | Wait on address synchronization interface | |
CN110765288A (en) | Image information synchronization method, device and system and storage medium | |
US9471458B2 (en) | Synchronization activity recording system for a concurrent software environment | |
CN105847446B (en) | Method, device and system for acquiring network data | |
KR102471739B1 (en) | Apparatus and method for managing of history information in a electronic device | |
CN114626752A (en) | Automatic vehicle scheduling method and device, computer equipment and storage medium | |
CN107003897A (en) | Monitor the utilization rate of issued transaction resource | |
CN110309100A (en) | A kind of snapshot object generation method and device | |
Gao | A General Logging Service for Symbian based Mobile Phones | |
CN113515317A (en) | Data recovery method and device | |
CN111831411A (en) | Task processing method and device, storage medium and electronic equipment | |
CN116339818B (en) | Code change type screening method, electronic device and readable storage medium | |
CN110245074A (en) | A kind of generation method of log recording, device, storage medium and server | |
CN109034668A (en) | ETL method for scheduling task, device, computer equipment and storage medium | |
CN110489576B (en) | Picture resource processing method and system, client, server, processor and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |