# US 2014/0207632 A1 · Budget-aware event information collection during program execution

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

- Number: US 2014/0207632 A1
- Document ID: US20140207632A1
- Status: Published application
- Kind: A1
- Application number: 13/997,643
- Filed: 2012-05-09
- Published: 2014-07-24
- Earliest claimed: 2012-05-09
- Assignees: Intel Corporation
- Inventors: Zhiqiang Ma; Paul M. Petersen
- Web page: https://patentgrep.com/patent/US20140207632A1

## CPC

- G06Q 40/12: Accounting
- G06F 11/3624: {by performing operations on the source code, e.g. via a compiler}
- G06F 11/3636: {by tracing the execution of the program}
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of techniques and systems for slowdown-budget-aware event information collection are described. In various embodiments, a system may be configured to control collection of information for events associated with execution of a program during execution of the program based on a slowdown cost budget. In various embodiments, the slowdown cost budget may be set in order to help keep slowdown experienced due to associated event information collection within a range around the budget. In embodiments, this may provide a user with greater control over the effects of the associated event information collection and instrumentation than would be available due to simple sampling rate control. Other embodiments may be described and claimed.

## Claims

### Claim 1

One or more non-transitory computer-readable storage media having instructions embodied therein that are configured to cause a computing device, in response to execution of the instructions by the computing device, to:
determine, for a thread executing on the computing device, a collection ratio of a number of events associated with execution of the thread that have occurred during a period of execution of the thread and for which information has been collected to a total number of associated events that have occurred during the period of execution of the thread;
determine, based at least in part on the determined collection ratio, whether a slowdown cost budget has been exceeded; and
determine, based at least in part on a result of the determination of whether a slowdown cost budget has been exceeded, whether to collect information about associated events occurring during execution of the thread subsequent to the period of execution.

### Claim 2 (depends on 1)

The one or more computer-readable storage media of claim 1, wherein the instructions are further configured to cause the computing device, in response to execution of the instructions, to select a version of code for the thread for the execution subsequent to the period based on the result of the determination of whether to collect information about associated events occurring during execution of the thread subsequent to the period.

### Claim 3 (depends on 2)

The one or more computer-readable storage media of claim 2, wherein the instructions are configured to cause the computing device, in response to execution of the instructions, to select the version of code for the thread from:
a first version that is not configured to collect information about associated events; and
a second version that is configured to collect information about one or more associated events that occur during execution of the thread.

### Claim 4 (depends on 3)

The one or more computer-readable storage media of claim 3, wherein the second version is configured to collect information about all associated events that occur during execution of the thread.

### Claim 5 (depends on 3)

The one or more computer-readable storage media of claim 3, wherein the instructions are configured to cause the computing device, in response to execution of the instructions, to determine the collection ratio based on information that been collected by the previously-executed versions of code that are configured to collect information about one or more associated events that occur during execution of the previously-executed versions of code.

### Claim 6 (depends on 1)

The one or more computer-readable storage media of claim 1, wherein the instructions are further configured to cause the computing device, in response to execution of the instructions, to:
determine, based at least in part on the determined collection ratio, whether a slowdown cost for the thread has exceeded a slowdown cost upper bound; and
if the slowdown cost has exceeded the slowdown cost upper bound, determine to collect no information about associated events occurring during execution of the thread.

### Claim 7 (depends on 1)

The one or more computer-readable storage media of claim 1, wherein the instructions are further configured to cause the computing device, in response to execution of the instructions, to:
determine, based at least in part on the determined collection ratio, whether a slowdown cost for the thread has dropped below a slowdown cost lower bound; and
if the slowdown cost has dropped below the slowdown cost lower bound, determine to collect information about associated events occurring during execution of the thread.

### Claim 8 (depends on 1)

The one or more computer-readable storage media of claim 1, wherein the instructions are further configured to cause the computing device, in response to execution of the instructions, to:
when a slowdown cost for the thread has exceeded the slowdown cost budget, determine, for a trace on the thread to be executed, whether a rate of previous sampling for the trace of the thread has fallen below an expected sampling rate for the trace of the thread;
when the rate of previous sampling for the trace of the thread has fallen below the expected sampling rate for the trace of the thread, determine whether to collect information about associated events occurring during execution of the thread subsequent to the period, regardless of whether the slowdown cost budget has been exceeded.

### Claim 9 (depends on 1)

The one or more computer-readable storage media of claim 1, wherein the instructions are further configured to cause the computing device, in response to execution of the instructions, to:
when a slowdown cost for the thread has not exceeded the slowdown cost budget, determine, for a trace on the thread to be executed, whether a rate of previous sampling for the trace of the thread has exceeded an expected sampling rate for the trace of the thread;
when the rate of previous sampling for the trace of the thread has exceeded the expected sampling rate for the trace of the thread, determine whether to collect information about associated events occurring during execution of the thread subsequent to the period, regardless of whether the slowdown cost budget has been exceeded.

### Claim 10 (depends on 9)

The one or more computer-readable storage media of claim 9, wherein the instructions are configured to cause the computing device, in response to execution of the instructions, to determine whether to collect information about associated events occurring during execution of the thread subsequent to the period, regardless of whether the slowdown cost budget has been exceeded based at least in part on a determination of whether the slowdown cost for the thread has dropped below a slowdown cost lower bound.

### Claim 11 (depends on 1)

The one or more computer-readable storage media of claim 1, wherein:
the thread is a thread of an application executing on the computing device; and
the instructions are configured to cause the computing device, in response to execution of the instructions, to determine whether the slowdown cost budget has been exceeded based at least in part on a comparison of the determined collection ratio to slowdown values representing additional time taken for execution of the application when instrumented to collect information about associated events that occurred during execution of the application.

### Claim 12 (depends on 11)

The one or more computer-readable storage media of claim 11, wherein the slowdown values comprise:
a full slowdown value for the application representing additional time taken for execution of the application when 100% of the events the application is instrumented to collect are collected; and
a survival slowdown value for the application representing additional time taken for execution of the application when none of the events the application is instrumented to collect are collected.

### Claim 13

(canceled)

### Claim 14

An apparatus for budget-aware event information collection during execution of a program on the apparatus, the apparatus comprising:
one or more computer processors; and
an auditor module configured to be operated by the one or more computer processors to:
determine, for a thread of the program executing on the apparatus, a collection ratio of a number of events associated with execution of the thread that have occurred during a period of execution of the thread and for which information has been collected to a total number of associated events that have occurred during the period of execution of the thread;
determine, based at least in part on the determined collection ratio, whether a slowdown cost budget has been exceeded; and
determine, based at least in part on a result of the determination of whether a slowdown cost budget has been exceeded, whether to collect information about associated events occurring during execution of the thread subsequent to the period of execution.

### Claim 15 (depends on 14)

The apparatus of claim 14, further comprising one or more accountant modules configured to be operated by the one or more computer processors to record occurrences of associated events during execution of the thread.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the one or more accountant modules are further configured to be operated by the one or more computer processors to record occurrences of information being collected about associated events by testing instrumentation during execution of the thread.

### Claim 17 (depends on 15)

The apparatus of claim 15, wherein the one or more accountant modules are each associated with basic blocks of the program.

### Claim 18 (depends on 14)

The apparatus of claim 14, wherein the auditor module is further configured to be operated by the one or more computer processors to select a version of code for the thread for the execution subsequent to the period based on the result of the determination of whether to collect information about associated events occurring during execution of the thread subsequent to the period.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the auditor module is further configured to be operated by the one or more computer processors to select the version of code for the thread from:
a first version that is not configured to collect information about associated events; and
a second version that is configured to collect information about one or more associated events that occur during execution of the thread.

### Claim 20

(canceled)

### Claim 21

(canceled)

### Claim 22 (depends on 14)

The apparatus of claim 14, wherein the auditor module is further configured to be operated by the one or more computer processors to:
determine, based at least in part on the determined collection ratio, whether the slowdown cost for the thread has exceeded a slowdown cost upper bound; and
if the slowdown cost has exceeded the slowdown cost upper bound, determine to collect no information about associated events occurring during execution of the thread.

### Claim 23 (depends on 14)

The apparatus of claim 14, wherein the auditor module is further configured to be operated by the one or more computer processors to:
determine, based at least in part on the determined collection ratio, whether the slowdown cost for the thread has dropped below a slowdown cost lower bound; and
if the slowdown cost has dropped below the slowdown cost lower bound, determine to collect information about associated events occurring during execution of the thread.

### Claim 24 (depends on 14)

The apparatus of claim 14, wherein the auditor module is further configured to be operated by the one or more computer processors to:
when a slowdown cost for the thread has exceeded the slowdown cost budget, determine, for a trace on the thread to be executed, whether a rate of previous sampling for the trace of the thread has fallen below an expected sampling rate for the trace of the thread;
when the rate of previous sampling for the trace of the thread has fallen below the expected sampling rate for the trace of the thread, determine whether to collect information about associated events occurring during execution of the thread subsequent to the period, regardless of whether the slowdown cost budget has been exceeded.

### Claim 25 (depends on 14)

The apparatus of claim 14, wherein the auditor module is further configured to be operated by the one or more computer processors to:
when a slowdown cost for the thread has not exceeded the slowdown cost budget, determine, for a trace on the thread to be executed, whether a rate of previous sampling for the trace of the thread has exceeded an expected sampling rate for the trace of the thread;
when the rate of previous sampling for the trace of the thread has exceeded the expected sampling rate for the trace of the thread, determine whether to collect information about associated events occurring during execution of the thread subsequent to the period, regardless of whether the slowdown cost budget has been exceeded.

### Claim 26 (depends on 14)

The apparatus of claim 14, wherein the auditor module is configured to be operated by the one or more computer processors to determine whether to collect information about associated events occurring during execution of the thread subsequent to the period, regardless of whether the slowdown cost budget has been exceeded based at least in part on a determination of whether the slowdown cost for the thread has dropped below a slowdown cost lower bound.

### Claim 27 (depends on 14)

The apparatus of claim 14, wherein:
the thread is a thread of an application executing on the one or more computer processors; and
the auditor module is configured to be operated by the one or more computer processors to determine whether the slowdown cost budget has been exceeded based at least in part on a comparison of the determined collection ratio to slowdown values representing additional time taken for execution of the application when instrumented to collect information about associated events that occurred during execution of the application.

### Claim 28 (depends on 27)

The apparatus of claim 27, wherein the slowdown values comprise:
a full slowdown value for the application representing additional time taken for execution of the application when 100% of the events the application is instrumented to collect are collected; and
a survival slowdown value for the application representing additional time taken for execution of the application when none of the events the application is instrumented to collect are collected.

### Claim 29

(canceled)

### Claim 30

A computer-implemented method for budget-aware event information collection during execution of a program on a computing device, the method comprising:
determining, by the computing device, a collection ratio of a number of events associated with execution of the thread that have occurred during a period of execution of the thread and for which information has been collected to a total number of associated events that have occurred during the period of execution of the thread;
determining, by the computing device, based at least in part on the determined collection ratio, whether a slowdown cost budget has been exceeded; and
determining, based at least in part on a result of the determining of whether a slowdown cost budget has been exceeded, by the computing device, whether to collect information about associated events occurring during execution of the thread subsequent to the period.

### Claim 31 (depends on 30)

The method of claim 30, further comprising selecting, by the computing device, a version of code for the thread for the execution subsequent to the period based on the result of the determination of whether to collect information about associated events occurring during execution of the thread subsequent to the period.

### Claim at position 32

32-42. (canceled)
