CN110908882A - Performance analysis method and device of application program, terminal equipment and medium - Google Patents

Performance analysis method and device of application program, terminal equipment and medium Download PDF

Info

Publication number
CN110908882A
CN110908882A CN201911112685.8A CN201911112685A CN110908882A CN 110908882 A CN110908882 A CN 110908882A CN 201911112685 A CN201911112685 A CN 201911112685A CN 110908882 A CN110908882 A CN 110908882A
Authority
CN
China
Prior art keywords
target
function
performance analysis
address information
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911112685.8A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Infinite Light Field Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Infinite Light Field Technology Co Ltd filed Critical Beijing Infinite Light Field Technology Co Ltd
Priority to CN201911112685.8A priority Critical patent/CN110908882A/en
Publication of CN110908882A publication Critical patent/CN110908882A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3428Benchmarking

Landscapes

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

Abstract

The disclosure discloses a performance analysis method and device of an application program, terminal equipment and a medium. The method comprises the following steps: after the application program is started, injecting a performance analysis file; modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function; acquiring the operation information at a position corresponding to the target address information, wherein the operation information is information acquired in the target function execution process; and performing performance analysis on the application program based on the operation information. By using the method, the application program performance can be analyzed.

Description

Performance analysis method and device of application program, terminal equipment and medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and in particular relates to a method and a device for analyzing performance of an application program, a terminal device and a medium.
Background
With the rapid development of computer technology, more and more applications are presented, and the requirements of users on the performance of the applications are higher and higher. The stronger performance can improve market share for applications. Performance analysis of the application is particularly important.
However, at present, it is difficult to analyze the performance of the application program, for example, when analyzing the application program with unknown source code, it needs to use a decompiled code to implement, and the decompiled code is difficult to read, thereby increasing the difficulty of analyzing the performance of the application program.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for analyzing performance of an application program, a terminal device and a medium, which can effectively realize analysis of performance of the application program.
In a first aspect, an embodiment of the present disclosure provides a performance analysis method for an application program, including:
after the application program is started, injecting a performance analysis file;
modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function;
acquiring the operation information at a position corresponding to the target address information, wherein the operation information is information acquired in the target function execution process;
and performing performance analysis on the application program based on the operation information.
In a second aspect, an embodiment of the present disclosure further provides an apparatus for analyzing performance of an application program, including:
the injection module is used for injecting the performance analysis file after the application program is started;
the modification module is used for modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function;
an obtaining module, configured to obtain the operation information at a position corresponding to the target address information, where the operation information is information obtained in an execution process of the target function;
and the analysis module is used for carrying out performance analysis on the application program based on the operation information.
In a third aspect, an embodiment of the present disclosure further provides a terminal device, including:
one or more processing devices;
storage means for storing one or more programs;
the one or more programs are executed by the one or more processing devices, so that the one or more processing devices implement the methods provided by the embodiments of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a computer readable medium, on which a computer program is stored, which when executed by a processing device implements the method provided by the disclosed embodiments.
The embodiment of the disclosure provides a method, a device, a terminal device and a medium for analyzing the performance of an application program, wherein a performance analysis file is injected after the application program is started; secondly, modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function; then, the operation information is obtained at the position corresponding to the target address information, and the operation information is obtained in the target function execution process; and finally, performing performance analysis on the application program based on the operation information. By utilizing the technical scheme, the application program performance can be analyzed.
Drawings
Fig. 1 is a schematic flowchart of a performance analysis method for an application according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a performance analysis method of an application according to a second embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an application performance analysis apparatus according to a third embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution. Furthermore, the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
Example one
Fig. 1 is a flowchart illustrating a performance analysis method for an application according to an embodiment of the present disclosure, where the method is applicable to a situation where performance of the application is analyzed, for example, performance of the application whose source code is unknown is analyzed. The reason for the source code of the application being unknown is not limited, such as the source code being lost or corrupted. The method may be performed by a performance analysis apparatus of an application, wherein the apparatus may be implemented by software and/or hardware, and is generally integrated on a terminal device, and in this embodiment, the terminal device includes but is not limited to: mobile phones, computers, personal digital assistants, and the like.
As shown in fig. 1, a method for analyzing performance of an application according to a first embodiment of the present disclosure includes the following steps:
and S110, injecting a performance analysis file after the application program is started.
In this embodiment, the application program may be a program to be analyzed for performance, which is written for the purpose of completing a certain application. The embodiment can trigger performance analysis after the application program is started.
Specifically, after the application program is started, the performance of the application program can be analyzed by injecting a performance analysis file in this step. The performance analysis file modifies the original address information of the corresponding objective function based on the performance to be analyzed. After the original address information is modified, corresponding operation information can be read from the modified address information to complete the analysis of the corresponding performance. The performance analysis file can be understood as a file which is required to be injected in the application program and is used for completing the application program, and performance analysis of the application program can be realized based on the performance analysis file.
Different performance corresponds to different objective functions, and different objective functions generate different operation information in the execution process. The performance analysis file may store identification information corresponding to performance to be analyzed, where the identification information is used to identify the objective function. The objective function may be understood as a function of monitoring required for performance analysis of the application. Different target functions can be monitored by analyzing different performances, and the corresponding relation of the target functions and the target functions can be predetermined. The determination means is not limited, and the correspondence relationship between the two may be a correspondence relationship common when writing the application program.
The specific means for injecting the performance analysis file is not limited herein, as long as the injected performance analysis file can modify the original address information of the objective function. Under different operating systems, the technical means for injecting the performance analysis file may be different, and those skilled in the art may determine the injection means according to the actual analysis situation. Such as injection of performance analysis files via a process tracking function.
Taking an android system as an example, the injection of the performance analysis file is realized through a process tracking function ptrace. The process tracking function may implement a method in which one process (e.g., an injected performance analysis file) monitors another process, i.e., a target process, and the performance analysis file may detect and change data in a memory and a register of the target process to implement performance analysis of the application.
Specifically, the performance analysis file may be attached to the target process, and after the target process is started, the performance analysis file may be triggered to be executed. The embodiment can realize the attachment of the target process through the process tracking function. The target process is not limited, and the target process to be attached may be determined according to the performance to be analyzed, for example, the target process is a main process of the application. In a multi-threaded process, each thread may be attached to a target process.
The purpose of injecting performance analysis through the process tracking function is to let the target process trigger the execution of a performance analysis file and to modify the code and data of the target process. The process tracking function may inject the filler data shellcode into the memory space of the target process and then load the performance analysis file by executing the shellcode. The shellcode injection is implemented by putting the operation of a dynamic link library, such as a dlopen/dlsym library function, into the shellcode, and the injection is implemented by only applying for a memory of a performance analysis file, then modifying parameters used by the dlopen/dlsym library function in the shellcode, then directly injecting the shellcode into an application space, and executing the performance analysis file by modifying a register.
And S120, modifying the original address information of the target function under the target path into target address information based on the performance analysis file.
After the performance analysis file is injected, the analysis of the performance of the application program can be realized based on the performance analysis file. Specifically, after the performance analysis file is injected by being attached to the target process, the original address information of the target function corresponding to the performance to be analyzed of the performance analysis file can be directly modified into the target address information, and the modifying means is not limited, such as replacement.
The original address information of the target function may be located under the target path. The destination path is not limited herein, and a person skilled in the art may contract the destination path for storing the original address information.
The original address information is used for storing operation information of the target function, wherein the operation information can be information obtained in the execution process of the target function, and analysis of the performance of the application program can be realized based on the operation information.
Different target functions can be identified through different identification information, when original address information is modified, the original address information of the target functions can be determined based on the identification information, and then the determined original address information is replaced by the target address information. The target address information may be used as operation information of the target function, and address information of a location where the application program is actually stored when performing performance analysis. The present embodiment can acquire the operation information from the position corresponding to the target address information.
In one embodiment, the objective function comprises one of: reading a function, a database function and a life cycle function, wherein the reading function is used for generating operation information of a file and/or a page; the database function is used for generating operation information of the database; the lifecycle function is used to generate operational information for the application.
When different performances of the application program are analyzed, different objective functions can be operated. The modification of the original address information of the objective function in this embodiment can be regarded as monitoring the objective function, i.e. hook.
Illustratively, the read function can generate operation information of a file and/or a page in the running process, and the operation information of the file and/or the page can be obtained by monitoring the read function, so that the speed of opening and reading and writing the file and the speed performance of entering the page can be analyzed; the database function generates operation information of the database in the running process, and the operation information of the database can be obtained by monitoring the database function, so that the analysis of the speed performance of opening and reading and writing of the database is realized; the life cycle function generates the operation information of the application program in the running process, and the operation information of the application program can be obtained by monitoring the life cycle function, so that the analysis of the starting speed performance of the application program is realized.
In one embodiment, the target path is a path that can execute a Global Offset Table (GOT) table of the ELF file, i.e., a global offset table of the linkable format file.
In one embodiment, the number of the objective functions is at least one.
By setting the number of objective functions to be at least one, detection of multiple performances of the application program can be achieved. The number of objective functions is not limited and may be determined based on the performance to be analyzed. After the target function to be monitored is determined, the identification information of the target function can be added to the performance analysis file, so that the original address information of the target function can be modified.
S130, acquiring the operation information at the position corresponding to the target address information.
In one example, different target functions may have different target address information, and accordingly, this step may obtain operation information of the corresponding target function from a position indicated by the different target address information.
In one example, different target functions may correspond to the same target address information, and accordingly, this step may obtain corresponding operation information from the target address information based on the identification information of the target function.
The operation information is information obtained in the execution process of the objective function, the objective function is different, the content represented by the operation information is different, and a person skilled in the art can determine the content included by the operation information according to the actually analyzed performance. When analyzing the file opening speed, the operation information may include a time for triggering file opening and a time for actual file opening; as another example, when analyzing the application start speed, the operation information includes a time when the application is triggered to be opened and a time when the actual application is opened.
And S140, performing performance analysis on the application program based on the operation information.
After the operation information is acquired, the operation information can be processed in the step, so that the application program performance can be analyzed. The specific analysis means is not limited herein, and is determined based on the performance of the analysis required and the specific content included in the acquired operation information.
For example, when the operation information includes the time when the application is triggered to open and the time when the actual application is opened, this step may determine the application start speed by subtracting the time when the application is triggered to open from the time when the actual application is opened, so as to implement the analysis of the application start speed performance of the application program. When the operation information includes the time for triggering file opening and the time for actual file opening, the step may determine the file opening speed by subtracting the time for triggering file opening from the time for actual file opening, so as to implement analysis of the file opening speed performance.
In one embodiment, the analyzed performance includes at least one of: speed of file opening and reading and writing; the speed of the page entry; the speed of opening and reading and writing the database; application launch speed.
The files, pages and databases herein may be divided into different categories. The present embodiment may determine, in units of categories, corresponding speeds of each file, page, or database included in the category.
The performance analysis method for the application program provided by the embodiment of the disclosure includes firstly, injecting a performance analysis file after the application program is started; secondly, modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function; then, the operation information is obtained at the position corresponding to the target address information, and the operation information is obtained in the target function execution process; and finally, performing performance analysis on the application program based on the operation information. By the method, the application program performance can be analyzed.
Example two
Fig. 2 is a schematic flow chart of a performance analysis method of an application program according to a second embodiment of the present disclosure, which is embodied on the basis of various alternatives in the first embodiment. In this embodiment, the injection performance analysis file is further embodied as: the performance analysis file is injected by a process tracking function.
Further, in this embodiment, the original address information of the target function under the modified target path based on the performance analysis file is further embodied as target address information: determining identification information in the performance analysis file, wherein the identification information is used for identifying an objective function;
and modifying the original address information corresponding to the identification information under the target path into target address information.
Please refer to the first embodiment for a detailed description of the present embodiment.
As shown in fig. 2, a performance analysis method for an application program according to a second embodiment of the present disclosure includes the following steps:
and S210, injecting a performance analysis file through a process tracking function after the application program is started.
Illustratively, after the application program is started, the shellcode script is started, and is attached to a target process, such as an ActivityThread process, through a ptrace function, where the process is a main process of a virtual machine in which the application program is located, and a performance analysis file is loaded into a memory through mmap. And then continuing to modify the register through a ptrace () function so that the register executes the performance analysis file to finish the injection of the performance analysis file.
Mmap may be considered a method for mapping a file in a memory, and maps a file or other objects into the memory.
S220, determining identification information in the performance analysis file, wherein the identification information is used for identifying the target function.
When the original address information of the target function under the target path is modified to be the target address information based on the performance analysis file, the identification information included in the performance analysis file may be determined first, and then the original address information of the target function is determined based on the identification information. The identification information of different target functions may have a one-to-one correspondence with the original address information.
And S230, modifying the original address information corresponding to the identification information under the target path into target address information.
After the identification information is determined, the original address information corresponding to the identification information under the target path can be directly modified into the target address information in the step, so as to obtain the operation information of the target function.
S240, acquiring the operation information at the position corresponding to the target address information.
And S250, performing performance analysis on the application program based on the operation information.
The following exemplifies the present disclosure:
the performance analysis method for the application program provided by the disclosure can be regarded as an implementation scheme for performing performance analysis on the application program based on local monitoring, namely a native hook technology, and the source code of the application program can be unknown. At present, the performance analysis of an application program with unknown source codes is realized by adopting a decompilation mode. And inserting codes for performance analysis into the decompiled codes, and then signing, packaging and installing. The technical problem of the technical means is that the decompiled code is difficult to read and insert the code for performance analysis into the decompiled code, so that the performance analysis of the application program is difficult.
Taking the android system as an example, the embodiment attaches to the target process of the application program through a ptrace () function after the application program is started. That is, after the application program is started, a suitable position is found, and then ptrace is attached to the process to be detected, so that the performance of the application program can be monitored in a hook manner.
In the whole compiling, linking, packaging and installing process, all application programs share the dynamic link, for example, different applications have file reading operation, namely read (), after the dynamic link is completed, the address of the read () in the virtual memory space is determined, the address is located in the GOT table of the ELF file in the memory, then the address of the read () is found in the GOT table and is modified into the address of the injected function (namely, the performance analysis file), and then the operation information of the file read () can be obtained, so that the performance monitoring can be carried out.
For example, after the application program is started, the shellcode script is attached to the target process through the ptrace function, and the my. So, we do the injection of the so file by continuing to modify the register with the ptrace () function so that it executes the inject () function in my. So as to monitor the performance of the read () function in libjavacore, the performance analysis file, such as the input () function, modifies the address of the read () function in the GOT table of the ELF file in the memory, so that the parameter information of all the read () functions can be taken to perform performance detection.
In this embodiment, after the performance analysis file is injected, the elf file hook is performed to acquire execution information (i.e., operation information) of specific methods such as file operation and database operation, thereby implementing monitoring. The method can monitor the size and speed of file opening and reading and writing, the opening and reading and writing speed of a database such as sqlite, the application starting speed, the page entering speed, the fluency and other performance data. By monitoring the data, the vulnerability of the application program to be improved can be determined. For example, the performance analysis method of the application program according to this embodiment may specifically indicate where a problem occurs in the application program, such as being able to determine whether the existing problem is caused by a large amount of database query data, or caused by a time-consuming task performed when the application is started, or caused by repeatedly reading the same file.
The embodiment monitors the position causing the performance bottleneck, namely, the embodiment monitors the process, namely the process of running the application program, so as to analyze the performance of the application program, and improve the performance of the application program.
The performance analysis method for the application program provided by the second embodiment of the disclosure embodies the operation of injecting the performance analysis file and modifying the original address information after the application program is started. By using the method, after the application program is started, the performance analysis file is injected, and then the original address information of the target function is modified based on the identification information in the performance analysis file, so that the analysis of the performance of the application program is completed, and the efficiency of the performance analysis of the application program is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an apparatus for analyzing performance of an application according to a third embodiment of the present disclosure, where the apparatus is applicable to a situation where performance of an application is analyzed, for example, performance of an application with unknown source code is analyzed. The reason for the source code of the application being unknown is not limited, such as the source code being lost or corrupted. Wherein the means can be implemented by software and/or hardware and are typically integrated on the terminal device.
As shown in fig. 3, the apparatus includes: an injection module 31, a modification module 32, an acquisition module 33 and an analysis module 34;
the injection module 31 is configured to inject a performance analysis file after the application program is started;
a modification module 32, configured to modify, based on the performance analysis file, original address information of a target function in a target path to be target address information, where the original address information is used to store operation information of the target function;
an obtaining module 33, configured to obtain the operation information at a position corresponding to the target address information, where the operation information is obtained in an execution process of the target function;
and the analysis module 34 is used for performing performance analysis on the application program based on the operation information.
In this embodiment, the apparatus firstly injects a performance analysis file after the application program is started through the injection module 31; secondly, modifying original address information of the target function under the target path into target address information by a modifying module 32 based on the performance analysis file, wherein the original address information is used for storing operation information of the target function; then, the operation information is obtained at the position corresponding to the target address information through an obtaining module 33, and the operation information is obtained in the process of executing the target function; finally, the performance of the application is analyzed by the analysis module 34 based on the operation information.
The embodiment provides a performance analysis device for an application program, which can realize the analysis of the performance of the application program.
Further, the objective function includes one of: reading a function, a database function and a life cycle function, wherein the reading function is used for generating operation information of a file and/or a page; the database function is used for generating operation information of the database; the lifecycle function is used to generate operational information for the application.
Further, the number of the objective functions is at least one.
Further, the modification module 32 is specifically configured to:
determining identification information in the performance analysis file, wherein the identification information is used for identifying an objective function;
and modifying the original address information corresponding to the identification information under the target path into target address information.
Further, the analyzed properties include at least one of: speed of file opening and reading and writing; the speed of the page entry; the speed of opening and reading and writing the database; application launch speed.
Further, the target path is a path of the global offset table executable with the linkable format file.
Further, the injection module 31 is specifically configured to: the performance analysis file is injected by a process tracking function.
The performance analysis device of the application program can execute the performance analysis method of the application program provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present disclosure. Fig. 4 shows a schematic structural diagram of a terminal device 400 suitable for implementing an embodiment of the present disclosure. The terminal Device 400 in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a vehicle mounted terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a digital TV, a desktop computer, etc. The terminal device 400 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the terminal device 400 may include one or more processing means (e.g., a central processing unit, a graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. One or more processing devices 401 implement the methods as provided by the present disclosure. In the RAM403, various programs and data necessary for the operation of the terminal apparatus 400 are also stored. The processing device 401, the ROM402, and the RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408, including, for example, magnetic tape, hard disk, etc., storage 408 for storing one or more programs; and a communication device 409. The communication means 409 may allow the terminal device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 illustrates a terminal apparatus 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer-readable medium may be contained in the terminal device 400; or may exist separately without being assembled into the terminal device 400.
The computer-readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device 400 to: after the application program is started, injecting a performance analysis file;
modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function;
acquiring the operation information at a position corresponding to the target address information, wherein the operation information is information acquired in the target function execution process;
and performing performance analysis on the application program based on the operation information.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the name of a module in some cases does not constitute a limitation on the module itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Example 1 provides a performance analysis method of an application program, according to one or more embodiments of the present disclosure, including:
after the application program is started, injecting a performance analysis file;
modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function;
acquiring the operation information at a position corresponding to the target address information, wherein the operation information is information acquired in the target function execution process;
and performing performance analysis on the application program based on the operation information.
Example 2 the method of example 1, the objective function comprising one of: reading a function, a database function and a life cycle function, wherein the reading function is used for generating operation information of a file and/or a page; the database function is used for generating operation information of the database; the lifecycle function is used to generate operational information for the application.
Example 3 the method of example 1, the number of objective functions being at least one, according to one or more embodiments of the present disclosure.
Example 4 the method of example 1, the modifying original address information of an objective function in a target path to target address information based on the performance analysis file, comprising:
determining identification information in the performance analysis file, wherein the identification information is used for identifying an objective function;
and modifying the original address information corresponding to the identification information under the target path into target address information.
Example 5 in accordance with one or more embodiments of the present disclosure, the performance of the analysis includes at least one of: speed of file opening and reading and writing; the speed of the page entry; the speed of opening and reading and writing the database; application launch speed.
And after adjustment, the number of the layers occupied by each control is determined by the number of the categories occupied by the category information of each control.
Example 6 the method of example 1, the target path being a path that can execute a global offset table with a linkable format file.
Example 7 the method of example 1, the injecting a performance analysis file, according to one or more embodiments of the present disclosure, comprising:
the performance analysis file is injected by a process tracking function.
Example 8 provides, according to one or more embodiments of the present disclosure, a performance analysis apparatus of an application program, including:
the injection module is used for injecting the performance analysis file after the application program is started;
the modification module is used for modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function;
an obtaining module, configured to obtain the operation information at a position corresponding to the target address information, where the operation information is information obtained in an execution process of the target function;
and the analysis module is used for carrying out performance analysis on the application program based on the operation information.
Example 9 provides, in accordance with one or more embodiments of the present disclosure, a terminal device, comprising:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the method of any of examples 1-7.
Example 10 provides a computer-readable medium having stored thereon a computer program that, when executed by a processing apparatus, implements the method of any of examples 1-7, in accordance with one or more embodiments of the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (10)

1. A method for analyzing performance of an application program, comprising:
after the application program is started, injecting a performance analysis file;
modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function;
acquiring the operation information at a position corresponding to the target address information, wherein the operation information is information acquired in the target function execution process;
and performing performance analysis on the application program based on the operation information.
2. The method of claim 1, wherein the objective function comprises one of: reading a function, a database function and a life cycle function, wherein the reading function is used for generating operation information of a file and/or a page; the database function is used for generating operation information of the database; the lifecycle function is used to generate operational information for the application.
3. The method of claim 1, wherein the number of objective functions is at least one.
4. The method of claim 1, wherein modifying the original address information of the target function in the target path to the target address information based on the performance analysis file comprises:
determining identification information in the performance analysis file, wherein the identification information is used for identifying an objective function;
and modifying the original address information corresponding to the identification information under the target path into target address information.
5. The method of claim 1, wherein the analyzed performance includes at least one of: speed of file opening and reading and writing; the speed of the page entry; the speed of opening and reading and writing the database; application launch speed.
6. The method of claim 1, wherein the target path is a path that can execute a global offset table with linkable format files.
7. The method of claim 1, wherein the injection performance analysis file comprises:
the performance analysis file is injected by a process tracking function.
8. An apparatus for analyzing performance of an application program, comprising:
the injection module is used for injecting the performance analysis file after the application program is started;
the modification module is used for modifying original address information of a target function under a target path into target address information based on the performance analysis file, wherein the original address information is used for storing operation information of the target function;
an obtaining module, configured to obtain the operation information at a position corresponding to the target address information, where the operation information is information obtained in an execution process of the target function;
and the analysis module is used for carrying out performance analysis on the application program based on the operation information.
9. A terminal device, comprising:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the method of any of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the method according to any one of claims 1-7.
CN201911112685.8A 2019-11-14 2019-11-14 Performance analysis method and device of application program, terminal equipment and medium Pending CN110908882A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911112685.8A CN110908882A (en) 2019-11-14 2019-11-14 Performance analysis method and device of application program, terminal equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911112685.8A CN110908882A (en) 2019-11-14 2019-11-14 Performance analysis method and device of application program, terminal equipment and medium

Publications (1)

Publication Number Publication Date
CN110908882A true CN110908882A (en) 2020-03-24

Family

ID=69817350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911112685.8A Pending CN110908882A (en) 2019-11-14 2019-11-14 Performance analysis method and device of application program, terminal equipment and medium

Country Status (1)

Country Link
CN (1) CN110908882A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111460020A (en) * 2020-04-02 2020-07-28 北京字节跳动网络技术有限公司 Method, apparatus, electronic device and medium for parsing message
WO2022199282A1 (en) * 2021-03-24 2022-09-29 北京字节跳动网络技术有限公司 Thread snapshot parsing method and apparatus, device, and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677550A (en) * 2015-12-29 2016-06-15 广州华多网络科技有限公司 Performance acquisition-analysis method, device and system based on Linux system
CN108415739A (en) * 2018-02-28 2018-08-17 腾讯科技(深圳)有限公司 A kind of the hook method, apparatus and storage medium of Dynamic Link Library Function
WO2019095968A1 (en) * 2017-11-20 2019-05-23 华为技术有限公司 Dynamic loading method, and target file producing method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677550A (en) * 2015-12-29 2016-06-15 广州华多网络科技有限公司 Performance acquisition-analysis method, device and system based on Linux system
WO2019095968A1 (en) * 2017-11-20 2019-05-23 华为技术有限公司 Dynamic loading method, and target file producing method and apparatus
CN108415739A (en) * 2018-02-28 2018-08-17 腾讯科技(深圳)有限公司 A kind of the hook method, apparatus and storage medium of Dynamic Link Library Function

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111460020A (en) * 2020-04-02 2020-07-28 北京字节跳动网络技术有限公司 Method, apparatus, electronic device and medium for parsing message
CN111460020B (en) * 2020-04-02 2023-09-08 抖音视界有限公司 Method, device, electronic equipment and medium for resolving message
WO2022199282A1 (en) * 2021-03-24 2022-09-29 北京字节跳动网络技术有限公司 Thread snapshot parsing method and apparatus, device, and storage medium

Similar Documents

Publication Publication Date Title
CN109726067B (en) Process monitoring method and client device
CN110502357B (en) Stack backtracking method, device, medium and equipment
CN110196795B (en) Method and related device for detecting running state of mobile terminal application
CN113449310A (en) Application program vulnerability detection method, device and equipment
CN110673986A (en) Memory operation abnormity capturing method, device, terminal and storage medium
US20120054724A1 (en) Incremental static analysis
CN110908882A (en) Performance analysis method and device of application program, terminal equipment and medium
US8769498B2 (en) Warning of register and storage area assignment errors
CN113946803A (en) Method and device for automatic bypass by having anti-debugging mechanism for target program
CN112650521B (en) Software development kit SDK thermal restoration method and device and electronic equipment
CN111506904B (en) Method and device for online bug repair
US9064042B2 (en) Instrumenting computer program code by merging template and target code methods
CN111385661B (en) Method, device, terminal and storage medium for voice control of full screen playing
CN111414308A (en) Application package processing method and application program running method and device
CN111124627A (en) Method, device, terminal and storage medium for determining application program caller
CN112379967B (en) Simulator detection method, device, equipment and medium
CN110858143A (en) Installation package generation method, device, equipment and storage medium
CN111796865B (en) Byte code file modification method, device, terminal equipment and medium
CN114489698A (en) Application program installation method and device
CN111309323A (en) Parameter initialization method and device and electronic equipment
CN111273967A (en) Remote hook setting method and device suitable for Android system and electronic equipment
CN111209225B (en) Method, device, medium and electronic equipment for acquiring real address
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable medium
CN111625432B (en) Page loading time consumption determination method and device and computer readable storage medium
CN117667645A (en) Application testing method, device, equipment, system and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230420

Address after: Room 802, Information Building, 13 Linyin North Street, Pinggu District, Beijing, 101299

Applicant after: Beijing youzhuju Network Technology Co.,Ltd.

Address before: No. 715, 7th floor, building 3, 52 Zhongguancun South Street, Haidian District, Beijing 100081

Applicant before: Beijing infinite light field technology Co.,Ltd.