Callgraph Construction for Multiple Entry Point Functions
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current dynamic binary instrumentation methods for generating callgraphs are error-prone, especially when dealing with functions having multiple entry points, as they fail to accurately collect and propagate arc counts, leading to incorrect callgraph representations.
Innovation Solution
Insert function count probe code at each function entry point and inter-entry point arc probe code before arcs, collecting data on function counts and inter-entry point arc counts to construct a more accurate callgraph, eliminating the need for special compilation flags and ensuring all arcs are considered.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If current dynamic binary instrumentation methods are used to generate callgraphs, then the process can be performed at program run-time without special compilation, but the callgraph becomes error-prone and inaccurate when functions have multiple entry points
Solution Approach 1:
The patent segments the function entry points into distinct probe insertion locations. Instead of treating a function with multiple entry points as a single monolithic unit, the system inserts separate probe code at each individual entry point (e.g., before each function call site). This segmentation allows accurate tracking of arcs from each entry point independently, resolving the ambiguity that leads to incorrect callgraph representations.
Solution Approach 2:
The patent applies preliminary action by inserting probe code before each arc source address that leads to a function entry point. This preliminary instrumentation ensures that arc count data is collected from the very beginning of each execution path, before any potential ambiguity about which entry point was taken can occur. The probe code is placed in advance at critical locations to capture accurate arc count information.
2Device complexity
If function count probe code is not inserted at each function entry point, then the instrumentation process is simpler, but arc counts are not collected accurately for functions with multiple entry points
Solution Approach 1:
The system segments the instrumentation process by inserting separate function count probe code at each distinct function entry point. This segmentation ensures that no arc count information is lost, as each entry point is independently tracked. The probe code at each entry point collects arc count data specific to that entry point, preventing any information loss that would occur if a single unified probe was used for all entry points.
Solution Approach 2:
The patent introduces intermediary probe code as a mediator between the arc and the function entry point. This intermediary probe code is inserted before each arc source address and serves as a mediator to collect arc count information. The probe acts as an intermediary that captures the arc count data and makes it available for later callgraph construction, ensuring that no information is lost in the process.
3Productivity
If only call arcs are collected for functions with multiple entry points, then the instrumentation process is faster, but non-call arcs that contribute to function time propagation are missed
Solution Approach 1:
The patent applies preliminary action by inserting probe code before each arc source address that leads to a function entry point, regardless of whether the arc is a call arc or a non-call arc. This preliminary instrumentation ensures that all arcs, including non-call arcs that contribute to function time propagation, are collected. The probe code is placed in advance at all critical locations to capture complete arc count information.
Solution Approach 2:
The patent makes the instrumentation process universal by treating all arcs (both call arcs and non-call arcs) equally. Instead of selectively collecting only call arcs, the system collects arc count data from all arcs that lead to function entry points. This universal approach ensures that both call arcs and non-call arcs contribute to the accurate calculation of function time propagation, eliminating any bias toward call arcs only.
Data Source
AI summary
A technique for building a callgraph for a software program that includes multiple function entry points using dynamic instrumentation. In one example embodiment, this is achieved by inserting function count probe code at each function entry point of each multiple entry function having multiple function entry points in the software program. Inter-entry point arc probe code is then inserted substantially before each arc source address of an arc. A performance analysis tool is then used to collect data resulting from execution of the software program including the function count probe code and the inter-entry point arc probe code and to obtain an actual function count value for each multiple entry function. A callgraph is then built using the obtained actual function count values.


