Command Line Interface
This section describes an example of using 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:
Download the apache_1.3.27.tar.gz archive of the Apache web server source code from:
http://www.apache.org/dist/httpd/
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.27.tar.gz .
tar zxvf apache_1.3.27.tar.gz
cd apache_1.3.27
To set up the Test RealTime environment, type the following command:
. <install_dir>/TestRealTime.2003.06.00/testrtinit.sh
where <install_dir> is the installation directory of the product.
Refer to the Rational Test RealTime Installation Guide for information about setting up and launching the product.
To compile the application with the Runtime Analysis features
To configure the Apache release, type the following command:
./configure --prefix=`pwd`
To compile the Apache server with instrumentation, type the following commands:
REP=`pwd`
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"
This compiles the application 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
This should display a message indicating that you have successfully built and installed the Apache 1.3 HTTP server.
To run the application and view runtime analysis results
Optionally, edit the configuration file apache_1.3.27/conf/httpd.conf.
To start the Apache server, type the following command:
/projects/Apache_Test/apache_1.3.27/bin/apachectl start
To stimulate the application, start a web browser on port 8080 (see the httpd.conf file), type the following command:
netscape <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.27/bin/apachectl stop
To split the results, type the following command:
atlsplit *.spt
To start the 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