# US 2008/0313618 A1 · Detaching Profilers

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

- Number: US 2008/0313618 A1
- Document ID: US20080313618A1
- Status: Published application
- Kind: A1
- Application number: 11/762,260
- Filed: 2007-06-13
- Published: 2008-12-18
- Earliest claimed: 2007-06-13
- Assignees: Microsoft Corporation
- Inventors: David Broman; Jonathan Keljo; Vance Morrison; Sean Selitrennikoff; Hsu-chieh Yuan
- Web page: https://patentgrep.com/patent/US20080313618A1

## CPC

- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 9/445: Program loading or initiating (bootstrapping G06F9/4401; security arrangements for program loading or initiating G06F21/57)
- G06F 2201/865: Monitoring of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A profiler may be detached from an actively running application by first sealing communications between the application and profiler, then evacuating the profiler by waiting for any profiler-modified or instrumented code to complete execution, profiler runtime code to complete execution, cleaning up any residual items from the profiler, and shutting down the profiler. The profiler may be operational in many different environments, including a managed environment such as a virtual machine and those environments having just in time compiling of executable code.

## Claims

### Claim 1

A method comprising:
initiating an executable application and a profiler for said executable application;
stopping new communication between said profiler and said executable application;
identifying profiler modified code within said executable application for a first function;
determining that said profiler modified code has completed operation; and
shutting down said profiler.

### Claim 2 (depends on 1)

The method of claim 1 further comprising:
replacing said profiler modified code with non-profiler modified code for said first function.

### Claim 3 (depends on 2)

The method of claim 2, said replacing being performed after said determining.

### Claim 4 (depends on 1)

The method of claim 1, said profiler modified code being in a call stack.

### Claim 5 (depends on 1)

The method of claim 1 further comprising:
identifying a thread modified by said profiler; and
shutting down said thread.

### Claim 6 (depends on 1)

The method of claim 1 further comprising:
identifying a profiler function in a call stack; and
removing said profiler function from said call stack.

### Claim 7 (depends on 1)

The method of claim 1 being performed in a managed code environment.

### Claim 8 (depends on 7)

The method of claim 7, said managed code environment being a virtual machine.

### Claim 9 (depends on 1)

The method of claim 1 comprising compiling at least a portion of said executable application with at least a portion of said profiler.

### Claim 10 (depends on 9)

The method of claim 9, at least a portion of said compiling being performed at runtime.

### Claim 11 (depends on 1)

A computer readable medium comprising computer executable instructions adapted to perform the method of claim 1.

### Claim 12

A system comprising:
a library of common functions;
a runtime engine adapted to execute an application;
a profiler operable with said application;
a profiler detachment mechanism adapted to:
stop new communication between said profiler and said executable application;
identify profiler modified code within said executable application for a first function;
determine that said profiler modified code has completed operation; and
shut down said profiler.

### Claim 13 (depends on 12)

The system of claim 12 comprising a managed code environment.

### Claim 14 (depends on 13)

The system of claim 13, said managed code environment comprising a virtual machine.

### Claim 15 (depends on 12)

The system of claim 12, said profiler detachment mechanism further adapted to:
identify a thread modified by said profiler; and
shut down said thread.

### Claim 16 (depends on 12)

The system of claim 12, said profiler detachment mechanism further adapted to:
replace said profiler modified code with non-profiler modified code for said first function.

### Claim 17

A device comprising:
a monitoring function adapted to monitor at least one parameter from an executing application;
a code modification function adapted to modify code within said executing application to produce device-modified code;
a detach function adapted to:
stop new communication between said device and said executable application;
identify said device-modified code within said executable application for a first function;
determine that said device-modified code has completed operation; and
shut down said device.

### Claim 18 (depends on 17)

The device of claim 17 operable within a managed code environment.

### Claim 19 (depends on 17)

The device of claim 17, a portion of said device being compiled with at least a portion of said executable application.

### Claim 20 (depends on 17)

The device of claim 17 being comprised in computer executable instructions on a computer readable media.
