# US 10,768,915 B2 · Systems and methods for selectively instrumenting a program according to performance characteristics

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,768,915 B2
- Document ID: US10768915B2
- Status: Granted
- Kind: B2
- Application number: 16/164,173
- Filed: 2018-10-18
- Published: 2020-04-23
- Granted: 2020-09-08
- Earliest claimed: 2018-10-18
- Assignees: DENSO International America, Inc.
- Applicants: Denso International America, Inc.
- Inventors: Ameer Kashani; Gopalakrishnan Iyer
- Web page: https://patentgrep.com/patent/US10768915B2

## CPC

- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 11/3636: {by tracing the execution of the program}
- G06F 21/57: Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F 2201/865: Monitoring of software
- G06F 2201/88: Monitoring involving counting
- G06F 2221/033: Test or assess software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

System, methods, and other embodiments described herein relate to determining performance overhead for instrumentation within a program. In one embodiment, a method includes, in response to compiling the program from source code into machine code, analyzing the program to generate overhead scores associated with segments of instrumentation within separate functions of the program. The instrumentation is combined with the source code to provide functionality in addition to a base functionality of the program. The method includes selectively modifying the segments in the source code for the separate functions according to whether the overhead scores for respective ones of the segments satisfies an instrumentation threshold associated with respective ones of the separate functions.

## Claims

### Claim 1

An overhead assessment system for selectively instrumenting a program, comprising:
one or more processors;
a memory communicably coupled to the one or more processors and storing:
a performance module including instructions that when executed by the one or more processors cause the one or more processors to analyze the program to generate overhead scores associated with segments of instrumentation within separate functions of the program, wherein the instrumentation is combined with source code of the program to provide functionality in addition to a base functionality of the program; and
an instrumentation module including instructions that when executed by the one or more processors cause the one or more processors to selectively modify the segments in the source code of the program for the separate functions according to whether the overhead scores for respective ones of the segments satisfies an instrumentation threshold associated with respective ones of the separate functions,
wherein the performance module includes instructions to generate the overhead scores including instructions to calculate the overhead scores for the respective ones of the segments associated with the separate functions as a ratio of a program count and an instrumentation count relative to a runtime coverage for the separate functions.

### Claim 2 (depends on 1)

The overhead assessment system of claim 1, wherein the instrumentation threshold for the respective ones of the separate functions is based, at least in part, on one or more characteristics associated with the separate functions including at least an importance level for instrumenting the separate functions as defined by an instrumentation policy.

### Claim 3 (depends on 1)

The overhead assessment system of claim 1, wherein the instrumentation module includes instructions to selectively modify the segments of instrumentation including instructions to improve the overhead scores by altering the instrumentation for unsatisfactory functions of the separate functions that do not satisfy the instrumentation threshold.

### Claim 4 (depends on 3)

The overhead assessment system of claim 3, wherein altering the instrumentation for the unsatisfactory functions includes one of: removing the instrumentation and replacing the instrumentation with optimized instrumentation that results in an improved overhead score for the unsatisfactory function.

### Claim 5 (depends on 1)

The overhead assessment system of claim 1, wherein the instrumentation is security instrumentation that controls a flow of the program to prevent redirection of the flow from secondary interactions that are external to the program.

### Claim 6 (depends on 5)

The overhead assessment system of claim 5, wherein the performance module includes instructions to analyze the program including instructions to generate the program count and the instrumentation count, wherein the program count indicates a number of instructions of the program associated with the separate functions, and wherein the instrumentation count indicates a number of instructions of the instrumentation for the respective segments.

### Claim 7 (depends on 5)

The overhead assessment system of claim 5, wherein the performance module includes instructions to analyze the program including instructions to dynamically capture the runtime coverage for the separate functions of the program as the program is executed.

### Claim 8 (depends on 5)

The overhead assessment system of claim 5, wherein the performance module includes instructions to analyze the program including instructions to statically determine the runtime coverage for the separate functions by calculating the runtime coverage according to an entry point into the program and a recursive analysis of the program according to a limited path depth.

### Claim 9

A non-transitory computer-readable medium storing instructions for selectively instrumenting a program and that when executed by one or more processors cause the one or more processors to:
analyze the program to generate overhead scores associated with segments of instrumentation within separate functions of the program, wherein the instrumentation is combined with source code to provide functionality in addition to a base functionality of the program; and
selectively modify the segments in the source code of the program for the separate functions according to whether the overhead scores for respective ones of the segments satisfies an instrumentation threshold associated with respective ones of the separate functions,
wherein the instructions to generate the overhead scores include instructions to calculate the overhead scores for the respective ones of the segments associated with the separate functions as a ratio of a program count and an instrumentation count relative to a runtime coverage for the separate functions.

### Claim 10 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the instrumentation threshold for the respective ones of the separate functions is based, at least in part, on one or more characteristics associated with the separate functions including at least an importance level for instrumenting the separate functions as defined by an instrumentation policy.

### Claim 11 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the instructions to selectively modify the instrumentation include instructions to improve the overhead scores by removing the instrumentation for unsatisfactory functions of the separate functions that do not satisfy the instrumentation threshold.

### Claim 12 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the instrumentation is security instrumentation that controls a flow of the program to prevent redirection of the flow from secondary interactions that are external to the program.

### Claim 13 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the instructions to analyze the program include instructions to dynamically capture the runtime coverage for the separate functions of the program as the program is executed.

### Claim 14

A method of selectively instrumenting a program, comprising:
in response to compiling the program from source code into machine code, analyzing the program to generate overhead scores associated with segments of instrumentation within separate functions of the program, wherein the instrumentation is combined with the source code to provide functionality in addition to a base functionality of the program; and
selectively modifying the segments in the source code for the separate functions according to whether the overhead scores for respective ones of the segments satisfy an instrumentation threshold associated with respective ones of the separate functions,
wherein generating the overhead scores includes calculating the overhead scores for the respective ones of the segments associated with the separate functions as a ratio of a program count and an instrumentation count relative to a runtime coverage for the respective ones of the segments.

### Claim 15 (depends on 14)

The method of claim 14, wherein the instrumentation threshold for the respective ones of the separate functions is based, at least in part, on one or more characteristics associated with the separate functions including at least an importance level for instrumenting the separate functions as defined by an instrumentation policy.

### Claim 16 (depends on 14)

The method of claim 14, wherein selectively modifying the segments of instrumentation includes improving the overhead scores by altering the instrumentation for unsatisfactory functions of the separate functions that do not satisfy the instrumentation threshold.

### Claim 17 (depends on 16)

The method of claim 16, wherein altering the instrumentation for the unsatisfactory functions includes one of: removing the instrumentation and replacing the instrumentation with optimized instrumentation that results in an improved overhead score for the unsatisfactory function.

### Claim 18 (depends on 14)

The method of claim 14,
wherein analyzing the program includes generating the program count and the instrumentation count, wherein the program count indicates a number of instructions of the program associated with the separate functions, and wherein the instrumentation count indicates a number of instructions of the instrumentation for the respective segments.

### Claim 19 (depends on 18)

The method of claim 18, wherein analyzing the program includes dynamically capturing the runtime coverage for the separate functions of the program, and wherein the instrumentation is security instrumentation that controls a flow of the program to prevent redirection of the flow from secondary interactions that are external to the program.

### Claim 20 (depends on 18)

The method of claim 18, wherein analyzing the program includes statically determining the runtime coverage for the separate functions by calculating the runtime coverage according to an entry point into the program and a recursive analysis of the program according to a limited path depth.
