CN113051166A - System tracking method, device, equipment and storage medium - Google Patents

System tracking method, device, equipment and storage medium Download PDF

Info

Publication number
CN113051166A
CN113051166A CN202110343174.8A CN202110343174A CN113051166A CN 113051166 A CN113051166 A CN 113051166A CN 202110343174 A CN202110343174 A CN 202110343174A CN 113051166 A CN113051166 A CN 113051166A
Authority
CN
China
Prior art keywords
event
trace
tracking
program
script
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.)
Pending
Application number
CN202110343174.8A
Other languages
Chinese (zh)
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.)
Shanghai Sensetime Technology Development Co Ltd
Original Assignee
Shanghai Sensetime Technology Development 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 Shanghai Sensetime Technology Development Co Ltd filed Critical Shanghai Sensetime Technology Development Co Ltd
Priority to CN202110343174.8A priority Critical patent/CN113051166A/en
Publication of CN113051166A publication Critical patent/CN113051166A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Disclosed are a system tracing method, apparatus, device and storage medium, the method comprising: determining a first position of a tracking object in a source program; generating a first script according to the configuration file of the tracking object, and generating a tracking program code according to the first script and a pre-generated probe script; inserting the trace program code into the first location in the source program; receiving a trace event generated when the trace program code is executed and recording the trace event. Under the condition of not changing the source system code and the state of the source system, the method ensures that the program corresponding to the tracking program code does not influence the logic correctness of the system, achieves the separation of the tracking program code and the system, realizes the dynamic instrumentation during the operation of the system, simplifies the detection complexity and is easy to realize.

Description

System tracking method, device, equipment and storage medium
Technical Field
The present disclosure relates to computer vision technologies, and in particular, to a system tracking method, apparatus, device, and storage medium.
Background
The positioning and analysis of performance bottlenecks in distributed systems is one of the research difficulties of distributed systems. It is now common practice to explicitly code-peg critical parts of the system to gather critical information during system operation. However, this method needs to change the module code of the system and redeploy the whole system, and cannot be applied to an online running system. Therefore, there is a need to develop a system tracking scheme that does not require display code level changes to the system being tracked.
Disclosure of Invention
The present disclosure provides a system tracing scheme to at least solve the problem in the related art that system tracing requires modification of module code and redeployment of the system. The technical scheme of the disclosure is as follows:
according to an aspect of the present invention, a system tracking method is provided, the method comprising: determining a first position of a tracking object in a source program; generating a first script according to the configuration file of the tracking object, and generating a tracking program code according to the first script and a pre-generated probe script; inserting the trace program code into the first location in the source program; receiving a trace event generated when the trace program code is executed and recording the trace event.
In combination with any one of the embodiments provided by the present disclosure, the generating a first script according to a configuration file for configuring the tracked object includes: receiving, via a configuration interface, an instruction specifying the tracking object; generating a configuration file according to the instruction; and generating the first script by compiling the configuration file.
In conjunction with any embodiment provided by the present disclosure, before generating the first script according to the profile of the tracked object, the method further includes: and detecting the legality of the configuration file.
In combination with any one of the embodiments provided by the present disclosure, the receiving a trace event generated when the trace program code is executed and recording the trace event includes: when a source program runs to the tracing program code, enabling the running tracing program to receive the control flow of the source program; the method further comprises the following steps: after recording the trace event, returning the control flow to a first location in the source program.
In combination with any one of the embodiments provided by the present disclosure, the receiving a trace event generated when the trace program code is executed and recording the trace event includes: receiving a trace event generated by the trace object through an event logging kernel thread, wherein the event logging kernel thread is started by an event logging kernel module loaded in a kernel; storing the trace event in an event queue.
In combination with any embodiment provided by the present disclosure, the method further comprises: and exporting a kernel interface to a user space through the event record kernel module, so that a user mode program reads the event queue through the kernel interface, converts the event queue into a set format and then sends the format to a log analysis system, and the log analysis system analyzes and processes the tracking event.
In connection with any of the embodiments provided in this disclosure, the method further includes, for the trace event, calibrating a trace object that generated the trace event, and/or calibrating a parent event of the trace event.
In connection with any embodiment provided by the present disclosure, the system comprises a distributed system, and the trace object comprises one or more of a function, a remote call instruction, and a module.
In conjunction with any of the embodiments provided by the present disclosure, the IEEE1588 protocol is used to synchronize node times in the distributed system.
According to an aspect of the present disclosure, a system tracking apparatus is provided, the apparatus including: a determining unit, configured to determine a first position of the tracking object in the source program; the generating unit is used for generating a first script according to the configuration file of the tracking object and generating a tracking program code according to the first script and a pre-generated probe script; an insertion unit for inserting the trace program code into the first location in the source program; and the recording unit is used for receiving the tracking event generated when the tracking program code is executed and recording the tracking event.
In combination with any embodiment provided by the present disclosure, when the generating unit is configured to generate the first script according to the configuration file of the tracking object, the generating unit is specifically configured to: receiving, via a configuration interface, an instruction specifying the tracking object; generating a configuration file according to the instruction; and generating the first script by compiling the configuration file.
In combination with any one of the embodiments provided by the present disclosure, the apparatus further includes a detection unit, configured to detect validity of the configuration file before generating the first script according to the configuration file of the tracked object.
In combination with any one of the embodiments provided by the present disclosure, the recording unit is specifically configured to: when a source program runs to the tracing program code, enabling the running tracing program to receive the control flow of the source program; the device further comprises: a return unit to return the control flow to a first location in the source program after recording the trace event.
In combination with any one of the embodiments provided by the present disclosure, the recording unit is specifically configured to: receiving a trace event generated by the trace object through an event logging kernel thread, wherein the event logging kernel thread is started by an event logging kernel module loaded in a kernel; storing the trace event in an event queue.
In combination with any embodiment provided by the present disclosure, the apparatus further includes a kernel interface export unit, configured to export a kernel interface to a user space through the event record kernel module, so that a user mode program reads the event queue through the kernel interface, converts the event queue into a set format, and sends the set format to a log analysis system, so that the log analysis system analyzes and processes the trace event.
In connection with any of the embodiments provided by the present disclosure, the apparatus further includes a calibration unit configured to calibrate, for the tracking event, a tracking object that generates the tracking event, and/or a parent event of the tracking event.
In connection with any embodiment provided by the present disclosure, the system comprises a distributed system, and the trace object comprises one or more of a function, a remote call instruction, and a module.
In conjunction with any of the embodiments provided by the present disclosure, the IEEE1588 protocol is used to synchronize node times in the distributed system.
According to an aspect of the present disclosure, an electronic device is provided, which includes a memory for storing computer instructions executable on a processor, and the processor is configured to implement the method according to any embodiment of the present disclosure when executing the computer instructions.
According to an aspect of the present disclosure, a computer-readable storage medium is proposed, on which a computer program is stored, which when executed by a processor implements the method according to any of the embodiments of the present disclosure.
According to an aspect of the present disclosure, a computer program product is proposed, comprising a computer program which, when executed by a processor, implements the method of any of the embodiments of the present disclosure.
In the embodiment of the disclosure, a tracing program code is generated according to a first script generated by a configuration file of the tracing object and a pre-generated probe script, the tracing program code is inserted into a first position where the tracing object is located in the source program, a tracing event generated when the tracing program code is executed is received and recorded, and under the condition that the states of the source system code and the source system are not changed, the logic correctness of the system is not affected by a program corresponding to the tracing program code, the separation of the tracing program code and the system is achieved, dynamic instrumentation during the operation of the system is realized, the detection complexity is simplified, and the implementation is easy.
Drawings
In order to more clearly illustrate one or more embodiments or technical solutions in the prior art in the present specification, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in one or more embodiments of the present specification, and other drawings can be obtained by those skilled in the art without inventive exercise.
Fig. 1 is a flowchart of a system tracking method according to at least one embodiment of the present disclosure;
fig. 2 is a schematic diagram of a function call in a system tracing method according to at least one embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a system tracking apparatus according to at least one embodiment of the present disclosure;
fig. 4 is a block diagram of an electronic device according to at least one embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all embodiments. All other embodiments that can be derived by one of ordinary skill in the art from one or more embodiments of the disclosure without making any creative effort shall fall within the scope of protection of the disclosure.
In the related art, for tracing of a distributed system, it is common to directly write a tracing program code in a system to be traced, for example, record a timestamp of an event before calling a function func (), generate an ID of the event, inherit a parent ID of the event, and the like, and thus a source system needs to be modified, and the method cannot be applied to an online running system.
In view of the above, the present disclosure provides a system tracking method, which can be applied to a node in a server and/or a distributed system. Fig. 1 is a flowchart of a system tracking method according to at least one embodiment of the present disclosure. As shown in fig. 1, the method includes steps 101 to 104.
In step 101, a first position of a tracked object in a source program is determined.
In embodiments of the present disclosure, the system that tracks may be a distributed system, such as a lustre distributed file system or the like.
For tracking of a distributed system, the tracking object may include one or more of a function, a Remote Procedure Call (RPC), and a module. Wherein the module is code that can be added to the kernel at runtime, such as a driver code module of a file system in a linux system.
The first location of the trace object in the source program is determined, i.e., the location of the trace object in the code of the source program, e.g., the first line of the trace object in the code of the source program.
In step 102, a first script is generated according to the configuration file of the tracking object, and a tracking program code is generated according to the first script and a pre-generated probe script.
In the disclosed embodiment, the configuration file may be compiled by a specially designed compiler to generate a corresponding first script, for example, a tapscript script. The probe script may be a probe script designed specifically for the system that is to track, such as a tapscript script as well. By compiling the first script and the probe script, a tracking program code may be generated. The program trace code may be a function code for tracing event generation and logging.
In one example, the first script and the probe script may be compiled synthetically by a kernel instrumentation systemmap to generate a linux kernel module, through which event generation and logging functionality is implemented.
In step 103, the tracking program code is inserted into the first location in the source program.
In an embodiment of the disclosure, the instructions at the first location may be replaced with the trace program code, the trace program receiving a control flow of a source program as the source program runs into the trace program code. After the tracing program finishes running and records the tracing, the control flow is made to flow to the first position in the original program, namely, the original position (first position) of the tracing object is returned. That is, in the disclosed embodiments, by dynamically inserting the trace program code into the trace object, such as a function, RPC, module, etc., the trace program only records the state information of the system, and does not change the state of the system.
In step 104, a trace event generated when the trace program code is executed is received and recorded.
By inserting the tracing program code into the tracing object, when a source program runs to the tracing object, the event generated by executing the instruction for the tracing object at the position can be traced, and the tracing event is recorded.
Take the function call shown in fig. 2 as an example, wherein the trace object is the function Func (). Under the condition of calling a function Func (), firstly, an RPC request is sent to a server; the server receives an RPC request sent by the client, executes the function and returns an RPC confirmation; and the client receives the RPC confirmation and returns the function Func (). The event generated during the process of calling the function Func () is an event to be traced.
In some embodiments, a trace program executed by execution of the trace program code may send trace events to a kernel thread of a server and/or node that receives trace events generated by the trace object through the kernel thread.
In the embodiment of the disclosure, a tracing program code is generated according to a first script generated by a configuration file of the tracing object and a pre-generated probe script, the tracing program code is inserted into a first position where the tracing object is located in the source program, a tracing event generated when the tracing program code is executed is received and recorded, and under the condition that the states of the source system code and the source system are not changed, the logic correctness of the system is not affected by a program corresponding to the tracing program code, the separation of the tracing program code and the system is achieved, dynamic instrumentation during the operation of the system is realized, the detection complexity is simplified, and the implementation is easy.
In some embodiments, the first script may be generated in the following manner.
First, an instruction specifying a tracking object is received through a configuration interface to generate a configuration file.
Taking instrumentation by the kernel instrumentation system (semtop) as an example, the related art usually requires the user to directly write a tracing program, such as a tapscript program, and the source system crashes and exits once the user writes a defect. Since the behavior of the user is not controllable, in the embodiment of the present disclosure, the operation right of writing the trace program is shielded from the user, and by exporting a set of configuration interfaces to the user, that is, the user only needs to write a configuration file as required, for example, to input a specified trace object, the trace program does not need to be written.
Next, the first script is generated by compiling the configuration file.
In the embodiment of the disclosure, a configuration interface is exported to a user to receive an instruction of a user-specified tracking object, a configuration file is generated according to the instruction, and a first script is generated by compiling the configuration file, so that the problem of system crash caused by misoperation of the user is avoided.
In some embodiments, the validity of the configuration file may also be detected before the configuration file is compiled. Therefore, the accuracy of the user input instruction is further guaranteed, and the problem caused by misoperation of the user is avoided.
In some embodiments, in the case that the trace program executed by executing the trace program code may send a trace event to a kernel thread of a server and/or node, the server and/or node receives the trace event generated by the trace object through the kernel thread and stores the trace event in an event queue. Wherein the receiving and recording of the trace event can be performed by a kernel module.
In some embodiments, trace events recorded by the kernel module may be forwarded to a dedicated log analysis system for analysis by a user-mode forwarding program.
In one example, the tracked system may be interfaced with an external probe system by compiling the first script and a pre-obtained probe script into a kernel module and loading the kernel module into a kernel.
Wherein the probe script can be designed specifically for the tracked system, such as an implicit probe tapscript script designed specifically for the lustre distributed system; the first script and the probe script may be compiled into a kernel module by a systemtap and downloaded into a kernel.
In an embodiment of the present disclosure, the kernel interfaces established include one or more of a probe (prob) interface, a tracing (tracing) interface, and an event (event) interface.
In some embodiments, the kernel interface may be exported to a user space, so that a user mode program reads the event queue through the kernel interface, converts the event queue into a set format, such as json format, and then sends the event queue to a log analysis system, so that the log analysis system performs one or more of event timing reconstruction, event summary, event storage, event parsing, visualization of a trace object, query of the trace object, event sampling frequency control, and the like on the trace event.
And under the condition that the tracked system is a distributed system, each node in the distributed system continuously records events and sends the events to the log analysis system.
For example, the event queue with the set format may be sent through an http module or a socket module, and the log analysis system may analyze the trace event in another language format, such as python, go, and the like.
In some embodiments, the log analysis system may be a system with a web front end, such as a system adapted based on a zipkin base platform to enable the support of functions, RPCs, modules, etc. to track objects.
In the embodiment of the disclosure, the log analysis system with the web front end is used for analyzing, summarizing, storing, reconstructing and the like the tracking events, so that the tracking and performance analysis of the distributed system can be realized, and the user can conveniently view and operate the log analysis system.
In an embodiment of the present disclosure, the method further includes calibrating, for the trace event, a trace object that generated the trace event, and/or calibrating a parent event of the trace event, so that the log analysis system can reconstruct a timing of all events generated by the trace object. Still taking the function call shown in fig. 2 as an example, a function call Func () of the client generates a function call event, and simultaneously generates a send RPC event in the call process of the function, and generates a receive event for the RPC at the server, and simultaneously generates other function calls at the server, and then generates a send RPC acknowledge (RPC ack) event to the client, and the client generates a receive RPC acknowledge event after receiving the corresponding RPC acknowledge, and finally generates a return Func () event. The above events all correspond to Func () trace objects.
In this example, for each event, on the one hand, the object Func () to be traced is marked, and on the other hand, the parent event of the event is marked, for example, in fig. 2, the parent event of receiving RPC is a send RPC event, and the parent event of sending RPC is a function call event.
In the embodiment of the disclosure, by calibrating the tracking object generating the event for the tracking event and/or calibrating the parent event of the tracking event, the log analysis system can quickly and efficiently reconstruct the time sequence of the tracking event generated by the tracking object.
In the process of tracking the behavior of the distributed system during operation, the delay is an important reference index. The delay allows for locating slower running components in the current system. The way of locating the slower part of the system in the stand-alone system can be obtained by directly obtaining the system running time, for example, by calling the function and adding a timestamp back to the function to obtain the running time of the corresponding function. However, for distributed systems, there may be a deviation in time between nodes (machines), resulting in an inability to accurately determine the time delay of an operation by means of a timestamp.
Still taking the function call shown in fig. 2 as an example, at time t2 in fig. 2, the RPC request is sent to the server, and at time t3, the server receives the RPC request sent from the client. In the case that the client and server times are synchronized, the delay of RPC communication can be obtained through t3-t 2; however, in the case where the client and server are not time synchronized, the delay of PRC communication cannot be directly acquired. For example, if t2 is 100 relative to the time of the client, the RPC communication delay is 10, then the time of t3 should be 110, but because of the asynchronous time, actually measured t3 is 80, it is seen that it is not feasible to obtain the RPC communication delay by calculating t3-t2, and therefore a synchronous system of the distributed system needs to be constructed.
In the related art, an NTP synchronization protocol is usually used to construct a synchronization system of a distributed system, and then the delay obtained by the method is too coarse, usually tens of milliseconds, and cannot meet the requirement of real-time tracking of the distributed system.
In the embodiment of the present disclosure, the IEEE1588 protocol may be used to synchronize node times in the distributed system, so as to synchronize hosts in the distributed system in a nanosecond level.
Fig. 3 is a schematic structural diagram of a system tracking apparatus according to at least one embodiment of the present disclosure, as shown in fig. 3, the apparatus includes: a determining unit 301, configured to determine a first position of a tracking object in a source program; a generating unit 302, configured to generate a first script according to the configuration file of the tracked object, and generate a tracking program code according to the first script and a pre-generated probe script; an inserting unit 303, configured to insert the tracing program code into the first location in the source program; a recording unit 304, configured to receive a trace event generated when the trace program code is executed and record the trace event.
In some embodiments, when the generating unit is configured to generate the first script according to the configuration file of the tracking object, the generating unit is specifically configured to: receiving, via a configuration interface, an instruction specifying the tracking object; generating a configuration file according to the instruction; and generating the first script by compiling the configuration file.
In some embodiments, the apparatus further includes a detecting unit configured to detect validity of the configuration file before generating the first script according to the configuration file of the tracked object.
In some embodiments, the recording unit is specifically configured to: when a source program runs to the tracing program code, enabling the running tracing program to receive the control flow of the source program; the device further comprises: a return unit to return the control flow to a first location in the source program after recording the trace event.
In some embodiments, the recording unit is specifically configured to: receiving a trace event generated by the trace object through an event logging kernel thread, wherein the event logging kernel thread is started by an event logging kernel module loaded in a kernel; storing the trace event in an event queue.
In some embodiments, the device further includes a kernel interface export unit, configured to export a kernel interface to a user space through the event record kernel module, so that a user mode program reads the event queue through the kernel interface, converts the event queue into a set format, and sends the set format to a log analysis system, so that the log analysis system analyzes and processes the trace event.
In some embodiments, the apparatus further comprises a calibration unit for calibrating, for the tracking event, a tracking object that generated the tracking event, and/or a parent event of the tracking event.
In some embodiments, the system comprises a distributed system, and the trace object comprises one or more of a function, a remote call instruction, and a module.
In some embodiments, node times in the distributed system are synchronized using the IEEE1588 protocol.
Fig. 4 is an electronic device provided in at least one embodiment of the present disclosure, and the electronic device includes a memory for storing computer instructions executable on a processor, and the processor is configured to implement the system tracking method according to any embodiment of the present disclosure when executing the computer instructions.
At least one embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the system tracking method according to any one of the embodiments of the present disclosure.
At least one embodiment of the present disclosure also provides a computer program product comprising a computer program, which when executed by a processor, implements the system tracking method according to any one of the embodiments of the present disclosure.
As will be appreciated by one skilled in the art, one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present description also provides a computer readable storage medium, on which a computer program may be stored, which when executed by a processor, implements the steps of the method for detecting a driver's gaze area described in any one of the embodiments of the present description, and/or implements the steps of the method for training a neural network of a driver's gaze area described in any one of the embodiments of the present description. Wherein "and/or" means having at least one of the two, e.g., "A and/or B" includes three schemes: A. b, and "A and B".
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the data processing apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to part of the description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Computers suitable for executing computer programs include, for example, general and/or special purpose microprocessors, or any other type of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory and/or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer does not necessarily have such a device. Moreover, a computer may be embedded in another device, e.g., a mobile telephone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., an internal hard disk or a removable disk), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (13)

1. A method for system tracking, the method comprising:
determining a first position of a tracking object in a source program;
generating a first script according to the configuration file of the tracking object, and generating a tracking program code according to the first script and a pre-generated probe script;
inserting the trace program code into the first location in the source program;
receiving a trace event generated when the trace program code is executed and recording the trace event.
2. The method of claim 1, wherein generating the first script from the configuration file that configures the tracked object comprises:
receiving, via a configuration interface, an instruction specifying the tracking object;
generating a configuration file according to the instruction;
and generating the first script by compiling the configuration file.
3. The method of claim 2, prior to generating the first script from the profile of the tracked object, the method further comprising:
and detecting the legality of the configuration file.
4. A method according to any one of claims 1 to 3, wherein said receiving a trace event generated upon execution of said trace program code and recording said trace event comprises:
when a source program runs to the tracing program code, enabling the running tracing program to receive the control flow of the source program;
the method further comprises the following steps:
after recording the trace event, returning the control flow to a first location in the source program.
5. The method according to any one of claims 1 to 4, wherein said receiving a trace event generated upon execution of said trace program code and recording said trace event comprises:
receiving a trace event generated by the trace object through an event logging kernel thread, wherein the event logging kernel thread is started by an event logging kernel module loaded in a kernel;
storing the trace event in an event queue.
6. The method of claim 5, further comprising:
and exporting a kernel interface to a user space through the event record kernel module, so that a user mode program reads the event queue through the kernel interface, converts the event queue into a set format and then sends the format to a log analysis system, and the log analysis system analyzes and processes the tracking event.
7. The method according to any one of claims 1 to 6, further comprising, for the trace event, calibrating a trace object that generated the trace event, and/or calibrating a parent event of the trace event.
8. The method of any one of claims 1 to 7, wherein the system comprises a distributed system, and wherein the trace object comprises one or more of a function, a remote call instruction, and a module.
9. The method of claim 8, wherein node times in the distributed system are synchronized using IEEE1588 protocol.
10. A system tracking apparatus, the apparatus comprising:
a determining unit, configured to determine a first position of the tracking object in the source program;
the generating unit is used for generating a first script according to the configuration file of the tracking object and generating a tracking program code according to the first script and a pre-generated probe script;
an insertion unit for inserting the trace program code into the first location in the source program;
and the recording unit is used for receiving the tracking event generated when the tracking program code is executed and recording the tracking event.
11. An electronic device comprising a memory for storing computer instructions executable on a processor, the processor being configured to implement the method of any one of claims 1 to 9 when executing the computer instructions.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that the computer program realizes the method of any of claims 1 to 9 when executed by a processor.
CN202110343174.8A 2021-03-30 2021-03-30 System tracking method, device, equipment and storage medium Pending CN113051166A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110343174.8A CN113051166A (en) 2021-03-30 2021-03-30 System tracking method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110343174.8A CN113051166A (en) 2021-03-30 2021-03-30 System tracking method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113051166A true CN113051166A (en) 2021-06-29

Family

ID=76516918

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110343174.8A Pending CN113051166A (en) 2021-03-30 2021-03-30 System tracking method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113051166A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116108091A (en) * 2022-12-26 2023-05-12 小米汽车科技有限公司 Data processing method, event tracking analysis method, device, equipment and medium
CN116450120A (en) * 2023-06-06 2023-07-18 北京翼辉信息技术有限公司 Method, device, equipment and medium for analyzing kernel of real-time operating system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722434A (en) * 2012-05-24 2012-10-10 兰雨晴 Performance test method and tool aiming at Linux process scheduling
CN105074671A (en) * 2013-03-27 2015-11-18 英特尔公司 Method and system for detecting concurrency programming errors in kernel modules and device drivers
CN105577480A (en) * 2016-02-01 2016-05-11 新浪网技术(中国)有限公司 Monitoring method and device of network connection performances
CN109284115A (en) * 2017-07-20 2019-01-29 北京国双科技有限公司 A kind of method and device generating tracker script
CN111597089A (en) * 2020-05-18 2020-08-28 广州锦行网络科技有限公司 Linux system call event acquisition and caching device and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722434A (en) * 2012-05-24 2012-10-10 兰雨晴 Performance test method and tool aiming at Linux process scheduling
CN105074671A (en) * 2013-03-27 2015-11-18 英特尔公司 Method and system for detecting concurrency programming errors in kernel modules and device drivers
CN105577480A (en) * 2016-02-01 2016-05-11 新浪网技术(中国)有限公司 Monitoring method and device of network connection performances
CN109284115A (en) * 2017-07-20 2019-01-29 北京国双科技有限公司 A kind of method and device generating tracker script
CN111597089A (en) * 2020-05-18 2020-08-28 广州锦行网络科技有限公司 Linux system call event acquisition and caching device and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DAVID CALAVERA等: "Linux内核观测技术BPF", 31 December 2020, 北京航空航天大学出版社, pages: 147 - 152 *
肖支才等: "自动测试技术", 北京航空航天大学出版社, pages: 147 - 152 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116108091A (en) * 2022-12-26 2023-05-12 小米汽车科技有限公司 Data processing method, event tracking analysis method, device, equipment and medium
CN116108091B (en) * 2022-12-26 2024-01-23 小米汽车科技有限公司 Data processing method, event tracking analysis method, device, equipment and medium
CN116450120A (en) * 2023-06-06 2023-07-18 北京翼辉信息技术有限公司 Method, device, equipment and medium for analyzing kernel of real-time operating system
CN116450120B (en) * 2023-06-06 2023-11-28 北京翼辉信息技术有限公司 Method, device, equipment and medium for analyzing kernel of real-time operating system

Similar Documents

Publication Publication Date Title
US8205120B2 (en) Intelligent test framework
Sambasivan et al. Principled workflow-centric tracing of distributed systems
CN110083543B (en) Regression testing method, device, electronic equipment and storage medium
US9634825B2 (en) Apparatus and method for correcting time stamps of transactions performed by multiple servers
US10761964B2 (en) Object monitoring in code debugging
CN113051166A (en) System tracking method, device, equipment and storage medium
US9355003B2 (en) Capturing trace information using annotated trace output
US10176078B1 (en) Debugging process
US20160224461A1 (en) Injected instrumentation application monitoring and management
US10042745B2 (en) Enhancing the debugger stack with recently reported errors under debug
US20060271345A1 (en) Debugging a circuit using a circuit simulation verifier
US8826060B2 (en) Correlation of log information in a distributed computing environment using relative timestamps
US20090138859A1 (en) Sampling based runtime optimizer for efficient debugging of applications
US9697101B1 (en) Detecting errors in web application runtime environments
US9141512B2 (en) System and method for cluster debugging
US10824549B1 (en) System and method for regression testing of an application programming interface
US20130275811A1 (en) Devices for indicating a physical layer error
US7380173B2 (en) Identifying temporal ambiguity in a aggregated log stream
Goel et al. Gretel: Lightweight fault localization for openstack
CN112702231B (en) Network delay measuring method and system
US20110161716A1 (en) Systems, methods, and apparatuses for providing access to real time information
US10387356B1 (en) Generating timestamps on a packet-oriented bus
KR20150062654A (en) Method and apparatus for measuring performance of software
CN110569184B (en) Test method and terminal equipment
WO2018020338A1 (en) System, method, and apparatus for crowd-sourced gathering of application execution events for automatic application testing and replay

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