Turning On Debug Flags For Store And Restore Opcards In CA-Alexandria 4.50 (Core CA-Alexandria Only) (taken from Support Newsletter 35 October 1998)

Document ID : KB000056143
Last Modified Date : 14/02/2018
Show Technical Document Details

The basic procedure for turning on debugging is:

  1. Determine what different types of debugging you want
  2. Calculate the debug flag
  3. Turn on debugging in the opcard
  4. Run the opcard
  5. View the debug log and temporary files

1. Determine what types of debugging you want
There are many different "levels" of debugging. Each "level" is combined from the following options. Determine which of the below debugging options you want.

Creates debug files and runs formatter debugging


With this field turned on, a debug file is created. In normal CA-Alexandria stores, debug files are not created. This can make the store run slower. The debug file will be called D.S.$$ and will be stored in the primary tmp directory.

Do not delete temporary files

An SLT file is a temporary file. These files are created during the process of a store and kept in the primary tmp directory. SLT files have file names like: SLT.$$.xxxx - where $$ is the PID of the process running and xxxx is the number of the SLT file.

Keep SLT Database file after store completes

The SLT Database file is the detailed information about the store that is uploaded into the CA-Alexandria database.

Buffer Activity sent to debug file

Low level formatter debugging, concerning internal buffer usage (buffers being filled to go to alex-store processes) is kept in the debug file.

Save database file

This is the file that gets uploaded into the CA-Alexandria database and becomes the detailed information in the database.

Redirect standard error to a file

CA-Alexandria runs some UNIX commands during the store process. This option will redirect the standard error of those commands to a SLT file. If you were running a find command on the command line, say find / -print > /tmp/find 2> /tmp/error, the standard error would be redirected to a file called /tmp/error. This is equivalent.

Detailed Debugging

This will cause even more debugging information to be written to the debug file. (The debug file will be called D.S.$$ and will be stored in the primary tmp directory.)

Simulate Media Failure

This option causes the store to go as normal, but CA-Alexandria pretends that the tape it found to write on was bad.

Detailed Formatter debug

The formatter is the CA-Alexandria program that takes data and converts it into clusters to write to tape. Turning on this option will cause detailed information about the formatter to be written into the debug file. (The debug file will be called D.S.$$ and will be stored in the primary tmp directory.)

Send store formatter output to /dev/null -- This option requires the option Use Unique Media to be selected
This option will run the store, but send all of the data to /dev/null. With this flag turned on, the store will go through all of the motions except sending data. The find command will run. A tape will be selected and loaded into a drive. The tape will be "fast forwarded" to the point that writing can begin. End of cluster marks will be written to tape. All data, however, will be sent to /dev/null instead of along the SCSI chain. The data will be sent to /dev/null on the local machine. That is, if you are running this on a client, the data is getting sent to the client's /dev/null, not the servers. Network traffic is not tested.

Split file across clusters

This option will simulate an End of Tape thus requiring a cluster to be split across tape boundaries.

2. Calculate the DEBUG FLAG
The DEBUG flag is a hexadecimal summation of all of the options you want turned on. Each option described above is associated with a field. (The chart below is for stores. The restore chart is at the end of this document.)

Bit Description of Store Debug But Mask
0 Creates debug files and run formatter debugging
1 Do not delete temporary files
2 Buffer Activity sent to debug file
3 Save database file
4 Redirect stderr to a file
5 Simulate a media failure
6 Detailed debugging
7 Detailed formatter debug
8 Split file across clusters
9 N/A
10 N/A
11 N/A
12 Stores nothing to tape (Data to /dev/null
13 N/A
14 N/A
15 N/A

Calculating the DEBUG flag requires a little bit of conversions. The easiest way show you how to calculate it is to give an example.
Forwards Calculation

From the above list, let's say we decided to run debugging with the following options:

Debug File Created and Formatter run with -v
Keep all SLT files
Remap Standard error
Detailed debugging

__ __ __ __  __ __ __ __  __ __ __ __  __ __ __ __
15 14 13 12  11 10 9  8   7  6  5  4   3  2  1  0

Place a 0 in each position that you are NOT turning on and a 1 in each position that you ARE turning on.

0  0  0  0   0  0  0  0   0  1  0  1   0  0  1  1

The number we just created, 0000000001010011, is a binary number. Open up your Windows Calculator. (Hit the Start button. Hit the Programs folder. Hit the Accessories folder. Select Calculator.) On the calculate, select "Scientific" from the View menu. On the left side of the calculator are radio buttons called "Hex Dec Oct Bin" These stand for hexadecimal, decimal, octal, and binary. Most likely, decimal is the current button selected. SELECT BIN.

After you have the windows calculator in BIN mode, type in the above number, 0000000001010011, just as you made it above. After you have typed in the above number (leading zeros will not appear), click on HEX for hexadecimal. The number will then be converted to hexadecimal. For this example, the hexadecimal number is "53." This is the number you are going to use to tell the opcard what debug level to use.
Backwards Calculation
Sometimes you may want to calculate this backwards. For instance, a support person or engineer may tell you to run the opcard in debug mode "4B." What is debug mode 4B?

Open up your windows calculator. Select Scientific from the View Menu. Select HEX for hexadecimal. Type in 4B. Click on BIN for binary. The number will then be converted to binary. 1001011

Put the number you get back on the below chart, working right to left.

0  0  0  0  0  0  0  0  0  1  0  0 1  0  1  1
__ __ __ __  __ __ __ __  __ __ __ __  __ __ __ __
15 14 13 12  11 10 9  8      7  6  5  4       3  2  1  0

Remember that a 0 means "OFF" and a 1 means "ON." The first field that is turned on is field 6. From the below chart, field six is "Detail pattern matching to debug file." The next field on is 3, and 3 means "Keep SLT Database file after store completes." The next on option is field 1, which means Keep all SLT files are store completes. The last ON field is 0, debug file created and formatter run with -v command line option.

So 4B is equivalent to:

Debug File Created and Formatter run with -v command line option
Keep All SLT Files after store completes
Do not delete SLT files
Detailed Debugging

3. Turn on debugging in the opcard
This case-sensitive procedure requires a space and then DEBUG followed by a space and a hexadecimal value. When turning on multiple levels at one time, you must add them in hexadecimal.

The first comment line in the opcard should contain a space as the first character, DEBUG as the second through sixth characters, a space for the seventh character and then the hexadecimal debug flag.
If debugging is being turned on via the GUI, the screen should look like this:

Figure 1

If debugging is being turned on via the command line, the file should look like this:

# DEBUG DB
## OP-CARD NAME: gwen TYPE: STORE
## EXECUTE MACHINE DEFINITION
     MACHINE
## DEBUG LEVEL DEFINITION
     DEBUG 000000DB
## MANAGED/ACTIVATION DEFINITION
     MANAGED
ACTIVATE-TIME 15:01
ACTIVATE-DATE 98/08/27

4. Run the opcard

Run the opcard just like you normally would.

5. View the debug log and temporary files

The debug log will be stored in the primary tmp directory with the name of "D.S.$$" where $$ is the PID of the store that ran.
The debug log will look like this:

Store began using Op-Card `gwen'
Launched from machine `<<<LOCAL>>>' at Tue Oct 20 12:20:17      1998
Store Date: 98/10/20 Store Time: 12:20 Store Key: chiqcjfjlugmqnswqr
Full Store: YES Auto Repeat: NO
Detail Database stored on `<<<LOCAL>>>'
Stack-Id `98/10/20:12:20-FULL-gwen.walisgi1'
Store Format Value 0x0000
Store Format Selected ALEXANDRIA
Store Compression Selected 
Store Encryption Selected ->
Beginning to build store includes/excludes...
Adding INTERNAL Exclude Pattern: ^/usr/people/alexbkup/ `^/usr/people/alexbkup/'
Adding INTERNAL Exclude Pattern: _ `_'
Listed Users will be INCLUDED
Listed Groups will be INCLUDED
Done building store includes/excludes.
Store Temp Dir = `/tmp/gwen/' Default Value: YES
Store Root Dir = `/etc' Default Value: NO
Find Arguments = `' Default Value: YES
Store will Terminate at WHEN DONE
User Cluster File `/tmp/gwen/SLT.21820.0003'
User Find Command `'
User Cluster Command `'
Per Cluster Dbase Update `NO'
Find Command `find /etc -print'
Sort Command `sort -T /tmp/gwen/'
sort start 
sort buffer `/etc
/etc/fstab
/etc/autoconfig

SLT files 1 through 6 are created by the find command and the detail filtering.
SLT.$$.0001 - Since this is usually empty, I haven't figured out what it is.
SLT.$$.0002 - The find list
SLT.$$.0003 - Since this is usually empty, I haven't figured out what it is.
SLT.$$.0004 - The find list with the exclude list removed
SLT.$$.0005 - The exclude list
SLT.$$.0006 - The database update file


From then on, they go in groups of three.

0007 - Rules File (used to be called Control In file.)
Contains what is to be stored in a cluster.

0008 - Results File (used to be called Control Out file.)
Contains what becomes the store detail file. One for each cluster.

0009 - Carry Over File. Contains an ongoing list of all files that are hard links.

0010 - Rules File (used to be called Control In file.)
Contains what is to be stored in a cluster.

0011 - Results File (used to be called Control Out file.)
Contains what becomes the store detail file. One for each cluster.

0012 - Carry Over File. Contains an ongoing list of all files that are hard links.

Restore Opcard Debugging Flags

Working with Restore Opcard Debug Flags is identical to working with Store Opcard Flags with the following exception: Only the below fields are available.

Bit Description of Restore Debug Bit Mask
0 Debug File Created
1 Keep All SLT Files after restore completes
2 N/A
3 Stops restore once restore list is built
4 N/A
5 Formatter performs format to format copy to /dev/ - Read data, but does not restore files
6 Formatter Debugging
7 Detailed formatter debugging
8 N/A
9 N/A
10 N/A
11 N/A
12 Build Control files without calling formatter
13 N/A
14 N/A
15 N/A