Coz: Causal Profiling
Go to file
Charlie Curtsinger 6a5d15f7be Firefox works
2014-09-11 12:49:58 -04:00
benchmarks goodbye make 2014-08-12 20:14:59 -04:00
include Firefox works 2014-09-11 12:49:58 -04:00
lib Firefox works 2014-09-11 12:49:58 -04:00
tests goodbye make 2014-08-12 20:14:59 -04:00
tools Updated binary inspection and real function resolution 2014-09-10 16:13:26 -04:00
.gitignore Small build adjustments, re-enabled argument parsing 2014-09-06 14:13:56 -04:00
README.md Readme updates 2014-08-15 20:26:00 -04:00
SConscript Updated binary inspection and real function resolution 2014-09-10 16:13:26 -04:00
SConstruct Updated binary inspection and real function resolution 2014-09-10 16:13:26 -04:00

Coz: Causal Profiling

Causal profiling is a novel technique to measure optimization potential. This measurement matches developers' assumptions about profilers: that optimizing highly-ranked code will have the greatest impact on performance. Causal profiling measures optimization potential for serial, parallel, and asynchronous programs without instrumentation of special handling for library calls and concurrency primitives. Instead, a causal profiler uses performance experiments to predict the effect of optimizations. This allows the profiler to establish causality: "optimizing function X will have effect Y," exactly the measurement developers had assumed they were getting all along.

Requirements

Coz, our prototype causal profiler, runs with unmodified Linux executables. Coz requires:

On debian or ubuntu, you can install all build dependencies with the following lines:

sudo apt-get install scons clang libboost-filesystem-dev libboost-program-options-dev libboost-system-dev r-base r-base-dev r-cran-ggplot2 r-cran-plyr
git clone git://github.com/ccurtsinger/libelfin
cd libelfin
make
sudo make install

Building

To build Coz, just clone this repository and run scons. Adding mode=release will build an optimized version with less debug logging.

You can install Coz by running scons install, with an optional prefix=<install prefix> argument if you do not want to install to /usr/local.

Using Coz

Before running your program with Coz, you will need to identify one or more progress points. These are points in your program that you would like to happen more frequently. For example, in the pbzip2 program under benchmarks/pbzip2 we have inserted a progress point after the code that compresses a block of data.

To add a progress point, add the CAUSAL_PROGRESS macro to the line you would like to execute more frequently. This macro is defined in causal.h, which is installed to <prefix>/include (/usr/local/include by default).

To run a program with Coz, just type coz --- <your program and arguments> on the command line. You can specify profiling options befor the ---. Run coz --help for a description of the available options. Profiling output is placed in the file profile.log by default.

Processing Results

To process results, run coz-process profile.log. This will generate a profile.csv file with predicted program speedups for all lines in the causal profile. To graph these results, run coz-plot profile.csv.

The coz-plot tool requires R, along with the ggplot2 and plyr packages. To install these, run R and type the command install.packages('ggplot2', 'plyr').

Note that coz-plot may produce error messages if there are not enough samples in the profile to produce a plot. You can execute the profiled application several times to collect additional samples.