Usage and Management

To use TDL, the TDL environment must be configured. To use the implicit version protection function, the TMAX environment must be configured. This chapter describes how to configure each environment and use the related tools.

1. Directory Configuration

The TDL directory consists of the config directory for environment files, the mod directory for soon-to-be-updated libraries, and the run directory for updated libraries.

Directory Description

config

Directory for TDL environment files (tdl.cfg). This directory is also used as the default location for the RACFILE parameter.

mod

Directory for soon-to-be-updated libraries. After copying shared libraries (*.so or *.sl) into the mod directory, execute tdlupdate.

run

Directory for updated libraries after executing tdlupdate. A user must not remove any file arbitrarily since the directory also contains system files required for internal operations.

If the $TDLDIR is not specified as the TDL root path, the path configured in the $TMAXDIR environment variable is used. If a user wants to specify a different path, the $TDLDIR environment variable must be configured. Also, TDL needs to be used in the local client, $TDLDIR must be configured.

The TDL 2.x version does not have config but tdl.cfg in the $TDLDIR.

2. Configuration

To use TDL, the TDL configuration file and the environment related to TDL must be set at Tmax.

The basic syntax for environment settings is parameter=value, with no spaces allowed within the line. Lines beginning with # are treated as comments. Environment variables are supported in the $site format (e.g., LOGDIR=${TDLDIR}/log).

2.1. TDL Configuration

The TDL configuration file is $TMAXDIR/config/tdl.cfg and the following describes an example TDL environment file with its items.

# shared memory version (1|2|3|4)
VERSION=2
# shared memory key
SHMKEY=0x90000
# shared memory and file creation permission
IPCPERM=0750
# number of dynamic loadable modules, rouded up to powers of 2
MAXMODULES=256
# shared memory backup
BACKUP=/home/tdl/tdl.bak
# path of a command file for searching export functions
#COMMAND=tdlcmd
# path of a log directory
LOGDIR=/home/tdl/log
# running mode (single|master|slave|shared)
MODE=single
# mornitoring statistics
MONITOR=Y
# crc check
BACKUPCRC=Y

# language of tdl application [C |COBOL |IBMCOBOL |PL1 |MIXED]
LANG=C
# path of a file including addresses for accessing remote tdl nodes
#RACFILE=tdl.rac
# tdl domain ID
DOMAINID=1
# multiple run, mod dir
#DIRMAPPINGLIST=(mod:run),(mod2:run2),(mod2:run2)
# HASHFUNC=[ LOOKUP2 |LOOKUP3 |SUPERFASTHASH |TDLHASH |MURMURHASH ]
#HASHFUNC=MURMURHASH
# Excluding global variables
CUSTOMCMD=Y
# copy method
#COPY=[ cp |mmap |self |dma ]
# tdl log name
#TDLNAME=REGION1
# compare to glosebal sequence number
GSEQNOTIME=Y

# shared mode with localrun
#MODE=shared
#MASTERNODENO=0
#NODELIST=node1,node2
#SMODDIR=${TDLDIR}/mod
#SRUNDIR=${TDLDIR}run<
#LRUNDIR=/home/tmax1/localrun
#KEEPEXT=asmo
#SHMKEY_SHARED=Y
Item Description

VERSION

Configures a version to run TDL. Select one among 1, 2, 3, and 4. (Default: 1)

For more information, refer to VERSION Item.

SHMKEY

Configures a shared memory key value used for running TDL.

IPCPERM

Configures the permission of the dynamic module and shared memory of the run directory.

MAXMODULES

The maximum number of dynamic modules. Used by being rounded off to 2^n. Can change without relocation of the modules. For more information, refer to Examples.

BACKUP

Specifies the shared memory backup file. During tdlinit and tdlupdate, the shared memory is automatically backed up to the specified file. If it is a relative path, the path begins at $TDLDIR or $TMAXDIR. $TDLDIR of the path information takes precedence.

COMMAND

Specifies the location of the script file to automatically extract a function to export from the library. If it is a relative path, the path begins at $TDLDIR/config or $TMAXDIR/config. $TDLDIR of the path information takes precedence.

LOGDIR

Specifies the error and information message logging directory. The log file name is "tdllog.mmddyyyy" format. If it is a relative path, the path begins at $TDLDIR or $TMAXDIR. $TDLDIR of the path information takes precedence.

MODE

Configures one of a master, slave, and single in the multi nodes or domains.

  • master

  • slave

  • single (Default)

  • shared

MONITOR

Option to collect TDL statistics information (Y|N). (Default: N )

If set to 'Y', AVG/MIN/MAX and CPU AVG/MIN/MAX, performing time by module are collected. Can be queried through the 'tdlshm –S' option.

It is activated by running the following command.

tdlshm -s e

BACKUPCRC

Sets whether to enable or disable the crc check function (Y|N). (Default: Y)

Enabling this option may slow down tdlupdate execution because of crc calculations.

When 'BACKUPCRC= Y' is set, the following applies:

  • When running tdlinit, tdlupdate, or tdlsync, crc information is written to the backup file.

  • When running tdlinit -b or tdlshm -a|-b, TDL’s hash table consistency check is performed.

  • When running tdlinit -b or tdlshm -a|-b, the crc check of the backup file is performed.

  • When running tdlupdate, crc checks of backup files are skipped to avoid performance degradation.

LANG

Selects one of the following languages for use by the TDL application:

  • C

  • COBOL

  • IBMCOBOL

  • PL1

  • MIXED

If no language is selected, the default is 'C'. The module extension is determined by the OS.

RACFILE

Specifies a file containing the racd addresses of all nodes in a multi-node or multi-domain environment. If it is a relative path, the path begins at $TDLDIR/config or $TMAXDIR/config. $TDLDIR of the path information takes precedence.

For an example of RACFILE, refer to RACFILE Example.

DOMAINID

ID for a TDL domain and must be configured differently per domain. (Default: 0)

DIRMAPPINGLIST

Indicates two or more run directories are used.

Pairs of the mod directories and run directories are separated by parenthesis and a colon(:) and can be set up to 10 pairs. Supported from Tmax v5.0 sp1 fix#2.

HASHFUNC

Specifies the type of HASH internally used in TDL (Index configuration for each module). Supported from Tmax v5.0 sp2.

CUSTOMCMD

Specifies whether global variables are registered when executing commands with tdlinit or tdlupdate. On IBM platforms, global variables can be searched using nm. When CUSTOMCMD = Y is set, global variables are not registered.

COPY

Determines how file copying is performed internally by tdlcall.

  • cp: Uses /bin/cp.

  • mmap: Copies files internally using a memory map. Available only on AIX, SUN, and LINUX platforms, and not on HP platforms. (Default)

  • self: Similar to cp, but copies files in read/write mode.

  • DMA: Uses a zero-copy function similar to sendfile(). Available only on Linux (kernel 2.6.33 or later) and Sun platforms.

TDLNAME

Specifies a prefix for log messages. When set, 'TDLNAME' is added as a prefix when printing logs.

GSEQNOTIME

Specifies how the Global Seqno is assigned when calling tdlgetseqno().

  • Y: Compares the call time with the Global Seqno to assign a larger number.

  • N: Assigns the Global Seqno of TDL directly. (Default)

MASTERNODENO

Specifies the master node number or node name in a multi-node environment. Must be set in the configuration file for all nodes. Setting this allows tdlupdate to be executed on nodes other than the master node.

Required when 'MODE = SHARED' is set.

NODELIST

Specifies the nodes to be synchronized when 'MODE = SHARED' is set. If not set, all nodes in the Tmax environment or racfile are synchronized by default. Multiple nodes (up to 100) can be separated by commas.

  • The tdlinit, tdlrm, and tdlshm (without -n option) commands can only run on specified nodes. Running them elseewhere causes an error.

  • The tdlupdate and tdlclean commands can be run on nodes not specified in this options, and the request will be forwarded to the node specified as MASTERNODENO and executed instead.

SMODDIR

Specifies the mod directory path. It can be an absolute or relative path. For a relative path, the path is set based on $TDLDIR.

(Default: $TDLDIR/mod directory)

SRUNDIR

Specifies the run directory path. It can be an absolute or relative path. For a relative path, the path is set based on $TDLDIR.

(Default: $TDLDIR/run directory)

LRUNDIR

Specifies the local run directory path. It can be an absolute or relative path. For a relative path, the path is set based on $TDLDIR. If not set, this feature is disabled.

When calling the tdlcall command, the program is called by loading the shared object from the LRUNDIR path, not the shared object in the SRUNDIR directory.

When executing the tdlinit, tdlupdate, and tdlclean commands, files are automatically copied from SRUNDIR to LRUNDIR. Files in SRUNDIR and LRUNDIR are compared, and file copying is performed if the file size or last modified time is different.

KEEPEXT

  • Allows tdlinit to copy files with the extension specified in this option from the SMODDIR directory to the SRUNDIR directory.

  • When specifying a file with an extension in the -m option when performing tdlupdate, it behaves as follows.

    • For shared objects (e.g., .so), function symbols are extracted and registered in shared memory as before.

    • Files with extensions listed in the KEEPEXT option are copied from SMODDIR to SRUNDIR without symbol checking.

    • Files with other extensions are registered as shared objects after appending the .so extension to the file name.

      The following is an example of registering the libtest.1.0.3.so library.

      tdlupdate -m libtest.1.0.3
  • When running tdlinit or tdlclean, files with the specified extension are not excluded from deletion in the SRUNDIR directory. You can specify up to 100 extensions, separated by commas (,).

SHMKEY_SHARED

Specifies whether the SHMKEY_SHARED feature is enabled (Y|N). In a logical node configuration, multiple nodes can exist on a single system.

When MODE = SHARED is set, SHMKEYs are duplicated because all nodes use the same configuration file. Enabling this option causes each node to use a SHMKEY offset by its node number multiplied by 3. (Default: N)

[Caution]

When calling the tdlcall() function in the client module, if this option is enabled, you must properly enter the number of the node to which the client belongs in the environment variable TDL_CLI_NODENO to obtain the exact SHMKEY of its own node.

VERSION Item

TDL can operate the system in the form of four VERSIONs. VERSION values can be configured through VERSION parameters of the TDL environment file (tdl.cfg).

  • VERSION 1

    The VERSION is set to 1 and has only one function per library. The function name must match the library name. (The function name must be unique.)

  • VERSION 2

    The VERSION is set to 2 and the library can have multiple functions. But functions to be exported are supported by the following. (The function name must be unique.)

    • Specification of Export Files

      A user specifies a function to export from the library by including an export file ("library name.exp") in the mod directory. This method is recommended as the automatic extraction may export functions that are not supposed to be exported.

      An export file specifies one function per line. If the first character of the line is '#', the line will be annotated.

      The following is an example.

      # mylibrary
      myfunction1
      myfunction2
      myfunction3
    • Automatic Extraction of Export Function

      Automatically extracts functions to be exported. If the export file is not specified, the function is automatically extracted. Internally, nm is used and a user can redefine the nm script. The script must be written in one line. If the first character of the line is '#', the line will be annotated. If the last character of the line is '\', the line will lead up to the following line. "$(LIB)" is a macro variable that indicates the library name.

      The following is an example.

      # for HP32
      nm $(LIB) |awk -F"|" '{if ($3 == "extern" && $4 == "code   ")
       {print $1}}' |grep -ve "^_"
      
      # for HP64
      nm $(LIB) |awk -F"|" '{if ($4 == "FUNC " && $7 == "   .text")
      {print $8}}' |grep -ve "^_"
      
      # for IBM32
      nm $(LIB) |awk '{if ($2 == "D") {print $1}}'
      
      # for IBM64
      nm -X64 $(LIB) |awk '{if ($2 == "D") {print $1}}'
      
      # for SUN
      nm $(LIB) |awk -F"|" '{if ($4 == "FUNC ") {print $8}}' |grep -v "^_"
      
      # for linux
      nm $(LIB) |awk '{if ($2 == "T") {print $3}}' |grep -v "^_"
      
      (*The above script is noly an example and the modification is needed depending on the actual platform)

      The above script can be used by using the COMMAND parameter of the TDL environment file(tdl.cfg) or the –x option from the management tool. Also, functions that are automatically extracted from the system can be identified in advance through tdlnm.

  • VERSION 3

    The VERSION is set to 3. The library name and function name are used for a key. Therefore, unlike VERSION 1 and 2, it is acceptable for the function name to be unique only within the library. But the VERSION 3 requires tdlcall2(), tdlcall2v(), and tdlcall2s() to be used.

  • VERSION 4

    The VERSION is set to 4. The library name, class name, and name space are used. This is used in C++ and does not use tdlcall but a separate interface. For more information, refer to Examples.

RACFILE Example

Save the configured file with ".rac" extension as follows. Configure the file name for the RACFILE item.

hostname1 192.168.1.1 3333
hostname2 192.168.1.2 3333
hostname3 192.168.1.3 3333
Using Environment Variables

Environment variables cannot be applied to variable names; they can only be set as variable values. Multiple environment variables can be specified. When no parentheses are used, ENV is interpreted as string + number + _ string. When parentheses are used, only the string inside the parentheses is interpreted ($ENV, $(ENV), $site).

  • Environment Variable Values

    $ENV = 'hello'
    $MY = 'of'
  • Example tdl.cfg settings and substitution results

    OPTION=value1$ENV/value2/data$MY     ==> OPTION=value1hello/value2/dataof
    OPTION=value1$ENVvalue2/data$MY      ==> OPTION=value1/dataof
    OPTION=value1$(ENV)/value2/data${MY} ==> OPTION=value1hello/value2/dataof
    OPTION=value1$(ENV)value2/data${MY}  ==> OPTION=value1hellovalue2/dataof

2.2. TDL Environment Variables

The following is a list of environment variables that can be set when using TDL.

Item Description

TDL_ENABLE_DL_TIMER

Specifies whether to measure execution time of dlopen, dlsym, and module calls when tdlcall* or tdlload* functions are executed in the debug library. (Default: N)

  • 'Y': Measures execution time and writes it to the debug log.

  • Debug library: libsvrd, libclid, libtdlcalld

2.3. Tmax Configuration

To use the implicit version protection, TDL must be configured at DOMAIN or NODE clause.

*DOMAIN
tmax ...,
         TDL = Y

*NODE
tmax1 ...,
         TDL = Y
  • DOMAIN Clause

    Item Description

    TDL

    Option to use the TDL implicit version protection (Y|N). (Default: N)

  • NODE Clause

    Item Description

    TDL

    Option to use the TDL implicit version protection (Y|N). If not configured, the TDL value of the DOMAIN clause will be used.

3. System Management Tools

The following are the management tools that TDL provides. They are located in the following path.

$TMAXDIR/bin
Command Description

tdlinit

Performs initialization of TDL shared memories and dynamic modules.

tdlclean

Cleans up the run directory’s older version of the library files or unnecessary files.

tdlnm

Queries the list of functions to be automatically exported for the specified library.

tdlrm

Management tool to completely remove shared memories when TDL is no longer used.

tdlseqno

Queries the sequence number of a specific module and function.

tdlshm

Queries information about TDL shared memories or configures whether to activate statistics monitoring and modules.

tdlsync

Performs synchronization of TDL shared memories and backup files.

tdltrace

Queries TDL environment settings and statistics information.

tdlupdate

Updates the specified dynamic module.

3.1. tdlinit

The tdlinit command initializes a TDL shared memory and dynamic modules. This command is executed only once when Tmax is installed and before Tmax starts. This command can be executed only in a master node in a multi-node environment.

The following shows how to use the command.

  • Usage

    $ tdlinit [-p TDL root directory path] [-x export function extraction script file path] [-f] [-b]
              [-B backup file path] [-i] [-v | -V] [-h]
    Option Description

    [-p TDL TDL root directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different directory, use this option.

    [-x export function extraction script file path]

    Specifies the directory containing the script file that extracts the export functions.

    [-f]

    Initializes already existing shared memory by force.

    [-b]

    Restores shared memory from a backup file.

    [-B backup file path]

    Restores shared memory from the specified backup file.

    [-i]

    Checks the run directory after a backup. Can be used with the [-b] or [-B] option.

    [-r]

    Reconstructs hashes when creating shared memory from a backup file generated after TDL patching. Must be used together with the [-b] or [-B] option; otherwise, an error may occur during hash construction.

    [-v | -V]

    Shows the version information.

    [-h]

    Shows the command help.

  • Examples

    • The following initializes shared memory and modules using a TDL configuration file <tdl.cfg>:

      $ tdlinit
    • The following backs up shared memory from a backup file in the event of a system failure or restart:

      $ tdlinit -b
  • Note

    A script file that extracts an export function is required if VERSION is set to 4.

    /* Example of exp file */
    /* dlib.exp */
    
    #! dlib.so
    TmaxSoft::Airplain
    Car

3.2. tdlclean

The tdlclean command removes outdated libraries or unnecessary files in a run directory. To remove a dynamic module from shared memory, use [-m] or [-M] options.

Note the following precautions when using the tdlclean command:

  • Running tdlupdate while executing tdlclean may lock the run directory and cause the process to hang.

  • Running 'tdlclean -m' on a module that is currently in use may prevent the module files in the run directory from being deleted.

The following shows how to use the command.

  • Usage

    $ tdlclean [-p TDL root directory path] [-m library name] [-M function name] [-b]
               [-d yyyymmddhhmi] [-D “n hour|day” [-N number] [-v | -V] [-h]] [-f]
    Option Description

    [-p TDL root directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different directory, use this option.

    [-m library name]

    Deletes the specified library and its related files from TDL shared memory and the run directory.

    [-M function name]

    Deletes only the specified function from shared memory while retaining the related files in the run directory. However, if VERSION=1 is set, this option behaves the same as [-m].

    [-b]

    Skips backup of shared memory files even if the BACKUP parameter is specified in the TDL configuration file (tdl.cfg). Can be used with either [-m] or [-M].

    [-d yyyymmddhhmi]

    Deletes all files of older library versions prior to the specified time (yyyymmddhhmi). Cannot be used with [-m] or [-M].

    [-D “n hour|day”]

    Deletes all files of older library versions prior to the specified hour or day. Cannot be used with [-m] or [-M].

    [-N number]

    Deletes all files of older library versions except for the specified number of files. Cannot be used with [-m] or [-M].

    [-v | -V]

    Shows the version information.

    [-h]

    Shows the command help.

    [-f]

    Registers all library information from the run directory into heap memory, and then performs a comprehensive comparison with the functions in the latest libraries in TDL shared memory.

    This option can improve performance. Cannot be used with [-N], [-m], or [-M].

  • Examples

    • The following removes outdated library files:

      $ tdlclean
    • The following removes library files that were created before 00:00 on February 1st, 2009:

      $ tdlclean –d 200902010000
    • The following removes library files older than five days:

      $ tdlclean -D "5 day"
    • The following removes mylibrary from TDL shared memory and the outdated files:

      $ tdlclean -m mylibrary

3.3. tdlnm

The tdlnm command retrieves a list of functions that are automatically exported to a specified library when VERSION is set to 2 or higher.

The following shows how to use the command.

  • Usage

    $ tdlnm [-p TDL root directory path] [-x export function extraction script file path]
            [-m library name] [-v | -V] [-h]
    Option Description

    [-p TDL root directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different directory, use this option.

    [-x export function extraction script file path]

    Specifies the directory containing the script file that extracts the export function.

    [-m library name]

    Specifies the name of the library that retrieves a list of automatic export functions.

    [-v | -V]

    Shows the version information.

    [-h]

    Shows the command help.

  • Example

    The following retrieves a list of export functions in the mylibrary.

    $ tdlnm -m mylibrary

3.4. tdlrm

The tdlrm command removes shared memory when a TDL is no longer used. tdlcall() cannot be called after this command is executed.

The following shows how to use the command.

  • Usage

    $ tdlrm [-p TDL root directory path] [-v | -V] [-h]
    Option Description

    [-p TDL root directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different directory, use this option.

    [-v | -V]

    Shows the version information.

    [-h]

    Shows the command help.

  • Example

    The following removes TDL shared memory.

    $ tdlrm

3.5. tdlseqno

This command retrieves the sequence number of a specific module and function .

The following shows how to use the command.

  • Usage

    $ tdlseqno [-m library name|-M function name[-p TDL root directory path]] [-V] [-h]
    Option Description

    [-p TDL root directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different path, use this option.

    [-m library name]

    Specifies the library name.

    [-M function name]

    Specifies the function name.

    [-V]

    Displays the version information.

    [-h]

    Displays command help.

  • Examples

    • The following retrieves the sequence numbers of the specified module and functions from $TDLDIR or $TMAXDIR.

      $ tdlseqno -m library1 -M module1
    • The following retrieves the sequence numbers of the specified module and functions from the specified directory.

      $ tdlseqno -m library1 -M module1 -p dirname

3.6. tdlshm

The tdlshm command retrieves information about TDL shared memory and enables/disables statistics monitoring and modules.

The following shows how to use the command.

  • Usage

    $ tdlshm [-p TDL root directory path] [-r] [-S] [-n node name] [-m library name]
             [-M function name] [-C] [-c start_index end_index] [-s e|d|r]
             [-u e|d] [-I mincol] [-v | -V] [-b] [-B backup file path] [-a] [-h]
    Option Description

    [-p TDL root directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different directory, use this option.

    [-r]

    Displays information about modules currently undergoing synchronization updates in a multi-node environment.

    [-S]

    Displays statistical information for dynamic modules. The retrieved information includes the AVG, MIN, and MAX execution time of each module, as well as the AVG, MIN, and MAX CPU time.

    [-n node name]

    Specifies the node from which to retrieve information in a multi-node environment.

    [-m library name]

    Specifies the name of the library to retrieve.

    [-M function name]

    Specifies the name of the function to retrieve.

    [-C]

    Executes dlopen and dlsym for all modules.

    [-c start_index end_index]

    Executes dlopen and dlsym for the modules within the specified index range.

    [-s e|d|r]

    Configures statistics monitoring for dynamic modules.

    • e : Enable

    • d : Disable

    • r : Reset

    [-u e|d]

    Configures a dynamic module.

    • e : Enable

    • d : Disable

    This option must be used with [-m] or [-M] options because only a single module can be set at a time.

    • The [-m] option must be specified if VERSION is set to 1 or 2 because the module name must be unique for all libraries. The function name used as an argument of the [-m] option must be unique.

    • [-m] and [-M] options must be specified if VERSION is set to 3, because, in this case, functions with different libraries can use the same name. The [-M] option must be used with the [-m] option.

    [-I mincol] (Uppercase I)

    Displays a comparison count, in the "Collision=n" format, when a hash collision occurs in a module. If n is 0, only one comparison was found.

    mincol is a minimum comparison count. The value must be greater than 0. When displaying each module, only information about modules with a comparison count greater than a specified value are displayed. Set mincol to a large value to quickly find a function with a high comparison count.

    This option can be used with [-p], [-m], [-M], and [-r] options.

    [-v | -V]

    Shows the version information.

    [-b]

    Retrieves information from the files defined by the BACKUP parameter in the TDL configuration file(tdl.cfg), instead of from shared memory data.

    [-B backup file path]

    Retrieves information from the specified backup file, instead of from shared memory data.

    [-a]

    Displays any discrepancies between the files defined by the BACKUP parameter in the TDL configuration file (tdl.cfg) and the shared memory data.

    When used with [-B backup file path], it compares the specified file with the shared memory data, and displays any discrepancies detected. If the compared information matches, SUCCESS is printed on the last line. If there are differences, the number of discrepancies (headers, modules, and indexes) is printed.

    [-h]

    Shows the command help.

  • Examples

    • The following is the basic usage of tdlshm:

      $ tdlshm TDLNAME = REGION1
      - TDLDIR = /home/jeffry/tmax LOGDIR = /home/jeffry/tmax/log/dlog
      - BACKUP = /home/jeffry/tmax/log/dlog/tdl.bak VERSION = 2, SHMKEY = 0x90000,
      - IPCPERM = 0750 MAXMODULES = 256, CURMODULES = 3, Global SEQNO = 45e27d28,
      - MONITOR = Y MODE = SINGLE, DOMAINID = 1 Index = 125, Funcname = myfunction1,
      - Libname = myfunction1, Seqno = 45e27d28, Active = Y Index = 126,
      - Funcname = myfunction2, Libname = myfunction2, Seqno = 45e27d28, Active = Y,
      - Index = 127, Funcname = myfunction3, Libname = myfunction3, Seqno = 45e27d28,
       Active = Y
    • The following retrieves information about TDL statistics:

      $ tdlshm -S TDLNAME = REGION1
      - TDLDIR = /home/jeffry/tmax LOGDIR = /home/jeffry/tmax/log/dlog
      - BACKUP = /home/jeffry/tmax/log/dlog/tdl.bak VERSION = 2, SHMKEY = 0x90000,
      - IPCPERM = 0750 MAXMODULES = 256, CURMODULES = 3, Global SEQNO = 45e27d28,
      - MONITOR = Y MODE = SINGLE, DOMAINID = 1 Index = 125, Funcname = myfunction1,
      - Libname = myfunction1, Seqno = 45e27d28, Active = Y Count = 0 SVC: Avg = 0.000,
      - MinTime = 0.000, Maxtime = 0.000 CPU: Avg = 0.000, MinTime = 0.000,
      - Maxtime = 0.000 Index = 126, Funcname = myfunction2, Libname = myfunction2,
      - Seqno = 45e27d28, Active = Y Count = 0 SVC: Avg = 0.000, MinTime = 0.000,
      - Maxtime = 0.000 CPU: Avg = 0.000, MinTime = 0.000, Maxtime = 0.000 Index = 127,
      - Funcname = myfunction3, Libname = myfunction3, Seqno = 45e27d28, Active = Y,
      - Count = 0 SVC: Avg = 0.000, MinTime = 0.000, Maxtime = 0.000 CPU: Avg = 0.000,
      - MinTime = 0.000, Maxtime = 0.000
    • The following is the result when [-s] or [-u] options are used:

      $ tdlshm -s r
      $ tdlshm -s e
      $ tdlshm -s d
      
      # VERSION=1|2
      $ tdlshm -u e -M myfunction
      $ tdlshm -u d -M myfunction
      
      # VERSION=3
      $ tdlshm -u e -m mylibrary -M myfunction
      $ tdlshm -u d -m mylibrary -M myfunction
    • The following is the result when [-C] or [-c] options are used:

      $ tdlshm -C
      $ tdlshm -c 0 1024
      $ tdlshm -c 1024

3.7. tdlsync

The tdlsync command synchronizes a backup file with TDL shared memory. This command is necessary when automatic backup is disabled.

The following shows how to use the command.

  • Usage

    $ tdlsync [-p TDL root directory path] [-B backup file path] [-v | -V] [-h]
    Option Description

    [-p TDL root directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different directory, use this option.

    [-B backup file path]

    Specifies the backup file directory.

    [-v | -V]

    Shows the version information.

    [-h]

    Shows the command help.

  • Example

    The following example backs up shared memory with a file specified as a BACKUP in the TDL configuration file <tdl.cfg>:

    $ tdlsync

3.8. tdltrace

This command retrieves the configuration and statistical information of TDL.

The following shows how to use the command.

  • Usage

    $ tdltrace [-p directory path] [-P PID] [-V] [-h] [-c]
    Option Description

    [-p directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different directory, use this option.

    [-P PID]

    Displays the information of the specified server process.

    [-V]

    Displays the version information.

    [-h]

    Displays the command help.

    [-c]

    Identifies zombie processes and removes their information.

  • Examples

    $ tdltrace
    $ tdltrace -P 20113
    $ tdltrace -P 20113 -p dirname
    $ tdltrace -c

3.9. tdlupdate

The tdlupdate command updates a specified dynamic module. A library name must be specified with a [-m] option. If a specified library is already registered, the library will be updated. If the library is not registered, it will be added. This command can be executed both in the Master node and a slave node within a multi-node configuration.

The following shows how to use the command.

  • Usage

    $ tdlupdate [-p TDL root directory path] [-r directory path]
                [-x export function extraction script file path] [-f] [-m library name] [-b]
                [-c] [-l file name] [-i] [-Q seqno] [-C [cp | mmap | self]] [-e] [-N] [-v|-V] [-h]
    Option Description

    [-p TDL root directory path]

    Specifies the TDL root directory. By default, this is either $TDLDIR or $TMAXDIR. To specify a different directory, use this option.

    [-r directory path]

    Specifies the TDL root directory (TDLDIR) of a remote node to execute tdlupdate.

    When the [-p] option is used and multiple TDL root directories exist, the [-r] option is required to distinguish the target directory.

    [-x export function extraction script file path]

    Specifies the directory containing the script file that extracts the export functions.

    [-f]

    When VERSION=2, forces the update even if the same function name already exists in another library.

    [-m library name]

    Specifies the library name to update. To specify multiple libraries, separate them with commas (,) without spaces.

    There is no limit to the number of libraries or functions that can be registered in each library. However, in a TDL multi-node environment, each library can contain a maximum of 1,024 registered functions.

    [-b]

    Skips the backup of shared memory files even if the BACKUP parameter is specified in the TDL configuration file (tdl.cfg).

    [-c]

    Synchronizes data across nodes in a multi-node configuration.

    [-l file name]

    Updates libraries listed in the specified file. All files are checked, and updates are performed only if no issues are detected. If an issue is found, a rollback is performed. To specify multiple files, separate them with commas (,) or newlines (Enter).

    There is no limit to the number of libraries or functions that can be registered in each library. However, in a TDL multi-node environment, each library can contain a maximum of 1,024 registered functions.

    [-i]

    Continues updating with the next file even if a target file does not exist.

    [-Q seqno]

    Uses the specified sequence number instead of the current time.

    [-C [cp|mmap|self]]

    Specifies the file copy method, overriding the COPY parameter setting in the TDL configuration file (tdl.cfg).

    Choose one of the following:

    • cp

    • mmap

    • self

    [-e]

    Returns an error code if tdlupdate fails on certain nodes in a multi-node configuration (MODE=SHARED).

    If this option is not set, the Master node returns the success value (0) even if tdlupdate fails on certain nodes.

    [-N]

    Selectively synchronizes modules to be updated with tdlupdate in a multi-node configuration (MODE=SHARED).

    If this option is not specified, all modules registered in SRUNDIR are synchronized with those in LRUNDIR, which may take more time.

    In a multi-node environment (MODE=SHARED), using the [-N] option is not recommended, as it may cause unstable synchronization. If synchronization issues occur, it is recommended to perform a full synchronization with 'tdlupdate -c' during a low-traffic period.

    [-v | -V]

    Shows the version information.

    [-h]

    Shows the command help.

  • Examples

    • The following updates the <mylibrary.so> file:

      $ tdlupdate -m mylibrary
    • The following updates multiple modules. The delimiter is a comma (,), and spaces are not allowed.

      $ tdlupdate -m mylibrary,mylibrary2,mylibrary3
    • The following creates a file that contains a list of modules to be updated, and then updates the modules.

      $ tdlupdate -l update.list
    • The following is a list of libraries in the <update.list> file. A comma (,) and newline can be used as a delimiter:

      mylibrary,mylibrary2
      mylibrary3
    • The following synchronizes nodes when there is an inconsistency in shared memory in a multi-node environment:

      $ tdlupdate -c
    • The following uses the -e option in a multi-node environment.

      $ tdlupdate -m func001 -e
      TDLUPDATE.redhat73.14389.174419:(E) TDLUTIL0028 socket connect error: nodename = node2, racport = 3478 [TDL0018]
      TDLUPDATE.redhat73.14389.174419:(I) TDLUTIL0095 /home/tmaxha/tmax/run/func001.64d5f4e3 is being processed [TDL0417]
      TDLUPDATE.redhat73.14389.174419:(I) TDLUTIL0118 Synchronization succeeded [TDL0064]
      TDLUPDATE.redhat73.14389.174419:(I) TDLUTIL0083 func001.64d5f4e3 updated successfully [TDL0443]
      $ echo $?
      9
  • Note

    If VERSION=4, a script file that extracts export functions is required.

    /* Example of exp file */
    /* dlib.exp */
    
    #! dlib.so
    TmaxSoft::Airplain
    Car

4. Restrictions

  • Library names and function names can be up to 63 characters long.

  • When using the tdlupdate command, the target file path must follow this format: {path}/{library name}.{seqno}

    • The full path string is limited to a maximum of 260 characters.

    • If the path exceeds this limit, tdlupdate may fail. Ensure that the directory structure and library name length keep the path within the limit.