What is Chronoscope?

Chronoscope is an intrumenting code profiler for Mac OS. It aims to provide a timeline view of program execution which allows you to inspect program behaviour, including the execution of interrupt code, and interaction between threads. It can also produce summary statistics that provide, for a selected time period, data on how much time is spent for each active thread in each function, and allows you to inspect detailed statistics on function timing.

How does it work?

Chronoscope leverages the Metrowerks CodeWarrior compiler's profiling intrumentation calls __PROFILE_ENTRY() and __PROFILE_EXIT(), calls to which are inserted at every function entry and exit point when the __profile__ compiler option is enabled (usually by checking the 'Profiler Information' checkbox in the 'PPC Processor' preferences panel). For every function entry and exit, Chronoscope logs some data with a time stamp. The Chronoscope viewer application then uses this data to reconstruct a picture of the program stack over time.

Chronoscope attempts to be aware of functions that are called at interrupt time (using the OS call TaskLevel()), and is able to log data for interrupt-time code. You can improve the accuracy of time accounting with respect to interrupt-time code by adding calls to functions in the Chronoscope API at the start and end of functions that are called at interrupt time (e.g. async file I/O callbacks).

The Chronoscope API was designed to be agnostic to any particular threading model, although it does currently assume that threads are cooperatively scheduled. By adding calls to Chronoscope API routines on thread creation and deletion, and in your thread scheduler, Chronoscope can be made aware of thread context switches, and properly maintain stack history, and time accounting for a large number of different threads.

What does it look like?

See the screenshots page for some images of Chronscope in action.


Chronoscope currently has the following limitations:

Quick Start

To use Chronoscope in a simple non-threaded application, you need to do three things:

  1. Turn on 'Profiler information' in the CodeWarrior PPC Processor prefs panel in your application's project
  2. Link with Chronosope library (remove the CodeWarrior Profiler library from your project if it is there)
  3. Add calls to ChronoInit() and ChronoTerm() in your code.

Now run your application, exercise some functionality, then quit. You should get a file call "{application name} data" in the same folder as the application. Open this with the Chronoscope viewer, and start examining your code.

For more details on Chronoscope usage, see the Instructions page. The screenshots page contains some useful information about the viewer application. There is also a page of Frequently Asked Questions.


To download the Chronoscope SDK and viewer, go to the Chronoscape project page, and look for the file release section.

Chronoscope is only currently available for Mac OS 9.x. Mac OS X support is planned, but see the first question of the FAQ.

SourceForge Logo
Last modified: 8-Apr-02