CN104199649A - Path profiling method for interaction information between parent process and child process - Google Patents

Path profiling method for interaction information between parent process and child process Download PDF

Info

Publication number
CN104199649A
CN104199649A CN201410419011.3A CN201410419011A CN104199649A CN 104199649 A CN104199649 A CN 104199649A CN 201410419011 A CN201410419011 A CN 201410419011A CN 104199649 A CN104199649 A CN 104199649A
Authority
CN
China
Prior art keywords
path
subprocess
parent process
parent
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410419011.3A
Other languages
Chinese (zh)
Other versions
CN104199649B (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 a path profiling method for interaction information between a parent process and a child process. The path profiling method is mainly used for carrying out path profiling under the circumstance that interaction occurs between the child process and the parent process. According to a path profiling technology, a procedure can be supplied with the method for analyzing and understanding dynamic behaviors of the running procedure, and an entry point for carrying out specific analysis on defects of the procedure is provided. The parent process and the child process are separated, so that different degrees of profiling are carried out on the two processes; main path information is obtained from the parent process and the child process, then, the path information obtained from the child process is provided for the parent process, the procedure path information is integrated effectively, records of overall running information of paths in the procedure are formed, running relation information of the parent process and the child process can be shown clearly, and the use range of the path profiling method is widened.

Description

A kind of path method for decomposing for interactive information between father and son's process
Technical field
The invention belongs to Program path and dissect field, relate to the solution that a kind of Program path dissects, particularly a kind of for solving the method for the dynamic interaction path anatomy of program problem between father and son's process.
Background technology
It is a kind of important dynamic analysis technology that path dissects (Path Profiling) technology, understands in computer architecture the program dynamic behaviour feature in program compilation, debugging and test for helping.Method path performed when the performance of a common program is moved with this program is directly related, and anatomy technology in path is carried out the method for frequency by path in collection procedure, provide one can be used for guiding software analysis, understanding and improvement, the point of penetration that can also analyze targetedly specific path.It is not only the analysis to the joint conduction of program that path dissects, and more focuses on the dynamic flow map analysis to program.By these paths, in computer architecture, in program compilation, provide a kind of high performance method of putting forward, programmer or compiler can make the travelling speed of program faster by optimizing the path of frequent execution simultaneously.
For large-scale complication system, for example operating system, database, by the path of carrying out is in a large number improved, can be by performance boost.For compiler, trace scheduling and the compiling based on path, the optimization of prover can benefit in the dynamic flow by control program, also can be used for improving the high-speed cache of instruction and the efficiency of execution in the frame design of computing machine.
Path dissects and has measured frequency and the cost of execution route in program, is the important technology of understanding the control flow of a program.Yet current path dissects technology mainly can dissect the path of single program, for the path that produces mutual situation in the program with subprocess, be difficult to process, a disposal route effectively is not provided.If the effective problem path position in recognizer, is difficult to improve the performance of software.
Path anatomy for a program comprises following demand: (1) can analyze the situation without path in ring-type and process; (2) circulation that can representation program implementation; (3) flow process of parsing program, the while keeps the accuracy of routing information in the flow process of program execution.By dissecting result, can make researcher that notice is placed on to the place that can promote program feature and improve.
Summary of the invention
technical matters:the object of this invention is to provide the path anatomy problem that a kind of use solves subprocess, under considering for program generation subprocess situation, father and son's process interaction situation is analyzed, can be reached the path method for decomposing for interactive information between father and son's process that father and son's process interaction situation is carried out to path anatomy.
technical scheme:path method for decomposing for interactive information between father and son's process of the present invention, comprises the steps:
Step 1) is carried out static analysis to the test procedure of appointment, parent process part and subprocess part in determine procedures;
Step 2) subprocess of described test procedure is partly carried out to slicing treatment, subprocess is partly cut out, obtain parent process part and the subprocess part of test procedure, and parent process is partly changed into one process program, then obtain the control flow graph of parent process and the control flow graph of subprocess;
Step 3) is used Efficient path method for decomposing to analyze to parent process, is specially: choose parent process and control the path that will dissect in flow graph as critical path, described critical path is carried out to pitching pile;
Step 4) is analyzed the control flow graph of subprocess, and the routing information that analysis is obtained passes to parent process with tree structure;
Step 5) is mapped to the pitching pile of parent process and subprocess in the respective code section of test procedure, then the parent process in test procedure and subprocess routing information is carried out to asynchronous process;
Step 6) parent process is carried out message integration after receiving the path profile information of subprocess, be specially: according to the analysis result of described step 3), determine the path ID in current parent's process, using described path ID as routing information in root node connexon process, form fullpath information.
In preferred version of the present invention, in step 4), the concrete grammar that the control flow graph of subprocess is analyzed is: choose subprocess and control the path that will dissect in flow graph as critical path, use k-BLPP method row pitching pile.
In preferred version of the present invention, in the asynchronous process of step 5), the pipeline of father and son's process is one-way pipeline, and with subprocess, for writing end, parent process is for reading end, and data send to parent process by subprocess.
The inventive method is emphasized the analysis to father and son's process interaction Program path, the integration dissecting by the path between parent process and two processes of subprocess respectively, the result dissecting by resolution path, can effectively identify the interactive relation between father and son's process.In program, isolate the code segment of father and son's process, by the critical path of two types of processes is dissected, utilize the communication mechanism between process to complete the path anatomy to interbehavior between father and son's process.
beneficial effect:the inventive method is compared with existing other path method for decomposing, has the following advantages:
(1) how the program that current method for decomposing is mainly paid close attention to one process carries out path anatomy, does not consider to be in multi-process situation at software in parsing process, and the path that is merely able to carry out a section or one process program dissects.How the path of multi-process program is dissected, existing method can not solve.The inventive method provides carries out the first method of separated rear combination to the path of father and son's process, effectively solves the path of multi-process is dissected to problem.
(2) with current path method for decomposing, the program of father and son's process is dissected, can only obtain single father and son's progress information, in the routing information dissecting out, there is no the relevance of father and son's process.In father and son's process situation, can not express the path relation between father and son's process.After the present invention has adopted subprocess is analyzed, information is transmitted in a parent process, the method of whole record in parent process, solved the problem of the profile information association that makes path in father and son's process, the routing information can logging program father and son process producing in reciprocal process, has improved the scope of application of path method for decomposing.
(3) provide the record of father and son path profile information is used to tree form data structure, make routing information can show clearly the associated situation in path, father and son's process path dissects the compactedness that has of result, avoided to the omission of multi-process Program path information, maybe can not, by the problem of the effective gang of path profile information of father and son's process, being conducive to the dynamic behaviour of program developer or user's prehension program in additive method.Promoted the path orientation ability in father and son's process interaction situation.
Accompanying drawing explanation
Fig. 1 represents father and son's process method for decomposing critical process process flow diagram;
Time response analysis when Fig. 2 is the operation of father and son's process;
Fig. 3 is the control flow graph of the program that will analyze of the present invention;
Fig. 4 is illustrated in and controls in flow graph after pitching pile in the pitching pile position of parent process and after completing pitching pile the corresponding path ID of every paths;
Fig. 5 is illustrated in and controls in flow graph after pitching pile in the pitching pile position of subprocess and after completing pitching pile the corresponding path ID of every path segments;
Fig. 6 is illustrated in and controls in flow graph after pitching pile in the pitching pile position of parent process and after completing pitching pile the corresponding path ID of every paths.
Embodiment
Below in conjunction with embodiment, technical scheme of the present invention is described in more detail:
Architecture
Fig. 1 has provided father and son's process path has been dissected to the critical workflow figure in technical process, in parsing process, comprises father's critical path, subpath, pipeline communication, semaphore, k-BLPP.
Provide illustrating of several main concept below:
Father path: the concept for father path is to be based upon on the concept of parent process, and parent process refers to create the process of one or more subprocesss.Father path representation program is the execution flow process in process from start to end, and the execution time of father's critical path need to be got rid of and waits for that subprocess carries out the time finishing.For parent process, a process can have a plurality of subprocesss, because this method is incorporated into routing information in father path, when dissecting path, need clearly distinguish father and son's process path.
Subpath: subpath refers to the path anatomy to subprocess, and subprocess refers to the process being created by another process (correspondence is referred to as parent process).Subprocess has been inherited most of attribute of corresponding parent process, as filec descriptor.In Unix, subprocess is generally the product of system call fork.In the case, subprocess is the copy of parent process at the very start, and after this, according to specific needs, subprocess can call chain type to load another program by exec.
Critical path: refer in the continuous implementation of program from start to end, the path of non-key transaction in rejected program, critical path is or analyst interested path large on program impact.
Pitching pile: guaranteeing to insert some probes on the basis that the original logic of tested program is complete in program, by the characteristic of the execution of probe the program of dishing out operation, by the analysis to these data, can obtain control stream and the traffic flow information of program, and then obtain the multidate informations such as logic covering, thereby realize the method for test purpose.
Pipeline communication: pipeline is for there being the communication between sibship process.Process first creates a pipeline before creating subprocess, for father and son's interprocess communication, creates subprocess, and parent process is closed and write end afterwards, and subprocess is closed and read end; So process just can be write data to pipeline, and parent process is from other end sense data.
Semaphore: semaphore is for guaranteeing to wake up a message of the parent process in waiting status, the anatomy result of guaranteeing can not lose subprocess when pathway information.
K-Ball-Larus Path Profiling(k-BLPP) method: the parsing process of the method mainly comprises two stages: the first stage, use Ball-Larus path profiling coding method to carry out unique coding ID to each paths in the path of controlling in flow graph; Subordinate phase, using the path ID that generates in the first stage to carry out the operation stream in a path in program can distinguishing identifier, be used for building a data structure and be used for the execution number of times of each clip path of track record, and then path is dissected to a prefix forest of result generation, k is a user-defined parameter.
The inventive method is utilized the control flow graph based on program conversion, then according to controlling flow graph, carries out successor operation.The control flow graph of the embodiment that uses as shown in Figure 3.
(1) test procedure of appointment is carried out to static analysis, the reference position of subprocess code and end position in finder, parent process part and subprocess part in determine procedures;
(2) by determined father and son's process two parts, test procedure is carried out to dicing method processing, program slice method is a kind of program analysis technique for decomposing program, and principle and method are set up in 1979 by M.Weiser in PhD dissertation.Concrete processing procedure is: according to the feature statement that produces subprocess in program, initial boundary as section, the end statement place of subprocess is the end boundary of section, delimit behind the border of subprocess, the subprocess identifying is partly cut out, obtain parent process part and the subprocess part of test procedure.Parent process is partly changed into one process program, then obtain the control flow graph of parent process and the control flow graph of subprocess, as Fig. 3, with the border of subprocess, determine the control flow graph of parent process and the control flow graph of subprocess;
(3) critical path in parent process is carried out to record, the method for use is analyzed for Efficient path method for decomposing.Efficient path method for decomposing is a kind of path method for decomposing that Thomas Ball proposed in IEEE meeting in 1996, for Program path being carried out to the analysis of frequency.Its idiographic flow is: obtain summit and frontier juncture system in the control flow graph of program, use algorithm to generate each limit and be worth accordingly, to using pitching pile algorithm to complete controlling the pitching pile of flow graph.In the present invention, detailed process is: choose parent process and control the path that will dissect in flow graph as critical path, described critical path is carried out to pitching pile; Pitching pile finishes to each critical path, have corresponding numerical coding corresponding afterwards, represents this path ID; Every critical path has unique coding.
To parent process pitching pile effect as Fig. 4; In parent process, dissect result with array form record; Program is in service obtains performed Program path, and program is repeatedly moved and can be obtained critical path and carry out frequency; In parent process, after the operation of each path, with a node form, pointing to current path node, is a node of the corresponding subprocess anatomy of this part parent process result.
(4) the control flow graph of subprocess is analyzed, used the method for k-BLPP to carry out pitching pile for program, detailed process is: choose and control the path that will dissect in flow graph as critical path.Critical path is carried out to pitching pile, a kind of construction algorithm is provided in the method, the new path flow of adding of input, this path flow is carried out after segmentation according to pitching pile information, can be by this path flow the formal output with forest, k-SF by name, adds dummy node and forms tree structure;
(5) pitching pile at parent process and subprocess is reverted in the respective code section of test procedure, then the parent process in test procedure and subprocess routing information are carried out to asynchronous process;
The aeoplotropism of interprocess communication information according to the present invention, sets up pipeline for the communication between process, in the present invention, only need to set up a half-duplex pipeline, can be between father and son's process; Subprocess is set for writing end, parent process, for reading end, writes by subprocess profile data in pipeline, by the parent process of the pipeline other end, is read.
Uncertainty due to working time of tested program father and son process, the asynchronous management of interpolation to Program path information after pitching pile in father and son's process is completed, after parent process anatomy finishes, because two sections of processes operation not necessarily identical reason consuming time, subprocess is end of run in time, and subprocess may exist following two kinds of situations:
A) after parent process anatomy finishes, the profile information of subprocess obtains, and parent process can directly be added subprocess path profile information to the profile information of parent process;
B) after parent process anatomy finishes, the profile information of subprocess not yet obtains, and now parent process needs antithetical phrase process path profile information to wait for;
In conjunction with above two kinds of situations, can use pipeline communication mode, for arranging in parent process, block sign, parent process path arranges and blocks sign after dissecting and finishing, and waits for that subprocess information writes.After writing, subprocess path profile information can write next time blocking sign replacement wait.
(6) routing information that is dissected the tree structure that in result, gained obtains by subprocess is passed to parent process, parent process is carried out message after receiving the path profile information of subprocess, forms fullpath information, and the data structure of routing information is as Fig. 5; Treatment step is:
A), according to the anatomy result that dissects path in current parent's process path, obtain path ID record in parent process;
B) in parent process current path ID judgement by sub path information to appending in parent process under current path information, under each parent process path, form the initial routing information of subprocess;
C) the subprocess routing information under parent process is converted into KIPT tree; Data structure is 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: make to set k-IPT and take Parent process ID: r as 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 ((ρ)) is illustrated in the set of the some ρ with (ρ) mark in k-SF; (ρ) represent the sign to ρ node; Counter (ρ) represents to comprise the counter of ρ node.
Above-described embodiment is only the preferred embodiment of the present invention; be noted that for those skilled in the art; under the premise without departing from the principles of the invention; can also make some improvement and be equal to replacement; these improve the claims in the present invention and are equal to the technical scheme after replacement, all fall into protection scope of the present invention.

Claims (3)

1. for a path method for decomposing for interactive information between father and son's process, it is characterized in that, the method comprises the steps:
Step 1) is carried out static analysis to the test procedure of appointment, parent process part and subprocess part in determine procedures;
Step 2) subprocess of described test procedure is partly carried out to slicing treatment, subprocess is partly cut out, obtain parent process part and the subprocess part of test procedure, and parent process is partly changed into one process program, then obtain the control flow graph of parent process and the control flow graph of subprocess;
Step 3) is used Efficient path method for decomposing to analyze to parent process, is specially: choose parent process and control the path that will dissect in flow graph as critical path, described critical path is carried out to pitching pile;
Step 4) is analyzed the control flow graph of subprocess, and the routing information that analysis is obtained passes to parent process with tree structure;
Step 5) is mapped to the pitching pile of parent process and subprocess in the respective code section of test procedure, then the parent process in test procedure and subprocess routing information is carried out to asynchronous process;
Step 6) parent process is carried out message integration after receiving the path profile information of subprocess, be specially: according to the analysis result of described step 3), determine the path ID in current parent's process, using described path ID as routing information in root node connexon process, form fullpath information.
2. the path method for decomposing for interactive information between father and son's process according to claim 1, it is characterized in that, in described step 4), the concrete grammar that the control flow graph of subprocess is analyzed is: choose subprocess and control the path that will dissect in flow graph as critical path, use k-BLPP method row pitching pile.
3. the path method for decomposing for interactive information between father and son's process according to claim 1 and 2, is characterized in that, in the asynchronous process of described step 5), the pipeline of father and son's process is one-way pipeline, with subprocess, for writing end, parent process is for reading end, and data send 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 true CN104199649A (en) 2014-12-10
CN104199649B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106055397A (en) * 2016-05-30 2016-10-26 新浪网技术(中国)有限公司 Control method and apparatus of lock
CN108334404A (en) * 2017-01-20 2018-07-27 腾讯科技(深圳)有限公司 The operation method and device of application program
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
王璐璐 等: "全路径剖析方法", 《软件学报》 *
王璐璐 等: "过程间循环路径剖析方法", 《计算机学报》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106055397A (en) * 2016-05-30 2016-10-26 新浪网技术(中国)有限公司 Control method and apparatus of lock
CN106055397B (en) * 2016-05-30 2019-09-27 新浪网技术(中国)有限公司 A kind of control method and device of lock
CN108334404A (en) * 2017-01-20 2018-07-27 腾讯科技(深圳)有限公司 The operation method and device of application program
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

Also Published As

Publication number Publication date
CN104199649B (en) 2017-04-05

Similar Documents

Publication Publication Date Title
McPhillips et al. YesWorkflow: a user-oriented, language-independent tool for recovering workflow information from scripts
AU2016216684B2 (en) Flow analysis instrumentation
US8601458B2 (en) Profile-driven data stream processing
CN106649100A (en) Automatic test method and system
US9367428B2 (en) Transparent performance inference of whole software layers and context-sensitive performance debugging
CN103020494B (en) Copyright ownership detecting method using Program code programming mode copyright ownership detecting model
Jeppu et al. Learning concise models from long execution traces
Yamanaka et al. Applying clone change notification system into an industrial development process
Hamou-Lhadj et al. A metamodel for the compact but lossless exchange of execution traces
Guana et al. Chaintracker, a model-transformation trace analysis tool for code-generation environments
CN104199649A (en) Path profiling method for interaction information between parent process and child process
CN100568177C (en) Entire system and system's local test use-case generation method based on process model
CN103744788B (en) The characteristic positioning method analyzed based on multi-source software data
Isaacs et al. Ordering traces logically to identify lateness in message passing programs
CN104317711A (en) Path-based method and system for verifying software implementation and design uniformity
CN106294136A (en) The online test method of concurrent program run duration performance change and system
CN111367786A (en) Symbol execution method, electronic equipment and storage medium
WO2023143426A1 (en) Performance analysis programming framework, method and apparatus
Normantas et al. An overview of the knowledge discovery meta-model
Alizadehsani et al. Modern integrated development environment (ides)
CN102004666A (en) Large-scale computer operation scheduling equipment and system
Nomura et al. Massive event data analysis and processing service development environment using dfd
Alawneh et al. Identifying computational phases from inter-process communication traces of HPC applications
CN102567845A (en) Online migration method and equipment for running example during combined service evolution
Qian et al. A strategy for multi-target paths coverage by improving individual information sharing

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