| Run time debugging of bshell (ttstpbshdebug) |  |
| use.session.to set or modify the various bshell debug options on runtime. These bshell debug options can also be set before runtime in the BW configuration in the Command field, using the Infor BW Environment and Configuration Selector ( BECS) program. The session is intended for advanced users, who have ERP LN programming experience and are familiar with the functionality of the Bshell. The session contains the following main groups or form tabs: General options Bshell Debug Levels BDB/SQL Tracing (BDB = ERP LN Data Base Tracing, SQL = Query Processor Tracing) Binary Logging and Tracing (BLAT) The logging information of the Bshell and the BDB/SQL Tracing is stored in an ASCII file. By default the logging info is stored in file $BSE/tmp/bshell.<pid>. On exit of the Bshell the log file will be deleted unless the check box 'Keep trace file after exit' is selected. To interpret the output of the Bshell log file: Because the output is in ASCII format, you can use any ASCII display utility or ASCII editor. The logging information of the Binary Logging and Tracing is stored in a Binary file. By default the logging info is stored in file $BSE/tmp/blat.<pid>. On exit of the Bshell the log file will be deleted unless the check box 'Keep trace file after exit' is selected. To interpret the output of the Binary log file: Because the output is in binary format, you must transfer the output to readable format. To transfer the output, the following two binaries are delivered in the portingset: btop6.2 and bls6.2. These utilities have the following meaning: btop6.2: This utility is the more important of the two and shows the top 10 most consuming queries. bls6.2: This utility shows the flow of the trace in logical order, which enables the user see what exactly happened and when. For details, refer to the Infor Enterprise Server 8.6 - Technical Manual (U8172 US).
Fields | Description
General Options
show trace in Message Window | Besides normal saving the logging data in the Bshell log file, the logging information will also be sent to the BW Message Window.
Debug on BW Message | This check box refers to the Bshell option -dbgmesg. The Debug on BW Message attempts to stop the current process if the process is compiled in debug. This feature will allow the programmer to determine where and when a BW message is generated.
Log messages to trace | The log messages that are normally sent to the $BSE/log/log.bshell6.2 are also sent to the bshell trace file.
Bshell messages to trace | This check box refers to the Bshell option -mdebug. Sends Bshell messages normally displayed in the BW message window also to the bshell trace file.
Trace level | This check box refers to the Bshell option -debuglevel <value>. The trace level is not used for BLAT. It is possible to specify a trace level to allow granularity of tracing. This allows better control over the reproduced amount of data. There are four trace levels. Each subsequent level provides a greater amount of detail. The levels are 0, 1, 2, and 3. Example with the following tracings enabled: “Show object information” (-dbgobj) “Show Symbol Loading” (-dbgsym) “Program Flow” (-dbgflow): Tracelevel 0: This will give information about the allocated memory per object/function. Tracelevel 1: By using this trace level, you can determine the number of bytes used for static allocation using declaration (as opposed to dynamic memory allocations with alloc.mem() ). In this situation, tracelevel 1 prints the size of the bytes of the types, including the external types. So, tracelevel 1 specifies exactly for each symbol (variable) how much memory is allocated. Tracelevel 2: When using tracelevel 2, the local and static symbols allocated are also shown. The names of the local and static symbols are “optimized away” by the bic compiler. At level 2, it becomes clear where and how much symbol memory is allocated for local symbols, external symbols, and for function arguments, (no function argument symbols). Example with -dbgfun in combination with -dbgcpu: The functions in ERP LN have globally two levels of the functions: 3GL/4GL functions. bshell functions. The 3GL/4GL functions are covered with -dbgflow. The bshell function trace is covered with -dbgcpu, -dbgfun and the tracelevels. Tracelevel 0 - This only prints the bshell functions. Tracelevel 1 - Prints the bshell functions with parameters and its return value. - The error value “e” is also printed when modified within the bshell. Tracelevel 2 - This level includes the symbol names, when available. - The error value “e” is also printed when modified within the bshell. Tracelevel 3 - This level prints the source line number with the source name when the object is in debug. - The error value “e” is also printed when modified within the bshell.
Keep trace file after exit | This check box refers to the Bshell option -keeplog. If this check box is selected, then the Bshell log file and the BLAT log file will not be deleted on exit of the Bshell.
Add Time stamps | This check box refers to the Bshell option -logtime. Add time stamps to Bshell log output.
Log name: | This check box refers to the Bshell option -logfile <file>. The name and path of the ASCII logfile, by default $BSE/tmp/bshell.<pid>. This field is readonly. The path and file name of the log file can only be set in the BW configuration using the option -logfile.
Remark | Here you can type remarks you want to write to the log file. The Remark text is written to the log file after clicking the Remark to Log button.
Bshell Debug Levels
Debug Functions | This check box refers to the Bshell option -dbgfun. This option will give information about the Bshell functions used. This option must be used in conjunction with -dbgcpu. Dbgfun only will give the object that is started, with the pid of that object. By adding –dbgcpu, the bshell function who is called in that object is logged in addition. If a new object is started, this will be put in the file. For old objects, the pid will be used. The functions that are used are only bshell functions and not the functions of applications.
Debug Cpu | This check box refers to the Bshell option -dbgcpu. This trace option switches the debug version of the bshell CPU on. The bshell cpu is the kernel of the bshell, executing all kind of tasks. Especially in case of bshell problems, this tracing can be useful. This option is used in combination with other loggings.
Debug Instructions | This check box refers to the Bshell option -dbginstr. This option logs the Bshell VM CPU instructions. Only for very experienced bshell users.
Dump Stack Traces | This check box refers to the Bshell option -dbgstack. This option logs the stacktrace for each 3/4GL function, and is used in combination with -dbgcpu. In case the 3/4GL object is not in debug mode, the stacktrace will only show internal 'IDs' instead of function names.
Getvar/Putvar debug | This check box refers to the Bshell option -dbggpvar. Trace information regarding getting and putting variables. A 3/4GL program can request a variable from another process using get.var(). And a 3/4GL program can assign a new value to a variable of another process using put.var(). These actions are logged using this trace option.
Program Flow | This check box refers to the Bshell option -dbgflow. Using this Debug option, the 3GL function flow, with function names or numbers, and object names are logged. This information gives you insight into how the program flow was, and which functions were called from which place. In case the objects are compiled in debug mode, the function names themselves are logged, otherwise function numbers are logged.
Debug Java VM Int | This check box refers to the Bshell option -dbgjvmi. This option logs the JavaVM integration actions.
Show object information | This check box refers to the Bshell option -dbgobj. This option logs the information of the objects that are used. First, we will get the object’s name and the pathname where it is stored. With this option, you can see which version is used and then a check can be done to see whether this is the latest version that must be used. Then, there is also some information on the object such as release number and revision number. This information is set in the object during compilation. Furthermore, we have some information about the number of bytes used within the object.
Show SRDD use | This check box refers to the Bshell option -dbgsrdduse. This option is used to see where the objects are loaded from; disk or memory. On UNIX, all objects will first be loaded from disc. If they are used again, you can load them from memory. On NT, the objects will stay in memory. Only after a fresh start of Windows, the objects will be loaded from disc. This only applies to objects that are in the $BSE/lib/srdd_init file. In this file, you can enter which files must be loaded in memory.
Debug TSS | This check box refers to the Bshell option -dbgtss. This option logs information about Triton Super Set. The multibyte enabling has been implemented in ERP LN by means of the Triton Super Set (TSS), which is a collection of character sets. TSS accommodates all multibyte character sets in a single package. TSS includes both ASCII character sets and multibyte character sets, such as Japanese, Chinese, and Hebrew. To distinguish between, for example, Japanese and Chinese, TSS consists of planes, each of which holds a 64 KB-size character set, or 256 pages of 256 characters.
Debug data.input() | This check box refers to the Bshell option -dbgdata. Logs the user data input that is handled by function data.input(). like the next command (n) in the “general maintenance session” (ttaad4100).
Debug Resources | This check box refers to the Bshell option -dbgres. This trace option shows all resources loaded by the bshell. Resources are coming from environment variables set. From files such as `$BSE/lib/default/all,$BSE/lib/user/u<username>` and so on.
Debug Expressions | This check box refers to the Bshell option -dbgyy. Tracing of the bshell expressions as used in expr.compile/l.expr/d.expr/s.expr$ calls (refer to the ERP LN 6.1 Programmer's Guide).
Show Symbol Info | This check box refers to the Bshell option -dbgsym. Show Symbol Info allows a finer tracing when tracing the allocation and reading of symbols. Remark: when having Show Symbol Info set only, it logs nothing, it only makes sense in combination with other loggings.
Show opened files | This check box refers to the Bshell option -dbgfile. In comparison with “Debug file access” (-dbgfdev), this tracing only shows the successfully opened files.
Debug file access | This check box refers to the Bshell option -dbgfdev. With this option, the files to be accessed are logged. The place where the files should appear is given, also, when an error occurs, like a read permission, this error is logged. It is possible to get an error 2 because the file does not exist, or an error 13, when the permission is not correct. By starting the ERP LN menu browser, the bshell will look for files with default information, in the $BSE/lib/default directory. It is not necessary to have these files, so it is not always necessary that the errno is 0.
Debug LTS | This check box refers to the Bshell option -dbglts. LTS provides a mechanism to store translatable software components, such as labels, questions, and messages separate from language-independent software components, such as form and report designs. For example, a sales order entry form contains only an identifier to a referring label and will be used by all system languages. The translated labels will be added only to display the form. This option shows from which location the labels are read. It is visible by the first character of each label that is displayed in this session (ttstpbshdebug), see list below: X (Inde X label dump files) Labels are read from the runtime labels database in the directory $BSE/labels. B (Data B ase) Labels are read from the develop time labels database from table ttadv140. F ( F allback) Labels are read from the form or report object in the directory $BSE/application (default). Note: No further information is stored in the Bshell log file.
Debug Scheduler | This check box refers to the Bshell option -dbgsched. This trace option logs information about scheduling of processes by the bshell. This option is only interesting in case of low-level problems regarding process scheduling.
Show process actions | This check box refers to the Bshell option -dbgmulact. This trace option gives information that occurs with the processes. When a session is started, this is a new process in the bshell. Processes can be activated, sleeping, killed, or can communicate with each other (send_bms and receive_bms). All this information regarding the processes is logged with this option.
BDB/SQL Tracing
Driver Type | This check box refers to the Bshell variable setting BDB_DEBUG=0001. This option logs the database drivers and parameters currently in use.
Database Actions | This check box refers to the Bshell variable setting BDB_DEBUG=0002. This option logs all kind of database actions such as Insert, Update, Delete, Commit, and Abort. The actions which are requested by the client, to be executed by the server (database driver), are specified by using messages. The ERP LN client sends commands to the server, and the server sends the results back to the client. In some cases, the server can ask the client for more information to carry out a command. In that case, the server sends an error back to the client and in some cases a list of required information as well. In most cases, the client sends the requested information to the server. Messages of BDB_DEBUG=00002 can be identified by the first character: An arrow to the right (->) means: ‘from client to server’. An arrow to the left (<-) means: ‘from the server to the client’. The following message types are possible: ATT_SERVER ATT_SESSION DD_INFO_TABLE EXE_SYSTEM EXE_ROW_CNTR EXE_DB_CNTR EXE_SESSION EXE_TBL_CNTR EXE_UPDATE SQL_MESSAGE PERMISSION SEND_COMPNR DET_SESSION DET_SERVER
Delayed Locks | This check box refers to the Bshell variable setting BDB_DEBUG=0004. This option logs information on currently set locks.
References | This check box refers to the Bshell variable setting BDB_DEBUG=0010. This option logs the references between tables.
Multi Byte Storage | This check box refers to the Bshell variable setting BDB_DEBUG=0040. This option logs all tables using native storage format.
Permissions/Roles | This check box refers to the Bshell variable setting BDB_DEBUG=0100. This option logs information about the database authorizations of the user. With the option BDB_DEBUG=02 the sending of the permissions is logged and with BDB_DEBUG=100 what permissions are send, is logged.
Open/Close Tables | This check box refers to the Bshell variable setting BDB_DEBUG=0200. This option logs information on the opening and closing of cursors. As soon as a table must be accessed, a cursor must be opened.
BDB_DEBUG value: | This readonly field shows the resulting value of the BDB_DEBUG options. Here is a summary of the BDB_DEBUG values that can be set:
00001 | Log the drivers and parameters currently in use
00002 | Log database actions such as Insert, Update, Delete, Commit and Abort
00004 | Log information on currently set locks
00010 | Log references between tables
00040 | Log all tables using native storage format
00100 | Log the permissions and roles allowed for each user
00200 | Log information on opening and closing of tables
If all BDB_DEBUG options are set, the resulting value will be: 00357
Internal SQL functions | This check box refers to the Bshell variable setting BAAN_SQL_TRACE=02000. The BAAN_SQL_TRACE value 02000 logs the calls of internal SQL functions. In addition, it added a lot of information to the trace file. In case you are not explicitly interested in this information, do not use value 02000 to keep the trace file small and more readable. In case you are interested in the flow of a program, the result of this trace value will give you an indication of the executed queries and their execution flow. (Consider running the program in debug mode to get an exact overview of the flow of a program).
BAAN_SQL_TRACE value: | This readonly field shows the resulting value of the BAAN_SQL_TRACE Flag. If the Internal SQL functions check box is selected. the value will be 02000.
Show BDB Actions | This check box refers to the Bshell option -dbgbdbact. This option logs the ERP LN database activities initiated from the Bshell. For example, when inserting a record in the Price Lists (tcmcs0134m000) session, or delete some records.
Print Enums | This check box refers to the Bshell option -dbgenums. This option dumps information about the enums used in the data dictionary when reading the DD.
Show locking errors | This check box refers to the Bshell option -dbglck. This option does not work any more.
Show BDB server type | This check box refers to the Bshell option -dbgsrv. This trace option logs for each table the database server type and its parameters.
Binary Logging and Tracing (BLAT)
BLAT introduction | The tracing functionality BLAT (binary logging and tracing) generates a set of related loggings that cover the entire range from bshell to the database driver. All generated logs have a defined portable format that facilitates automatic processing. Several log types have been defined that can be enabled independently that offer a fine-grained control to the type and amount of generated data. When applicable, you can use the threshold setting to decrease the amount of generated data by clipping all of the information that did not exceed the threshold. To process logs, you must use tools. Currently, two tools available: bls6.2 and btop6.2. To activate the logging before starting the Bshell, you must set the environment variable BLAT. You can set the logging level for each log type, however, to set the default logging you can assign default to the environment variable BLAT. To avoid problems in the environment variable handling due to the presence of spaces in the BLAT configuration, you can use an alternative separator, which you can define with the environment variable BLATSEP. Using the Infor BW interface, BW.exe, you can configure this as follows: Start BW Configuration (BW.EXE /CONFIG) and fill in the Command field as in the following example: -- -set BLATSEP=_ -set BLAT=sql_s_01111_th_0_retry_s_1 A blatlog file containing the trace output will be generated in the current directory. Threshold logging: for some log types, you can specify thresholds, such as the trans and sql loggings. After you set a threshold, all loggings that do not exceed the threshold value will be discarded. Setting thresholds is a powerful method to limit the amount of generated data, while problems will still be visible. The BLAT configuration string can contain a sequence of basic specifications, predefined templates and a log file specification. Basic specifications: <type> <state> [<threshold>], see table below:
Specification | Syntax | Description
<type> | {“proc” | “sess” | “trans” | “retry” | “sql” } | One of the implemented log types.
<state> | {“s” | “state”} <value> | This specification sets the log state. The value has a different meaning for each log type.
<threshold> | {“th” | “threshold” } {<value>| “off”} | This optional specification sets the threshold value to be used for this log type. The threshold is specified in seconds, for example, 0.5.
Log file specification: "log" | "logfile" <quoted path> Predefined templates: “off” disables all logging. “default” shorthand for: sess s 1 sql s 011 th 5.0
Trace option: Retry Related | This check box refers to the BLAT option -set BLAT="retry s 01". A 3GL command or the handling of recoverable ERP LN Database errors can result in a jump to a retry point. The BLAT Tool’s Retry Points log types contains information on the handling of the retry points in the bshell. Defined log states: This log type is enabled when the state is set to 1, and disabled when set to 0. Threshold logging is not applicable for this log type.
Trace option: Session Related | This check box refers to the BLAT option -set BLAT="sess s <value>". The session-related log provides information about the starting and stopping of sessions at various levels in the ERP LN clients and database drivers. A session at the 3GL level, for example, might result in multiple sessions in the lower levels. This happens as soon as multiple database drivers are required to handle an ERP LN session, or when a session modifies audited tables. Defined log states: The log state value is interpreted as a bitmap. Any value != 0 Enables logging at the 3GL / BDB level (client) Flag 002 Enables logging at the DBS level in the database drivers. Flag 010 Enables logging at the DBS level in the audit driver. Threshold logging is not applicable for this log type.
Trace option: Transaction Related | This check box refers to the BLAT option -set BLAT= "trans s <value> th <value>". This log type contains information about the handling of commit and abort actions. The transaction-related log provides information about the handling at several levels in the ERP LN clients and database drivers. A transaction at the 3GL level can result in multiple transactions in the lower levels. This happens as soon as multiple database drivers are required to handle an ERP LN session, or when a session modifies audited tables. EXAMPLE: -set BLAT= "trans s 01 th 0.5”. Defined log states: The log state value is interpreted as a bitmap. Any value != 0 Enables logging at the 3GL / BDB level (client) Flag 002 Enables logging at the DBS level in the database drivers. Flag 010 Enables logging at the DBS level in the audit driver. Threshold logging: The “trans” log type supports the threshold mechanism.
Trace option: Query Related | This check box refers to the BLAT option -set BLAT="sql s <value> th <value>". This log type contains information about query handling. A query at the 3GL level can result in multiple queries in the lower levels. Defined log states: 0000001: Log-aggregated information about a query. If you set this flag, a log that contains aggregated information about a query is generated when you close the query. 0000002: Log all parse, execute, and fetch actions. This option can be very powerful in combination with a threshold to find long elapse times in the query handling. 0000010: Log SQL text. If you set this flag, the query information contains the query text. If you do not set this flag, the query text is absent. This can be useful for long-running traces that must log only a limited amount of log data. Because the 3GL location is always present, you still have an indication where a problem is occuring. 0000100: Log aggregated information. Identical to the 000001 flag, however, the database driver generates this log. 0000200: Log all actions. Note that the generated dbs_info log contains a link between the client query ID (qid) and the query ID in the database driver. 0001000: Log database-dependent SQL text. Identical to the 0000010 flag, however, the database driver generates this log. Thresholds: The query-related log type supports threshold logging. As a result, logs are only generated after you complete the command when a threshold has been exceeded. This implies that the order of the information that is generated on different levels will be reversed. A log can also be delayed: when an exec exceeds the threshold, you might be required to generate an info log, as well.
Log name: | The name and path of the Binary log file, by default $BSE/tmp/blat.<pid>. The log file is created on the first BLAT logging message. The path and file name of the log file can be modified dynamically.
Remark | You can enter Remark text in this text box. The Remark text is written to the BLAT log file after clicking the Remark to Log button.
BLAT command | This readonly field shows the resulting values of the BLAT options. The resulting values are shown in the following format: proc 01 sess 13 retry s off trans 13 th 5 sql 07 The BLAT options can also be set in the BW configuration using the Bshell variable BLAT. example: -set BLAT="proc s 01 sess s 13 retry s off trans s 13 th 5 sql 07 th 3" The table below shows a summary of the BLAT option values (states) and their meanings. For some log types, you can specify thresholds, such as the trans and sql loggings. After you set a threshold, all loggings that do not exceed the threshold value will be discarded.
level | type | state | description
Bshell | proc | 00001 | logs information regarding to processes
BDB | sess | 00001 | logs information regarding to 3GL / BDB level (client)
DBS | sess | 00002 | logs information regarding to DBS level (database driver)
DBDL | sess | 00004 | logs information regarding to DBDL level (database driver / RDBMS integration) not yet implemented
DBS | sess | 00010 | logs information regarding to DBS level (audit driver)
Bshell | retry | 00001 | logs information about the handling of the retry points in the bshell
BDB | trans | 00001 | logs information regarding transactions done by 3GL / BDB level (client)
DBS | trans | 00002 | logs information regarding to DBS level (database driver)
DBDL | trans | 00004 | logs information regarding to DBDL level (database driver / RDBMS integration) not yet implemented
DBS | trans | 00010 | logs information regarding to DBS level (audit driver)
BDB | sql | 00001 | logs aggregated information
BDB | sql | 00002 | logs all actions
BDB | sql | 00010 | logs ERP LN SQL text
BDB | sql | 00020 | logs bind variables
BDB | sql | 00040 | logs selected data
DBS | sql | 00100 | logs aggregated information (database driver level 2)
DBS | sql | 00200 | logs all actions (database driver level 2)
DBS | sql | 01000 | logs database dependent SQL text (database driver level 2)
DBS | sql | 02000 | logs bind variables (database driver level 2)
DBS | sql | 04000 | logs selected data (database driver level 2)
DBS | sql | 10000 | logs aggregated information (database driver level 1)
Commands | Description
Dump Process List | Click this button to write all currently running processes in the Bshell to the Bshell log file.
Memory Totals | This button refers to the Bshell option -dbgmemtot. Click this button to write the Memory Totals to the Bshell log file.
Free Memory | This button refers to the Bshell option -dbgmemfree. Click this button to write the free memory list to the Bshell log file.
Memory Used | This button refers to the Bshell option -dbgmemused. Click this button to write the used memory list to the Bshell log file.
Memory Block List | This button refers to the Bshell option -dbgmemblk. Click this button to write the memory usage per block to the Bshell log file.
All Memory Info | This button refers to the Bshell option –dbgmem. Click this button to write all memory statistics to the Bshell log file.
Show Shared Mem | Click this button to write the shared memory information to the Bshell log file.
Remark to Log (Bshell) | Click this button to write the Remark text to the Bshell log file.
Remark to Log (BLAT) | Click this button to write the Remark text to the BLAT log file.