Introduction

canalyze.py is a tool that integrates the analyzer into the building process. Although the analyzer can be used directly from the command line, it is hard to use it to analyze a software package, which may have complex compiling options and building processes. canalyze.py works in three steps: logging, preprocessing, and analyzing. The general form of the canalyze.py command is:

canalyze.py command options

Logging

In this step, the whole building process is recorded. The command is:

canalyze.py log -dir datadir

Option -dir specifies the directory that will be used to store various analysis data. This option is required by every canalyze.py command.

-build is another option for log. It specifies the building command. The default value is 'make'.

Preprocessing

After logging the building process, Canalyze needs to call native compiler to emit preprocessed source code. The command is:

canalyze.py preprocess -dir datadir

Option -compiler specifies the native compiler command. It defaults to gcc for C code. You may specify another compiler, for example, arm-linux-gcc.

Analyzing

The command doing analysis is:

canalyze.py analyze -dir datadir

The generated bug reports will be in directory datadir/report/datetime.

Example

A complete analysis may consist of the following steps:
  1. canalyze.py log -dir ~/data/foo -build 'make'
  2. canalyze.py preprocess -dir ~/data/foo
  3. canalyze.py analyze -dir ~/data/foo