CN112328491A - Output method of trace message, electronic device and storage medium - Google Patents

Output method of trace message, electronic device and storage medium Download PDF

Info

Publication number
CN112328491A
CN112328491A CN202011299217.9A CN202011299217A CN112328491A CN 112328491 A CN112328491 A CN 112328491A CN 202011299217 A CN202011299217 A CN 202011299217A CN 112328491 A CN112328491 A CN 112328491A
Authority
CN
China
Prior art keywords
trace
information
trace message
rtc
message
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
Application number
CN202011299217.9A
Other languages
Chinese (zh)
Other versions
CN112328491B (en
Inventor
师雯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011299217.9A priority Critical patent/CN112328491B/en
Publication of CN112328491A publication Critical patent/CN112328491A/en
Application granted granted Critical
Publication of CN112328491B publication Critical patent/CN112328491B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

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

The application discloses a trace message output method, electronic equipment and a storage medium. The output method of the tracking message comprises the following steps: sending a first instruction to a target system TS when a tracking task is started; the first instruction is used for indicating the TS to report first information; the first information represents information for assisting debugging; receiving a first response returned by the TS based on the first instruction; the first response carries at least one piece of first information; writing at least one first trace message to a trace log for the trace task; wherein the first trace message is derived based on the first response; each of the at least one first trace message correspondingly carries one piece of first information of the at least one piece of first information.

Description

Output method of trace message, electronic device and storage medium
Technical Field
The present disclosure relates to the field of embedded systems, and in particular, to a method for outputting a trace message, an electronic device, and a storage medium.
Background
The trace technology is a common analysis and debugging means in an embedded System, a Target System (TS, Target System) outputs a trace message through an output interface, and a debugging and testing System (DTS, Debug Test System) receives the trace message at a corresponding input interface, thereby generating a trace Log (Log). The development engineer analyzes the log using specialized tools to find and solve problems, and may also optimize the target system.
In the related art, trace information for assisting debugging is periodically output to the debugging and testing system by the target system during the trace process, resulting in an increase in load on the target system.
Disclosure of Invention
The embodiment of the invention provides a transmission method of a trace message, electronic equipment and a storage medium, which are used for at least solving the problem of reducing the load of a target system caused by the output of the trace message in the related art.
The technical scheme of the embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a method for outputting a trace message, where the method includes:
sending a first instruction to a target system TS when a tracking task is started; the first instruction is used for indicating the TS to report first information; the first information represents information for assisting debugging;
receiving a first response returned by the TS based on the first instruction; the first response carries at least one piece of first information;
writing at least one first trace message to a trace log for the trace task; wherein,
the first trace message is derived based on the first response; each of the at least one first trace message correspondingly carries one piece of first information of the at least one piece of first information.
In a second aspect, an embodiment of the present application provides an electronic device, including:
the sending unit is used for sending a first instruction to a target system TS when the tracking task is started; the first instruction is used for indicating the TS to report first information; the first information represents information for assisting debugging;
a receiving unit, configured to receive a first response returned by the TS based on the first instruction; the first response carries at least one piece of first information;
a writing unit for writing at least one first trace message into a trace log regarding the trace task; wherein the first trace message is derived based on the first response; each of the at least one first trace message correspondingly carries one piece of first information of the at least one piece of first information.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory for storing a computer program operable on the processor, wherein the processor is configured to execute the above trace message output method when the computer program is executed.
In a fourth aspect, the present application provides a storage medium, on which a computer program is stored, and the computer program, when executed by a processor, performs the above trace message output method.
In the embodiment of the application, when the trace system starts a trace task, the DTS sends an instruction to the TS so that the TS sends TS side information required for assisting debugging to the DTS, and then the DTS writes the received debugging assistance information into a trace log of the trace task. In each trace task, the DTS only needs to read the relevant auxiliary debug information from the TS once, that is, the TS only needs to send the debug auxiliary information to the DTS when receiving an instruction from the DTS. Therefore, the negative influence of the periodic output of auxiliary debugging information on the design and operation of the TS in the related art can be effectively reduced. Therefore, the problem of reducing the load of the output tracking message on a target system in the related art is solved, and sufficient auxiliary information can be provided to meet the analysis requirement. Meanwhile, the trace log does not have repeated debugging auxiliary information, so that the storage space occupied by the trace log in the DTS is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic architecture diagram of a tracking system provided in the related art;
FIG. 2 is a schematic diagram illustrating a trace log provided in the related art;
fig. 3 is a flowchart illustrating an output method of a trace message according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a tracking system according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a trace log according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a target system side trace message format and a schematic diagram of a debug and test system side trace message format according to an embodiment of the present application;
fig. 7 is a schematic structural component diagram of an electronic device according to an embodiment of the present disclosure;
fig. 8 is a schematic diagram of a hardware component structure of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In order to facilitate understanding of the technical solutions of the embodiments of the present application, the following description will be made of related technologies related to the embodiments of the present application.
Debug (Debug) refers to detecting, tracing, and eliminating software errors. Debugging is also used for performance testing and system level hardware debugging of embedded processor systems.
Trace (Trace) is an analysis and debugging tool, also known as Trace technology. It makes the activity of the processor or system visible externally in real time, or stores and retrieves the system activity for the application developer to view through the relevant program or external device.
The Mobile Industry Processor Interface (MIPI) alliance defines a Target System (TS) and a Debug and Test System (DTS). The TS and the DTS together form a tracking system and together perform a tracking task, i.e. the DTS generates a tracking log based on a tracking message sent by the received TS.
TS refers to the system being debugged. TS may be a discrete device, such as a chip, or an aggregate of multiple discrete devices on a substrate or a group of substrates. The TS may also contain 0 to N independent debug and test targets.
DTS refers to a hardware and software combination system that provides debug visibility and control for system developers when connecting to TS. The system comprises:
a host computer: a workstation or other processing system runs debug or test software, and controls the debug and test controller.
A debugger: debug software, part of a debug and test system. It interacts with the debug and test controllers and provides a user interface for operating the debug and test controllers (e.g., controlling single steps, setting breakpoints, memory display/modification, trace reconstruction, etc.).
Fig. 1 is an architecture diagram of a tracking system provided in the related art, and as shown in fig. 1, a flow of sending a generated tracking message to a DTS by a TS in the related art includes:
tracing the source to the trace module: there are multiple Trace sources on the TS, each of which sends the generated Trace message to the Trace module, and the Trace module packages the Trace message, for example, the Trace module generates an STP Trace data stream based on a System Trace Protocol (STP). In the related art, a timer for triggering the TS to periodically send the debug assistance information to the DTS is also included in the TS. The debug assistance information will typically include information such as the RTC of the TS and the software and hardware version of the TS. The TS periodically and repeatedly sends the debugging auxiliary information to the DTS, so that even if errors occur in the Trace transmission process, the debugging auxiliary information can be ensured to be included in the Log file which is captured by the DTS at any moment.
Tracking module to output interface: the Trace module sends an STP Trace data stream to the output interface. Each Trace message in the STP Trace data stream is tagged with a corresponding timestamp to mark the acquisition time of each Trace message.
Output interface to DTS input interface: and the output interface of the TS sends an STP Trace data stream to the DTS, and the STP Trace data stream is used for the DTS to generate a tracking log file.
The process of generating the log file by the DTS according to the tracking message in the TS comprises the following steps:
inputting an interface to the trace log module: and the DTS sends the STP Trace data stream received by the input interface and sent by the TS output interface to a Log generation module for generating a Log file. It should be understood that a development engineer may analyze the Log file using specialized tools to discover and solve problems in the TS, and may also optimize the system. As the TS always actively sends the debugging assistance information to the DTS periodically, the Log file also contains repeated debugging assistance information, and as shown in fig. 2, in the Log file, the same debugging assistance information is added to the Log file at fixed intervals except for the trace message received according to the time sequence.
In summary, in the related art, the TS needs to output the debug assistance information to the DTS periodically at all times. This periodic task must increase the workload of the tracking software on the TS and also occupy valuable computational resources and transmission bandwidth on the TS.
Based on this, the following technical solution of the embodiment of the present application is proposed, when the trace system starts the trace task, the DTS sends an instruction to the TS so that the TS sends TS side information required for assisting debugging to the DTS, and then the DTS writes the received debugging assistance information into the trace log of the trace task. In each tracing task, the DTS only needs to read the relevant auxiliary debugging information from the TS once, so that the waste of operation resources caused by the fact that the TS periodically outputs the debugging auxiliary information to the DTS in the prior art can be avoided, and the workload of tracing software on the TS can be effectively reduced. Therefore, the problem of reducing the load of the output trace message on a target system in the related technology is solved, the effects of reducing the operation and transmission load in the TS are achieved, and meanwhile, because the trace log does not have the debugging auxiliary information which repeatedly appears, the storage space occupied by the trace log in the DTS is also reduced.
The following describes the execution steps of the trace message output method, and fig. 3 is a schematic flowchart of the trace message output method according to the embodiment of the present application, and as shown in fig. 3, the flowchart includes the following steps:
step 301: sending a first instruction to a target system TS when a tracking task is started; the first instruction is used for indicating the TS to report first information; the first information characterizes information for assisting debugging.
Step 302: receiving a first response returned by the TS based on the first instruction; the first response carries at least one piece of first information.
Step 303: writing at least one first trace message to a trace log for the trace task; wherein the first trace message is derived based on the first response; each of the at least one first trace message correspondingly carries one piece of first information of the at least one piece of first information.
The device carrier whose main execution body is DTS may be an electronic device such as a mobile terminal, a computer terminal, or a similar operation device, but is not limited thereto. For convenience of description, the following description refers to an execution body as a receiving end, which can be understood as a receiving end device.
It should be noted that the first information represents information for assisting debugging. The first information includes at least one of:
real-time Clock (RTC) information of the TS;
software version information of the TS;
hardware version information of the TS;
decoding the information;
trace message configuration information.
Here, the decoding information is used to characterize information that may assist in decoding the trace message, and may include a name of a decoder, a version number, or a storage path deposited by the decoder in some possible embodiments. The Trace message configuration information is used to characterize the Trace configuration information corresponding to the current Trace task, and in some possible embodiments, the Trace message configuration information may include a directory of Trace Sources (TRs) that need to be traced in the TS in the current Trace task, or priorities of different TRs, and the like.
In step 301, when starting the tracking task, the receiving end first sends a first instruction to the TS, instructing the TS to report first information.
It should be understood that, in one possible implementation, the first information content specifically reported by the TS may be explicitly listed by the first instruction sent by the receiving end. For example, the first instruction instructs the TS to report software and hardware version information of the TS. In another possible embodiment, the first instruction only indicates that the TS needs to report the first information, but does not need to list a specific type of information that needs to be reported, and the TS reports the preset first information. For example, the first information reported by the TS preset is software and hardware version information of the TS and RTC information.
Here, it is easily understood that the first information is mainly debugging assistance information on the TS side that the DTS has to acquire from the TS. The first information as the debugging assisting information can be divided into two categories: RTC and static information. Static debug assistance information does not change over time, such as software and hardware version information, whereas the RTC changes over time. In the related art, the TS actively and periodically sends the debug assistance information to the DTS. In the present application, whether the RTC or the static debug assistance information, in some possible embodiments, only needs to be read once from the TS. The negative influence on the design and operation of the TS caused by the auxiliary debugging information output periodically in the related technology can be effectively reduced.
In step 302, the receiving end receives a first response returned by the TS based on the first instruction. Here, the first response carries at least one piece of first information.
In step 303, the receiving end writes at least one first trace message into the trace log with respect to the trace task started in step 301. Here, each of the at least one first trace message corresponds to one of the at least one piece of first information carried by the first response in step 302.
It should be noted that the first trace message is used to characterize the trace message on the TS side into which the first information is encoded and converted using the encoding format of the trace message on the TS side.
With respect to the differences between the first trace message and the first response in steps 302 and 303, it should be noted that, in some possible embodiments, the receiving the first response returned by the TS based on the first instruction includes:
receiving the at least one first trace message sent by the TS based on the first instruction.
Here, the first response received by the receiving end is the at least one first trace message in step 303. It will be readily appreciated that the TS encodes the first message to be sent to the DTS directly in the format of the TS itself trace message, and then the first response received by the DTS is already the first trace message and can be used directly in step 303 to write the trace log.
In other possible embodiments, the receiving a first response returned by the TS based on the first instruction includes:
receiving the at least one piece of first information sent by the TS based on the first instruction;
constructing the at least one first trace message based on the received at least one piece of first information.
It should be noted that, unlike the case where the first response received by the DTS is the first trace message in the foregoing embodiment, in this embodiment, because the at least one piece of first information sent by the first instruction received by the DTS is not encoded in the format of the TS-side trace message, a new step needs to be added to encode the first information into the first trace message: constructing the at least one first trace message based on the received at least one piece of first information.
For this addition step, it should also be noted that the following possible embodiments exist: the constructed at least one first trace message may contain at least two pieces of first information. For example: a first trace message is constructed based on the received TS software version information and TS hardware version information.
The tracking system of the present application is briefly described below with reference to fig. 4. Comparing fig. 4 with fig. 1, it is easy to see that the timer module can be simplified in the TS. The reason is that in the present application, the Task that needs to send the debugging assistance information to the DTS by means of the timer period trigger in the related art is removed, and the information Task (Info Task) module on the DTS is used to execute steps 301 to 303 in the present application. It can be seen that the present application is actually a collaborative solution for a tracking system. The Trace on TS and DTS as a whole can work cooperatively. Previously, a part of the work done in the TS is migrated to the DTS to be completed. The workload of the Trace software on the TS is reduced, and resources such as a CPU (central processing unit), a memory, Trace bandwidth and the like occupied by the Trace software are also reduced. The scheme is simple and efficient in design, low in cost and wide in applicability, and can be realized by upgrading on the basis of the existing DTS software.
It should be further noted that, for step 303, the purpose of the receiving end receiving the first response is to store all the first information carried by the first response in the trace log related to the trace task. In some embodiments, part of the first information in the first response needs to be saved in the trace log in cooperation with some debugging assistance information on the DTS side, so as to be helpful for the subsequent actual debugging analysis.
In an optional embodiment, the first information includes a first RTC when the TS reports corresponding first information; the method further comprises the following steps:
writing a second trace message to the trace log; the second trace message carries a second RTC; wherein,
and the second RTC represents the RTC corresponding to the DTS when the TS reports the corresponding first information.
It should be noted that in this embodiment, the transmission time from the TS to the DTS is negligible, so the second RTC may also be understood as the RTC at the DTS end when the DTS receives the corresponding first information.
And writing a second tracking message carrying a second RTC into the tracking log, and aligning the time of the TS on the DTS side through a set calculation formula under the condition that the RTC of the TS of the tracking system is different from the RTC of the DTS.
The writing of the at least one first trace message to the trace log in step 303 of the present application is further illustrated with reference to fig. 5. As shown in fig. 5, in an alternative embodiment, in the trace log established for the started trace task, two first trace messages characterizing the TS-side auxiliary debug information are first written into the corresponding trace log. For example, the first trace message 1 may be a first trace message characterizing the TS software and hardware version information or a first trace message characterizing the TS-side decoding information. The tracking system can automatically load the corresponding decoder according to the tracking information, immediately start to decode the tracking information, and start to decode without waiting for the completion of the tracking log, thereby being convenient for directly reading and rapidly processing the tracking information. The first trace message 2 may be RTC information of the TS, and then the corresponding second trace message is RTC information of the DTS. The RTCs of the DTS and the TS can be kept independent from each other, and based on the RTCs of the existing TS and the RTCs of the DTS, even if the two RTCs are not consistent, the time alignment between the two RTCs can be realized through a related conversion formula, and a specific implementation manner of the time alignment will be described in detail later. It should be noted that, when there are two or more first trace messages, the order in which the first trace messages are written into the trace log may be according to a preset order, or may be according to a priority order. By summarizing the trace Log shown in fig. 5, it can be known that, by using the trace message output method of the present application, the TS does not need to continuously output the debugging auxiliary information any more, thereby effectively avoiding the repeated debugging auxiliary information in the Log file.
In an alternative embodiment, in step 303, the writing at least one first trace message to a trace log regarding the trace task includes:
writing the at least one first trace message to a set location of the trace log.
It should be understood that the first trace message may be written to the beginning of the trace log as shown in fig. 5, but may be written to other predetermined locations of the trace log. As long as the DTS knows the set position, the related first trace message can be quickly called for debugging analysis. Therefore, the set position may be at the end of the trace log, or may be in the middle of the trace log, or any other set position.
The following further introduces the cooperative work of the TS and the Trace of the DTS, including finding the time point corresponding to the DTS according to the time of the TS, and also including finding the time point corresponding to the TS according to the time of the DTS.
In some possible embodiments, the first RTC and the second RTC are not equal, and the method for outputting the trace message further includes the following steps:
calculating a time stamp (timestamp) in the first RTC, the second RTC and a third tracking message, wherein the RTC corresponding to the DTS is calculated when the third tracking message is sent; or,
calculating a timestamp corresponding to the TS when a fourth trace message is generated based on a third RTC of the first RTC, the second RTC and the fourth trace message; wherein,
the third trace message characterizes any trace message sent by the TS during the execution of the trace task; the fourth trace message characterizes any trace message generated by the DTS during execution of the trace task.
First, the description will be given of the time conversion that is required, and it is understood that when analyzing the Log on the TS side, it is sometimes necessary to analyze the Log on the DTS side corresponding to the time point, and vice versa. For example, it is checked whether the DTS receives a message sent from the TS, or whether the DTS sends a certain message to the TS.
Next, the present embodiment will be further illustrated with reference to fig. 6. Fig. 6 shows an example of message formats on the TS side and the DTS side according to the embodiment of the present application.
The key items in the TS side trace message format in fig. 6 are introduced as follows:
time stamping: timestamp information. The corresponding time interval between the two timestamp information is a fixed value of 38.4 MHz.
In practical applications, the payload typically also contains RTC information of the TS.
The key items in the DTS-side trace message format in fig. 6 are introduced as follows:
a real-time clock: i.e. the second RTC as described above.
Note that, the trace message of the general DTS does not include time stamp information.
The steps are as follows: calculating, based on the timestamps in the first RTC, the second RTC, and the third trace message, an RTC corresponding to the DTS when the third trace message is sent, which can be implemented by the following formula:
a formula for calculating the RTC on the DTS side corresponding to the nth third Trace message (Trace message n) in the Trace log:
ts_msg_n_rtc_dts=(ts_msg_n_timestamp–msg_ts_rtc_timestamp)*interval+rtc_dts
wherein,
ts _ msg _ n _ rtc _ dts: RTC on DTS side corresponding to Trace message n on TS side.
And TS _ msg _ n _ timestamp, which is the timestamp corresponding to the Trace message n on the TS side.
msg _ ts _ RTC _ timestamp the timestamp of the first RTC at the beginning of the Log.
interval is the time length corresponding to the timestamp of each unit.
rtc _ dts: second RTC at the beginning of Log.
The steps are as follows: calculating, based on the first RTC, the second RTC, and a third RTC of the fourth trace message, a timestamp corresponding to the TS when the fourth trace message is generated, which can be implemented by the following formula:
the calculation formula of the timestamp of the TS side corresponding to the nth fourth trace message in the DTS side trace log is as follows:
dts_msg_n_timestamp_ts=msg_ts_rtc_timestamp+(rtc_dts_n-rtc_dts)/interval
wherein,
dts _ msg _ n _ timestamp _ ts: and TS side time (in a timestamp form) corresponding to the nth fourth tracking message on the DTS side.
RTC _ DTS _ n is the RTC of the nth fourth trace message on the DTS side.
In practical application, according to the above formula, the TS and DTS time can be aligned, and Log on two sides can be analyzed, which is helpful for quickly positioning problems.
In order to implement the output method of the trace message in the embodiment of the present application, an embodiment of the present application further provides an electronic device, as shown in fig. 7, where the electronic device is used as a receiving end of the trace message and is deployed with a DTS, and the electronic device includes:
a sending unit 701, configured to send a first instruction to a target system TS when a tracking task is started; the first instruction is used for indicating the TS to report first information; the first information represents information for assisting debugging;
a receiving unit 702, configured to receive a first response returned by the TS based on the first instruction; the first response carries at least one piece of first information;
a writing unit 703 for writing at least one first trace message into a trace log regarding the trace task; wherein the first trace message is derived based on the first response; each of the at least one first trace message correspondingly carries one piece of first information of the at least one piece of first information.
In one embodiment, the target system is configured with at least three output interfaces; the second output interface has a highest priority among all of the at least three output interfaces in the first state.
In an embodiment, the receiving unit 702, when receiving a first response returned by the TS based on the first instruction, is configured to:
receiving the at least one first trace message sent by the TS based on the first instruction.
In an embodiment, the receiving unit 702, when receiving a first response returned by the TS based on the first instruction, is configured to:
receiving the at least one piece of first information sent by the TS based on the first instruction;
constructing the at least one first trace message based on the received at least one piece of first information.
In an embodiment, the first information includes a first real time clock RTC when the TS reports the corresponding first information; the write unit is further to:
writing a second trace message to the trace log; the second trace message carries a second RTC; and the second RTC represents the RTC corresponding to the debugging and testing system DTS when the TS reports the corresponding first information.
In an embodiment, the first RTC is not equal to the second RTC, and the electronic device further includes a computing unit configured to:
calculating a RTC corresponding to the DTS when the third trace message is sent based on timestamps in the first RTC, the second RTC and the third trace message; or,
calculating a timestamp corresponding to the TS when a fourth trace message is generated based on a third RTC of the first RTC, the second RTC and the fourth trace message; wherein,
the third trace message characterizes any trace message sent by the TS during the execution of the trace task; the fourth trace message characterizes any trace message generated by the DTS during execution of the trace task.
In an embodiment, the writing unit 703, when writing at least one first trace message into the trace log regarding the trace task, is configured to:
writing the at least one first trace message to a set location of the trace log.
In one embodiment, the first information includes at least one of:
first RTC information of the TS;
software version information of the TS;
hardware version information of the TS;
decoding the information;
trace message configuration information.
In actual application, the sending unit 701, the receiving unit 702, the writing unit 703 and the calculating unit may be implemented by a processor in the electronic device, and the processor needs to run a program stored in a memory to implement the functions of the program modules.
It should be noted that, in the above-mentioned fig. 7, the electronic device provided in the embodiment is only exemplified by the division of the above-mentioned program modules, and in practical applications, the above-mentioned processing distribution may be completed by different program modules according to needs, that is, the internal structure of the electronic device is divided into different program modules to complete all or part of the above-mentioned processing. In addition, the electronic device and the embodiment of the method for outputting the trace message provided by the above embodiment belong to the same concept, and specific implementation processes thereof are detailed in the embodiment of the method and are not described herein again.
Based on the hardware implementation of the program module, in order to implement the method of the embodiment of the present application, an embodiment of the present application further provides an electronic device. Fig. 8 is a schematic diagram of a hardware component structure of an electronic device 800 according to an embodiment of the present disclosure. The electronic device 800 shown in fig. 8 includes a processor 810, and the processor 810 can call and execute a computer program from a memory to implement the method in the embodiment of the present application.
Optionally, as shown in fig. 8, the electronic device 800 may also include a memory 820. From the memory 820, the processor 810 can call and run a computer program to implement the method in the embodiment of the present application.
The memory 820 may be a separate device from the processor 810 or may be integrated into the processor 810.
Optionally, as shown in fig. 8, the electronic device 800 may further include a transceiver 830, and the processor 810 may control the transceiver 830 to communicate with other devices, and specifically, may transmit information or data to the other devices or receive information or data transmitted by the other devices.
The transceiver 830 may include a transmitter and a receiver, among others. The transceiver 830 may further include one or more antennas.
Optionally, the electronic device 800 may implement corresponding processes of the output method of each trace message in the embodiment of the present application, and for brevity, details are not described here again.
The memory in the embodiments of the present application is used to store various types of data to support operations in an electronic device. Examples of such data include: any computer program for operating on an associated device.
It will be appreciated that the memory can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memories described in the embodiments of the present application are intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the embodiments of the present application may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The processor described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in a memory where a processor reads the programs in the memory and in combination with its hardware performs the steps of the method as previously described.
When the processor executes the program, corresponding processes in the methods of the embodiments of the present application are implemented, and for brevity, are not described herein again.
In an exemplary embodiment, the present application further provides a storage medium, i.e., a computer storage medium, specifically a computer readable storage medium, for example, including a memory storing a computer program, which is executable by a processor to perform the steps of the foregoing method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, electronic device and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof that contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling an electronic device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for outputting trace messages, the method comprising:
sending a first instruction to a target system TS when a tracking task is started; the first instruction is used for indicating the TS to report first information; the first information represents information for assisting debugging;
receiving a first response returned by the TS based on the first instruction; the first response carries at least one piece of first information;
writing at least one first trace message to a trace log for the trace task; wherein,
the first trace message is derived based on the first response; each of the at least one first trace message correspondingly carries one piece of first information of the at least one piece of first information.
2. The method of claim 1, wherein receiving the first response returned by the TS based on the first instruction comprises:
receiving the at least one first trace message sent by the TS based on the first instruction.
3. The method of claim 1, wherein receiving the first response returned by the TS based on the first instruction comprises:
receiving the at least one piece of first information sent by the TS based on the first instruction;
constructing the at least one first trace message based on the received at least one piece of first information.
4. The method of claim 1, wherein the first information comprises a first Real Time Clock (RTC) when the TS reports the corresponding first information; the method further comprises the following steps:
writing a second trace message to the trace log; the second trace message carries a second RTC; wherein,
and the second RTC represents that the RTC corresponding to the test system DTS is debugged when the TS reports the corresponding first information.
5. The method of claim 4, wherein the first RTC is not equal to the second RTC; the method further comprises the following steps:
calculating a RTC corresponding to the DTS when the third trace message is sent based on timestamps in the first RTC, the second RTC and the third trace message; or,
calculating a timestamp corresponding to the TS when a fourth trace message is generated based on a third RTC of the first RTC, the second RTC and the fourth trace message; wherein,
the third trace message characterizes any trace message sent by the TS during the execution of the trace task; the fourth trace message characterizes any trace message generated by the DTS during execution of the trace task.
6. The method of claim 1, wherein writing at least one first trace message to a trace log for the trace task comprises:
writing the at least one first trace message to a set location of the trace log.
7. The method according to any one of claims 1 to 6, wherein the first information comprises at least one of:
first RTC information of the TS;
software version information of the TS;
hardware version information of the TS;
decoding the information;
trace message configuration information.
8. An electronic device, comprising:
the sending unit is used for sending a first instruction to a target system TS when the tracking task is started; the first instruction is used for indicating the TS to report first information; the first information represents information for assisting debugging;
a receiving unit, configured to receive a first response returned by the TS based on the first instruction; the first response carries at least one piece of first information;
a writing unit for writing at least one first trace message into a trace log regarding the trace task; wherein the first trace message is derived based on the first response; each of the at least one first trace message correspondingly carries one piece of first information of the at least one piece of first information.
9. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 7 when running the computer program.
10. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, realizing the steps of the method according to any one of claims 1 to 7.
CN202011299217.9A 2020-11-18 2020-11-18 Tracking message output method, electronic device and storage medium Active CN112328491B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011299217.9A CN112328491B (en) 2020-11-18 2020-11-18 Tracking message output method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011299217.9A CN112328491B (en) 2020-11-18 2020-11-18 Tracking message output method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN112328491A true CN112328491A (en) 2021-02-05
CN112328491B CN112328491B (en) 2024-06-28

Family

ID=74321453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011299217.9A Active CN112328491B (en) 2020-11-18 2020-11-18 Tracking message output method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112328491B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115296985A (en) * 2022-09-27 2022-11-04 广州医科大学附属第五医院(广州再生医学与健康广东省实验室附属医院) Breakpoint positioning method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105493048A (en) * 2013-09-04 2016-04-13 株式会社Ntt都科摩 Debug device, debug method, and debug program
CN106980572A (en) * 2016-01-19 2017-07-25 阿里巴巴集团控股有限公司 The on-line debugging method and system of distributed system
CN110311839A (en) * 2019-07-30 2019-10-08 秒针信息技术有限公司 Pushed information method for tracing, device, server, terminal and storage medium
CN111782522A (en) * 2020-06-29 2020-10-16 Oppo广东移动通信有限公司 Output method of trace message, electronic device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105493048A (en) * 2013-09-04 2016-04-13 株式会社Ntt都科摩 Debug device, debug method, and debug program
CN106980572A (en) * 2016-01-19 2017-07-25 阿里巴巴集团控股有限公司 The on-line debugging method and system of distributed system
CN110311839A (en) * 2019-07-30 2019-10-08 秒针信息技术有限公司 Pushed information method for tracing, device, server, terminal and storage medium
CN111782522A (en) * 2020-06-29 2020-10-16 Oppo广东移动通信有限公司 Output method of trace message, electronic device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115296985A (en) * 2022-09-27 2022-11-04 广州医科大学附属第五医院(广州再生医学与健康广东省实验室附属医院) Breakpoint positioning method and device and electronic equipment

Also Published As

Publication number Publication date
CN112328491B (en) 2024-06-28

Similar Documents

Publication Publication Date Title
US10013332B2 (en) Monitoring mobile application performance
KR102119585B1 (en) Debugging method, multi-core processor, and debugging device
JP4805163B2 (en) Apparatus and method for time sequencing events in a system having multiple time domain groups
US9355003B2 (en) Capturing trace information using annotated trace output
CN110750592B (en) Data synchronization method, device and terminal equipment
KR100878098B1 (en) Failure analyzing system, failure analyzing method and emulator device
CN107025167B (en) Method and apparatus for data flow analysis using compiler type information in processor trace logs
Tancreti et al. Tardis: software-only system-level record and replay in wireless sensor networks
US8402446B2 (en) Associating probes with test cases
US20120036501A1 (en) Method and System for Capturing System and User Events Using Hardware Trace Devices
CN111782522B (en) Tracking message output method, electronic device and storage medium
CN112328491B (en) Tracking message output method, electronic device and storage medium
CN116627850B (en) Function debugging method and device, storage medium and electronic equipment
CN115102653A (en) Time synchronization method and device, computer equipment and storage medium
CN117707969B (en) ARMv 8-based operation system adjustment and measurement system
CN112740187A (en) Method and system for debugging program
US20130139002A1 (en) Debugging method and computer system using the same
Giese et al. Architecture-driven platform independent deterministic replay for distributed hard real-time systems
CN116562203B (en) Data processing method, device, equipment and storage medium in debugging system
CN117376229B (en) FTP file system software cross debugging method and system based on embedded equipment
US8839207B2 (en) Debugging extensible markup language
CN113688055B (en) Single DSP equipment testing arrangement based on DSS
CN118093446B (en) Heterogeneous program debugging method, system, device, electronic equipment and storage medium
CN113535525A (en) Tracking message transmission method, electronic device and storage medium
KR20040076915A (en) Real-time debugging method of digital signal processor

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