TWI684916B - Function selection method and server - Google Patents

Function selection method and server Download PDF

Info

Publication number
TWI684916B
TWI684916B TW108101178A TW108101178A TWI684916B TW I684916 B TWI684916 B TW I684916B TW 108101178 A TW108101178 A TW 108101178A TW 108101178 A TW108101178 A TW 108101178A TW I684916 B TWI684916 B TW I684916B
Authority
TW
Taiwan
Prior art keywords
function
identification
function call
time
application program
Prior art date
Application number
TW108101178A
Other languages
Chinese (zh)
Other versions
TW201942736A (en
Inventor
曹玉斌
Original Assignee
香港商阿里巴巴集團服務有限公司
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
Priority to ??201810278922.7 priority Critical
Priority to CN201810278922.7A priority patent/CN108595319B/en
Priority to CN201810278922.7 priority
Application filed by 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW201942736A publication Critical patent/TW201942736A/en
Application granted granted Critical
Publication of TWI684916B publication Critical patent/TWI684916B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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; 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; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/81Threshold

Abstract

The embodiments of the present specification provide a function selection method and a server. The method includes: running an application program including a debug code in the source code to obtain operating state information of the application program; the operating state information includes function call information corresponding to a thread identification; and the function call information includes Function identification and the time stamp corresponding to the function identification; analyzing the function call information corresponding to the default thread identification to obtain at least one function call chain corresponding to the default thread identification; each of the function call chains At least one function identification is included; the function identification corresponding to the running time greater than or equal to the preset time threshold is selected from the at least one function call chain; the running time corresponding to the function identification is based on the time stamp corresponding to the function identification get.

Description

Function selection method and server

The embodiments of the present specification relate to the technical field of computers, in particular to a function selection method and a server.

During the life cycle of an application, when an application itself undergoes changes in code upgrades, version iterations, or bug fixes, or other applications associated with the application undergo changes in code upgrades, version iterations, or bug fixes, etc. , Usually need to locate the time-consuming function in the application, in order to optimize the response time of the application. The time-consuming function may be a function with a long running time. The response time may include startup time, time to execute a certain function, and so on. In the related art, a trace file (trace file) of an application can be obtained, and the trace file can be analyzed in a manual manner to identify a time-consuming function therefrom. For example, developers can use TraceView (a tool for testing application performance) to analyze the trace file to identify time-consuming functions. However, using manual methods to identify time-consuming functions has low efficiency and accuracy, making it difficult to meet actual needs.

The purpose of the embodiments of the present specification is to provide a method for selecting functions and a server to improve the efficiency and accuracy of time-consuming function identification. To achieve the above purpose, embodiments of the present specification provide a method for function selection, including: running an application program including a debug code in the source code to obtain operating state information of the application program; the operating state information includes a thread identification correspondence Function call information; the function call information includes function identification and the time stamp corresponding to the function identification; analyze the function call information corresponding to the default thread identification to obtain at least one corresponding to the default thread identification Function call chain; each of the function call chains includes at least one function identification; from the at least one function call chain, a corresponding function identification whose running time is greater than or equal to a preset time threshold is selected; function identification The corresponding running time is obtained based on the function identifying the corresponding time stamp. In order to achieve the above purpose, an embodiment of the present specification provides a server, including: a running unit for running an application program including a debug code in a source code to obtain operating state information of the application program; the operating state information includes execution Thread identification corresponding function call information; the function call information includes function identification and function identification corresponding time stamp; analysis unit is used to analyze the function call information corresponding to the default thread identification to obtain the pre-call Let the thread identify at least one corresponding function call chain; each function call chain includes at least one function identification; the selection unit is used to select the corresponding running time from the at least one function call chain to be greater than or equal to The function identification equal to the preset time threshold; the running time corresponding to the function identification is obtained based on the time stamp corresponding to the function identification. To achieve the above purpose, embodiments of the present specification provide a server, including: a memory for storing computer instructions; a processor for executing the computer instructions to achieve the following steps: running an application program including a debug code in the original code To get the running status information of the application; the running status information includes the function call information corresponding to the thread identification; the function call information includes the function identification and the time stamp corresponding to the function identification; analyze the default execution Thread identification corresponding to the function call information, to obtain at least one function call chain corresponding to the default thread identification; each function call chain includes at least one function identification; from the at least one function call chain The function identification corresponding to the operation time greater than or equal to the preset time threshold is selected; the operation time corresponding to the function identification is obtained based on the time stamp corresponding to the function identification. It can be seen from the above technical solutions provided by the embodiments of the present specification that in the embodiments of the present specification, the continuous integration server can run the application program including the debug code in the source code to obtain the running status information of the application program; the default execution can be analyzed Thread identification corresponding to the function call information, to obtain at least one function call chain corresponding to the default thread identification; the corresponding running time can be selected from the at least one function call chain is greater than or equal to a preset time threshold Function recognition. In the embodiment of the present specification, the continuous integration server can analyze the function call information corresponding to the default thread recognition in the application program to obtain at least one function call chain; it can be based on the preset time threshold from the at least one function Time-consuming functions are filtered out in the call chain. In this way, the continuous integration server can improve the efficiency and accuracy of time-consuming function recognition.

The technical solutions in the embodiments of the present specification will be described clearly and completely in the following with reference to the drawings in the embodiments of the present specification. Obviously, the described embodiments are only a part of the embodiments of the present specification, but not all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this specification. Please refer to Figure 1. The embodiments of the present specification provide a function selection system. The function selection system may include a version server, a continuous integration server (Continuous Integration Server) and at least one terminal device. In this embodiment, the terminal device may be a terminal device used by developers, such as a personal computer (PC), a server, or the like. The developer can use the terminal device to edit the source code of the application program. The version server can be used to store and manage the source code of each version of the application. For example, the version server may run application version control systems such as SVN (Subversion) and CVS (Concurrent Version System); the source code of each version of the application may be managed based on the application version control system. The continuous integration server can be used to compile and test the source code of the application. In this embodiment, the terminal device may upload the source code of the application program to the version server. The version server can receive and store the source code of the application. The continuous integration server can obtain the source code of the application from the version server; the source code of the application can be compiled to obtain the application; the performance of the application can be tested to obtain the test Results; the test results can be sent to the terminal device. The terminal device may receive the test result. In this way, through the test result, the developer can obtain a function that reflects the performance of the application from the source code of the application. The performance here may be, for example, startup time, or power consumption, etc.; the function may be understood as a set of computer program instructions capable of implementing certain functions. Please refer to Figure 2. The embodiments of the present specification provide a method for selecting functions. The function selection method uses the continuous integration server as an execution subject, and may include the following steps. Step S10: Run the application program including the debugging code in the original code to obtain the running state information of the application program. In this embodiment, the application program may be a computer program for performing one or more tasks. The application program may specifically be any type of application program, for example, it may be a payment type application program, a video playback type application program, or an image processing type application program. In this embodiment, in the development stage of the application program, the developer may insert a debug code in the source code of the application program, so that the running state information of the application program can be obtained when the application program is run. In the subsequent process, by analyzing the running state information, defects in the source code of the application can be found. The debugging code may include a debugging function. The debugging function can be used to generate operating status information. The debugging function may include, for example, Debug.startMethodTracing, Debug.stopMethodTracing, and so on. Of course, the debugging code may also include other functional functions, such as a detection function. The detection function may be used to trigger the debugging function when it is detected that a specific condition is satisfied, for example, when the file in the root directory is detected to be a trigger. In this embodiment, the running state information may include thread identification of at least one thread of the application program, and function call information corresponding to the thread identification. The thread identification can be used to identify the thread, for example, it can be the name or number of the thread. The function call information can be used to describe the function called by the thread identified by the thread identification. The function call information may specifically include at least one function identification, and a time stamp corresponding to the function identification. The function identification can be used to identify the function, for example, it can be the name or number of the function. The time stamp may include an entry time stamp and an exit time stamp. The entry time stamp may be used to indicate the entry time of the function identified by the function identification; the exit time stamp may be used to indicate the exit time of the function identified by the function identification. The running time of the function identified by the function identification can be calculated based on the entry timestamp and the exit timestamp. It should be noted that, given that a thread can call a function one or more times, the function identification in the function call information can correspond to one or more pairs of timestamps, and each pair of timestamps can include an entry time Stamp and an exit timestamp. In a scenario example of this embodiment, the continuous integration server can run an application program that includes a debug code in the source code, thereby obtaining a trace file (trace file). The tracking file may include the running status information of the application program. Specifically, for example, the tracking file may include:

Figure 02_image001
In the above trace file; threadID means thread identification. For example, thread identification 12622 is used to identify thread main; thread identification 12693 is used to identify thread OnLineMonitor. class.method means function recognition. For example, android.os.Handler.dispatchMessage and android.os.MessageQueue.next are function recognition respectively. Action means action. For example, Action may include ent and xit. Ent means to enter the function; xit means to exit the function. usecs means timestamp. For example, 16752 is the entry timestamp corresponding to android.os.Handler.dispatchMessage for function recognition; 18976 is the exit timestamp corresponding to android.os.Handler.dispatchMessage for function recognition. In an implementation of this embodiment, it is considered that the developer can obtain the running state information of the application in different operation stages by inserting debugging codes in different positions of the application source code. For example, the developer can obtain the running status information of the application during the startup phase by inserting a debugging code at the activation code of the source code of the application. The activation code may be a code executed by the application program during the activation phase. As such, the operating state information may include operating state information of the application program in a preset operating stage. The preset operation phase may include a startup phase. Of course, the preset operation stage may also include other stages, for example, a stage for executing a certain function. In this embodiment, the continuous integration server may receive the source code of the application program sent from the version server, and the source code of the application program may include a debug code; it may be based on the source code of the application program, Generate the application program; run the application program to obtain the running status information of the application program. Specifically, the continuous integration server may compile the source code of the application program to obtain the application program. The version server may send the source code of the latest version of the application stored by itself to the continuous integration server every preset time period. The preset time period can be flexibly set according to actual needs, for example, it can be 10 days, 25 days, or 30 days. Or, in view of that the version server generally considers the received source code to be the source code of the latest version of the application, the version server may store and receive the source code of the application from the terminal device Sending the source code of the application to the continuous integration server. In a scenario example of this embodiment, the source code of the application program may include a debugging code. The debugging code may include a detection function and a debugging function. The detection function may be used to trigger the debugging function after detecting that a certain file exists in the root directory, and the file may be, for example, abc.txt. The debugging function may include Debug.startMethodTracing and Debug.stopMethodTracing. Specifically, the debugging function Debug.startMethodTracing may be located at the start position of the startup code in the application source code; the debugging function Debug.stopMethodTracing may be located at the end of the startup code in the application source code position. In this scenario example, after editing the source code of the application, the developer can use the terminal device to send the source code of the application to the version server. The version server can receive and store the source code of the application; the source code of the application can be sent to the continuous integration server. The continuous integration server can receive the source code of the application program; the source code of the application program can be compiled to obtain the application program. The continuous integration server can write a pre-agreed file (such as the file abc.txt) in the root directory to trigger the detection function in the source code of the application; the application can be run to obtain the trace file. The trace file may include information about the running status of the application during the startup phase. Step S12: Analyze the function call information corresponding to the default thread identification to obtain at least one function call chain corresponding to the default thread identification. In this embodiment, the number of the predetermined thread recognition may be one or more. The thread identified by the default thread identification may be part or all of the threads of the application program. For example, the thread identified by the default thread identification may be a thread related to activation of the application program. Specifically, for example, the preset thread identification may include thread identifications 12622 and 12693, thread identification 12622 may be used to identify thread main, and thread identification 12693 may be used to identify thread OnLineMonitor. The function call chain may include at least one function identification. The functions identified by the function identification in each of the function call chains may have a step-by-step call relationship. In a scenario example of this embodiment, a function call chain may include 16 function identifications, specifically including:
Figure 02_image003
The functions identified in the above function call chain may have a step-by-step call relationship. Specifically, the function recognition function com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run can call the function recognition function java.lang.reflect.Method.invoke recognized function; function recognition java.lang.reflect The method identified by .Method.invoke can call the function identified by android.app.ActivityThread.main; by analogy, the function identified by com.alibaba.fastjson.serializer.ListSerializer.write can call the function Identify the function identified by com.alibaba.fastjson.serializer.MapSerializer.write. In this embodiment, for each default thread, the continuous integration server can obtain the function call information corresponding to the default thread in the running state information; the obtained function call information can be Target function call information; the call relationship between the functions identified by each function identification in the target function call information can be analyzed to obtain at least one function call chain corresponding to the thread identification. Step S14: Select, from the at least one function call chain, a function identification whose corresponding running time is greater than or equal to a preset time threshold. In this embodiment, the running time corresponding to the function identification can be obtained based on the time stamp corresponding to the function identification. Specifically, as mentioned above, the time stamp corresponding to the function identification may include an entry time stamp and an exit time stamp. In this way, for each function identification in the at least one function call chain, the continuous integration server may use the exit time stamp corresponding to the function identification as the exit time; the function may identify the corresponding time The time indicated by the entry timestamp is the entry time; the difference between the exit time and the entry time can be calculated as the function to identify the corresponding running time. In this embodiment, for each function call chain in the at least one function call chain, the continuous integration server may find whether the function call chain includes a running time greater than or equal to the preset time Function identification of the threshold; when the function call chain includes function identification whose running time is greater than or equal to the preset time threshold, the corresponding running time can be selected from the function call chain to be greater than or equal to the preset time Function identification of threshold. The preset time threshold may be flexibly set according to actual needs, for example, it may be 100 ms, 150 ms, or 180 ms. It should be noted that, given that one function identification can correspond to one or more pairs of timestamps, one function identification can correspond to one or more runtimes. When any one of the one or more runtimes corresponding to the function identification is greater than or equal to the preset time threshold, the continuous integration server may consider the corresponding runtime of the function identification to be greater than or equal to the The preset time threshold. It should also be noted that when the running time of a function is greater than or equal to the preset time threshold, the running time of each function of the function until the function is also greater than or equal to the preset time threshold . In this way, for each function call chain in the at least one function call chain, the function identification selected by the continuous integration server from the function call chain can form a sub-function of the function call chain Call chain. In a scenario example of this embodiment, the at least one function call chain may include function call chains CA and CB. In this scenario example, the function call chain CA may include five function identifications including FA, FB, FC, FD, and FE. The functions identified in the function call chain CA can have a step-by-step call relationship. Specifically, the function identified by the function identification FA can call the function identified by the function identification FB; the function identified by the function identification FB can call the function identified by the function identification FC; and so on, the function identified by the function identification FD The function can call the function identified by the function identification FE. In the function call chain CA, the running time corresponding to the function recognition FA, FB, and FC is greater than the preset time threshold. In this scenario example, the function call chain CB may include six function identifications, such as FC, FF, FG, FH, FI, and FJ. The functions identified by the function identification in the function call chain CB may have a step-by-step call relationship. Specifically, the function recognized by the function FC can call the function recognized by the function FF; the function recognized by the function FF can call the function recognized by the function FG; and so on, the function recognized by the function FI The function can call the function recognized by the function recognition FJ. In the function call chain CB, the running time corresponding to the function recognition FC, FF, FG, and FH is greater than the preset time threshold. In this scenario example, the continuous integration server can select the function identification FA, FB, FC from the function call chain CA. The function recognition FA, FB, FC can form a sub-function call chain of the function call chain CA. The continuous integration server can select the function identification FC, FF, FG, FH from the function call chain CB. The function recognition FC, FF, FG, FH can form a sub-function call chain of the function call chain CB. In one implementation of this embodiment, the continuous integration server may also obtain the running time corresponding to the selected function identification. In an example of a scenario of this embodiment, the function recognition and the obtained running time selected by the continuous integration server may be as follows:
Figure 02_image005
Figure 02_image007
Among them, function recognition android.os.Handler.dispatchMessage, android.os.Handler.handleCallback, com.alipay.mobile.nebulacore.bridge.H5BridgeImpl$2.run, com.alipay.mobile.nebulacore.bridge.H5BridgeImpl.access$100 , Com.alipay.mobile.nebulacore.bridge.H5BridgeImpl.executeWeb, com.alibaba.fastjson.JSON.toJSONString, com.alibaba.fastjson.serializer.JSONSerializer.write (783 ms), com.alibaba.fastjson.serializer.MapSerializer .write, com.alibaba.fastjson.serializer.MapSerializer.write, com.alibaba.fastjson.serializer.ListSerializer.write, com.alibaba.fastjson.serializer.ListSerializer.write, and com.alibaba.fastjson.serializer.MapSerializer. write can form a sub-function call chain. Function recognition android.os.Handler.dispatchMessage, android.os.Handler.handleCallback, com.alipay.mobile.nebulacore.bridge.H5BridgeImpl$2.run, com.alipay.mobile.nebulacore.bridge.H5BridgeImpl.access$100, com .alipay.mobile.nebulacore.bridge.H5BridgeImpl.executeWeb, com.alibaba.fastjson.JSON.toJSONString, com.alibaba.fastjson.serializer.JSONSerializer.write, com.alibaba.fastjson.serializer.MapSerializer.write, com.alibaba .fastjson.serializer.MapSerializer.write, com.alibaba.fastjson.serializer.ListSerializer.write, com.alibaba.fastjson.serializer.ListSerializer.write, and com.alibaba.fastjson.serializer.MapSerializer.write can form a sub-function Call chain. The following describes one application scenario of the function selection method in this embodiment. It is worth noting that the example of this scenario is only to better illustrate this embodiment, and does not constitute an undue limitation on this embodiment. In this scenario example, at the first moment, the version server may send the source code of the first version of the application to the continuous integration server. The continuous integration server can receive the source code of the first version of the application program, and the source code of the first version of the application program can include a debug code; the source code of the first version of the application program can be compiled to obtain The first version of the application program; the first version of the application program can be run to obtain the running state information of the first version of the application program during the startup phase; the startup-related threads can be analyzed to correspond to the running state information Function call information to obtain at least one function call chain; the corresponding function identification whose running time is greater than or equal to the preset time threshold can be selected from the at least one function call chain; the selected function identification can be identified Function as a time-consuming function. In this scenario example, at a subsequent second moment, the version server may send the source code of the second version of the application to the continuous integration server. The continuous integration server can receive the source code of the second version of the application, and the source code of the second version of the application can include a debug code; the source code of the second version of the application can be compiled to obtain The second version of the application program; can run the second version of the application program to obtain the running state information of the second version of the application program at the startup stage; can analyze the startup-related threads corresponding to the running state information Function call information to obtain at least one function call chain; the corresponding function identification whose running time is greater than or equal to the preset time threshold can be selected from the at least one function call chain; the selected function identification can be identified Function as a time-consuming function. In this scenario example, the continuous integration server can compare the time-consuming function in the first version of the application with the time-consuming function in the second version of the application; the application can be output A newly added time-consuming function in the second version of the program, or a time-consuming function whose running time becomes longer in the second version of the application program can be output. In this way, the developer can find defects in the source code of the second version of the application program, which facilitates optimization of the source code of the second version of the application program. In this embodiment, the continuous integration server can run the application program including the debug code in the source code to obtain the running state information of the application program; the function call information corresponding to the default thread identification can be analyzed to obtain The preset thread recognizes the corresponding at least one function call chain; the corresponding function recognition whose running time is greater than or equal to the preset time threshold can be selected from the at least one function call chain. In this embodiment, the continuous integration server can analyze the function call information corresponding to the default thread recognition in the application program to obtain at least one function call chain; it can be based on the preset time threshold from the at least one function Time-consuming functions are filtered out in the call chain. In this way, the continuous integration server can improve the efficiency and accuracy of time-consuming function recognition. Please refer to Figure 3. An embodiment of this specification also provides a server. The server may include the following units. The running unit 20 is used to run an application program including a debug code in the source code to obtain the running state information of the application program; the running state information includes function call information corresponding to the thread identification; the function call information Including function identification and the time stamp corresponding to the function identification; the analyzing unit 22 is used to analyze the function call information corresponding to the default thread identification to obtain at least one function call chain corresponding to the default thread identification; each Each of the function call chains includes at least one function identification; the selecting unit 24 is configured to select from the at least one function call chain a corresponding function identification whose running time is greater than or equal to a preset time threshold; function identification The corresponding running time is obtained based on the function identifying the corresponding time stamp. Please refer to Figure 4. The embodiment of this specification also provides another server. The server may include a memory and a processor. In this embodiment, the memory includes but is not limited to dynamic random access memory (Dynamic Random Access Memory, DRAM) and static random access memory (Static Random Access Memory, SRAM). The memory can be used to store computer commands. In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may adopt, for example, a microprocessor or a processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, a dedicated Integrated circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller, etc. The processor may be used to execute the computer instructions to implement the following steps: run the application program including the debug code in the source code to obtain the running state information of the application program; the running state information includes a function corresponding to the thread identification Function call information; the function call information includes function identification and the time stamp corresponding to the function identification; analyze the function call information corresponding to the default thread identification to obtain at least one function corresponding to the default thread identification Call chain; each of the function call chains includes at least one function identification; from the at least one function call chain, a corresponding function identification whose running time is greater than or equal to a preset time threshold is selected; a function identification corresponds to The running time is obtained based on the timestamp corresponding to the function identification. It should be noted that the embodiments of the present application are described in a progressive manner. The same and similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. Office. In particular, for the server embodiment, since it is basically similar to the function selection method embodiment, the description is relatively simple. For related parts, please refer to the description of the function selection method embodiment. In addition, those skilled in the art should understand that after reading the specification of this application, those skilled in the art may think that some or all of the embodiments listed in the file of this application can be combined without creative efforts. Within the scope of application disclosure and protection. In the 1990s, the improvement of a technology can be clearly distinguished from the improvement of hardware (for example, the improvement of the circuit structure of diodes, transistors, switches, etc.) or the improvement of software (for the process flow Improve). However, with the development of technology, the improvement of many methods and processes can be regarded as a direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method and process cannot be achieved with hardware physical modules. For example, a programmable logic device (Programmable Logic Device, PLD) (such as a field programmable gate array (Field Programmable Gate Array, FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. It is up to the designer to “integrate” a digital system on a PLD without having to ask a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, this kind of programming is also mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing. The source code before compilation must also be written in a specific programming language, which is called a hardware description language (Hardware Description Language, HDL), and HDL is not only one, but there are many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog2. Those skilled in the art should also understand that it is only necessary to logically program the method flow in the above hardware description languages and program it into the integrated circuit, and the hardware circuit that implements the logic method flow can be easily obtained. The system, device, module or unit explained in the above embodiments may be implemented by a computer chip or entity, or by a product with a certain function. The system, device, module or unit explained in the above embodiments may be implemented by a computer chip or entity, or by a product with a certain function. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, and a wearable device Or any combination of these devices. It can be known from the description of the above embodiments that those skilled in the art can clearly understand that this specification can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions of this specification can be embodied in the form of software products in essence or part of the contribution to the existing technology. The computer software products can be stored in storage media, such as ROM/RAM, disk, An optical disc, etc., includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of this specification or some parts of the embodiments. This manual can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, small Computers, mainframe computers, distributed computing environments including any of the above systems or equipment, etc. This description can be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification can also be practiced in distributed computing environments in which remote processing devices connected through a communication network perform tasks. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices. Although the description is described through the embodiments, those of ordinary skill in the art know that there are many variations and changes in the description without departing from the spirit of the description, and it is hoped that the scope of the attached patent application includes these variations and changes without departing from the spirit of the description .

S10: Step S12: Step S14: Step 20: running unit 22: Analysis unit 24: Select unit

In order to more clearly explain the embodiments of the present specification or the technical solutions in the prior art, the following will briefly introduce the drawings required in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only Some embodiments described in the specification can be obtained by those skilled in the art without any creative labor, and other drawings can be obtained based on these drawings. 1 is a schematic diagram of a function selection system according to an embodiment of the specification; 2 is a flowchart of a method for selecting a function according to an embodiment of the present specification; 3 is a functional structural diagram of a server according to an embodiment of the specification; and FIG. 4 is a functional structural diagram of a server according to an embodiment of the present specification.

Claims (10)

  1. A function selection method, including: Run the application program including the debug code in the source code to obtain the running state information of the application program; the running state information includes the function call information corresponding to the thread identification; the function call information includes the function identification and function To identify the corresponding time stamp; Analyzing the function call information corresponding to the default thread identification to obtain at least one function call chain corresponding to the default thread identification; each function call chain includes at least one function identification; and A function identification corresponding to a running time greater than or equal to a preset time threshold is selected from the at least one function call chain; the running time corresponding to the function identification is obtained based on a time stamp corresponding to the function identification.
  2. According to the method of claim 1, the corresponding time stamps of the function identification include entry time stamps and exit time stamps.
  3. According to the method described in claim 2, the running time corresponding to the function identification is calculated as follows: The time indicated by the exit time stamp corresponding to the function identification is the exit time, and the time indicated by the entry time stamp corresponding to the function identification is the entry time, and the difference between the exit time and the entry time is calculated as This function identifies the corresponding runtime.
  4. According to the method of claim 1, the operation state information includes operation state information of the application program in a preset operation stage; the preset operation stage includes a startup stage.
  5. According to the method of claim 1, the application program including the debugging code in the running source code to obtain the running state information of the application program includes: Receiving the source code of the application program sent from the version server; the source code includes a debugging code; Generating the application based on the source code; and Run the application program to obtain the running state information of the application program.
  6. According to the method of claim 1, the analyzing the function call information corresponding to the default thread identification to obtain at least one function call chain corresponding to the default thread identification includes: Obtaining the function call information corresponding to the default thread identification in the running state information; and Use the acquired function call information as the target function call information, analyze the call relationship between the functions identified by each function in the target function call information, and obtain at least one function corresponding to the default thread identification Call chain.
  7. According to the method of claim 1, the selection of a function identification corresponding to a running time greater than or equal to a preset time threshold from the at least one function call chain includes: For each function call chain in the at least one function call chain, when the function call chain includes a corresponding function identification whose running time is greater than or equal to a preset time threshold, select from the function call chain The corresponding function identification whose running time is greater than or equal to the preset time threshold; the selected function identification can form a sub-function call chain of the function call chain.
  8. The method according to claim 1, further comprising: Get the running time corresponding to the selected function identification.
  9. A server, including: The running unit is used to run the application program including the debug code in the source code to obtain the running state information of the application program; the running state information includes the function call information corresponding to the thread identification; the function call information includes Function identification and the time stamp corresponding to function identification; An analysis unit, configured to analyze the function call information corresponding to the default thread identification to obtain at least one function call chain corresponding to the default thread identification; each function call chain includes at least one function identification; as well as The selecting unit is configured to select a function identification corresponding to a running time greater than or equal to a preset time threshold from the at least one function call chain; the corresponding operating time of the function identification is obtained based on a time stamp corresponding to the function identification.
  10. A server, including: Memory for storing computer commands; and A processor, configured to execute the computer instructions to implement the following steps: run the application program including the debug code in the source code to obtain the running state information of the application program; the running state information includes a function call corresponding to the thread identification Information; the function call information includes function identification and the time stamp corresponding to the function identification; analyze the function call information corresponding to the default thread identification to obtain at least one function call chain corresponding to the default thread identification Each of the function call chains includes at least one function identification; from the at least one function call chain, a corresponding function identification whose running time is greater than or equal to a preset time threshold is selected; a function identification corresponding to the running time Based on this function, the corresponding time stamp is identified.
TW108101178A 2018-03-30 2019-01-11 Function selection method and server TWI684916B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
??201810278922.7 2018-03-30
CN201810278922.7A CN108595319B (en) 2018-03-30 2018-03-30 Function selection method and server
CN201810278922.7 2018-03-30

Publications (2)

Publication Number Publication Date
TW201942736A TW201942736A (en) 2019-11-01
TWI684916B true TWI684916B (en) 2020-02-11

Family

ID=63624002

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108101178A TWI684916B (en) 2018-03-30 2019-01-11 Function selection method and server

Country Status (3)

Country Link
CN (1) CN108595319B (en)
TW (1) TWI684916B (en)
WO (1) WO2019184597A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595319B (en) * 2018-03-30 2020-08-04 阿里巴巴集团控股有限公司 Function selection method and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8850394B2 (en) * 2008-05-08 2014-09-30 Icera Inc. Debugging system and method
TWI561980B (en) * 2015-10-20 2016-12-11
TW201714085A (en) * 2015-10-02 2017-04-16 緯創資通股份有限公司 Method for monitoring server, monitoring device and monitoring system
CN106874168A (en) * 2017-01-12 2017-06-20 北京奇虎科技有限公司 Determine method, device and the mobile terminal of application program runnability
CN107145429A (en) * 2017-06-01 2017-09-08 成都通甲优博科技有限责任公司 A kind of log analysis method and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101482845B (en) * 2008-01-08 2011-08-10 国际商业机器公司 Method and system for calling instant debugger
US8312254B2 (en) * 2008-03-24 2012-11-13 Nvidia Corporation Indirect function call instructions in a synchronous parallel thread processor
CN106909431A (en) * 2015-12-22 2017-06-30 阿里巴巴集团控股有限公司 The method and device of mapping function performance issue
CN105844156A (en) * 2016-03-22 2016-08-10 北京金山安全软件有限公司 Process information acquiring method and device and electronic equipment
CN106649084B (en) * 2016-09-14 2019-05-24 腾讯科技(深圳)有限公司 The acquisition methods and device of function call information, test equipment
CN107480029B (en) * 2017-08-02 2019-02-15 北京深思数盾科技股份有限公司 A kind of monitoring method and device of function call time
CN108595319B (en) * 2018-03-30 2020-08-04 阿里巴巴集团控股有限公司 Function selection method and server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8850394B2 (en) * 2008-05-08 2014-09-30 Icera Inc. Debugging system and method
TW201714085A (en) * 2015-10-02 2017-04-16 緯創資通股份有限公司 Method for monitoring server, monitoring device and monitoring system
TWI561980B (en) * 2015-10-20 2016-12-11
CN106874168A (en) * 2017-01-12 2017-06-20 北京奇虎科技有限公司 Determine method, device and the mobile terminal of application program runnability
CN107145429A (en) * 2017-06-01 2017-09-08 成都通甲优博科技有限责任公司 A kind of log analysis method and system

Also Published As

Publication number Publication date
WO2019184597A1 (en) 2019-10-03
CN108595319B (en) 2020-08-04
TW201942736A (en) 2019-11-01
CN108595319A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
US9740594B2 (en) Automated debug trace specification
US20170052871A1 (en) Completing functional testing
EP3030969B1 (en) Automated application test system
US20200174872A1 (en) Systems and methods of detecting power bugs
US9514029B2 (en) Partial recording of a computer program execution for replay
Muccini et al. Software testing of mobile applications: Challenges and future research directions
US20160357519A1 (en) Natural Language Engine for Coding and Debugging
US9465717B2 (en) Native code profiler framework
Amalfitano et al. A gui crawling-based technique for android mobile application testing
US8578340B1 (en) Recording and replaying computer program execution with recorded execution event breakpoints
US9256517B1 (en) Display of aggregated stack traces in a source code viewer
US8359584B2 (en) Debugging from a call graph
US20130179866A1 (en) Debugging A High Performance Computing Program
US7644394B2 (en) Object-oriented creation breakpoints
US7530054B2 (en) Program analysis tool presenting object containment and temporal flow information
US7908521B2 (en) Process reflection
US9298596B2 (en) Test framework for computing jobs
US9329981B2 (en) Testing program, testing method, and testing device
US7950001B2 (en) Method and apparatus for instrumentation in a multiprocessing environment
EP2724235B1 (en) N-way runtime interoperative debugging
US8839203B2 (en) Code coverage-based taint perimeter detection
JP5415557B2 (en) User script code conversion for debugging
US8756460B2 (en) Test selection based on an N-wise combinations coverage
US20100023926A1 (en) Call graph dependency extraction by static source code analysis
JP5523872B2 (en) Program dynamic analysis method and apparatus