Application Profiling via Interrupt Sampling and Process Isolation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing profiling methods in computer systems face challenges in acquiring detailed profile information due to the minimum interrupt time of the system timer, which limits the resolution of profiling data, and struggle to distinguish between profiling target and non-target processes, especially in virtual storage environments, resulting in mixed profile information.
Innovation Solution
A profiling method that involves adding a call instruction for a profile acquisition function to the source code of an application program, linking a library of profile acquisition functions, and using a profile acquisition driver to sample information at interrupt occurrences, allowing for precise acquisition of execution status and differentiation between profiling target and non-target processes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If system interrupt timing is used for profiling, then profiling can be performed with system timer support, but the interrupt interval is limited to minimum system timer time (10ms in UNIX/Linux) preventing detailed command-level profile information acquisition
Solution Approach 1:
The system divides the profiling function into two separate components: a profiling target program that contains the code to be profiled, and a profiling program that collects profile information. This segmentation allows the profiling program to run concurrently with the target program, enabling detailed command-level profiling without being constrained by system timer interrupt intervals.
Solution Approach 2:
The profiling function is merged into the profiling target program by incorporating profile acquisition function calls directly into the target program's source code. This merging enables the target program to generate profile information during its normal execution without requiring separate system interrupts, thus achieving fine-grained profiling at command level.
2Productivity
If multiple processes are executed concurrently in OS with virtual storage mechanism, then system can handle multiple tasks, but profiling target processes and non-target processes cannot be distinguished resulting in mixed profile information
Solution Approach 1:
The system applies local quality by giving each process unique identification (process ID) and using this identifier to selectively collect profile information. The profiling program checks the process ID of each interrupt source to determine whether to collect profile data, thereby ensuring that only profiling target processes contribute to the profile information while maintaining concurrent execution of multiple processes.
3Measurement precision
If system call for process monitoring is used to acquire program counter value, then profiling can be performed, but system processing time is consumed and detailed command-level information is lost
Solution Approach 1:
The profiling target program performs self-service by containing embedded profile acquisition function calls within its own code. When executed, these functions automatically collect profile information during normal program operation without requiring external system calls or interrupts, thereby eliminating system processing overhead while achieving detailed command-level profiling.
Data Source
AI summary
A profiling method executed by a computer and system including generating a source code by adding a call instruction for a profile acquisition function to a source program of an application, generating an execution form of a profiling target program by linking a library of profile acquisition functions to the source code, executing the profiling target program in an operating system of a target system, calling a profile acquisition driver by executing the call instruction of the profile acquisition function via the library of the profile acquisition functions, and acquiring sampling information on an execution status of the profiling target program based on an interrupt occurrence by the profile acquisition driver.


