CN105426310A - Method and apparatus for detecting performance of target process - Google Patents

Method and apparatus for detecting performance of target process Download PDF

Info

Publication number
CN105426310A
CN105426310A CN201510850213.8A CN201510850213A CN105426310A CN 105426310 A CN105426310 A CN 105426310A CN 201510850213 A CN201510850213 A CN 201510850213A CN 105426310 A CN105426310 A CN 105426310A
Authority
CN
China
Prior art keywords
class
target process
target
hook
goal approach
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510850213.8A
Other languages
Chinese (zh)
Other versions
CN105426310B (en
Inventor
冯刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510850213.8A priority Critical patent/CN105426310B/en
Publication of CN105426310A publication Critical patent/CN105426310A/en
Application granted granted Critical
Publication of CN105426310B publication Critical patent/CN105426310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing

Landscapes

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

Abstract

Embodiments of the invention provide a method and an apparatus for detecting the performance of a target process. The method comprises: when the target process is started, hooking a target method of a target class in the target process; sending a performance data collection instruction to the target process; and reading performance data of the hooked target method of the target class, collected by the target process according to the collection instruction. According to the embodiments of the invention, a granularity monitoring policy is realized; as the monitoring granularity is controllable, the test performance is controllable; hot spots in the process can be accurately positioned, the performance bottleneck can be conveniently found out, and the test efficiency is improved; and it is not required to make any change for a tested object, so that the stability of the tested object is ensured.

Description

A kind of method and apparatus detecting the performance of target process
Technical field
The present invention relates to the technical field of computer disposal, particularly relate to and a kind ofly detect the method for the performance of target process and a kind of device detecting the performance of target process.
Background technology
In the life cycle model of application, these stages of demand analysis, design, coding, test and operation maintenance are all fundamentals wherein.
In order to verify whether application reaches the performance index of user's proposition, finding the performance bottleneck existed in application simultaneously, playing the object optimized and apply, usually can test application Progressive symmetric erythrokeratodermia.
When traditional performance test, develop the complete application of complete or basic exploitation for one, tester uses one or more performance testing tool, in the mode of Reality simulation user behavior of trying one's best, concurrent operations is carried out to this software, collect and the result of more different scene, then the performance of software is analyzed.
In some performance testing tool, the emphasis of performance test is the performance monitoring of whole system, and testing efficiency is lower, is difficult to the bottleneck finding out performance.
In some performance testing tool, often need to add certain code in measurand, destroy the stability of measurand.
Summary of the invention
In view of the above problems, propose the present invention in case provide a kind of overcome the problems referred to above or solve the problem at least in part a kind ofly detect the method for the performance of target process and corresponding a kind of device detecting the performance of target process.
According to one aspect of the present invention, provide a kind of method detecting the performance of target process, comprising:
When target process starts, hook Hook is carried out to the goal approach of target class in described target process;
To the collection instruction of described target process sending performance data;
Read described target process according to described collection instruction acquisition, by the performance data of goal approach of the target class of hook Hook.
Alternatively, also comprise:
The executable file of target process is read by tool processes;
The goal approach of according to target class is identified in described executable file;
By the data file that the title of the title of described target class, described goal approach will write in public directory belonging to tool processes.
Alternatively, describedly the goal approach of target class in described target process carried out linking up with the step of Hook comprise:
Read the public directory belonging to tool processes;
When the data file relevant to target process being detected, from described data file, read the title of target class, the title of goal approach;
According to the title of described target class, the title of described goal approach, hook Hook is carried out to the goal approach of target class.
Alternatively, the step of the described collection instruction to described target process sending performance data comprises:
By the collection instruction of Intent mechanism to described target process sending performance data.
Alternatively, the described target process of described reading according to described collection instruction acquisition, comprised by the step of performance data of the goal approach of the target class of hook Hook:
When described target process run Activity OnCreate method, receive the collection instruction of performance data by Intent mechanism time, read returned by described target process, by the performance data of goal approach of the target class of hook Hook.
Alternatively, the described target process of described reading according to described collection instruction acquisition, comprised by the step of performance data of the goal approach of the target class of hook Hook:
From the public directory belonging to tool processes, read that described target process stores according to described collection instruction, by the performance data of goal approach of the target class of hook Hook.
Alternatively, the described goal approach of described target class comprises:
The rewrite method of component class, the run method of thread class;
Or,
The rewrite method of component class, the rewrite method of derived class, public method, the run method of thread class;
Or,
Rewrite method, the public method of non-self-defining class;
Or,
All methods of all classes.
Alternatively, described performance data comprises following one or more:
Call number, operation duration.
According to a further aspect in the invention, provide a kind of device detecting the performance of target process, comprising:
Hooking module, is suitable for when target process starts, and carries out hook Hook to the goal approach of target class in described target process;
Collect instruction sending module, be suitable for the collection instruction to described target process sending performance data;
Performance data read module, be suitable for reading described target process according to described collection instruction acquisition, by the performance data of the goal approach of the target class of hook Hook.
Alternatively, also comprise:
Executable file read module, is suitable for the executable file being read target process by tool processes;
Goal approach identification module, is suitable for the goal approach identifying according to target class in described executable file;
Data file writing module, is suitable for the data file title of the title of described target class, described goal approach will write in public directory belonging to tool processes.
Alternatively, described Hooking module is also suitable for:
Read the public directory belonging to tool processes;
When the data file relevant to target process being detected, from described data file, read the title of target class, the title of goal approach;
According to the title of described target class, the title of described goal approach, hook Hook is carried out to the goal approach of target class.
Alternatively, described collection instruction sending module is also suitable for:
By the collection instruction of Intent mechanism to described target process sending performance data.
Alternatively, described performance data read module is also suitable for:
When described target process run Activity OnCreate method, receive the collection instruction of performance data by Intent mechanism time, read returned by described target process, by the performance data of goal approach of the target class of hook Hook.
Alternatively, described performance data read module is also suitable for:
From the public directory belonging to tool processes, read that described target process stores according to described collection instruction, by the performance data of goal approach of the target class of hook Hook.
Alternatively, the described goal approach of described target class comprises:
The rewrite method of component class, the run method of thread class;
Or,
The rewrite method of component class, the rewrite method of derived class, public method, the run method of thread class;
Or,
Rewrite method, the public method of non-self-defining class;
Or,
All methods of all classes.
Alternatively, described performance data comprises following one or more:
Call number, operation duration.
The embodiment of the present invention is by the goal approach of target class in Hook target process, the performance data of goal approach in target class can be obtained exactly, achieve a point granularity monitoring strategies, because monitoring granularity can control, therefore, test performance is controlled, not only can the focus of precise positioning process inside, conveniently find out performance bottleneck, improve testing efficiency, and without the need to doing any change to measurand, ensure that the stability of measurand.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows a kind of according to an embodiment of the invention flow chart of steps detecting the embodiment of the method 1 of the performance of target process;
Fig. 2 shows a kind of according to an embodiment of the invention flow chart of steps detecting the embodiment of the method 2 of the performance of target process; And
Fig. 3 shows a kind of according to an embodiment of the invention structured flowchart detecting the device embodiment of the performance of target process.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
With reference to Fig. 1, show a kind of according to an embodiment of the invention flow chart of steps detecting the embodiment of the method 1 of the performance of target process, specifically can comprise the steps:
Step 101, when target process starts, carries out hook Hook to the goal approach of target class in described target process;
It should be noted that, the embodiment of the present invention can be applied in various mobile device, such as, and mobile phone, panel computer, personal digital assistant, wearable device (as glasses, wrist-watch etc.) etc.
The operating system of this mobile device can comprise Android (Android), IOS, WindowsPhone, Windows etc., usually supports the operation of various application, as shooting application, immediate communication tool, map application etc.
Be applied in operational process, carry out activity with process (process), namely process is the example of the program run.
In actual applications, owing to being made up of java class the application of java language development, the implementation of application is then made up of the method in java class, therefore, to the monitoring of application performance, method can carry out hook Hook according to actual needs, be converted to the monitoring to method.
Hook is the method for kidnapping certain process in process and controlling.Such as, assumption method A is the original goal approach in target class, the address of goal approach A is replaced to the address of method B, during operation by manner of execution B no longer performance objective method A, this process is called Hook.
It should be noted that, target process is for monitored, and it is carried out the process of performance monitoring, and goal approach is also for monitored, and it is the method needing to carry out performance monitoring.
Generally speaking, the method that application comprises is a lot, and the method itself performing Hook has cost, if distinguish whole Hook so do not add, the error of performance monitoring can be made to increase, so, in some cases, a part of method can be got rid of, the method that Hook is more crucial.
In embodiments of the present invention, the class in android system can being applied is defined as following several:
1, application component class
Such as, from the class that the Android framework composition classes such as Activity, Service, ContentProvider, BroadcastReceiver derive from, or the class of assembly relevant interface is realized, as the click etc. of button.
The performance that directly represent application consuming time of method in these classes.
2, Android derived class
Non-Android component class, but be the class in Android framework, as SQLiteOpenHelper, Bundle, View etc., the derived class of these classes or realize the class of relevant interface, can referred to as derived class.
3, thread class
Derived from by the Thread class of Java, or realize the class of Runnable interface.
The execution time of thread is also one of main project of performance test.
4, inner java class
By the class of derivations all kinds of in JavaSDK (SoftwareDevelopmentKit, SDK (Software Development Kit)), as the class derived from from classes such as HashMap, List.
5, self defined class
Do not derive from and the class of unrealized any system interface from any class, and the subclass of these classes.
Namely in the embodiment of the present invention, can by each class in target process by above 5 kinds of classification, provide by the granularity of different stage the method that target process needs Hook.
Inner java class, self defined class are outside Android framework, in the method for application component class, derived class or thread class, often call the object of these classes, so the performance of these classes finally can be reflected in the method for component class or thread class, therefore, the method for these classes can suitably be ignored.
And also can directly ignore for abstract class, interface, the class of enumerating the performances such as class irrelevant.
Furthermore, the goal approach of target class can comprise:
The rewrite method of component class, the run method of thread class;
Key method in component class is all rewriting (Override) method of its base class, as the OnCreate method, the OnReceive method of BroadcastReceiver class, the OnItemClick method of OnItemClickListener interface etc. of Activity class, these rewrite methods are application critical process when performing, the implementation of implementation namely these methods of an application.
Run method in thread class is also rewrite method, the time of the time that run method performs i.e. thread execution.
Or,
The rewrite method of component class, the rewrite method of derived class, public method (method of namely being modified by public), the run method of thread class;
Or,
Rewrite method, the public method of non-self-defining class;
Or,
All methods of all classes.
Certainly, just exemplarily, when implementing the embodiment of the present invention, can arrange other target class and goal approach according to actual conditions, the embodiment of the present invention is not limited this for above-mentioned target class and goal approach.In addition, except above-mentioned target class and goal approach, those skilled in the art can also adopt other target class and goal approach according to actual needs, and the embodiment of the present invention is not also limited this.
Step 102, to the collection instruction of described target process sending performance data;
In specific implementation, can the collection instruction of target process sending performance data, namely the performance data of the goal approach of target class is collected in instruction.
Step 103, read described target process according to described collection instruction acquisition, by the performance data of goal approach of the target class of hook Hook.
If target process receives collection instruction, then can read its performance data and respond.
In specific implementation, performance data can comprise following one or more:
Call number, operation duration.
Assumption method A is the original goal approach in target class, if the operation duration of monitoring objective method A and call number, then goal approach A can be replaced to method B by the method for Hook.
Invocation target method A again in method B, recorded current system time t before invocation target method A 0, after method A returns, then system time time thus deducts t 0value, be exactly goal approach A perform duration.
And the call number of goal approach A is exactly the call number of method B, the call number of self can be recorded in method B.
Certainly, above-mentioned performance data just exemplarily, when implementing the embodiment of the present invention, can arrange other performance datas according to actual conditions, as CPU occupancy, EMS memory occupation amount, traffic consumes value, electric quantity consumption value etc., the embodiment of the present invention is not limited this.In addition, except above-mentioned performance data, those skilled in the art can also adopt other performance data according to actual needs, and the embodiment of the present invention is not also limited this.
The embodiment of the present invention is by the goal approach of target class in Hook target process, the performance data of goal approach in target class can be obtained exactly, achieve a point granularity monitoring strategies, because monitoring granularity can control, therefore, test performance is controlled, not only can the focus of precise positioning process inside, conveniently find out performance bottleneck, improve testing efficiency, and without the need to doing any change to measurand, ensure that the stability of measurand.
With reference to Fig. 2, show a kind of according to an embodiment of the invention flow chart of steps detecting the embodiment of the method 2 of the performance of target process, specifically can comprise the steps:
Step 201, is read the executable file of target process by tool processes;
If operating system is Android, then the embodiment of the present invention can be applied in Xposed framework.
In android system, the process of application is all hatched out by Zygote process, and Zygote process is by Init process initiation.
Zygote process can create a Dalvik virtual machine instance when starting, whenever the program process that its hatching one is new, this Dalvik virtual machine instance copies to inside new program process and goes by capital, thus makes each program process have an independently Dalvik virtual machine instance.
Xposed framework is a dynamic abduction project for Android platform, by replacement/system/bin/app_process programmed control zygote process, make app_process (process of application) load this jar of XposedBridge.jar in the first meeting of startup to wrap, thus complete the abduction of the Dalvik virtual machine to Zygote process and establishment thereof, so under Xposed framework, the behavior of each process at the beginning of starting can be controlled.
Therefore, in Xposed framework, can when not revising application installation kit APK designation method in Hook application installation kit APK, namely Xposed framework can allow target process complete Hook process to designation method when startup.
It should be noted that, tool processes is for monitoring, and it is the process of carrying out performance monitoring.
Step 202, identifies the goal approach of according to target class in described executable file;
For Android, based on the characteristic of the executable file (Dex file) self of application, tool processes can by the executable file of evaluating objects process, get the title of all classes in target process, and pass through each attribute of the reflex mechanism analysis classes of Java, attribute of the base class comprising class, the method comprised, method etc.
Step 203, by the data file that the title of the title of described target process, described goal approach will write in public directory belonging to tool processes;
Tool processes reads the executable file of target process, the granularity of specifying by user resolves the target class and the goal approach thereof that need Hook, the class name and method that need Hook are outputted to data file, this data file place catalogue is a sub-directory under tool processes own directory, tool processes is the readable authority of this catalogue and all users of following file opening, and this catalogue can be called public directory.
Step 204, by Xposed framework, makes each process read public directory belonging to tool processes when self starts;
Step 205, when the data file relevant to target process being detected, reads the title of target class, the title of goal approach from described data file;
Step 206, target process carries out hook Hook according to the title of described target class, the title of described goal approach to the goal approach of target class;
In specific implementation, utilizing behavior during Xposed intended target process initiation, reading the public directory of tool processes when starting, if find that there is the data file relevant with self, then read data files, and the goal approach that Hook residence has this document fixed.
Step 207, carries out various operation to target process, as user's input, and data base read-write etc., the target process after Hook can record the performance data of each operation;
Step 208, by the collection instruction of Intent mechanism to target process sending performance data;
Step 209, when described target process receives the collection instruction of performance data, read returned by described target process, by the performance data of goal approach of the target class of hook Hook, and performance data to be write in the file of public directory.
In embodiments of the present invention, the method for receiving tool process instruction can be implanted in the OnCreate method of Activity.
Collect the transmission of instruction, reception, can be realized by Intent mechanism.
Provide in Android Intent mechanism assist to apply between mutual and communication, Intent is responsible for action to single job in application, action relates to data, additional data is described.
Android, then according to the description of this Intent, is responsible for finding corresponding assembly, Intent is passed to the assembly called, and complete calling of assembly.
Intent not only can be used between application program, mutual between the Activity/Service that also can be used for application program inside.
Therefore, Intent plays a part a media mediation here, and the relevant information providing assembly to call mutually specially realizes the decoupling zero between caller and callee.
When tool processes sends the instruction of collecting performance data, under performance data can be write the public directory of tool processes by target process.
Then in embodiments of the present invention, tool processes can from the public directory belonging to tool processes, read that target process stores according to described collection instruction, by the performance data of goal approach of the target class of hook Hook, check that this file is maybe copied to SD (SecureDigitalMemoryCard) and blocks by this file.
For embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the embodiment of the present invention is not by the restriction of described sequence of movement, because according to the embodiment of the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and involved action might not be that the embodiment of the present invention is necessary.
With reference to Fig. 3, show a kind of according to an embodiment of the invention structured flowchart detecting the device embodiment of the performance of target process, specifically can comprise as lower module:
Hooking module 301, is suitable for when target process starts, and carries out hook Hook to the goal approach of target class in described target process;
Collect instruction sending module 302, be suitable for the collection instruction to described target process sending performance data;
Performance data read module 303, be suitable for reading described target process according to described collection instruction acquisition, by the performance data of the goal approach of the target class of hook Hook.
In a kind of embodiment of the present invention, this device can also comprise as lower module:
Executable file read module, is suitable for the executable file being read target process by tool processes;
Goal approach identification module, is suitable for the goal approach identifying according to target class in described executable file;
Data file writing module, is suitable for the data file title of the title of described target class, described goal approach will write in public directory belonging to tool processes.
In a kind of embodiment of the present invention, described Hooking module 301 can also be suitable for:
Read the public directory belonging to tool processes;
When the data file relevant to target process being detected, from described data file, read the title of target class, the title of goal approach;
According to the title of described target class, the title of described goal approach, hook Hook is carried out to the goal approach of target class.
In a kind of embodiment of the present invention, described collection instruction sending module 302 can also be suitable for:
By the collection instruction of Intent mechanism to target process sending performance data.
In a kind of embodiment of the present invention, described performance data read module 303 can also be suitable for:
When described target process run Activity OnCreate method, receive the collection instruction of performance data by Intent mechanism time, read returned by described target process, by the performance data of goal approach of the target class of hook Hook.
In a kind of embodiment of the present invention, described performance data read module 303 can also be suitable for:
From the catalogue belonging to tool processes, read that described target process stores according to described collection instruction, by the performance data of goal approach of the target class of hook Hook.
In specific implementation, the described goal approach of described target class comprises:
The rewrite method of component class, the run method of thread class;
Or,
The rewrite method of component class, the rewrite method of derived class, public method, the run method of thread class;
Or,
Rewrite method, the public method of non-self-defining class;
Or,
All methods of all classes.
In actual applications, described performance data comprises following one or more:
Call number, operation duration.
For device embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize the some or all parts in the equipment of the performance of the detection target process according to the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
The embodiment of the invention discloses A1, a kind of method detecting the performance of target process, comprising:
When target process starts, hook Hook is carried out to the goal approach of target class in described target process;
To the collection instruction of described target process sending performance data;
Read described target process according to described collection instruction acquisition, by the performance data of goal approach of the target class of hook Hook.
A2, method as described in A1, also comprise:
The executable file of target process is read by tool processes;
The goal approach of according to target class is identified in described executable file;
By the data file that the title of the title of described target class, described goal approach will write in public directory belonging to tool processes.
A3, method as described in A1 or A2, describedly comprise the step that the goal approach of target class in described target process carries out linking up with Hook:
Read the public directory belonging to tool processes;
When the data file relevant to target process being detected, from described data file, read the title of target class, the title of goal approach;
According to the title of described target class, the title of described goal approach, hook Hook is carried out to the goal approach of target class.
A4, method as described in A1, the step of the described collection instruction to described target process sending performance data comprises:
By the collection instruction of Intent mechanism to described target process sending performance data.
A5, method as described in A4, the described target process of described reading according to described collection instruction acquisition, comprised by the step of the performance data of the goal approach of the target class of hook Hook:
When described target process run Activity OnCreate method, receive the collection instruction of performance data by Intent mechanism time, read returned by described target process, by the performance data of goal approach of the target class of hook Hook.
A6, method as described in A1 or A2, the described target process of described reading according to described collection instruction acquisition, comprised by the step of the performance data of the goal approach of the target class of hook Hook:
From the public directory belonging to tool processes, read that described target process stores according to described collection instruction, by the performance data of goal approach of the target class of hook Hook.
A7, method as described in A1 or A2 or A4 or A5, the described goal approach of described target class comprises:
The rewrite method of component class, the run method of thread class;
Or,
The rewrite method of component class, the rewrite method of derived class, public method, the run method of thread class;
Or,
Rewrite method, the public method of non-self-defining class;
Or,
All methods of all classes.
A8, method as described in A1 or A2 or A4 or A5, described performance data comprises following one or more:
Call number, operation duration.
The embodiment of the invention discloses B9, a kind of device detecting the performance of target process, comprising:
Hooking module, is suitable for when target process starts, and carries out hook Hook to the goal approach of target class in described target process;
Collect instruction sending module, be suitable for the collection instruction to described target process sending performance data;
Performance data read module, be suitable for reading described target process according to described collection instruction acquisition, by the performance data of the goal approach of the target class of hook Hook.
B10, device as described in B9, also comprise:
Executable file read module, is suitable for the executable file being read target process by tool processes;
Goal approach identification module, is suitable for the goal approach identifying according to target class in described executable file;
Data file writing module, is suitable for the data file title of the title of described target class, described goal approach will write in public directory belonging to tool processes.
B11, device as described in B9 or B10, described Hooking module is also suitable for:
Read the public directory belonging to tool processes;
When the data file relevant to target process being detected, from described data file, read the title of target class, the title of goal approach;
According to the title of described target class, the title of described goal approach, hook Hook is carried out to the goal approach of target class.
B12, device as described in B9, described collection instruction sending module is also suitable for:
By the collection instruction of Intent mechanism to described target process sending performance data.
B13, device as described in B12, described performance data read module is also suitable for:
When described target process run Activity OnCreate method, receive the collection instruction of performance data by Intent mechanism time, read returned by described target process, by the performance data of goal approach of the target class of hook Hook.
B14, device as described in B9 or B10, described performance data read module is also suitable for:
From the public directory belonging to tool processes, read that described target process stores according to described collection instruction, by the performance data of goal approach of the target class of hook Hook.
B15, device as described in B9 or B10 or B12 or B13, the described goal approach of described target class comprises:
The rewrite method of component class, the run method of thread class;
Or,
The rewrite method of component class, the rewrite method of derived class, public method, the run method of thread class;
Or,
Rewrite method, the public method of non-self-defining class;
Or,
All methods of all classes.
B16, device as described in B9 or B10 or B12 or B13, described performance data comprises following one or more:
Call number, operation duration.

Claims (10)

1. detect a method for the performance of target process, comprising:
When target process starts, hook Hook is carried out to the goal approach of target class in described target process;
To the collection instruction of described target process sending performance data;
Read described target process according to described collection instruction acquisition, by the performance data of goal approach of the target class of hook Hook.
2. the method for claim 1, is characterized in that, also comprises:
The executable file of target process is read by tool processes;
The goal approach of according to target class is identified in described executable file;
By the data file that the title of the title of described target class, described goal approach will write in public directory belonging to tool processes.
3. method as claimed in claim 1 or 2, is characterized in that, describedly comprises the step that the goal approach of target class in described target process carries out linking up with Hook:
Read the public directory belonging to tool processes;
When the data file relevant to target process being detected, from described data file, read the title of target class, the title of goal approach;
According to the title of described target class, the title of described goal approach, hook Hook is carried out to the goal approach of target class.
4. the method for claim 1, is characterized in that, the step of the described collection instruction to described target process sending performance data comprises:
By the collection instruction of Intent mechanism to described target process sending performance data.
5. method as claimed in claim 4, is characterized in that, the described target process of described reading according to described collection instruction acquisition, comprised by the step of the performance data of the goal approach of the target class of hook Hook:
When described target process run Activity OnCreate method, receive the collection instruction of performance data by Intent mechanism time, read returned by described target process, by the performance data of goal approach of the target class of hook Hook.
6. method as claimed in claim 1 or 2, is characterized in that, the described target process of described reading according to described collection instruction acquisition, comprised by the step of the performance data of the goal approach of the target class of hook Hook:
From the public directory belonging to tool processes, read that described target process stores according to described collection instruction, by the performance data of goal approach of the target class of hook Hook.
7. the method as described in claim 1 or 2 or 4 or 5, it is characterized in that, the described goal approach of described target class comprises:
The rewrite method of component class, the run method of thread class;
Or,
The rewrite method of component class, the rewrite method of derived class, public method, the run method of thread class;
Or,
Rewrite method, the public method of non-self-defining class;
Or,
All methods of all classes.
8. the method as described in claim 1 or 2 or 4 or 5, is characterized in that, described performance data comprises following one or more:
Call number, operation duration.
9. detect a device for the performance of target process, comprising:
Hooking module, is suitable for when target process starts, and carries out hook Hook to the goal approach of target class in described target process;
Collect instruction sending module, be suitable for the collection instruction to described target process sending performance data;
Performance data read module, be suitable for reading described target process according to described collection instruction acquisition, by the performance data of the goal approach of the target class of hook Hook.
10. device as claimed in claim 9, is characterized in that, also comprise:
Executable file read module, is suitable for the executable file being read target process by tool processes;
Goal approach identification module, is suitable for the goal approach identifying according to target class in described executable file;
Data file writing module, is suitable for the data file title of the title of described target class, described goal approach will write in public directory belonging to tool processes.
CN201510850213.8A 2015-11-27 2015-11-27 A kind of method and apparatus for the performance for detecting target process Active CN105426310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510850213.8A CN105426310B (en) 2015-11-27 2015-11-27 A kind of method and apparatus for the performance for detecting target process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510850213.8A CN105426310B (en) 2015-11-27 2015-11-27 A kind of method and apparatus for the performance for detecting target process

Publications (2)

Publication Number Publication Date
CN105426310A true CN105426310A (en) 2016-03-23
CN105426310B CN105426310B (en) 2018-06-26

Family

ID=55504528

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510850213.8A Active CN105426310B (en) 2015-11-27 2015-11-27 A kind of method and apparatus for the performance for detecting target process

Country Status (1)

Country Link
CN (1) CN105426310B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657358A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Service proxy method and device for Android applications
CN107025173A (en) * 2017-04-05 2017-08-08 腾讯科技(深圳)有限公司 The method of testing and device of a kind of function timing
CN107092828A (en) * 2017-04-13 2017-08-25 深圳海云安网络安全技术有限公司 A kind of Android dynamic debuggings detection method
CN107943676A (en) * 2016-10-12 2018-04-20 腾讯科技(深圳)有限公司 The performance test data treating method and apparatus of application operating nonvolatile memory
CN108446216A (en) * 2018-02-05 2018-08-24 捷开通讯(深圳)有限公司 The method, apparatus and storage device of trace flow track
CN108809763A (en) * 2018-06-14 2018-11-13 武汉斗鱼网络科技有限公司 A kind of network performance parameter acquisition method, terminal installation and storage medium
CN109684219A (en) * 2018-12-26 2019-04-26 百度在线网络技术(北京)有限公司 System performance testing method, apparatus and storage medium
CN109726067A (en) * 2017-10-30 2019-05-07 腾讯科技(深圳)有限公司 A kind of process monitoring method and client device
CN109857650A (en) * 2019-01-14 2019-06-07 珠海金山网络游戏科技有限公司 A kind of game performance monitor method and system
CN111694724A (en) * 2019-03-15 2020-09-22 百度在线网络技术(北京)有限公司 Testing method and device of distributed table system, electronic equipment and storage medium
CN112148253A (en) * 2019-06-26 2020-12-29 北京达佳互联信息技术有限公司 Program generation method, Java object replacement method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414305A (en) * 2008-12-01 2009-04-22 浙大网新科技股份有限公司 Method for acquisition of PASS headspring information based on proceeding graininess and opening file aggregation
CN102890643A (en) * 2012-07-26 2013-01-23 上海交通大学 Resource scheduling system based on immediate feedback of application effect under display card virtualization
CN102959519A (en) * 2010-06-28 2013-03-06 现代自动车株式会社 System test apparatus
US20130086426A1 (en) * 2011-05-09 2013-04-04 Kia Motors Corporation Exception handling test device and method thereof
CN103825783A (en) * 2014-03-10 2014-05-28 珠海市君天电子科技有限公司 Test method and device
CN104951375A (en) * 2015-07-01 2015-09-30 北京博睿宏远科技发展有限公司 Mobile phone APP performance data collecting method based on function interception technology

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414305A (en) * 2008-12-01 2009-04-22 浙大网新科技股份有限公司 Method for acquisition of PASS headspring information based on proceeding graininess and opening file aggregation
CN102959519A (en) * 2010-06-28 2013-03-06 现代自动车株式会社 System test apparatus
US20130086426A1 (en) * 2011-05-09 2013-04-04 Kia Motors Corporation Exception handling test device and method thereof
CN102890643A (en) * 2012-07-26 2013-01-23 上海交通大学 Resource scheduling system based on immediate feedback of application effect under display card virtualization
CN103825783A (en) * 2014-03-10 2014-05-28 珠海市君天电子科技有限公司 Test method and device
CN104951375A (en) * 2015-07-01 2015-09-30 北京博睿宏远科技发展有限公司 Mobile phone APP performance data collecting method based on function interception technology

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943676B (en) * 2016-10-12 2020-10-30 腾讯科技(深圳)有限公司 Performance test data processing method and device for operating nonvolatile memory by application
CN107943676A (en) * 2016-10-12 2018-04-20 腾讯科技(深圳)有限公司 The performance test data treating method and apparatus of application operating nonvolatile memory
CN106657358A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Service proxy method and device for Android applications
CN107025173A (en) * 2017-04-05 2017-08-08 腾讯科技(深圳)有限公司 The method of testing and device of a kind of function timing
CN107025173B (en) * 2017-04-05 2021-08-31 腾讯科技(深圳)有限公司 Method and device for testing function execution time
CN107092828A (en) * 2017-04-13 2017-08-25 深圳海云安网络安全技术有限公司 A kind of Android dynamic debuggings detection method
CN109726067A (en) * 2017-10-30 2019-05-07 腾讯科技(深圳)有限公司 A kind of process monitoring method and client device
CN108446216A (en) * 2018-02-05 2018-08-24 捷开通讯(深圳)有限公司 The method, apparatus and storage device of trace flow track
CN108809763A (en) * 2018-06-14 2018-11-13 武汉斗鱼网络科技有限公司 A kind of network performance parameter acquisition method, terminal installation and storage medium
CN109684219A (en) * 2018-12-26 2019-04-26 百度在线网络技术(北京)有限公司 System performance testing method, apparatus and storage medium
CN109857650A (en) * 2019-01-14 2019-06-07 珠海金山网络游戏科技有限公司 A kind of game performance monitor method and system
CN109857650B (en) * 2019-01-14 2022-07-01 珠海金山网络游戏科技有限公司 Game performance monitoring method and system
CN111694724A (en) * 2019-03-15 2020-09-22 百度在线网络技术(北京)有限公司 Testing method and device of distributed table system, electronic equipment and storage medium
CN112148253A (en) * 2019-06-26 2020-12-29 北京达佳互联信息技术有限公司 Program generation method, Java object replacement method and device

Also Published As

Publication number Publication date
CN105426310B (en) 2018-06-26

Similar Documents

Publication Publication Date Title
CN105426310A (en) Method and apparatus for detecting performance of target process
KR101246623B1 (en) Apparatus and method for detecting malicious applications
Zhou et al. API deprecation: a retrospective analysis and detection method for code examples on the web
KR101699981B1 (en) Memory optimization of virtual machine code by partitioning extraneous information
CN107423048B (en) Data collection method, device, medium and computing equipment
CN107451474B (en) Software bug fixing method and device for terminal
CN105630463B (en) For detecting the method and device of JAR packet conflict
US20070089092A1 (en) Method and system for autonomically prioritizing software defects
CN102402479B (en) For the intermediate representation structure of static analysis
Kirbas et al. The relationship between evolutionary coupling and defects in large industrial software
CN105550104A (en) Application program performance test method and device
CN109471768B (en) Service problem monitoring method and device and electronic equipment
CN105224869A (en) Assembly test method and device
CN104679500B (en) Method and device for realizing automatic generation of entity class
CN105573915A (en) Test method and device based on code coverage rate
US9134975B1 (en) Determining which computer programs are candidates to be recompiled after application of updates to a compiler
CN107391362A (en) Application testing method, mobile terminal and storage medium
JP2010134643A (en) Test case selection method and selection system
CN105389262A (en) Method and device for generating test suggestions in allusion to interface tests
CN112506492B (en) Visual point burying method supporting dynamic scene configuration
CN105095077A (en) Automated testing method and device for user interfaces
CN105574150A (en) Data processing method and device
US10846206B2 (en) Adaptive software testing
CN115705250A (en) Monitoring stack usage to optimize programs
CN110941547A (en) Automatic test case library management method, device, medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220729

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right