CBL_CREATE_STACKDUMP

Restrictions: This routine has the following restrictions:
  • It is only supported on Linux platforms.
  • It is not supported in programs built to INT or GNT.
Generates a stackdump file.

Syntax:

call "CBL_CREATE_STACKDUMP" using by value flags
                            using by value process-id
                            using by reference stackdump-name
                                 returning status-code

Parameters:

  Using call prototype (see Key) Picture
flags cblt-x4-comp5 pic x(4) comp-5.
process-id cblt-x4-comp5 pic x(4) comp-5.
stackdump-name pic x(n) pic x(n)

On Entry:

flags Control flags
0x1
By default, only the thread that called the routine is dumped. By setting this flag, all threads in the process are dumped.
process-id The process ID. If this is set to 0, the calling process is dumped.
stackdump-name The name of the output stackdump file as a null-terminated string. If set to null, the value is taken from the stackdump_filename tunable. If the tunable is also not set, the platform default is used, which is <program-basename>.stackdump.<process-id>.log.

stackdump-name can contain the same string substitution characters as the stackdump_filename tunable.

%%
Single %
%d
The date of when the program encountered the error, in the format yyyymmdd
%f
The basename of the program that encountered the error
%p
The process ID of the program that has encountered the error
%t
The time of when the program encountered the error, in the format hhmmss
For example: To create a stackdump file that contains the program name and pid, enter %f.%p.dump

On Exit:

status-code The possible return values are:
0
Success
1
Invalid process ID
2
Could not create or write to stackdump file
3
Unable to start diagnostics
4
Invalid flags
5
Routine not supported on the platform
6
Internal error