# US 2022/0012160 A1 · Instrumentation trace capture technique

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

- Number: US 2022/0012160 A1
- Document ID: US20220012160A1
- Status: Published application
- Kind: A1
- Application number: 16/926,268
- Filed: 2020-07-10
- Published: 2022-01-13
- Earliest claimed: 2020-07-10
- Assignees: Metawork Corporation
- Applicants: Metawork Corporation
- Inventors: Nicholas DeMonner; David Michael Renie; David Marcin; Margaret Henry
- Web page: https://patentgrep.com/patent/US20220012160A1

## CPC

- G06F 11/3636: {by tracing the execution of the program}
- G06F 8/70: Software maintenance or management
- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 11/3644: {by instrumenting at runtime}
- G06F 11/366: {using diagnostics (G06F11/0703 takes precedence)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An instrumentation trace capture technique enables software developers to monitor, diagnose and solve errors associated with application development and production. A client library of an investigative platform is loaded in a user application executing on a virtual machine instance of a virtualized computing environment. The client library interacts with an agent of the platform to instrument executable code of the user application and, to that end, loads a capture configuration that specifies, inter alia, methods and associated arguments, variables and data structures (values), to instrument. The client library inspects the executable code to determine portions of the code to instrument based on the capture configuration, which describes a degree of fidelity (e.g., a frequency) of the executable code and data to trace at runtime. Capture points of the runtime application are implemented as callbacks to the client library, which are registered with a runtime system executing the user application.

## Claims

### Claim 1

A method comprising:
automatically instrumenting executable code of methods of an application to capture traces of execution of the application on a computer node having a memory, wherein instrumenting of the executable code is in accordance with a capture configuration determining a fidelity of trace capture;
generating a capture filter defining information to capture from the traces of execution;
establishing one or more callbacks to a client library as one or more event-driven capture intervals of the traces during execution of the application, wherein the client library is loaded into a process of the application;
capturing the traces of execution during the capture interval via the callback to the client library according to the capture filter, wherein the traces include symbolic information selected from one or more of (i) high-level programming text processed by a runtime system executing the application and (ii) symbols as labels representing one or more of methods, variables, data and state of the executable code;
compressing the traces via the callback to the client library; and
sending the traces to an agent process via the callback to the client library, the agent process and application process executing on a same operating system.

### Claim 2 (depends on 1)

The method of claim 1 wherein capturing the traces of execution during the capture interval further comprises:
searching the capture filter to determine a presence of one or more identifiers of the information to capture from the traces of execution; and
in response to determining the presence of an identifier of the information to capture, recording the trace of execution.

### Claim 3 (depends on 2)

The method of claim 2 wherein capturing the traces of execution during the capture interval further comprises:
querying the runtime system via an application programming interface to determine a call history of methods and associated arguments of the application invoked during the capture interval.

### Claim 4 (depends on 1)

The method of claim 1 further comprising:
in response to an exception raised during the capture interval, increasing the fidelity of the trace capture.

### Claim 5 (depends on 1)

The method of claim 1 wherein capturing the traces of execution during the capture interval further comprises:
determining whether an expression stored in the capture configuration matches a path of a data structure defined in the executable code; and
in response to determining that the expression stored in the capture configuration matches the path, capturing a runtime value of the data structure.

### Claim 6 (depends on 1)

The method of claim 1 wherein capturing the traces of execution during the capture interval further comprises:
capturing runtime values of a data structure by walking elements of the data structure in the memory according to a maximum nested depth stored in the capture configuration.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
dynamically adjusting the maximum nested depth stored in the capture configuration based on one of a type of a first element of the data structure or runtime value of the first element of the data structure.

### Claim 8 (depends on 1)

The method of claim 1 wherein capturing the traces of execution during the capture interval further comprises:
determining whether an expression stored in the capture configuration matches a type of an element of a data structure defined in the executable code; and
in response to determining that the expression stored in the capture configuration matches the type of the element, capturing a value of the element of the structure.

### Claim 9 (depends on 8)

The method of claim 8 wherein the expression stored in the capture configuration is defined as key/value pair.

### Claim 10 (depends on 1)

The method of claim 1 wherein changes to the capture configuration are reloaded and the capture filter is re-generated during the callback to the client library.

### Claim 11

A non-transitory computer readable medium including program instructions for execution on one or more processors, the program instructions configured to:
automatically instrument executable code of methods of an application to capture traces of execution of the application on a computer node having a memory, wherein the executable code is instrumented in accordance with a capture configuration determining a fidelity of trace capture;
generate a capture filter defining information to capture from the traces of execution;
establish one or more callbacks to a client library as one or more event-driven capture intervals of the traces during execution of the application, wherein the client library is loaded into a process of the application;
capture the traces of execution during the capture interval via the callback to the client library according to the capture filter, wherein the traces include symbolic information selected from one or more of (i) high-level programming text processed by a runtime system executing the application and (ii) symbols as labels representing one or more of methods, variables, data and state of the executable code;
compress the traces via the callback to the client library; and
send the traces to an agent process via the callback to the client library, the agent process and application process executing on a same operating system.

### Claim 12 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein the program instructions configured to capture the traces of execution during the capture interval are further configured to:
search the capture filter to determine a presence of one or more identifiers of the information to capture from the traces of execution; and
in response to determining the presence of an identifier of the information to capture, record the trace of execution.

### Claim 13 (depends on 12)

The non-transitory computer readable medium of claim 12, wherein the program instructions configured to capture the traces of execution during the capture interval are further configured to:
query the runtime system via an application programming interface to determine a call history of methods and associated arguments of the application invoked during the capture interval.

### Claim 14 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein the program instructions configured to capture the traces of execution during the capture interval are further configured to:
in response to an exception raised during the capture interval, increase the fidelity of the trace capture.

### Claim 15 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein the program instructions configured to capture the traces of execution during the capture interval are further configured to:
determine whether an expression stored in the capture configuration matches a path of a data structure defined in the executable code; and
in response to determining that the expression stored in the capture configuration matches the path, capture a runtime value of the data structure.

### Claim 16 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein the program instructions configured to capture the traces of execution during the capture interval are further configured to:
capture runtime values of a data structure by walking elements of the data structure in the memory according to a maximum nested depth stored in the capture configuration.

### Claim 17 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein the program instructions configured to capture the traces of execution during the capture interval are further configured to:
determine whether an expression stored in the capture configuration matches a type of an element of a data structure defined in the executable code; and
in response to determining that the expression stored in the capture configuration matches the type of the element, capture a value of the element of the structure.

### Claim 18 (depends on 16)

The non-transitory computer readable medium of claim 16 wherein the expression stored in the capture configuration is defined as key/value pair.

### Claim 19 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein changes to the capture configuration are reloaded and the capture filter is re-generated during the callback to the client library.

### Claim 20

A system comprising:
a node including a processor and a memory, the memory including an application having executable code of methods linked to a client library with program instructions configured to,
automatically instrument the executable code of the methods to capture traces of execution of the application according to a capture configuration determining a fidelity of trace capture;
generate a capture filter defining information to capture from the traces of execution;
establish one or more callbacks to a client library as one or more event-driven capture intervals of the traces during execution of the application, wherein the client library is loaded into a process of the application;
capture the traces of execution during the capture interval via the callback to the client library according to the capture filter, wherein the traces include symbolic information selected from one or more of (i) high-level programming text processed by a runtime system executing the application and (ii) symbols as labels representing one or more of methods, variables, data and state of the executable code;
compress the traces via the callback to the client library; and
send the traces to an agent process via the callback to the client library, the agent process and application process executing on a same operating system.
