Getting Started with Agent Controller - Linux

Contents

Overview

Prerequisites

    Notation

    Installing Agent Controller

Setting Up Agent Controller

    Configuring Agent Controller

    Starting Agent Controller

    Stopping Agent Controller

Querying Agent Controller version information

Checking Agent Controller Installation

Server Logging

Running the Java Profiler

    Invocation from the Eclipse Workbench

    Invocation of the Java Profiler from the Command Line

Uninstalling Agent Controller

Overview

This document explains the installation and configuration steps required to use the standalone Agent Controller. To profile a Java application on a remote machine or run a TPTP test on a remote machine, you must first install a standalone Agent Controller on that remote machine. To profile a Java application locally or run a TPTP test locally, you have the option of installing a standalone Agent Controller on the local machine or using the Integrated Agent Controller. If using the Integrated Agent Controller, there is no need to install and configure the standalone Agent Controller when using the Profiling and Logging perspective and Test perspective locally. For more information, see Integrated Agent Controller

Prerequisites

Notation

<install-dir> = The absolute directory path where the Agent Controller has been unzipped.  For example: /opt/tptpAC

Installing Agent Controller

Download one of the Linux Agent Controller Runtime packages from the TPTP Download page. Install it by simply creating a directory and unzipping the package contents into that directory.

Setting Up Agent Controller

After a normal installation, you still need to configure the Agent Controller before you can start it. 

Configuring Agent Controller

  1. Ensure that the files in the <install-dir>/bin and <install-dir>/lib directory are executable.
  2. Run SetConfig.sh script from a command shell in the <install-dir>/bin directory to generate the configuration file for the Agent Controller.  The script requires that a Java Virtual Machine (JVM) be present in the PATH environment variable.  Follow the prompts and enter the required parameters as appropriate.  The configuration file <install-dir>/config/serviceconfig.xml will be generated based on your inputs.
  3. Add <install-dir>/bin directory to the PATH environment variable.
  4. Add <install-dir>/lib directory to the LD_LIBRARY_PATH environment variable.

If you want to make changes to the configuration file that was generated in step 1, you may run the SetConfig.sh script again or you may manually edit the file according to the rules outlined in the document Agent Controller configuration files. The Agent Controller must be restarted for the changes to take effect.

Starting Agent Controller

Start the Agent Controller by changing your working directory to  <install-dir>/bin and running ACStart.sh.

Note: The Agent Controller may also be started using RAStart.sh, in support of backward compatibility.

Stopping Agent Controller

Stop the Agent Controller by changing your working directory to  <install-dir>/bin and running ACStop.sh.

Note: The Agent Controller may also be stopped using RAStop.sh, in support of backward compatibility.

Querying Agent Controller Version Information

To display the version of Agent Controller, change your working directory to <install-dir>/bin in a command shell and run the following command:

ACServer -v
    or
ACServer -version

Note: The Agent Controller version may also be queried using RAServer, in support of backward compatibility.

The Agent Controller will display its version and terminate.

Checking Agent Controller Installation

If desired, you can verify proper operation of your Agent Controller installation by executing the SampleClient application provided with the runtime package.

Perform the following steps:

  1. Start the Agent Controller.
  2. Open a command prompt window
  3. Go to the <install-dir>/bin directory
  4. Enter the following at the command prompt:

        SampleClient
     
  5. Observe the console output for SampleClient.  It should be similar to the following example:

------------------- SampleClient Console Output --------------------------------

Connected to the Agent Controller on "localhost" at port number #####

The Time Collector Agent ID: ###

Established a data channel with the agent.

Sending 5 Hello messages over data channel to TimeCollector ...

Start the TimeCollector ...

Incoming data: Hello from Time Collector Agent - Count 0

Incoming data: Hello from Time Collector Agent - Count 1

Incoming data: Hello from Time Collector Agent - Count 2

Incoming data: Hello from Time Collector Agent - Count 3

Incoming data: Hello from Time Collector Agent - Count 4


Stop the TimeCollector ...

Incoming data: Hello from Time Collector Agent - Count 5

Incoming data: Hello from Time Collector Agent - Count 6

Incoming data: Hello from Time Collector Agent - Count 7

Incoming data: Hello from Time Collector Agent - Count 8

Incoming data: Hello from Time Collector Agent - Count 9

Incoming data: Hello from Time Collector Agent - Count 10

All finished
Press any key to exit...

Note:  The above port number and Agent ID values will typically be 10006 and 103 respectively, depending on Agent Controller configuration settings and the number of times that the SampleClient application runs.

Refer to the Agent Controller build readme.txt file for detailed information on the SampleClient functionality. 

Server Logging

All server log entries will be placed in <install-dir>/config/servicelog.log .

Running the Java Profiler

The Java Profiler consists of a Profiling Agent packaged as a library.  This profiling agent is started by the JVM when the JVM is started with the -Xrun option described below.  The profiling agent interacts with the JVM to capture and record the Java application's behavior. The output from the profiling agent is in the form of XML fragments.  The format of this fragment is described in this document titled "Event Specification for the Java Profiler".

You can profile a Java application by using the Eclipse workbench or manually by invoking the profiler from the command line.

Invocation from the Eclipse Workbench

The Java Profiler can be launched from the Eclipse workbench. From the Profiling and Logging Perspective of the Eclipse workbench you can launch applications using the Run > Profile menu or the toolbar button.  A wizard will come up.  Simply follow the wizard to profile an application.  Applications in the current Eclipse workbench's workspace, or external Java applications located in the file system, can be launched and profiled.

Invocation of the Java Profiler from the Command Line

Note that another step in Starting Agent Controller is required for invoking the Java Profiler from the command line. The Java Profiler is invoked from a command line using the -Xrun JVM option as follows:

    -XrunpiAgent[:agent_parm[,agent_parm]*]
where agent_parm may be:

Note: This parameter is only used when server=standalone is specified.

Specifies the name of the file that contains the initial class filter definitions to be used during the trace. The default is filters.txt in the current directory.

The format of the file is as follows:

        <classpattern> <methodpattern> <mode> where:
classpattern
is a string with no embedded blanks. The string may contain a single "*" either at the beginning of the string or at the end of the string. The "*" will match zero or more characters, thus making the pattern a generic prefix or suffix pattern. A single "*" can also be specified to represent all strings.
methodpattern
is a string with no embedded blanks. The string may contain a single "*" either at the beginning of the string or at the end of the string. The "*" will match zero or more characters, thus making the pattern a generic prefix or suffix pattern. A single "*" can also be specified to represent all strings.
mode
is one of INCLUDE or EXCLUDE. Filter patterns are processed in the order that they are specified until the first pattern match succeeds. If the class name does not match any of the specified filter patterns, the default is to INCLUDE the class.

Uninstalling Agent Controller

To uninstall the agent controller:

  1. Stop the agent controller:
  2. Remove the <install-dir>.
  3. Remove the <install-dir>/bin directory from the PATH environment variable, if necessary.
  4. Remove the <install-dir>/lib directory from the LD_LIBRARY_PATH environment variable, if necessary.

Copyright (C) 2006-2007 Intel Corporation.