Understanding SLM Tags logging
You can enable IBM® Software License Metric (SLM) Tags logging in the compiler so that IBM License Metric Tool (ILMT) can track compiler license usage.
Types of compiler licenses logged
- Authorized user licenses: Each compiler license is tied to a specific user ID, designated by that user's uid.
- Concurrent user licenses: A certain number of concurrent users are authorized to use the compiler license at any given time.
The SLM daemon process
The SLM tag file is created by the SLM daemon. The SLM daemon is a regular executable in the compiler. It outputs a tag file for every user-defined period of time. You can specify the period of time through the -slm-period option. The daemon terminates if no user invokes the compiler within a user-defined period of time, and restarts with a new invocation of the compiler. The minimum number of seconds that the SLM daemon must wait before terminating can be specified by the -slm-timeout option.The SLM tag file
The compiler logs compiler license usage to an SLM tag file slm_dir/hash.slmtags, where slm_dir can be specified by the -slm-dir option, and hash is the MD5 hash of the SWID and root directory of the current product. The default value of slm_dir is /var/opt/ibm/xl-compiler/ for a default installation, or $prefix/var/opt/ibm/xl-compiler for a nondefault installation, where $prefix is the nondefault installation path. The slm_dir directory must be readable and writable by all users invoking the compiler.
- <StartTime> and <EndTime>
- The start time and end time of the invocations.
- <Value>
- The maximum number of users that invoked the compiler simultaneously within the time period denoted by the <StartTime> and <EndTime> elements.
- <Type>
- The type of compiler license logged.
- <Metric>
- All the preceding elements are contained in the <Metric> element. The SLM daemon outputs up to two <Metric> elements for every time period, one for authorized users and one for concurrent users.
The following example is a tag file generated by the compiler. It logs three concurrent user invocations followed by one authorized user invocation.
<SchemaVersion>2.1.1</SchemaVersion>
<SoftwareIdentity>
<PersistentId>80bc33fc989d4df6a6cab5c741384a31</PersistentId>
<Name>IBM Open XL C/C++ for AIX</Name>
<InstanceId>/opt/ibm/ibm-clang/17.1.2</InstanceId>
</SoftwareIdentity>
<Metric logTime="2022-10-01T18:39:51Z">
<Type>AUTHORIZED_USER</Type>
<Value>1</Value>
<Period>
<StartTime>2022-10-01T18:34:51Z</StartTime>
<EndTime>2022-10-01T18:39:51Z</EndTime>
</Period>
</Metric>
<Metric logTime="2022-10-01T18:39:51Z">
<Type>CONCURRENT_USER</Type>
<Value>3</Value>
<Period>
<StartTime>2022-10-01T18:14:51Z</StartTime>
<EndTime>2022-10-01T18:19:51Z</EndTime>
</Period>
</Metric>
The tag file has a configurable size limit and the default is 5,000,000 bytes. If the size of the current file exceeds the maximum size, old <Metric> elements in the file are removed. You can specify the size limit through the -slm-limit option.
Error logs
If an error occurs before the daemon forks, a return code of -1 is returned. Otherwise, no failure will be reported. In either case, the error will be logged to slm_dir/.hash/log.