EP0777181A1

System and method for profiling code on symmetric multiprocessor architectures

Abstract

A profiler that accurately measures performance metrics for all threads executing a process on a SMP computer system. The profiler uses dynamic instrumentation to cause threads to sample performance metrics before and after certain code regions. In addition, the profiler uses extensions to a parallel support layer to register a parent thread with its child threads. Each thread stores the measured performance metric, or delta, in a memory cell or cells corresponding to its region and its parent region. When the process is complete, the profiler scans through the memory storage areas and sums the deltas for each particular level of code. Then, the results may be analyzed at the thread or process level. In this manner, the profiler can be adapted to work with any process executing on the computer system.

EP0777181A1, drawing sheet 1
Sheet 1 of 5

Term

Term ended

Projected expiry passed 27 November 2016, 9.8 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

10 claims: 3 independent, 7 dependent

  1. 1
    A method of profiling a process having a plurality of threads executing on a computer system, comprising:allocating a memory storage area within the computer system for each thread, each memory storage area having a plurality of memory cells, wherein each memory cell is associated with a particular thread of the plurality of threads;registering a parent thread with a plurality of child threads, the parent and plurality of child threads selected from the plurality of threads;calculating, by each child thread, a delta for a particular code region of the process;and storing, by each child thread, the delta in a first memory cell associated with the child thread and in a second memory cell associated with the registered parent thread.
  2. 6
    A profiler for profiling the execution of a process having a plurality of threads on a computer system having a memory and a plurality of CPUs, comprising:means for allocating memory storage areas within the memory for each of the plurality of threads, each memory storage area having a plurality of memory cells, wherein each memory cell is associated with a particular thread of the plurality of threads;a parallel support layer for spawning a plurality of child threads on behalf of a parent thread and for registering the parent thread with the child threads, wherein the parent and child threads are a subset of the plurality of threads and each child thread is associated with a different CPU;sampling means for sampling the CPU associated with each child thread to determine a performance metric for each child thread;and storing means for storing the performance metric for each child thread in the storage area corresponding to that child thread in a first memory cell associated with the child thread and a second memory cell associated with registered parent thread.
  3. 10
    A profiler for profiling a process having a plurality of threads executing on a computer system having a memory, comprising:allocating means for allocating a memory storage area in the memory for each thread, each memory storage area having a plurality of memory cells, wherein each memory cell is associated with a particular thread of the plurality of threads;registering means for registering a parent thread with a plurality of child threads, the parent thread and plurality of child threads selected from the plurality of threads;calculating means for calculating, for each child thread, a delta for a particular code region of the process;storing means for storing, for each child thread, the delta in a first memory cell associated with the child thread and a second memory cell associated with the registered parent thread;and wherein the registering means includes: a parallel support layer for allocating child threads;extensions to the parallel support layer for registering a parent thread with the allocated child threads;and wherein the calculating means further comprises: first sampling means for sampling a performance metric for each child thread at a beginning of the code region to determine a first value;second sampling means for sampling the performance metric for each child thread at an end of the code region to determine a second value;and means for calculating, for each of the child threads, a delta from the first and second values.