CN108228448A - A kind of code tracking method and device - Google Patents

A kind of code tracking method and device Download PDF

Info

Publication number
CN108228448A
CN108228448A CN201611197658.1A CN201611197658A CN108228448A CN 108228448 A CN108228448 A CN 108228448A CN 201611197658 A CN201611197658 A CN 201611197658A CN 108228448 A CN108228448 A CN 108228448A
Authority
CN
China
Prior art keywords
target
function
acquisition
hot spot
code
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
CN201611197658.1A
Other languages
Chinese (zh)
Other versions
CN108228448B (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.)
China Mobile Communications Group Co Ltd
China Mobile Group Shandong Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Shandong 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 China Mobile Communications Group Co Ltd, China Mobile Group Shandong Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201611197658.1A priority Critical patent/CN108228448B/en
Publication of CN108228448A publication Critical patent/CN108228448A/en
Application granted granted Critical
Publication of CN108228448B publication Critical patent/CN108228448B/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/362Software debugging
    • G06F11/3628Software debugging of optimised code

Abstract

The embodiment of the invention discloses a kind of code tracking method and devices.This method includes:The data of pre-established plug-in unit acquisition are obtained, on the target process that the pre-established plug-in unit is attached to;Performance analysis of central issue is carried out, and determine target interface according to analysis result to the data got;In a production environment, slicing treatment is carried out to the target interface, extracts the corresponding usability of program fragments of performance hot spot;Under the test environment, described program segment acquisition approach tracking information in operating status is tracked.The embodiment of the present invention keeps apart from the code that magnanimity is run performance hot spot by using the mode of slice, and isolated operation under the test environment, with prior art ratio, without carrying out any code transformation to existing application, have the advantages that tracking accuracy is high, flexibility is strong.

Description

A kind of code tracking method and device
Technical field
The present embodiments relate to fields of communication technology, and in particular to a kind of code tracking method and device.
Background technology
When transaction application based on J2EE frameworks can realize operation by JVM Instrumentation (code instrument) Code injection selects to carry out code path tracking, and capture parameter and return value under the premise of not reprogramming original appearance, Operation maintenance personnel can be helped to be quickly found out performance hot spot, quickly to improve user experience.The carrier network of traditional mode at present Core transaction is mostly based on native applications realization, such as operates in the journey of the C/C++ exploitations on transaction middleware CICS or Tuxedo Sequence, it is difficult to injecting codes in environment at runtime, monitor particles degree also tends to interface level not drill down further into primary.
In face of native applications, existing technological means is to dissect frame (Basic by basic C++ codes instrument Instrumentation and Profiling Framework for C++) it realizes, by developing a series of inserting code (C ++ pretreatment is macro), selectivity is obtained with compiling of application into together.Generally caught using two macro completion function names and the ginseng that comes in and goes out It obtains, including a function entrance is macro and function outlet is macro, it is macro to be referred to as the outpost of the tax office.
During the embodiment of the present invention is realized, inventor has found that C++ codes instrument dissects frame and has very big defect:Such as Code retrofit work amount is big, can not be further to issuing for the dynamic base after operating system grade component call and some encapsulation Code path is dug, performance positioning granularity can only arrive function grade, cannot still arrive specific code grade.
Invention content
One purpose of the embodiment of the present invention is to solve the prior art in a large amount of code of needs for carrying out code tracking to change Work is made, and the precision tracked is relatively low.
The embodiment of the present invention proposes a kind of code tracking method, including:
The data of pre-established plug-in unit acquisition are obtained, the pre-established plug-in unit is attached on target process;
Performance analysis of central issue is carried out, and determine target interface according to analysis result to the data got;
In a production environment, slicing treatment is carried out to the target interface, extracts the corresponding usability of program fragments of performance hot spot;
Under the test environment, described program segment acquisition approach tracking information in operating status is tracked.
Optionally, before slicing treatment is carried out to the target interface, the method further includes:
According to the data acquisition target decanting point got;
Sensor is injected into the target decanting point, to obtain the transaction middleware interface parameters of the sensor acquisition Value.
Optionally, it is described that target interface progress slicing treatment is included:
Test case is generated according to the transaction middleware interface parameters value;
Business detection processing, the business are carried out to production isolation middleware and test middleware according to the test case It detects as from existing network service stream, data flow extraction procedure segment.
Optionally, the data acquisition target decanting point that the basis is got includes:
Choose the performance hot spot of least significant end in allocating stack;
The corresponding function of performance hot spot of selection is analyzed, and whether is had according to the function that analysis result judges to choose There is service attribute;
If so, whether discriminant function parameter can normal sequence and unserializing;
If so, whether discriminant function parameter is less than preset byte length threshold;
If so, choose the corresponding decanting point of function target decanting point the most.
Optionally, if judge to know selection function do not have service attribute or function parameter can not normal sequenceization and Unserializing or function parameter are greater than or equal to preset byte length threshold, then judge that there is no effectively notes in the function chosen Access point;
Build the derived class for the corresponding function parameter of performance hot spot chosen;
Clone's processing is carried out to the derived class, obtains clone's copy;
According to derived class sequencing method is preloaded, serializing processing acquisition is carried out to clone's copy and is efficiently injected into a little.
The embodiment of the present invention proposes a kind of code tracking device, including:
Acquisition module, for obtaining the data of pre-established plug-in unit acquisition, the pre-established plug-in unit is attached on target process;
Analysis module for carrying out performance analysis of central issue to the data got, and determines that target connects according to analysis result Mouthful;
Module is sliced, in a production environment, carrying out slicing treatment to the target interface, extracting performance hot spot pair The usability of program fragments answered;
Tracking module, under the test environment, tracking described program segment acquisition approach tracking in operating status Information.
Optionally, described device further includes:Searching module;
The searching module, for according to the data acquisition target decanting point got;Sensor is injected into the target Decanting point, to obtain the transaction middleware interface parameters value of the sensor acquisition.
Optionally, the slice module, for generating test case according to the transaction middleware interface parameters value;According to The test case carries out production isolation middleware and test middleware business detection processing, and the business detection is from existing net Business Stream, data flow extraction procedure segment.
Optionally, the searching module, for choosing the performance hot spot of least significant end in allocating stack;To the performance heat of selection The corresponding function of point is analyzed, and judges whether the function chosen has service attribute according to analysis result;If so, judge Whether function parameter can normal sequence and unserializing;If so, whether discriminant function parameter is less than preset byte length threshold Value;If so, choose the corresponding decanting point of function target decanting point the most.
Optionally, the searching module, if being additionally operable to the function for judging to know selection does not have service attribute or function Parameter can not normal sequence and unserializing or function parameter be greater than or equal to preset byte length threshold, then judge to choose Function in there is no being efficiently injected into a little;Build the derived class for the corresponding function parameter of performance hot spot chosen;To the derivation Class carries out clone's processing, obtains clone's copy;According to derived class sequencing method is preloaded, clone's copy is carried out at serializing Reason is obtained and is efficiently injected into a little.
As shown from the above technical solution, the code tracking method and device that the embodiment of the present invention proposes is by using slice Mode keeps apart performance hot spot from the code that magnanimity is run, and isolated operation under the test environment, and prior art ratio, Without carrying out any code transformation to existing application, have the advantages that tracking accuracy is high, flexibility is strong..
Description of the drawings
The features and advantages of the present invention can be more clearly understood by reference to attached drawing, attached drawing is schematically without that should manage It solves to carry out any restrictions to the present invention, in the accompanying drawings:
Fig. 1 shows a kind of flow diagram for code tracking method that one embodiment of the invention provides;
Fig. 2 shows a kind of principle schematics for code tracking method that one embodiment of the invention provides;
Fig. 3 shows the flow signal of selection decanting point in a kind of code tracking method that one embodiment of the invention provides Figure;
Fig. 4 a show that the flow that code slice is handled in a kind of code tracking method that one embodiment of the invention provides is shown It is intended to;
Fig. 4 b show the flow signal that middleware is called in a kind of code tracking method that one embodiment of the invention provides Figure;
Middleware is called in Fig. 5 a and a kind of code tracking method provided Figure 5b shows that another embodiment of the present invention Flow diagram;
Fig. 6 shows a kind of structure diagram for code tracking device that one embodiment of the invention provides;
Fig. 7 shows a kind of structure diagram for code tracking device that another embodiment of the present invention provides.
Specific embodiment
Purpose, technical scheme and advantage to make the embodiment of the present invention are clearer, below in conjunction with the embodiment of the present invention In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is The part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people Member's all other embodiments obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
Embodiment one
Fig. 1 shows a kind of flow diagram for code tracking method that one embodiment of the invention provides, should referring to Fig. 1 Method includes the following steps:
110th, the data of pre-established plug-in unit acquisition, the mesh run in the production environment that the pre-established plug-in unit is attached to are obtained In mark process;
It should be noted that into line code with tracking when, plug-in unit is attached to by production ring by JVM codes instrument first On target process when border is run;Then, when business is opened to the outside world, parameter and return value are captured, and then is performance hot spot point Analysis provides the support in data.
120th, performance analysis of central issue is carried out, and determine target interface according to analysis result to the data got;
It should be noted that based on the data obtained in step 110, sieved by pre-set criteria and determine target interface;
Wherein, the efficiency of transmission of parameter and return value comparison interface layer that pre-set criteria can capture according to, and according to Comparing result selects target interface from interface layer.Such as:If wherein the efficiency of transmission of some interface is far below other interfaces Efficiency of transmission either some interface efficiency of transmission less than preset threshold value, then select the interface, and the interface is made For target interface.
130th, in a production environment, slicing treatment is carried out to the target interface, extracts the corresponding program of performance hot spot Segment;
It should be noted that slicing treatment is isolates target program piece from a code path in a production environment Section;
140th, under the test environment, described program segment acquisition approach tracking information in operating status is tracked.
It should be noted that by using the mode of slice by the interface selected and Network Isolation, and will isolate The corresponding usability of program fragments of performance hot spot independent operating in test environment, under isolation environment, acquisition approach tracking information;Separately Outside, it should be noted that in order to obtain different data, can otherwise be realized by configuration log grade, such as:Configuration Daily record is relatively low, only realizes print log;During configuration log highest, it is debugging level, the nearly all information of interface can be obtained, and then Path trace message can therefrom be extracted.
As it can be seen that the present embodiment keeps apart from the code that magnanimity is run performance hot spot by using the mode of slice, and Isolated operation under the test environment with prior art ratio, without carrying out any code transformation to existing application, has tracking essence The advantages of degree is high, flexibility is strong.
Embodiment two
Fig. 2 shows a kind of principle schematics for code tracking method that one embodiment of the invention provides, should referring to Fig. 2 The principle of method is as follows:
210th, plug-in unit is attached in process when production environment is run by JVM codes instrument, captures parameter and return Value to provide data support to search target decanting point, improves the search efficiency of target decanting point;
220th, parameter and return value based on plug-in unit capture, search and obtain target decanting point;JVM codes instrument will be predefined Sensor is injected into target decanting point, and transaction middleware interface parameters value is captured by sensor;
230th, code slice program assembles according to the transaction middleware interface parameters value, generates test case;
240-250, business detection processing is carried out to production isolation middleware and test middleware according to the test case, The business detection is from existing network service stream, data flow extraction procedure segment.With higher business similarity and matching degree, because This probability that largely Upgrade Problem reappears.
260th, because being isolated entirely from production, the daily record rank that can start DEBUG patterns carries out production isolation middleware Path trace;
It should be noted that DEBUG patterns correspond to maximum daily record rank, in such a mode, daily record will record debugging letter Breath etc..
270th, code path the matching analysis is carried out based on the middleware code routing information in daily record, obtains code path; Alternatively, starting session tracking performs step 280;
280th, the session of database is sent to from specific machine can also start session tracking on the database, to be based on SQL (Structured Query Language) routing information carries out code path the matching analysis, obtains code path.
As it can be seen that performance hot spot is narrowed down to interface layer, then producing by the function slice of interface layer by the present embodiment first Shielding system re-calls, and fine function operation track is obtained by starting max log rank.It avoids to native applications Transformation, while positioning problems granularity can narrow down to specific code row.
Embodiment three
Web front end system, which is crossed, calls some package interfaces to call transaction middle layer indirectly, is divided into two kinds of technologies here and realizes Mode:Firstth, JVM directly invokes production isolation middleware CICS/ test transaction middlewares Tuxedo by transaction gateway;The 2nd, CICS/Tuxedo is called by enterprise's bus indirectly.Wherein, first method includes three steps.
Referring to Fig. 3, the first step specifically includes:
310th, storehouse analysis is carried out to the allocating stack that code instrument suite obtains;
320th, on entire allocating stack, the performance hot spot of least significant end is chosen;
It should be noted that more the business realizing of bottom often has wider implantation capability, can cover most of Business scenario.If prompting, which is ongoing thread, waits for Object.wait (), either synchronously or asynchronously adjusted in waiting in fact Return has little significance to path trace, it is therefore desirable to be called by the interface of fine CPU sample acquisitions more bottom detailed Feelings, CPU samplings carry out entire thread stacks at interval of a smaller period (about 10ms) full dose scanning, can look for Go out information extremely basic in some JVM operational process.After CPU is sampled, it can be found that encapsulated before finally calling CTG again Multilayer service logic, the purpose of the encapsulation are that by fixed format organization and interface call parameters are built message.
330th, the corresponding function of performance hot spot of selection is analyzed, and is according to the function that analysis result judges to choose It is no that there is service attribute, if so, performing step 340;
340th, discriminant function parameter whether can normal sequence and unserializing, if so, perform step 350;
350th, whether discriminant function parameter is less than preset byte length threshold, if so, performing step 360;
360th, the corresponding decanting point of function target decanting point the most is chosen.
If judging to know, the function of selection can not normal sequence and antitone sequence without service attribute or function parameter Change or function parameter is greater than or equal to preset byte length threshold, then judge that there is no be efficiently injected into a little in the function chosen; Build the derived class for the corresponding function parameter of performance hot spot chosen;Clone's processing is carried out to the derived class, it is secondary to obtain clone This;According to derived class sequencing method is preloaded, serializing processing acquisition is carried out to clone's copy and is efficiently injected into a little.
It should be noted that the function being initially injected a little will have crucial interface message, if believed without the corresponding interface Breath, needs to find from decanting point context;Its subparameter can be with normal sequence and unserializing, it is ensured that energy after parameter reconstruct Code slice program normally is passed to, while is necessary to ensure that serializing operation will not cause the change of object properties;Finally, it injects The parameter volume of point cannot be excessive, and performance pressures are caused to runtime environment to avoid when exporting.Therefore based on this principle into Row decanting point selects.
In addition, if third party's component object lacks sequencing method, need to be transformed program, be not suitable for producing The investigation of emergency under environment, it is therefore desirable to further search downwards to other more reliable decanting points.Generally by ECI side When formula (External CICS Call) calls CICS, it is related to the concept in the comunication area, i.e., as one for going out ginseng and entering that ginseng exchanges A platform, front end applications are sent to comunication area COMMAREA by the way that sequence of message is turned to bytecode, are further connected to pair The interface routine answered, therefore this decanting point can select contiguous function (link), parameter has (program ID, sequence of message Bytecode, bytecode total length), word string form is converted to by bytecode and is transmitted to slice program.Since comunication area overall length is solid Definite value 31744 if all 124K bytes can be reached by being converted to word string, generates production environment higher I/O, while general report Text will not take the entire comunication area, according to statistics if non-batch service, message using space also just in 10%-20% or so, because This can intercept about 30% or so bytecode, remainder polishing in code slice program.
As it can be seen that the present embodiment is by judging sensor injection phase, it is ensured that sensor injection safety, can By property, the influence to operation system is smaller.
Example IV
Fig. 4 b, which are shown in a kind of code tracking method that another embodiment of the present invention provides, calls the flow of middleware to show It is intended to, referring to Fig. 4 b, its basic ideas of second step are:Code slice is completely isolated from code path during production run for one Usability of program fragments out can independently be run, in production environment referring to Fig. 4 a;
It specifically includes as follows:
410th, CTG environmental preparations:Since code slice extracts in front end Web layers of application, code slice It needs to call a CTG environment as production, therefore produce isolation environment a CTG environment can be configured, by Web application journeys Sequence far call;
420th, receive the test instruction sent from production, will enter to join comunication area bytecode character string and reversely rebuild bytecode Sequence;
If the 430th, bytecode curtailment 31744, remainder bytes code is with 0 polishing;
440th, start ECI to call, CICS service names, user account permission including setting connection, start one it is new Affairs, program connection and submission;
450th, record path tracking information;
It should be noted that code slice relative business is unrelated, it can be by entire any one ring of business operation flow Section individually extracts operation.Isolation environment is without other calling services, therefore CICS serve logs can be adjusted to DEBUG grades Not, with the output of realization detailed code path to transaction middleware.
460th, affairs is waited for return.
As it can be seen that code slice for one from code path during production run it is completely isolated out usability of program fragments, can be only It is vertical to run in production environment, there are many advantages compared to other message analogy methods:The interference of other non-performance hot spots is such as abandoned Factor only retains the problem of crucial, and close to production environment, reproducible ratio is higher.Traditional message analog form, one is By front desk service operation simulation, the invalid data amount of generation is very big;Another kind is to be advised by the parameter that transaction middleware calls Lattice, the message of simulation generation enterprise bus call, but many operators will not be by some interior business for information security consideration Logic is exposed in enterprise's bus, because this latter can enforcement difficulty it is larger.
The third step of first method specifically includes:Class business is changed, may can not be reappeared, and have potential disturb in production The influence of random business datum, therefore can preferentially select to simulate in test environment, re-send to production environment if can not reappear. If inquiry class business can be simulated in production repeatedly.Call the part of Oracle can be backward for transaction middleware The upper session initiation session trackings to carrying out self-isolation detection CICS environment of Oracle, specific practice are:Establishment one is system-level to touch Device is sent out, the session for any connection to Schema starts 10046 events, finally exports SQL and performs detail time sequence, treats After session status switches to INACTIVE states, 10046 events are closed.
Embodiment five
Fig. 5 a and the stream Figure 5b shows that calling middleware in a kind of code tracking method of one embodiment of the invention offer Journey schematic diagram, referring to Fig. 5 a and Fig. 5 b, the basic thought of second method is:If judgement, which is known to be not present in the function of selection, to be had Decanting point is imitated, then builds the derived class of the corresponding function parameter of performance hot spot of selection;Clone's processing is carried out to the derived class, Obtain clone's copy;According to derived class sequencing method is preloaded, serializing processing acquisition is carried out to clone's copy and is efficiently injected into Point.It is specific as follows:
This situation needs to place decanting point in the inlet of web front end application call enterprise bus, it will usually under encountering Row problem:
1st, serialization process causes irreversible influence under production environment it is possible that the change of object properties can be caused, Therefore it needs to confirm to third party's component manufacturer before use.To cope with this problem, this motion proposes two kinds of thinkings:It 1) can be in the note Context procedures decanting point is found in access point upstream, generally builds the relevant operation that this parameter object is carried out and is captured, Similar multiple Object.setAttribute ("<ATTR1>”,“<ATTR_VALUE>") assembling form;2) it is being injected Before point parameter object serializing, an object copies are cloned, and argument sequence is carried out to this copy, it is timely after the completion of serializing This copy is destroyed, this requires the object that can clone, therefore derives from clone's class:class ArgumentClonable Extends Argument implements Clonable { }, and pass through cglib and remove dynamic definition Redefine, referring to figure 5a。
2nd, test case is usually unable to the true web front end system of full simulation one, therefore is added by injection point methods The other configurations of load need to determine in advance, character encoding format such as message, whether using secure connection and encryption key, referring to Fig. 5 b.
As it can be seen that the present embodiment is without in the case of being efficiently injected into a little, by being derived to existing parameter class and increasing serializing Parameter object is cloned and is interfered to avoid to runtime environment by method.
For method embodiment, in order to be briefly described, therefore it is all expressed as to a series of combination of actions, but ability Field technique personnel should know that embodiment of the present invention is not limited by described sequence of movement, because according to the present invention Embodiment, certain steps may be used other sequences or are carried out at the same time.Secondly, those skilled in the art should also know, Embodiment described in this description belongs to preferred embodiment, involved action embodiment party not necessarily of the present invention Necessary to formula.
Embodiment six
Fig. 6 shows a kind of structure diagram for code tracking device that one embodiment of the invention provides, should referring to Fig. 6 Device includes:Acquisition module 610, analysis module 620, slice module 630 and tracking module, wherein:
Acquisition module 610, for obtaining the data of pre-established plug-in unit acquisition, the pre-established plug-in unit is attached to target process On;
Analysis module 620 for carrying out performance analysis of central issue to the data got, and determines target according to analysis result Interface;
Module 630 is sliced, in a production environment, slicing treatment being carried out to the target interface, extracts performance heat The corresponding usability of program fragments of point;
Tracking module 640, under the test environment, track described program segment acquisition approach in operating status with Track information.
It should be noted that when performing code path tracking, acquisition module 610 obtains the data of plug-in unit acquisition, and will Data are sent to analysis module 620, by analysis module 620 to data progressive energy analysis of central issue, and then performance hot spot are reduced To interface layer, then analysis result, which is sent to, is sliced module 630, and slice module 630 carries out slicing treatment to target interface, will The corresponding usability of program fragments of performance hot spot is kept apart from the code that magnanimity is run, and is being surveyed usability of program fragments by tracking module 640 It runs and tracks under test ring border, acquisition approach tracking information.
As it can be seen that the present embodiment keeps apart from the code that magnanimity is run performance hot spot by using the mode of slice, and Isolated operation under the test environment with prior art ratio, without carrying out any code transformation to existing application, has tracking essence The advantages of degree is high, flexibility is strong.
Embodiment seven
Fig. 7 shows a kind of structure diagram for code tracking device that another embodiment of the present invention provides, referring to Fig. 7, Compared with embodiment six, the device of this implementation further includes:Searching module 720;
The searching module 720, for according to the data acquisition target decanting point got;Sensor is injected into the mesh Access point is marked, to obtain the transaction middleware interface parameters value of the sensor acquisition.Its operation principle is as follows:
Choose the performance hot spot of least significant end in allocating stack;The corresponding function of performance hot spot of selection is analyzed, and Judge whether the function chosen has service attribute according to analysis result;If so, whether discriminant function parameter can normal sequence Change and unserializing;If so, whether discriminant function parameter is less than preset byte length threshold;If so, choose the function Corresponding decanting point target decanting point the most.
If if judging to know, the function of selection can not normal sequence and inverted sequence without service attribute or function parameter Rowization or function parameter are greater than or equal to preset byte length threshold, then judge that there is no be efficiently injected into the function chosen Point;Build the derived class for the corresponding function parameter of performance hot spot chosen;Clone's processing is carried out to the derived class, obtains clone Copy;According to derived class sequencing method is preloaded, serializing processing acquisition is carried out to clone's copy and is efficiently injected into a little..
Correspondingly, the slice module 740 in the present embodiment is used to be generated according to the transaction middleware interface parameters value and survey Example on probation;Business detection processing, the business are carried out to production isolation middleware and test middleware according to the test case It detects as from existing network service stream, data flow extraction procedure segment.
For device embodiments, since it is substantially similar to method embodiment, so description is fairly simple, Related part illustrates referring to the part of method embodiment.
It should be noted that in all parts of the device of the invention, according to the function that it to be realized to therein Component has carried out logical partitioning, and still, the present invention is not only restricted to this, all parts can be repartitioned as needed or Person combines.
The all parts embodiment of the present invention can be with hardware realization or to be transported on one or more processor Capable software module is realized or is realized with combination thereof.In the present apparatus, PC is by realizing internet to equipment or device The step of remote control, accurately control device or device each operate.The present invention is also implemented as performing here The some or all equipment or program of device of described method are (for example, computer program and computer program production Product).The program of the present invention, which is achieved, may be stored on the computer-readable medium, and the file or document tool that program generates Having can be statistical, generates data report and cpk reports etc., and batch testing can be carried out to power amplifier and is counted.On it should be noted that Stating embodiment, the present invention will be described rather than limits the invention, and those skilled in the art are not departing from Replacement embodiment can be designed in the case of attached the scope of the claims.It in the claims, should not will be between bracket Any reference mark be configured to limitations on claims.Word "comprising" does not exclude the presence of member not listed in the claims Part or step.Word "a" or "an" before element does not exclude the presence of multiple such elements.The present invention can borrow Help the hardware for including several different elements and realized by means of properly programmed computer.If listing equipment for drying Unit claim in, several in these devices can be embodied by same hardware branch.Word first, Second and the use of third etc. do not indicate that any sequence.These words can be construed to title.
Although being described in conjunction with the accompanying embodiments of the present invention, those skilled in the art can not depart from this hair Various modifications and variations are made in the case of bright spirit and scope, such modifications and variations are each fallen within by appended claims Within limited range.

Claims (10)

  1. A kind of 1. code tracking method, which is characterized in that including:
    The data of pre-established plug-in unit acquisition are obtained, the pre-established plug-in unit is attached on target process;
    Performance analysis of central issue is carried out, and determine target interface according to analysis result to the data got;
    In a production environment, slicing treatment is carried out to the target interface, extracts the corresponding usability of program fragments of performance hot spot;
    Under the test environment, described program segment acquisition approach tracking information in operating status is tracked.
  2. 2. according to the method described in claim 1, it is characterized in that, to the target interface carry out slicing treatment before, institute The method of stating further includes:
    According to the data acquisition target decanting point got;
    Sensor is injected into the target decanting point, to obtain the transaction middleware interface parameters value of the sensor acquisition.
  3. 3. according to the method described in claim 2, it is characterized in that, described include target interface progress slicing treatment:
    Test case is generated according to the transaction middleware interface parameters value;
    Business detection processing, the business detection carry out production isolation middleware and test middleware according to the test case For from existing network service stream, data flow extraction procedure segment.
  4. 4. the according to the method described in claim 2, it is characterized in that, data acquisition target decanting point packet that the basis is got It includes:
    Choose the performance hot spot of least significant end in allocating stack;
    The corresponding function of performance hot spot of selection is analyzed, and judges whether the function chosen has industry according to analysis result Business attribute;
    If so, whether discriminant function parameter can normal sequence and unserializing;
    If so, whether discriminant function parameter is less than preset byte length threshold;
    If so, the corresponding decanting point of the function is chosen as target decanting point.
  5. If 5. according to the method described in claim 4, it is characterized in that, judge know selection function do not have service attribute or Person's function parameter can not normal sequence and unserializing or function parameter be greater than or equal to preset byte length threshold, then sentence Surely there is no be efficiently injected into a little in the function chosen;
    Build the derived class for the corresponding function parameter of performance hot spot chosen;
    Clone's processing is carried out to the derived class, obtains clone's copy;
    According to derived class sequencing method is preloaded, serializing processing acquisition is carried out to clone's copy and is efficiently injected into a little.
  6. 6. a kind of code tracking device, which is characterized in that including:
    Acquisition module, for obtaining the data of pre-established plug-in unit acquisition, the pre-established plug-in unit is attached on target process;
    Analysis module for carrying out performance analysis of central issue to the data got, and determines target interface according to analysis result;
    Module is sliced, in a production environment, carrying out slicing treatment to the target interface, it is corresponding extracting performance hot spot Usability of program fragments;
    Tracking module, under the test environment, tracking described program segment acquisition approach tracking information in operating status.
  7. 7. device according to claim 6, which is characterized in that described device further includes:Searching module;
    The searching module, for according to the data acquisition target decanting point got;Sensor is injected into the target injection Point, to obtain the transaction middleware interface parameters value of the sensor acquisition.
  8. 8. device according to claim 7, which is characterized in that the slice module, for according to the transaction middleware Interface parameters value generates test case;Business spy is carried out to production isolation middleware and test middleware according to the test case Survey is handled, and the business detection is from existing network service stream, data flow extraction procedure segment.
  9. 9. device according to claim 7, which is characterized in that the searching module is minimum in allocating stack for choosing The performance hot spot at end;The corresponding function of performance hot spot of selection is analyzed, and the function for judging to choose according to analysis result Whether there is service attribute;If so, whether discriminant function parameter can normal sequence and unserializing;If so, judge letter Whether number parameter is less than preset byte length threshold;If so, choose the corresponding decanting point of function target decanting point the most.
  10. 10. device according to claim 9, which is characterized in that the searching module, if being additionally operable to judge to know selection Function do not have service attribute either function parameter can not normal sequence and unserializing or function parameter be greater than or equal to Preset byte length threshold then judges that there is no be efficiently injected into a little in the function chosen;It is corresponding to build the performance hot spot chosen The derived class of function parameter;Clone's processing is carried out to the derived class, obtains clone's copy;It is serialized according to derived class is preloaded Method carries out clone's copy serializing processing acquisition and is efficiently injected into a little.
CN201611197658.1A 2016-12-22 2016-12-22 Code tracking method and device Active CN108228448B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611197658.1A CN108228448B (en) 2016-12-22 2016-12-22 Code tracking method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611197658.1A CN108228448B (en) 2016-12-22 2016-12-22 Code tracking method and device

Publications (2)

Publication Number Publication Date
CN108228448A true CN108228448A (en) 2018-06-29
CN108228448B CN108228448B (en) 2021-03-26

Family

ID=62657005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611197658.1A Active CN108228448B (en) 2016-12-22 2016-12-22 Code tracking method and device

Country Status (1)

Country Link
CN (1) CN108228448B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235128A (en) * 2020-09-23 2021-01-15 建信金融科技有限责任公司 Transaction path analysis method, device, server and storage medium
CN113535539A (en) * 2020-04-22 2021-10-22 网易(杭州)网络有限公司 Debugging method, device, equipment and storage medium in game editing

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510115A (en) * 2009-03-26 2009-08-19 浙江大学 Method for controlling processor frequency when program operation by using dynamic compiler
CN102722434A (en) * 2012-05-24 2012-10-10 兰雨晴 Performance test method and tool aiming at Linux process scheduling
US20140380269A1 (en) * 2008-10-06 2014-12-25 The Mathworks, Inc. Verification of computer-executable code generated from a model
CN104850411A (en) * 2015-06-10 2015-08-19 清华大学 Storage system reference evaluation program generating method and apparatus
CN105677550A (en) * 2015-12-29 2016-06-15 广州华多网络科技有限公司 Performance acquisition-analysis method, device and system based on Linux system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140380269A1 (en) * 2008-10-06 2014-12-25 The Mathworks, Inc. Verification of computer-executable code generated from a model
CN101510115A (en) * 2009-03-26 2009-08-19 浙江大学 Method for controlling processor frequency when program operation by using dynamic compiler
CN102722434A (en) * 2012-05-24 2012-10-10 兰雨晴 Performance test method and tool aiming at Linux process scheduling
CN104850411A (en) * 2015-06-10 2015-08-19 清华大学 Storage system reference evaluation program generating method and apparatus
CN105677550A (en) * 2015-12-29 2016-06-15 广州华多网络科技有限公司 Performance acquisition-analysis method, device and system based on Linux system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535539A (en) * 2020-04-22 2021-10-22 网易(杭州)网络有限公司 Debugging method, device, equipment and storage medium in game editing
CN113535539B (en) * 2020-04-22 2023-07-25 网易(杭州)网络有限公司 Method, device, equipment and storage medium for debugging in game editing
CN112235128A (en) * 2020-09-23 2021-01-15 建信金融科技有限责任公司 Transaction path analysis method, device, server and storage medium

Also Published As

Publication number Publication date
CN108228448B (en) 2021-03-26

Similar Documents

Publication Publication Date Title
Ko et al. Execution monitoring of security-critical programs in distributed systems: A specification-based approach
CN101553769B (en) Method and system for tracking and monitoring computer applications
Sun et al. Operation context and context-based operational transformation
CN103186733B (en) Database user behavior management system and database user behavior management method
Xu et al. Experience mining Google's production console logs
CN108469984A (en) It is a kind of to be examined oneself function grade virtual machine kernel dynamic detection system and method based on virtual machine
CN108182359A (en) The method, apparatus and storage medium of API safeties under a kind of test trusted context
CN105760174A (en) Suggested data extraction method based on Windows timed task
CN108091384A (en) A kind of medical image processing system based on micro services frame
CN108628600A (en) Software dynamic behavior modeling method and apparatus based on control flow analysis
CN108228448A (en) A kind of code tracking method and device
Zhou et al. Confmapper: Automated variable finding for configuration items in source code
Blundell et al. Assume-guarantee testing
CN106681909A (en) Online transaction fault locating method and device
Zhao et al. Robust multimodal failure detection for microservice systems
CN110231931A (en) A kind of power supply real-time control module and system
Afonso et al. Applying aspects to a real-time embedded operating system
Huo et al. Autolog: A log sequence synthesis framework for anomaly detection
Guarnieri et al. Test execution checkpointing for web applications
CN109857716A (en) System interaction log recording method, device and storage medium, server
Xie et al. Implementation of Simulation Control Automation Tool Based on Android Accessibility Service
Douglas et al. Improving sql query performance on embedded devices using pre-compilation
Andersen et al. Protocol combinators for modeling, testing, and execution of distributed systems
Sun et al. XGBoost Dynamic Detection for Data Race in Multithreaded Programs
Yang API Parameter Recommendations Made Effective

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant