IP Library Granted Patent US 7,380,241
Granted Patent B2
US 7,380,241 · App. 11/006,370 · Granted May 27, 2008

Scalable and improved profiling of software programs

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,380,241
App. No.
11/006,370
Granted
May 27, 2008
Kind
B2
Abstract

A method for profiling software programs uses a small pinned buffer and a large unpinned histogram buffer. When a process that is being profiled receives a time slice, the process' program counter is written to the small pinned buffer by a kernel routine. The small pinned buffer is configured to be large enough to store several program counters. When the small pinned buffer is full, or almost full, an internal profiling signal is sent by the kernel routine. When the process is resumed, any outstanding signals (including the profiling signal) are processed before resuming the process. The profiling signal is handled by reading the program counters from the small pinned buffer, calculating a slot in the histogram buffer that corresponds to each of the program counters, incrementing the value in the corresponding histogram slots, and clearing the small pinned buffer so that it can be reused.

Claims (14)

1. A method of profiling a process executing on a processor, the method comprising:

receiving a profiling request from the process, the profiling request including a pointer to an unpinned histogram buffer that was allocated by the process in a memory;

setting a flag in a data structure corresponding to the process indicating that the process is being profiled;

allocating, by a kernel routine, a small pinned buffer in the memory, wherein the unpinned histogram buffer is larger than the small pinned buffer;

initializing a buffer counter used to count the number of entries recorded in the small pinned buffer, wherein the small pinned buffer is allocated by a kernel routine;

recording, in the small pinned buffer, a plurality of program counters encountered while executing the process until a threshold number of program counters recorded in the small pinned buffer is reached;

incrementing the buffer counter each time one of the plurality of program counters is recorded in the small pinned buffer;

in response to reaching the threshold number of program counters:

for each program counter recorded in the small pinned buffer:

calculating a slot within the unpinned histogram buffer that corresponds to the program counter;

reading a counter from the calculated slot;

incrementing the counter; and

writing the counter back to the calculated slot; and

clearing the small pinned buffer after each program counter recorded in the small pinned buffer has been processed, wherein the clearing of the small pinned buffer includes resetting the buffer counter.

Assignments (3)
CHANGE OF NAME Recorded Dec 20, 2021
From: FACEBOOK, INC.
To: META PLATFORMS, INC.
Reel/Frame 058553/0802 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 4, 2012
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: FACEBOOK, INC.
Reel/Frame 027991/0416 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 5, 2005
From: BURDICK, DEAN J.; WARRIER, SURESH E.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 015533/0862 →