Command line examples

Command Line Interface

This section describes an example of using Rational® Test RealTime Runtime Analysis tools through the Command Line Interface:

Note This example is for UNIX platforms only.

This example demonstrates using Runtime Analysis tools through the attolcc Instrumentation Launcher. The example application is the Apache Web Server, which is widely available for most platforms.

Additionally, the Apache Web Server is a multi-process, multi-tasking application written in C where particular attention must be paid to tracking memory leaks.

To prepare for the example:
  1. Download the apache_1.3.37.tar.gz archive of the Apache web server source code from
  2. Copy the archive file to the directory where you will perform the tests (for example, /projects/Apache_Test) and untar the archive:
    cp /projects/download/apache_1.3.37.tar.gz . 
    tar zxvf apache_1.3.37.tar.gz
    cd apache_1.3.37
  3. To set up the Rational® Test RealTime environment, enter the following command:
    . <install_dir>/TestRealTime/

where <install_dir> is the installation directory of the product.

See the Installation overview section for information about setting up and starting the product.

Compiling the application with the Runtime Analysis features:
  1. To configure the Apache release, enter the following command:
    ./configure --prefix=`pwd`
  2. To compile the Apache server with instrumentation, enter the following commands:
    make -C src/main gen_test_char
    make CC="attolcc -mempro -perfpro -trace -proc=ret -block=l -keep --atl_multi_process=1 --atl_traces_file=$REP/atlout.spt -- gcc"

The application is compiled with the following options:

    • Memory Profiling instrumentation enabled

    • Performance Profiling instrumentation enabled

    • Runtime Tracing instrumentation enabled

    • Instrumentation of procedure inputs, outputs, and terminal instructions

    • Instrumentation of simple, implicit and logical blocks (loops)

    • Keep instrumented files

    • Multi-process support

To install the Apache server, type the following command:
make install

A message indicates that you have successfully built and installed the Apache 1.3 HTTP server.

To run the application and view runtime analysis results:

  1. Optionally, edit the configuration file apache_1.3.37/conf/httpd.conf.
  2. Enter the following command to start the Apache server:
     /projects/Apache_Test/apache_1.3.37/bin/apachectl start
  3. Start a web browser on port 8080 (see the httpd.conf file), type the following command:
    firefox <IP Address>:8080

where <IP Address> is the IP address of the machine hosting the Apache server.

To stop the Apache server, type the following command:

 /projects/Apache_Test/apache_1.3.37/bin/apachectl stop

To split the results, type the following command:

atlsplit *.spt

To start the Rational® Test RealTime GUI to view the results, type the following command:

studio `find . -name "*.fdc"` `find . -name "*.tsf"` *.tio *.tpf *.tqf *.tdf 

Related Topics

Command Line Runtime Analysis for C and C++ | Command Line Interface