Download NightTrace Manual

Transcript
NightTrace Manual
int_const
An integer constant that is unique within table_name. It may be
decimal, octal, or hexadecimal. Decimal values have no special
prefix. Octal values begin with a zero (0). Hexadecimal values
begin with 0x.
str_const
A character string to be associated with int_const. Keep this
string short; otherwise, ntrace may be unable to display it in
the limited window space available. Use a \n for a newline,
not a carriage return in the middle of the string.
The optional default item line associates all other integer values with a single string. The
fields of the default item line are:
default_item
The keyword that begins all default item lines.
str_const
(See str_const above.)
TIP:
If your table needs only one entry, you may omit the item line and supply only the default
item line. A get_string() call with this table name as the first parameter needs no
second parameter.
ntrace returns a string of the item number in decimal if:
• There is no default item line, and the specified item is not found.
• The string table is not found. (The first time ntrace cannot find a
particular string table ntrace flags it as an error.)
The following lines provide an example of a string table in a configuration file.
string_table (curr_state) = {
item = 3, “Processing Data”;
item = 1, “Initializing”;
item = 99, “Terminating”;
default_item = “Other”;
};
In this example, your application logs a trace event with a numeric argument that identifies the current state (curr_state). This argument has three significant values (3, 1,
and 99). When curr_state has the value 3, the ntrace display shows the string
“Processing Data.” When it has the value 1, the display shows “Initializing.”
When it has the value 99, the display shows “Terminating.” For all other numeric
values, the display shows “Other.”
For more information on string tables and the get_string() function, see
“get_string()” on page 9-75 and the /usr/lib/NightTrace/tables file.
Pre-Defined String Tables
5
The following string tables are pre-defined in ntrace:
event
5-14
A dynamically generated string table internal to ntrace. It
maps all known numeric trace event IDs with symbolic trace
ev ent tag s. A sim ilar association appears in the
/usr/lib/NightTrace/eventmap file; this is an