# Client configuration and license management

License configuration and license management on a license client provide you with the tools and utilities to help you to administer licenses and troubleshoot licensing problems on your test systems.

For License configuration and license management tasks you must differentiate between two license types:

- [System licenses](https://lhc.advantest.com/books/client-configuration-and-license-management/page/system-lic-license-files): enable you to scale test system capabilities, like speed and memory.
- [Software licenses](https://lhc.advantest.com/books/client-configuration-and-license-management/page/the-software-lic-license-files): cover SmarTest release streams and service and support software tools.

**Related information:**

- [Licensing modes](https://tdc.advantest.com/help/index.jsp#topic/com.verigy.itee.help.smartest.ui.8.7.6/246943.htm)

# Installing the FLexNet (FNP) license client

Installing a FlexNet Publisher (FNP) license client used to provide the activated licenses to a SmarTest installation on a system controller workstation requires two steps: the installation of the license client software itself on the SmarTest host system, and configuration of the license server configuration file to prioritized the order of server access.

<section class="section" id="bkmrk-about-this-task-the-">### About this task

The following procedure explains how to install the FlexNet client.

</section><section id="bkmrk-before-you-begin-the">### Before you begin

The license client is the SmarTest software. The FlexNet license server communicates with SmarTest using the FlexNet client.

</section><section id="bkmrk-procedure-open-the-a">### Procedure

1. Open the Advantest Software Center in a browser: [https://softwarecenter.advantest.com/](https://softwarecenter.advantest.com/)Login with your credentials.
2. To get the list of all available Licensing products, from the left menu select: **<span class="menucascade"><span class="uicontrol">Other</span><abbr title="and then"> &gt; </abbr><span class="uicontrol">Licensing</span></span>**[![11.png](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/3vE11-png.png)](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/3vE11-png.png)
3. Scroll to and select **<span class="uicontrol">FNP-Client</span>** and the version you want to install and expand to display the details.
4. **Copy the installation command** to the clipboard by clicking [![22.png](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/J5O22-png.png)](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/J5O22-png.png). <p class="callout info"><span class="title">To install the **<span class="keyword">smart-install-3</span>** tool, you need root permissions.   
    To install software with **<kbd class="userinput">smart-install-3</kbd>** version 3.1.6.0 and higher, the user account you are using must be a root-level account or be included in the **<span class="keyword">smartinstall</span>** user group or the **<span class="keyword">smart-install-3</span>** command must be run as system administrator (root).  
    Add a user to the **<span class="keyword">smartinstall</span>** user group with the command:  
    <kbd class="userinput"><var class="varname">`<kbd class="userinput">usermod -aG smartinstall username</kbd>`</var></kbd>  
    </span></p>
    
    Running this command on your workstation installs the package to your system controller. For details, see [smart-install-3 command line tool](https://tdc.advantest.com/help/topic/com.verigy.itee.help.smartest.ui.8.7.6/353606.htm "Command line tool for downloading, installing and uninstalling related software from the Advantest Software Center.") and [Downloading SmarTest software](https://tdc.advantest.com/help/topic/com.verigy.itee.help.smartest.ui.8.7.6/354237.htm "The smart-install-3 tool can be used to download SmarTest products available from the Advantest Software Center to your local system.").
    
    Alternatively, click on a file. The save file dialog opens, from which you can specify a download location. For details, see [Downloading SmarTest software](https://tdc.advantest.com/help/topic/com.verigy.itee.help.smartest.ui.8.7.6/354237.htm "The smart-install-3 tool can be used to download SmarTest products available from the Advantest Software Center to your local system.").
5. **Optional:**  
    
    1. Download the archive package by clicking the [![9.png](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/NQh9-png.png)](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/NQh9-png.png) icon. The selected license (**<span class="filepath">tar.gz</span>**) package is downloaded to your browser's download folder.
        
        Example FNP Client packages include:
        
        <span class="filepath"><span class="title"><kbd class="userinput"><var class="varname">`<kbd class="userinput">fnp_client_11.12.1.7_20056_rhel7.tar.gz</kbd>`  
          
        </var></kbd></span></span>
    2. Create an empty installation directory. For example: <kbd class="userinput"><span class="filepath"><span class="title"><kbd class="userinput"><var class="varname">`<kbd class="userinput"><kbd class="userinput">/tmp/smartest_pakages</kbd></kbd>`  
          
        </var></kbd></span></span></kbd>
    3. Install the RPM package from the **<span class="filepath">smartest\_packages</span>** directory on your workstation: <kbd class="userinput"><kbd class="userinput"><span class="filepath"><span class="title"><kbd class="userinput"><var class="varname">`<kbd class="userinput"><kbd class="userinput"><kbd class="userinput">smart-install-3 local-install <package-name>.tar.gz </kbd></kbd></kbd>`  
          
        </var></kbd></span></span></kbd></kbd>
        
        For example:
        
        <kbd class="userinput"><kbd class="userinput"><kbd class="userinput"><span class="filepath"><span class="title"><kbd class="userinput"><var class="varname">`<kbd class="userinput"><kbd class="userinput"><kbd class="userinput">smart-i<kbd class="userinput">nstall-3 local-install fnp-client_11.12.1.7-20056_rhel7.tar.gz</kbd></kbd></kbd></kbd>`</var></kbd></span></span></kbd></kbd></kbd>
        
        Installation of the selected licensing packages starts and successful installation is confirmed with:
        
        <div><div class="p"><div>  
        </div></div></div>```
        Complete!
        ```
        
        <div>  
        </div>
    4. Remove the installation directory. For example: <kbd class="userinput"><kbd class="userinput"><kbd class="userinput"><kbd class="userinput"><span class="filepath"><span class="title"><kbd class="userinput"><var class="varname">`<kbd class="userinput"><kbd class="userinput"><kbd class="userinput"><kbd class="userinput">rm -rf /tmp/smartest_packages</kbd></kbd></kbd></kbd>`  
          
        </var></kbd></span></span></kbd></kbd></kbd></kbd>
    5. After the installation has completed, configure the license server configuration file where the list of FlexNet Publisher license servers are listed in a prioritized order as described in [System .lic license files](https://lhc.advantest.com/books/client-configuration-and-license-management/page/system-lic-license-files "System *.lic licenses enable you to scale test system capabilities, such as speed and memory.") and [Editing .lic license files](https://lhc.advantest.com/link/88#bkmrk-editing-.lic-license "This topic describes how to edit FlexNet Publisher license server related license files (.lic files).").

</section><section class="section" id="bkmrk-results-you-have-ins">### Results

You have installed the license client software and configured the list of FlexNet Publisher license servers in a prioritized order.

</section>

# System .lic license files

#### Subtopics

1. [Find out HostID and HostName](https://lhc.advantest.com/link/88#bkmrk-find-out-hostid-and--1)
2. [Editing .lic license files](https://lhc.advantest.com/link/88#bkmrk-editing-.lic-license)

System `<span class="filepath">*.lic</span>` licenses enable you to scale test system capabilities, such as speed and memory.

All `<span class="filepath">*.lic</span>` license files reside by default in the `<span class="filepath">/opt/flexlm/license</span>` directory on both the license client and the license server.

The system `<span class="filepath">.lic</span> `license file on the client provides the hostname or IP address of the license server for SmarTest and the dedicated vendor daemon value (For Advantest SmarTest, the vendor daemon value is `<kbd class="userinput">socbu</kbd>`). The vendor daemon value specifies that this license file is associated with the <kbd class="userinput">socbu</kbd> vendor daemon.

To receive a system` <span class="filepath">*.lic</span>` license file, you must activate the corresponding license. For details see [Activating licenses](https://lhc.advantest.com/books/activating-licenses/page/activating-licenses "Licenses can be activated from entitlements or available licenses activated to a selected license server. If the license server has access to the internet, it synchronises automatically. For license servers that are not connected to the internet, the license files must be downloaded and installed manually.").

<p class="callout info"><span class="title">Note: Service and Support (S&amp;S) licenses do not need to be activated.</span></p>

<div id="bkmrk-checking-out-license"><section class="section">### **Checking out licenses from a license server**

The procedure for checking out licenses is:

- At startup, SmarTest reads the test program file and resolves the requested capability into required licenses.
- Next, the` <kbd class="userinput">*.lic</kbd>` license files in the `<span class="filepath">/opt/flexlm/license</span>` directory on the same workstation are read. The `<span class="filepath">*.lic</span> `license files specify the hostname of the license server, which can be the same workstation in the case of a local license server, or another workstation in the case of a central license server. See [Editing .lic license files](https://lhc.advantest.com/link/88#bkmrk-editing-.lic-license "This topic describes how to edit FlexNet Publisher license server related license files (.lic files).").
- Finally, SmarTest contacts the license server to check if the required licenses are available: 
    - Available: the licenses are checked out and the features enabled.
    - Not available: SmarTest runs the script `<span class="filepath">license_checkout_failure</span>.`

<p class="callout info"><span class="title">Note:</span> Base capabilities are always available, even without licenses.</p>

</section><section class="section">### **Returning licenses to a license server**

Licenses are automatically returned the license server when SmarTest is shut down.

</section></div><nav id="bkmrk-related-information-">### **Related information**

<div class="ri"><div>[Activating licenses](https://lhc.advantest.com/books/activating-licenses/page/activating-licenses "Licenses can be activated from entitlements or available licenses activated to a selected license server. If the license server has access to the internet, it synchronises automatically. For license servers that are not connected to the internet, the license files must be downloaded and installed manually.")</div><div>[Editing .lic license files](https://lhc.advantest.com/link/88#bkmrk-editing-.lic-license "This topic describes how to edit FlexNet Publisher license server related license files (.lic files).")</div></div></nav>---

# Find out HostID and HostName

This topic describes how to find out the HostID and the HostName of the license servers for license activation.

<div id="bkmrk-about-this-task-note"><section class="section">### About this task

<p class="callout info"><span class="title">Note:</span> This topic is applicable to SmarTest 7 and SmarTest 8.</p>

To activate license you need the following information:

- **Entitlement** Certificate
- **HostID** of the license servers
- **HostName** of the license servers

</section><section class="sectiontitlefake">### Procedures

</section><section class="section">#### **Find out HostID**

**FLEXlm binaries are installed**

1. Login to as user root: `<kbd class="userinput">su root</kbd>` and enter the root user password.<s>  
      
    </s>
2. Open a terminal window.<s>  
      
    </s>
3. Type: `<kbd class="userinput">/opt/flexlm/bin/lmutil lmhostid -n</kbd>`

**FLEXlm binaries are not installed**

The HostID is an 8 digit hexadecimal number (HP-UX or Solaris) or a 12-digit hexadecimal number (Linux). Select from one of the following commands, depending on your OS.

**Sun Solaris**

1. Log in as root and open a terminal window.
2. Type: `<kbd class="userinput">/usr/bin/hostid</kbd>`

**Linux**

1. Login to as user root: `<kbd class="userinput">su root</kbd> `and enter the root user password.
2. Open a terminal window.
3. Type: 
    - <span style="text-decoration:underline;">**<span class="uicontrol">Linux RHEL 5</span>**</span><kbd class="userinput">`/sbin/ifconfig eth0 | grep HWaddr | sed 's/://g' | awk ' {print $NF} '`  
          
        </kbd>
    - <span style="text-decoration:underline;">**<span class="uicontrol">Linux RHEL 7</span>**</span>`<kbd class="userinput">/sbin/ifconfig eno1 | grep "ether" | sed 's/://g' | awk ' {print $2} '</kbd>`

</section><section class="section">#### **Find out HostName**

**Sun Solaris**

1. Log in as root and open a terminal window.
2. Type: `<kbd class="userinput">/bin/hostname</kbd>`

**Linux**

1. Login to as user root: <kbd class="userinput">su root</kbd> and enter the root user password.
2. Open a terminal window.
3. Type: `<kbd class="userinput">/usr/bin/hostname</kbd>`

</section><section class="section">### What to do next

[Activating licenses](https://lhc.advantest.com/books/activating-licenses/page/activating-licenses "Licenses can be activated from entitlements or available licenses activated to a selected license server. If the license server has access to the internet, it synchronises automatically. For license servers that are not connected to the internet, the license files must be downloaded and installed manually.")

</section></div><nav id="bkmrk-related-information--1">### Related information

<div class="ri"><div>[Install a floating license file](https://lhc.advantest.com/link/84#bkmrk-install-a-floating-l "A copy of the SmarTest floating-license file must be stored on each computer upon which you will want to execute the SmarTest feature.")</div><div>[FlexNet licensing](https://lhc.advantest.com/books/flexnet-licensing/page/flexnet-licensing "For Pin Scale hardware all SmarTest and V93000 test card features are controlled by FlexNet licensing. This third-party license management software allows for efficient use of licenses as it makes software licenses available anywhere on a network.")</div><div>[License clients and license servers](https://lhc.advantest.com/books/flexnet-licensing/page/license-clients-and-license-servers "Understanding the concept of "license client" and "license server" is essential for a correct setup.")</div></div></nav>---

# Editing .lic license files

This topic describes how to edit FlexNet Publisher license server related license files (.lic files).

<div id="bkmrk-about-this-task-1"><section class="section">### About this task

</section></div><p class="callout warning"><span class="title">CAUTION:</span> The editing instructions below only apply to license files referring to a license server. Service and support license files have a different structure and must not be edited.</p>

<div id="bkmrk-the%C2%A0.lic%C2%A0license-fil"><section class="section">The `<span class="filepath">.lic</span>` license files must reside in the `flexlm` license directory `<span class="filepath">/opt/flexlm/license/</span> `for both license servers and clients.

The server `<span class="filepath">.lic</span>` license file must provide the server hostname and the correct vendor daemon ("`<kbd class="userinput">socbu</kbd>`").

The `<span class="filepath">.lic</span> `file on the license server provides the actual license, while the corresponding client `<kbd class="userinput">.lic</kbd>` file can contain an additional USE\_SERVER statement used to specify the associated license server. When SmarTest reads the USE\_SERVER statement from the client `<kbd class="userinput">.lic</kbd>` file, it ignores everything else in the license file except the preceding SERVER lines and transfers license control to the specified license server. The USE\_SERVER statement takes no arguments and should be used in client license files only.

<div class="p">Advantest strongly recommends adding the USE_SERVER statement to client `<kbd class="userinput">.lic</kbd>` files. When using a central license server, the USE_SERVER statement improves performance compared with setting the LM_LICENSE_FILE environment variable.</div></section></div><p class="callout info"><span class="title">Note:</span> For information about license server installation, see the section **[License server setup](https://lhc.advantest.com/books/license-server-setup/page/license-server-setup "This section covers licensing requirements and considerations you will want to examine before installing your licenses.").**</p>

<div id="bkmrk-procedures-server-li"><section class="sectiontitlefake">### Procedures

</section><section class="section">#### **Server license files**

To edit `<kbd class="userinput">.lic</kbd>` license files on a server system:

1. Copy the `<kbd class="userinput">.lic</kbd>` license file you received to the `<span class="filepath">/opt/flexlm/license/</span>` directory on the license server system.
2. Open the `<kbd class="userinput">.lic</kbd>` license file in an editor.
3. The SERVER statements specify the hostname and host IDs of the license server systems and the TCP/IP port number of the license server manager (`lmgrd`).  
      
    In the **<kbd class="userinput">SERVER</kbd>** statement, replace the server hostname placeholder string **<kbd class="userinput">this\_host</kbd>** with the hostname of the license server.
    
    The graphic below shows the server string to be replaced.
    
    <div class="p"><figure class="fignone">[![33.png](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/9Qz33-png.png)](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/9Qz33-png.png)  
      
    </figure></div>
4. Also in the **<kbd class="userinput">SERVER</kbd>** statement, replace the server host ID placeholder string <kbd class="userinput">123456789012</kbd> with the actual host ID of your license server (and optionally the port number of your license server).  
      
    <p class="callout info"><span class="title">Note:</span> For more information about querying the license server hostnames and host IDs, see **[Find out HostID and HostName](https://lhc.advantest.com/link/84#bkmrk-find-out-hostid-and- "This topic describes how to find out the HostID and the HostName of the license servers for license activation.").**   
    <kbd class="userinput">&lt;host\_name&gt;</kbd> = The license server hostname or IP address returned by the <kbd class="userinput">hostname</kbd> command.   
    <kbd class="userinput">&lt;hostid&gt;</kbd> = The string returned by the <kbd class="userinput">lmhostid</kbd> command.  
    <kbd class="userinput">\[port\]</kbd> = TCP/IP port number to use.</p>
    
    <div class="p">If a port must be specified (check with your network administrator), the syntax is as follows: 
    - `<kbd class="userinput">SERVER <host_name> <hostid> [port]</kbd>`, for example: `<kbd class="userinput">SERVER MyLicSvr 8502053d1905 27000</kbd>`
    - `<kbd class="userinput">VENDOR socbu [port]</kbd>`, for example: `<kbd class="userinput">VENDOR socbu PORT=27020</kbd>`
    
    </div><p class="callout info"><span class="title">Note:</span> If no port is configured, the client automatically checks all ports from 27000 to 27009. Any other ports must be specified.</p>
    
      
    Normally a license file has one SERVER statement. Three SERVER statements signifies that you are using a three-license-server redundancy configuration. See **[License clients and license servers](https://lhc.advantest.com/books/flexnet-licensing/page/license-clients-and-license-servers "Understanding the concept of "license client" and "license server" is essential for a correct setup.")**. In a three-license-server configuration you must edit all three SERVER statement entries.
5. The VENDOR statement specifies the daemon name and should be as follows: `<kbd class="userinput">VENDOR socbu</kbd>`.

</section><section class="section">#### **Client license files**

To edit `<span class="filepath">.lic</span>` license files on a client system:  
  
1. Copy the`<span class="filepath">.lic</span>` license file you received to the` <span class="filepath">/opt/flexlm/license/</span> `directory on the client machine.
2. Open the <span class="filepath">`.lic`</span> license file in an editor.
3. The SERVER statements specify the hostname and host IDs of the license server systems and the TCP/IP port number of the license server manager (lmgrd).  
      
    In the <kbd class="userinput">SERVER</kbd> statement, replace the server hostname placeholder string <kbd class="userinput">this\_host</kbd> with the hostname of the license server.
    
    The graphic below shows the server string to be replaced.
    
    <div class="p"><figure class="fignone">[![44.png](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/aAP44-png.png)](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/aAP44-png.png)</figure></div>
4. Also in the **<kbd class="userinput">SERVER</kbd>** statement, replace the server host ID placeholder string <kbd class="userinput">123456789012</kbd> with the actual host ID of your license server (and optionally the port number of your license server).  
      
    <p class="callout info"><span class="title">Note:</span> For more information about querying the license server hostnames and host IDs, see **[Find out HostID and HostName](https://lhc.advantest.com/link/84#bkmrk-find-out-hostid-and- "This topic describes how to find out the HostID and the HostName of the license servers for license activation.").**   
    <kbd class="userinput">&lt;host\_name&gt;</kbd> = The license server hostname or IP address returned by the <kbd class="userinput">hostname</kbd> command.   
    <kbd class="userinput">&lt;hostid&gt;</kbd> = The string returned by the <kbd class="userinput">lmhostid</kbd> command.  
    <kbd class="userinput">\[port\]</kbd> = TCP/IP port number to use.</p>
    
      
    Normally a license file has one **SERVER** statement. Three **SERVER** statements signifies that you are using a three-license-server redundancy configuration. See [License clients and license servers](https://lhc.advantest.com/books/flexnet-licensing/page/license-clients-and-license-servers "Understanding the concept of "license client" and "license server" is essential for a correct setup."). In a three-license-server configuration you must edit all three SERVER statement entries.
5. The **VENDOR** statement specifies the daemon name and should be as follows: `<kbd class="userinput">VENDOR socbu</kbd>.`
6. The **<kbd class="userinput">USE\_SERVER</kbd>** line in the client license file ensures that the requested license features are obtained from the specified license servers. The license file on the client no longer needs to be in sync with the license file on the server and may even not contain any license information. <div class="p">Enter the **<kbd class="userinput">USE\_SERVER</kbd>** statement. It takes no arguments.  
      
    </div><p class="callout info"><span class="title">Note:</span> For standalone systems with a local license server, the **<kbd class="userinput">USE\_SERVER</kbd>** statement is not necessary as both client and server use the `<span class="filepath">/opt/flexlm/license/*</span> directory`. Therefore, the server license file automatically specifies the server for the client (`<kbd class="userinput"><host_name></kbd> = <kbd class="userinput">localhost</kbd>`).</p>
7. **Optional:** In the client `<span class="filepath">.lic</span>` file only, any license strings below the <kbd class="userinput">USE\_SERVER</kbd> keyword are ignored and can be removed. Only the licenses on the servers specified in the **<kbd class="userinput">SERVER</kbd>** lines are read.

</section></div><nav id="bkmrk-related-information--2">### Related information

<div class="ri"><div>[License clients and license servers](https://lhc.advantest.com/books/flexnet-licensing/page/license-clients-and-license-servers "Understanding the concept of "license client" and "license server" is essential for a correct setup.")</div></div></nav>

# Enabling license logging

<nav id="bkmrk-subtopics-reading-lo">#### **Subtopics**

<div id="bkmrk-reading-log-file-dat">1. [Reading log file data](https://lhc.advantest.com/link/93#bkmrk-reading-log-file-dat-1 "Log file data contains information, such as memory usage.")
2. [Example logfile parser](https://lhc.advantest.com/link/93#bkmrk-example-logfile-pars "The following code is an example parser for reading license log files and printing the top 10 measurement executions contributing to the specified feature and signal.")

</div></nav>Detailed information about license consumption and optimize license usage can be identified by License usage logging.

```
TestProgramConfig config;
config.enableLicenseLogging = true;
testProgram.loadWithConfig(config);
```

<div id="bkmrk-about-this-task-to-b"><section class="section">### About this task

To be able to get detailed information about license consumption and optimize license usage, it is necessary to analyze the licensing requirements for memory and speed for each measurement within a test program. From this information, it is then possible to isolate the main license requirements.

License usage logging (incremental over measurements and per measurement logging) provides the information required to establish the licensing dependencies. If the watermark increases in proportion to the measurement data, the test is independent, otherwise it shares data with other tests.

Log data is written to:

`<span class="filepath">/opt/hp93000/soc/system/log/licenseUsage_<sessionId>.log</span>`

To read in the data you need to generate a parser based on protobuf library using the grammar in:

`<span class="filepath">/opt/hp93000/soc/system/include/xoc/profiling/licenseUsage.proto</span>`

An existing file is not overwritten - only new data is appended to the existing content.

The most valuable data collected by license logging is when you have not previously executed an initial bind before executing the profile configuration. After an initial bind, only dynamic changes are recorded.

</section><section>### Before you begin

Make sure the test program has been loaded.

License logging can only be enabled using a Profile launch configuration.

</section><section>### Procedure

1. Select a test program or testflow in the **<span class="uicontrol">Package Explorer</span>** view for which you want to enable license logging.  
      
    License logging is not available for encrypted testflows or test programs containing encrypted testflows.
2. Open the **<span class="wintitle">Profile Configurations</span>** dialog from the context menu: <div><span class="menucascade">**<span class="uicontrol">Profile As</span><abbr title="and then"> &gt; </abbr>**<span class="uicontrol">**Profile Configurations**  
      
    </span></span></div>
3. Select <span class="uicontrol">Test Program</span> from the objects pane on the left.
4. Click the New Launch Configuration [![10.png](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/JLb10-png.png)](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/JLb10-png.png) button.
5. Enter a name for the new profile configuration in the configuration pane on the right.
6. In the <kbd class="userinput">Main</kbd> tab (default selection), select **<span class="uicontrol">Enable license logging</span>**. [![55.png](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/NMg55-png.png)](https://lhc.advantest.com/uploads/images/gallery/2025-10/scaled-1680-/NMg55-png.png)
7. Specify any other required configurations. For details, see [Creating a run configuration for running test programs or testflows](https://tdc.advantest.com/help/topic/com.verigy.itee.help.smartest.ui.8.7.6/256920.htm "You can specify, save and reuse customized configurations for starting test programs or testflows in execute or debug mode.").
8. Click **<span class="uicontrol">Apply</span>** to save the profile configuration.
9. Click **<span class="uicontrol">Profile</span>** to profile the testflow or **<span class="uicontrol">Close</span>** to close the **<span class="wintitle">Profile Configurations</span>** dialog box.

</section><section class="section">### Results

License logging is enabled.

Log data is written to `<span class="filepath">/opt/hp93000/soc/system/log/licenseUsage_<sessionId>.log</span>.`

A license usage log file contains the memory contribution (in Bytes) for each signal for each measurement.

<p class="callout info"><span class="title">Note:</span> License logging can also be enabled and disabled using the Test Cell API.   
For example:  
`<span class="typ">TestProgramConfig</span><span class="pln"> config</span><span class="pun">;<br></br><span class="pln">config</span>.<span class="pln">enableLicenseLogging </span>= <span class="kwd">true</span>;<br></br></span><span class="pun"><span class="pln">testProgram</span>.<span class="pln">loadWithConfig</span>(<span class="pln">config</span>);</span>`  
  
For details about <var class="varname">TestProgramConfig</var>, see **[TestProgramConfig](https://tdc.advantest.com/help/topic/com.verigy.itee.help.smartest.ui.8.7.6/structxoc_1_1tcapi_1_1_test_program_config.html).**</p>

</section><section class="section">### What to do next

The generated log file is user-readable and it is possible to manually extract the licensing requirements for memory and speed for each measurement within a test program. It is not essential to parse this file.

However, for further processing, it can be beneficial to parse the file to arrange its content into a more readable format.

To read in the data you can generate a parser based on the <span class="keyword">protobuf</span> library using the grammar in:

`<span class="filepath">/opt/hp93000/soc/system/include/xoc/profiling/licenseUsage.proto</span>`

For more details, see [Reading log file data](https://lhc.advantest.com/link/93#bkmrk-reading-log-file-dat-1 "Log file data contains information, such as memory usage.").

---

# Reading log file data

</section></div>Log file data contains information, such as memory usage.

<section class="section" id="bkmrk-about-this-task-if-l">### About this task

If license logging is enabled, the license log data is written to: `<span class="filepath">/opt/hp93000/soc/system/log/licenseUsage_<sessionId>.log</span>.`

The following log example shows the used memory (Pattern or PA = 1032 bytes) for the signal D04. The total accumulated value (`accDoubleValue`) is 3096 bytes which the total memory used by the complete program.

**LicenseUsage.log file example:**

```
measurementName: "Main.GlobalPAPattern.measurement"
measurementTimestamp: "Mon, 01 Jul 2019 15:30:08 -0700"
licensedFeatureLog {
featurePerSignal {
signalList: "D00 + D01 + D02 + D03 + D04"
feature {
feature: "speed"
accDoubleValue: 10000000
unit: "bps"
}
}
featurePerSignal {
signalList: "D04"
feature {
feature: "memory"
accDoubleValue: 3096
doubleValue: 1032
unit: "B"
}
feature {
feature: "sharedMemory"
doubleValue: 60352
unit: "B"
}
}
}
```

A license usage log file contains the memory contribution (in Bytes) for each signal for each measurement. The accumulated memory value is also recorded.  
In the example above:

<div class="p"><div>  
</div></div><div class="p"><table class="frame-all" style="border-collapse:collapse;border-width:0.2px;width:83.8095%;"><tbody><tr><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:35.0084%;">**<span class="uicontrol">Measurement</span>**</td><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:65.1221%;">`Main.GlobalPAPattern.measurement`</td></tr><tr><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:35.0084%;">**<span class="uicontrol">Signal names</span>**</td><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:65.1221%;">`signal_list: "D00 + D01 + D02 + D03 + D04"`</td></tr><tr><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:35.0084%;">**<span class="uicontrol">Signal requirement type</span>**</td><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:65.1221%;">`feature: speed` (all signals) `feature: memory` (signal D04)

`feature: sharedMemory` (signal D04)

</td></tr><tr><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:35.0084%;">**<span class="uicontrol">Accumulated speed value</span>**</td><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:65.1221%;">`accDoubleValue: 10000000 bps` (all signals)</td></tr><tr><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:35.0084%;">**<span class="uicontrol">Accumulated memory value</span>**</td><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:65.1221%;">`acc_double_value: 3096 B` (signal D04)</td></tr><tr><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:35.0084%;">**<span class="uicontrol">Memory value</span>**</td><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:65.1221%;">`doubleValue: 1032 B` (signal D04)</td></tr><tr><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:35.0084%;">**<span class="uicontrol">Shared memory value</span>**</td><td class="colsep-1 rowsep-1" style="border-width:0.2px;width:65.1221%;">`doubleValue: 60352 B` (signal D04)</td></tr></tbody></table>

</div>This file is in the protobuf (ASCII) format and can be read using a simple parser. For more information, refer to: [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/)

</section><p class="callout info"><span class="title">Note: If you only require the values for a specific measurement, you can read this from the ASCII text manually.</span></p>

<section class="section" id="bkmrk-the-protocol-buffer-">The protocol buffer compiler is installed under `<span class="filepath">/usr/bin/protoc</span>`.

The protoc version can be found with the command: `<kbd class="userinput">/usr/bin/protoc --version</kbd>`

Output example: **`<span class="filepath">libprotoc 2.5.0</span>`**

To structure information, protocol buffer message types are defined in .proto files. The following protobuf file is used for license logging, which can be compiled with the protocol buffer compiler to Java, Python, Objective-C, or C++.

<dl><dt class="dlterm">**<span class="uicontrol" style="background-color:rgb(206,212,217);">SmarTest ≥ 8.2.0</span>**</dt><dd>`<span class="filepath">/opt/hp93000/soc/system/include/xoc/profiling/licenseUsage.proto</span>`

</dd></dl></section><section id="bkmrk-before-you-begin-mak">### **Before you begin**

Make sure that license logging is enabled. For details, see [Enabling license logging](https://lhc.advantest.com/books/client-configuration-and-license-management/page/enabling-license-logging "Detailed information about license consumption and optimize license usage can be identified by License usage logging.").

</section><section id="bkmrk-procedure-create-a-p">### **Procedure**

1. Create a parser file, for an example, see [Example logfile parser](https://lhc.advantest.com/link/93#bkmrk-example-logfile-pars "The following code is an example parser for reading license log files and printing the top 10 measurement executions contributing to the specified feature and signal.").
2. For example, to compile to C++ with the protocol buffer compiler, run the following commands or a <span class="filepath">make.sh</span> script containing the commands:  
      
    `<kbd class="userinput">protoc -I=/opt/hp93000/soc/system/include/xoc/profiling/ --cpp_out=. /opt/hp93000/soc/system/include/xoc/ profiling/licenseUsage.proto</kbd>`
    
    `<kbd class="userinput">c++ -std=c++11 -g -L/usr/local/lib -lprotobuf -o licenseLogger licenseUsage.pb.cc main.cpp</kbd>`
    
    The generated C++ class is used to simplify the parser implementation.
    
    ```
    ./licenseLogger licenseUsage.log memory D04
    Analysing: licenseUsage.log memory D04
    Top 20 measurement runs for feature "memory" at signal "D04"
    Measurement Run                   | Value        | Watermark Value
    ----------------------------------+--------------+-----------------------
    Main.GlobalPAPattern2.measurement | 1032.000     | 3096.000
    ```

</section><section class="section" id="bkmrk-results-after-the-ab">## Results

After the above `<kbd class="userinput">protoc</kbd>` call or `<kbd class="userinput">make.sh</kbd>` script is run, the following files are created:

<dl><dt class="dlterm">**<span style="background-color:rgb(206,212,217);">licenseLogger</span>**</dt><dd>Generated Parser Executable To execute the **licenseLogger**, use the command:

`<kbd class="userinput">./licenseLogger <output_file_name> <license_type> <signal></kbd>`

For example:

`<kbd class="userinput">./licenseLogger licenseUsage.log memory D01</kbd>`

</dd><dt class="dlterm"><span style="background-color:rgb(206,212,217);">**measurementLicense.pb.cc** </span></dt><dd>Generated after running **protobuf** compiler  
  
</dd><dt class="dlterm"><span style="background-color:rgb(206,212,217);">**measurementLicense.pb.h**</span></dt><dd>Generated after running **protobuf** compiler</dd></dl></section>---

# Example logfile parser

The following code is an example parser for reading license log files and printing the top 10 measurement executions contributing to the specified feature and signal.

<section class="section" id="bkmrk-example-parser-%28smar">### Example parser (SmarTest ≥ 8.2.0)

```
#include <iostream>
#include <fcntl.h>
#include <fstream>
#include <google/protobuf/text_format.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <map>
#include <iostream>
#include <iomanip>
#include <sstream>
#include "licenseUsage.pb.h"
using namespace std;
using namespace license;
using namespace ::google::protobuf::io;
using ::google::protobuf::TextFormat;
map<double,string> featureValuePerMeasurement;
map<string,double> featureValuePerMeasurementWatermark;
// measurementName, <license string, count>
multimap<string, pair<string,int> > licenseUsage;
// utility to extract signal from signal list into a vector of signals
vector<string> signalsToVector(string& signals)
{
vector<string> items;
const char* t = " \t\n\r\f\v";
unsigned long opos = 0;
unsigned long pos = signals.find_first_of(" + ");
while (true) {
// trim white spaces
string extract = signals.substr(opos, pos - opos);
extract.erase(0, extract.find_first_not_of(t));
extract.erase(extract.find_last_not_of(t) + 1);
items.push_back(extract);
if (string::npos == pos) { break; }
pos = signals.find_first_of(" + ", opos = pos + 1);
}
return items;
}
// Sample method to print Top 20 measurement runs for given feature and signal
// In addition print the license usage after the Top1 measurement was executed.
void printTop20(string& featureKey, string& sigKey)
{
int x = 0;
int mrlen = 0;
for(auto elem = featureValuePerMeasurement.rbegin();elem != featureValuePerMeasurement.rend() && x < 20; ++elem, ++x) {
if(elem->second.size() > mrlen) { mrlen = elem->second.size(); }
}
cout << "Top 20 measurement runs for feature \"" << featureKey << "\" at signal \"" << sigKey << "\"" << endl << endl;
cout << setw(mrlen) << left << "Measurement Run" << " | Value | Watermark Value " << endl;
for(int i=0;i<mrlen;++i) { cout << "-"; }
cout << "-+--------------+-----------------------" << endl;
x=0;
for(auto elem = featureValuePerMeasurement.rbegin();elem != featureValuePerMeasurement.rend() && x < 20; ++elem, ++x) {
cout << fixed << setw(mrlen) << elem->second << " | " << setw(12) << left << setprecision(3) << elem->first << " | " << setprecision(3) << featureValuePerMeasurementWatermark[elem->second] << endl;
}
cout << endl << endl;
string mrName = featureValuePerMeasurement.rbegin()->second;
auto elements = licenseUsage.equal_range(mrName);
auto elem = elements.first;
for(;elem != elements.second; ++elem) {
cout << "Count: "<< setw(6) << elem->second.second <<elem->second.first << endl;
}
}
bool processMessage(string& message, string featureKey, string sigKey)
{
license::MeasurementLicense log;
if (!TextFormat::ParseFromString(message, &log)) {
cerr << endl << "Failed to parse string: " << endl;
return false;
}
string mrName = log.measurementname();
LicensedFeatureLog feature = log.licensedfeaturelog();
for(int i=0; i<feature.featurepersignal_size();++i) {
FeaturePerSignal fps = feature.featurepersignal(i);
string signals = fps.signallist();
vector<string> signalVector = signalsToVector(signals);
for(int x=0;x<fps.feature_size();++x) {
Feature f = fps.feature(x);
if(f.feature() == featureKey) {
for(auto const & sig : signalVector) {
if(sig == sigKey) {
featureValuePerMeasurementWatermark[mrName] = f.accdoublevalue();
featureValuePerMeasurement[f.doublevalue()] = mrName;
}
}
}
}
}
for(int i=0;i<log.licenses_size();++i) {
auto l = log.licenses(i);
for(int x=0; x<l.licensestring_size();++x) {
auto ls = l.licensestring(x);
licenseUsage.insert(make_pair(mrName,make_pair(ls.name(), ls.count())));
}
}
return true;
}
int main(int argc, char** argv)
{
if (argc != 4) {
printf("wrong arguments, ussage: licenseLogger featureKey sigKey\n");
exit (1);
}
ifstream file(argv[1]);
string featureKey = string(argv[2]);
string sigKey = string(argv[3]);
string str, message;
printf("Analysing: %s %s %s\n", argv[1], argv[2], argv[3]);
getline(file, message);
while (getline(file, str)) {
if(str.size() > 16 && str.substr(0,16).compare("measurementName:") == 0) {
if(!processMessage(message, featureKey, sigKey)) { exit(-1); }
message = str;
continue;
}
message += str;
}
printTop20(featureKey, sigKey);
}
```

</section>