# US 2008/0313406 A1 · Methods and systems for porting sysprof

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

- Number: US 2008/0313406 A1
- Document ID: US20080313406A1
- Status: Published application
- Kind: A1
- Application number: 11/763,389
- Filed: 2007-06-14
- Published: 2008-12-18
- Earliest claimed: 2007-06-14
- Assignees: Red Hat, Inc.
- Inventors: Kristian Hoegsberg Kristensen
- Web page: https://patentgrep.com/patent/US20080313406A1

## CPC

- G06F 11/3471: {Address tracing}
- G06F 11/3452: {Performance evaluation by statistical analysis}
- G06F 2201/885: Monitoring specific for caches
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of the present invention provide a system profiler that can be used on any processor architecture. In particular, instead of copying an entire stack every time, the stack is divided into blocks of a fixed size. For each block, a hash value is computed. As stack blocks are sent out of the kernel, the hash value and a copy of the block contents is kept in a user space cache. In the kernel, the hash codes of sent stack blocks are tracked in a table. During system profiling, the kernel module sampling the call stack determines if that stack block was previously sent by checking for the hash value in the kernel table. If the hash matches an entry in the kernel table, then only the hash value is sent. If the hash value is not in the table, the entire block and the hash value is sent.

## Claims

### Claim 1

A method of profiling a computer system, said method comprising:
dividing a call stack into fixed size blocks;
calculating hash values for each of the blocks;
sampling the call stack;
determining, for each block in a sample, if the block was previously sent to an application running on the computer system;
sending only the hash value for the block when that block was previously sent; and
sending the hash value and the block when that block was not previously sent.

### Claim 2 (depends on 1)

The method of claim 1, wherein dividing the call stack comprises dividing the call stack into blocks of 256 bytes.

### Claim 3 (depends on 1)

The method of claim 1, wherein calculating hash values for each of the blocks comprises calculating MD-5 hash values for each of the blocks.

### Claim 4 (depends on 1)

The method of claim 1, wherein calculating hash values for each of the blocks comprises calculating SHA-1 hash values for each of the blocks.

### Claim 5 (depends on 1)

The method of claim 1, wherein calculating hash values for each of the blocks comprises calculating CRC32 hash values for each of the blocks.

### Claim 6 (depends on 1)

The method of claim 1, wherein calculating hash values for each of the blocks comprises calculating Adler32 hash values for each of the blocks.

### Claim 7 (depends on 1)

The method of claim 1, wherein determining, for each block in a sample, if the block was previously sent to an application running on the computer system by checking a table of hash values.

### Claim 8 (depends on 1)

The method of claim 1, wherein determining, for each block in a sample, if the block was previously sent to an application running on the computer system by checking a kernel table of hash values.

### Claim 9 (depends on 1)

The method of claim 1, wherein sending the hash value and the block when that block was not previously sent comprises recording the hash value in a table when the block was not previously sent.

### Claim 10 (depends on 1)

An apparatus comprising means configured to perform the method of claim 1.

### Claim 11 (depends on 1)

A computer readable medium comprising computer executable code for performing the method of claim 1.

### Claim 12

A system configured to profile its operations, said system comprising:
a processor configured to use a call stack;
a memory, coupled to the processor, comprising a kernel space and a user space;
a profiling application, running from user space, configured to profile operations of the system based on samples of the call stack.
a sampling module, running from the kernel space, configured to divide the call stack into fixed size blocks, sample the call stack, calculate hash values for each block in a sample, determine if each block was previously sent to the profiling application, send only the hash value when that block was previously sent, and send the hash value and the block when that block was not previously sent.

### Claim 13 (depends on 12)

The system of claim 12, wherein the sampling module is configured to divide the call stack into fixed size blocks of 256 bytes.

### Claim 14 (depends on 12)

The system of claim 12, wherein the sampling module is configured to calculate MD5 hash values.

### Claim 15 (depends on 12)

The system of claim 12, wherein the sampling module is configured to calculate SHA-1 hash values.

### Claim 16 (depends on 12)

The system of claim 12, wherein the sampling module is configured to calculate CRC32 hash values.

### Claim 17 (depends on 12)

The system of claim 12, wherein the sampling module is configured to calculate Adler32 hash values.

### Claim 18 (depends on 12)

The system of claim 12, wherein the sampling module is configured to track blocks that have been sent to the profiling application based on a table of hash values stored in the kernel space.

### Claim 19 (depends on 16)

The system of claim 16 wherein the sampling module is configured to send only the hash value when the hash value for that block matches an entry in the table of hash values.

### Claim 20 (depends on 16)

The system of claim 16, wherein the sampling module is configured to send the hash value and the block when the hash value for that block does not match an entry in the table of hash values.

### Claim 21 (depends on 12)

The system of claim 12, wherein the profiling application is configured to make copies of blocks it receives from the sampling module into a user space cache.

### Claim 22 (depends on 12)

The system of claim 12, wherein the profiling application is configured to retrieve a copy of a block from a user space cache when it receives only a hash value from the sampling module.

### Claim 23 (depends on 12)

The system of claim 12, wherein the processor is a non-x86 processor.
