CN104199649B - The path method for decomposing of interactive information between a kind of process for father and son - Google Patents

The path method for decomposing of interactive information between a kind of process for father and son Download PDF

Info

Publication number
CN104199649B
CN104199649B CN201410419011.3A CN201410419011A CN104199649B CN 104199649 B CN104199649 B CN 104199649B CN 201410419011 A CN201410419011 A CN 201410419011A CN 104199649 B CN104199649 B CN 104199649B
Authority
CN
China
Prior art keywords
path
subprocess
program
parent process
father
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.)
Active
Application number
CN201410419011.3A
Other languages
Chinese (zh)
Other versions
CN104199649A (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.)
Southeast University
Original Assignee
Southeast University
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 Southeast University filed Critical Southeast University
Priority to CN201410419011.3A priority Critical patent/CN104199649B/en
Publication of CN104199649A publication Critical patent/CN104199649A/en
Application granted granted Critical
Publication of CN104199649B publication Critical patent/CN104199649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses between a kind of process for father and son interactive information path method for decomposing, producing mainly for the treatment of subprocess and parent process carries out the problem of path anatomy under interaction scenario.The method that path dissects the analysis and understanding of dynamic behaviour when technology can provide for running to program for program, there is provided the point of penetration of specific aim analysis is carried out to the deficiency of program.The present invention is by carrying out separating forming the different degrees of anatomy to two sections of programs parent process and subprocess, respectively by predominating path information is obtained in father and son's process, and then the routing information obtained in subprocess is supplied to into parent process, Program path information is effectively integrated, define the record to the overall operation information in path in program, operational relation information that can be by parent process with subprocess clearly shows, and improves the use range of path method for decomposing.

Description

The path method for decomposing of interactive information between a kind of process for father and son
Technical field
The invention belongs to Program path dissects field, it is related to the solution that a kind of Program path is dissected, more particularly to one Plant for solving the method that the dynamic interaction path of program dissects problem between father and son's process.
Background technology
Path dissects(Path Profiling)Technology is a kind of important dynamic analysis technology, is used to help understand in meter Calculate mechanism rack, the program dynamic behaviour feature in program compiling, debugging and test.The performance of a usual program is transported with the program Method path performed during row is directly related, and path dissects the method that technology performs frequency by path in collection procedure, Can be used to guide software analysis, understand and improvement there is provided one, specific path can also targetedly be analyzed Point of penetration.Path dissects the analysis of the collective behavior not exclusively to program, more focuses on the dynamic flow map analysis to program. By these paths, one kind is provided in computer architecture, program compiling and put forward high performance method, while programmer or compiling The speed of service that device can make program by optimizing the path for frequently executing is faster.
For large-scale complication system, such as operating system, data base, by a large amount of paths for performing are improved, Can be by performance boost.For compiler, trace scheduling and the compiling based on path, it has therefore proved that the optimization of program can be by control Benefit in the dynamic flow of processing procedure sequence, may also be used for improving cache and the execution of instruction in the frame design of computer Efficiency.
Path dissects the frequency and cost for having measured execution route in program, is the weight of the control flow for understanding a program Want technology.However, current path dissects the path that technology can mainly dissect single program, for the program with subprocess The middle path for producing interaction scenario is difficult to process, no to provide an effectively processing method.If can not effective recognizer Interior problem path position is then difficult to the performance for improving software.
Include following demand for the path of a program dissects:(1)The feelings without path in ring-type and process can be analyzed Condition;(2)It is capable of the circulation of representation program implementation procedure;(3)The flow process of parsing program, while keeping in the flow process of program performing The accuracy of routing information.By dissecting result, researcher can be made to be placed on attention and can lift program feature where It is improved.
The content of the invention
Technical problem:It is an object of the invention to provide a kind of path for solving subprocess dissects problem, considering right Father and son's process interaction situation is analyzed in the case of program produces subprocess, can reach and father and son's process interaction situation is entered The path method for decomposing for interactive information between father and son's process that walking along the street footpath dissects.
Technical scheme:The path method for decomposing for interactive information between father and son's process of the present invention, comprises the steps:
Step 1)Static analysis is carried out to specified test program, parent process part and subprocess portion in program is determined Point;
Step 2)Slicing treatment is carried out to the subprocess part of the test program, subprocess part is cut out, is surveyed The parent process part and subprocess part of examination program, and one process program is changed into in parent process part, then obtain parent process Controlling stream graph and subprocess controlling stream graph;
Step 3)Parent process is analyzed using Efficient paths method for decomposing, specially:Choose parent process control In flow graph processed, path to be dissected carries out pitching pile to the critical path as critical path;
Step 4)The controlling stream graph of subprocess is analyzed, the routing information that analysis is obtained is transmitted with tree structure To parent process;
Step 5)Pitching pile of the parent process with subprocess is mapped in the respective code section of test program, then to test Parent process and subprocess routing information in program carries out asynchronous process;
Step 6)Parent process carries out message integration after receiving the path profile information of subprocess, specially:According to described Step 3)Analysis result, it is determined that the path ID in current parent process, using the path ID as root node connection subprocess in Routing information, forms complete path information.
In the preferred version of the present invention, step 4)In, to the concrete grammar that the controlling stream graph of subprocess is analyzed it is:Choosing Path to be dissected in subprocess controlling stream graph is taken as critical path, using k-BLPP method row pitching piles.
In the preferred version of the present invention, step 5)Asynchronous process in, the pipeline of father and son's process is one-way pipeline, with son To write end, to read end, data are sent to parent process by subprocess to parent process to process.
The inventive method emphasizes the analysis to father and son's process interaction Program path, respectively by parent process and subprocess The integration that path between two processes dissects, the result dissected by resolution path, can effectively the friendship between father and son's process Mutual relation is identified.The code segment of father and son's process is isolated in a program, is entered by the critical path to two types process Row is dissected, and completes to dissect the path of interbehavior between father and son's process using the communication mechanism between process.
Beneficial effect:The inventive method compared with existing other path method for decomposing, with advantages below:
(1)Current method for decomposing focuses mainly on how the program of one process carries out path anatomy, in parsing process Do not account for, in the case of software is multi-process, being merely able to carry out one section or the path of one process program dissecting.How to entering more The path of Cheng Chengxu is dissected, and existing method can not be solved.Present approach provides carrying out to the path of father and son's process The method for combining afterwards is first separated, the path to multi-process is effectively solved and is dissected problem.
(2)The program of father and son's process is dissected with current path method for decomposing, can only obtain single father and son and enter Journey information, the relatedness for not having father and son's process in the routing information for dissecting out.In the case of for father and son's process, it is impossible to enough represent Path relation between father and son's process.Present invention employs in information transmission parent process after being analyzed to subprocess, in father The method integrally recorded in process, solves the problems, such as to make the profile information in path in father and son's process to associate, is able to record that program Routing information of father and son's process produced by interaction, improves the scope of application of path method for decomposing.
(3)Record to father and son path profile information is provided and uses tree form data structure so that routing information can be clear Show path association situation, father and son process path dissect result with compactedness, it is to avoid to multi-process in additive method The omission of Program path information or the problem that can not be effectively united the path profile information of father and son's process, are conducive to The dynamic behaviour of program developer or user prehension program.Improve to the path orientation energy in the case of father and son's process interaction Power.
Description of the drawings
Fig. 1 is represented to father and son's process method for decomposing critical process flow chart;
Fig. 2 is time response analysis when father and son's process is run;
Fig. 3 is the controlling stream graph of present invention program to be analyzed;
Fig. 4 represents that institute is right per paths in the pitching pile position of parent process and after completing pitching pile after pitching pile in controlling stream graph The path ID for answering;
Fig. 5 represent in controlling stream graph after pitching pile in the pitching pile position of subprocess and complete pitching pile after per path segments institute Corresponding path ID;
Fig. 6 represents that institute is right per paths in the pitching pile position of parent process and after completing pitching pile after pitching pile in controlling stream graph The path ID for answering.
Specific embodiment
Technical scheme is described in more detail with reference to embodiment:
Architecture
Fig. 1 gives the critical workflow figure dissected to father and son's process path in technical process, includes father in parsing process Critical path, subpath, pipeline communication, semaphore, k-BLPP.
Illustrating for several key concepts is given below:
Father path:For the concept of father path is built upon on the concept of parent process, parent process refer to create one or The process of multiple subprocess.Father path representation program from start to end during execution flow process, the execution of father's critical path Time needs to exclude and waits subprocess to perform the time for terminating.For parent process, a process can have multiple subprocess, because This method is incorporated into routing information in father path, when path is dissected, need to clearly distinguish father and son's process path.
Subpath:Subpath refers to that the path to subprocess dissects, and subprocess is referred to by another process(Correspondence is referred to as Parent process)The process for being created.Subprocess inherits most of attribute of corresponding parent process, such as filec descriptor.In Unix In, subprocess is usually the product that system calls fork.In the case, subprocess is the copy of parent process at the very start, and After this, according to specific needs, subprocess can be called by exec and carry out another program of chain type loading.
Critical path:In referring to the continuous implementation procedure of program from start to end, non-key transaction in rejected program Path, critical path is to affect larger or path that analysis personnel are interested to program.
Pitching pile:Ensureing to insert some probes in a program on the basis of the original logic of tested program is complete, by probe Execution and program of dishing out operation characteristic, by the analysis to these data, it is possible to obtain the controlling stream sum of program According to stream information, and then the multidate informations such as Logic coverage are obtained, the method so as to realize test purpose.
Pipeline communication:Pipeline is used for the communication for having between sibship process.Process first creates one before subprocess is created Pipeline, for father and son's interprocess communication, creates subprocess, and parent process is closed and writes end afterwards, and subprocess is closed and reads end;It is so enter Journey just can write data to pipeline, and parent process reads data from the other end.
Semaphore:Semaphore is for ensureing to wake up a message of the parent process being waited for, it is ensured that formed The anatomy result of subprocess will not be lost during routing information.
k-Ball-Larus Path Profiling(k-BLPP)Method:The parsing process of the method mainly includes two Stage:First stage, by the path in controlling stream graph using Ball-Larus path profiling coded methods to each Path carries out unique encodings ID;Second stage, using operations of the path ID generated in the first stage to a path in program Stream carry out can distinguishing identifier, for building a data structure for keeping track of the execution number of times of each clip path, enter And path is dissected into result and generates a prefix forest, k is a user-defined parameter.
Then the inventive method carries out successor operation according to controlling stream graph using the controlling stream graph based on Program transformation.Institute Controlling stream graph using embodiment is as shown in Figure 3.
(1)Static analysis, original position and the end of finder sub-process code are carried out to specified test program Position, determines the parent process part and subprocess part in program;
(2)Father and son's process two parts determined by, carry out dicing method process to test program, and program slice method is A kind of program analysis technique for decomposing program, principle and method are set up in 1979 in thesis for the doctorate by M.Weiser. Concrete processing procedure is:According to the feature sentence that subprocess is produced in program, as the initial boundary of section, the end of subprocess It is the end boundary of section at sentence, after delimiting the border of subprocess, the subprocess part that will identify that cuts out, obtains testing journey The parent process part and subprocess part of sequence.One process program is changed into in parent process part, the control of parent process is then obtained The controlling stream graph of flow graph and subprocess, such as Fig. 3, determine the control of the controlling stream graph and subprocess of parent process with the border of subprocess Flow graph;
(3)Critical path in parent process is recorded, the method for using is carried out point for Efficient paths method for decomposing Analysis.Efficient paths method for decomposing is a kind of path anatomy side that Thomas Ball were proposed in IEEE meetings in 1996 Method, for the analysis of frequency is performed to Program path.Its idiographic flow is:Summit and frontier juncture in the controlling stream graph of acquisition program System, makes to be generated algorithmically by each bar side and is worth accordingly, to completing the pitching pile to controlling stream graph using pitching pile algorithm.It is concrete in the present invention Process is:In selection parent process controlling stream graph, path to be dissected carries out pitching pile to the critical path as critical path;Insert Stake has corresponding digital coding correspondence to each critical path after terminating, represent path ID;Every critical path has uniquely Coding.
To parent process pitching pile effect such as Fig. 4;Result is dissected in parent process to record with array form;Obtain in program operation Performed Program path, is run multiple times to program and critical path execution frequency is obtained;In parent process after each path operation Current path node is pointed to head node form, is the head node that the subprocess corresponding to the parent process of part dissects result.
(4)The controlling stream graph of subprocess is analyzed, pitching pile, detailed process is carried out for program using the method for k-BLPP For:In selection controlling stream graph, path to be dissected is used as critical path.Pitching pile is carried out to critical path, one in the method, is provided Kind of construction algorithm, the path stream of the new addition of input, after path stream is segmented according to pitching pile information, can by path stream with The form output of forest, entitled k-SF, addition dummy node constitute tree structure;
(5)By in the respective code section that the pitching pile of parent process and subprocess reverts to test program, then to testing journey Parent process and subprocess routing information in sequence carries out asynchronous process;
According to the aeoplotropism of interprocess communication information in the present invention, the communication that pipeline is used between process is set up, in the present invention Only need to set up a half-duplex pipeline, can be used between father and son's process;Subprocess is set to write end, parent process is reading End, by profile data from subprocess to pipeline in write, by the pipeline other end parent process read.
Due to the uncertainty of the run time of tested program father and son's process, to adding right after the completion of pitching pile in father and son's process The asynchronous management of Program path information, after parent process is dissected to be terminated, because two sections of process operations take not necessarily identical original Cause, subprocess may not end of run in time, subprocess there may be following two situations:
a)After parent process is dissected to be terminated, the profile information of subprocess has been obtained, and parent process can directly by subprocess road Footpath profile information is added to the profile information of parent process;
b)After parent process is dissected to be terminated, the profile information of subprocess is not yet obtained, and now parent process need to be to subprocess road Footpath profile information is waited;
With reference to both the above situation, pipeline communication mode can be used, be that obstruction mark, parent process path are set in parent process Anatomy arranges obstruction mark after terminating, wait the write of subprocess information.Can be to obstruction after the write of subprocess path profile information Mark resets and waits write next time.
(6)The routing information that the tree structure that gained is obtained in result is dissected by subprocess is passed to into parent process, father enters Journey carries out message after receiving the path profile information of subprocess, form complete path information, and the data structure of routing information is such as Fig. 5;Process step is:
a)According to the anatomy result that path is dissected in current parent's process path, path ID record in obtaining parent process;
b)Judged sub-path information to being attached in parent process under current path information by current path ID in parent process, The initial routing information of subprocess is formed under each parent process path;
c)Subprocess routing information under parent process is converted into into KIPT trees;Data structure such as accompanying drawing 6
Converting algorithm is as follows
procedure make_KIPT():
1: I ← ∅
2: for each node ρ ∈ k-SF do
3: if ℓ(ρ) ∈ I then
4: add ℓ(ρ) to I and let s(ℓ(ρ)) ←∅
5: end if
6: add ρ to s(ℓ(ρ))
7: end for
8:Tree k-IPT is made with Parent process ID:R is root node
9: for each r ∈ I do
10: for each ρ∈ s(r) do
11: join_subtree(ρ, φ, k)
12: end for
13: end for
procedure join_subtree(ρ, γ, d):
1: δ ← child of γ in the k-IPT s.t. ℓ(δ) = ℓ(ρ)
2: if δ = null then
3: add new node δ as a child of γ in the k-IPT
4: ℓ(δ) ← ℓ(ρ) and counter(δ) ← counter(ρ)
5: else
6: counter (δ) ← counter (δ) + counter (ρ)
7: end if
8: if d > 0 then
9: for each child σ of ρ in the k-SF do
10: join_subtree(σ, δ, d − 1)
11: end for
12: end if
Set s ((ρ)) represents the set of the point ρ with (ρ) labelling in k-SF;(ρ) represent the mark to ρ nodes; Counter (ρ) is represented with the enumerator comprising ρ nodes.
Above-described embodiment is only the preferred embodiment of the present invention, it should be pointed out that:For the ordinary skill of the art For personnel, under the premise without departing from the principles of the invention, some improvement and equivalent can also be made, these are to the present invention Claim is improved and the technical scheme after equivalent, each falls within protection scope of the present invention.

Claims (3)

1. between a kind of process for father and son interactive information path method for decomposing, it is characterised in that the method comprises the steps:
Step 1)Static analysis is carried out to specified test program, parent process part and subprocess part in program is determined;
Step 2)Slicing treatment is carried out to the subprocess part of the test program, subprocess part is cut out, obtain testing journey The parent process part and subprocess part of sequence, and one process program is changed into in parent process part, then obtain the control of parent process The controlling stream graph of flow graph processed and subprocess;
Step 3)Parent process is analyzed using Efficient paths method for decomposing, specially:Choose parent process controlling stream In figure, path to be dissected carries out pitching pile to the critical path as critical path;
Step 4)The controlling stream graph of subprocess is analyzed, the routing information that analysis is obtained is passed to into father with tree structure Process;
Step 5)Pitching pile of the parent process with subprocess is mapped in the respective code section of test program, then to test program In parent process and subprocess routing information carry out asynchronous process;
Step 6)Parent process carries out message integration after receiving the path profile information of subprocess, specially:According to the step 3)Analysis result, the critical path coding that pitching pile is obtained made with the path ID as the path ID in current parent process Connect subprocess Road footpath information for root node, form complete path information.
2. between the process for father and son according to claim 1 interactive information path method for decomposing, it is characterised in that it is described Step 4)In, to the concrete grammar that the controlling stream graph of subprocess is analyzed it is:It is to be dissected in selection subprocess controlling stream graph Path as critical path, using k-BLPP method row pitching piles.
3. between the process for father and son according to claim 1 and 2 interactive information path method for decomposing, it is characterised in that The step 5)Asynchronous process in, the pipeline of father and son's process is one-way pipeline, and with subprocess to write end, parent process is reading end, Data are sent to parent process by subprocess.
CN201410419011.3A 2014-08-22 2014-08-22 The path method for decomposing of interactive information between a kind of process for father and son Active CN104199649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410419011.3A CN104199649B (en) 2014-08-22 2014-08-22 The path method for decomposing of interactive information between a kind of process for father and son

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410419011.3A CN104199649B (en) 2014-08-22 2014-08-22 The path method for decomposing of interactive information between a kind of process for father and son

Publications (2)

Publication Number Publication Date
CN104199649A CN104199649A (en) 2014-12-10
CN104199649B true CN104199649B (en) 2017-04-05

Family

ID=52084946

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410419011.3A Active CN104199649B (en) 2014-08-22 2014-08-22 The path method for decomposing of interactive information between a kind of process for father and son

Country Status (1)

Country Link
CN (1) CN104199649B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106055397B (en) * 2016-05-30 2019-09-27 新浪网技术(中国)有限公司 A kind of control method and device of lock
CN108334404B (en) * 2017-01-20 2022-02-22 腾讯科技(深圳)有限公司 Application program running method and device
WO2022178889A1 (en) * 2021-02-27 2022-09-01 华为技术有限公司 Function calling context encoding method and apparatus, and function calling context decoding method and apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6072951A (en) * 1997-10-15 2000-06-06 International Business Machines Corporation Profile driven optimization of frequently executed paths with inlining of code fragment (one or more lines of code from a child procedure to a parent procedure)
CN101963907A (en) * 2010-10-14 2011-02-02 中国科学技术大学苏州研究院 Dynamic analysis mechanism for computer program hot spot
CN103399741A (en) * 2013-07-24 2013-11-20 中国科学院声学研究所 Method and device for profiling assembly-level static paths

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6072951A (en) * 1997-10-15 2000-06-06 International Business Machines Corporation Profile driven optimization of frequently executed paths with inlining of code fragment (one or more lines of code from a child procedure to a parent procedure)
CN101963907A (en) * 2010-10-14 2011-02-02 中国科学技术大学苏州研究院 Dynamic analysis mechanism for computer program hot spot
CN103399741A (en) * 2013-07-24 2013-11-20 中国科学院声学研究所 Method and device for profiling assembly-level static paths

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
全路径剖析方法;王璐璐 等;《软件学报》;20120615(第06期);1413-1428 *
过程间循环路径剖析方法;王璐璐 等;《计算机学报》;20131115(第11期);2224-2234 *

Also Published As

Publication number Publication date
CN104199649A (en) 2014-12-10

Similar Documents

Publication Publication Date Title
CN112699377B (en) Function-level code vulnerability detection method based on slice attribute graph representation learning
CN104503917B (en) Change domain of influence analysis method and system based on data flow function call path
CN106649100A (en) Automatic test method and system
CN103116540B (en) Dynamic symbolic execution method based on overall situation super block dominator graph
CN102750223B (en) A kind of location of mistake method based on object-oriented program section spectrum
CN104850411B (en) Storage system benchmark evaluation program generation method and device
CN104199649B (en) The path method for decomposing of interactive information between a kind of process for father and son
CN109614980A (en) A kind of small sample target identification method based on semi-supervised wide area migration metric learning
CN106547520A (en) A kind of code path analysis method and device
Bansal et al. Holist: An environment for machine learning of higher-order theorem proving (extended version)
CN108228187A (en) A kind of global optimization method of mathematical program
CN115617395A (en) Intelligent contract similarity detection method fusing global and local features
CN112765031A (en) Decomposition method of crowd-sourcing vulnerability mining task
CN104915680A (en) Improved RBF neural network-based multi-label metamorphic relationship prediction method
CN103744788A (en) Feature localization method based on multi-source software data analysis
CN106294136A (en) The online test method of concurrent program run duration performance change and system
CN108897680B (en) Software system operation profile construction method based on SOA
CN116578336A (en) Software clone detection method based on plagiarism-detector countermeasure
CN103606042B (en) Services Composition instance migration availability deciding method based on dynamic dependency graph
CN110069347A (en) A kind of thread dividing method of Kernel-based methods different degree
Qian et al. A strategy for multi-target paths coverage by improving individual information sharing
CN114706558A (en) K-TRUSS-based complex software key module identification method
CN102567845A (en) Online migration method and equipment for running example during combined service evolution
KR101290847B1 (en) Method for creating a feature model from legacy system source code
CN109710538A (en) A kind of static detection method for state related defects in large scale system

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