Command line examples

Command Line Interface

This section describes an example of using OneTest Embedded 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:

  1. 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

  1. To set up the OneTest Embeddede environment, type the following command:

. <install_dir>/TestRealTime/


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

Refer to the OneTest Embedded Installation overview section for information about setting up and starting the product.


To compile the application with the Runtime Analysis features

  1. To configure the Apache release, type the following command:

./configure --prefix=`pwd`

  1. To compile the Apache server with instrumentation, type 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"


This compiles the application with the following options:

  1. 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

  1. Optionally, edit the configuration file apache_1.3.37/conf/httpd.conf.

  1. To start the Apache server, type the following command:

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

  1. To stimulate the application, 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.

  1. To stop the Apache server, type the following command:

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

  1. To split the results, type the following command:

atlsplit *.spt

  1. To start the OneTest Embedded 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