trcupdate Command

Purpose

Adds, replaces, or deletes trace report format templates.

Syntax

trcupdate-o ] [  -t File ] [  -v ] [  -x  IDList ] [ File ]

Description

The trcupdate command adds, replaces, or deletes trace report format templates in the /etc/trcfmt or the /etc/trcfmt.Z file. When the /etc/trcfmt.Z file is used, the trcupdate command uncompresses the file, updates it, and recompresses it. The trcupdate command creates an "undo" file named File.undo.trc in the specified directory.

The trcupdate command adds the extension .trc to the file name and reads update commands from that file. The undo file is input to the trcupdate command if the -o (override) flag is specified. When the -o flag is specified, the trcupdate command undoes the changes previously made to the file.

The first field of each template contains an operator:

Item Description
+ The plus sign indicates that a template is to be added or replaced. The field that follows this operator contains the template to be replaced.
- The minus sign indicates that a template is to be deleted. The field after this operator contains the hook ID of the template to delete. Operations are performed in the order in which they appear.

The input to the trcupdate command must contain the following as the first line:

* /etc/trcfmt

The following is a sample trace file:

* /etc/trcfmt
+ 15A 1.0 new_fmt
- 1B3
- A14

When adding or replacing, the trcupdate command compares the version numbers of each input template with the version number of the template with the same hook ID. If the version number of the input template is greater than or equal to the version of the existing template, the trcupdate command replaces the old template with the input template. If a template does not exist, then the input template is added to the file.

The trcupdate command will not modify the /etc/trcfmt file if a syntax error is detected in the update file.

Flags

Item Description
-o Overrides the old template with the input template without verifying the version number of either template.
-t File Specifies a file, instead of the /etc/trcfmt or the /etc/trcfmt.Z file, to be used as the template file.
-v Prints the file names as each file is opened.
-x IDList Extracts the templates specified in the IDList from the template file and writes them to standard output. The IDList parameter lists the hook IDs.

Security

Access Control: None, but you must have write authority to the template file you are changing. The default is /etc/trcfmt.

Examples

  1. To add a template, enter the following command:
    trcupdate
    * /etc/trcfmt
    + 15A 1.0 new_fmt
    Tip: In AIX® 6.1 and later versions, this is equivalent to:
    trcupdate
    * /etc/trcfmt
    + 15A0 1.0 new_fmt
  2. To delete a template, type the following command:
    trcupdate
    * /etc/trcfmt
    - 15A 1.0 new_fmt
    Tip: In AIX 6.1 and later versions, this is equivalent to:
    trcupdate
    * /etc/trcfmt
    - 15A0 1.0 new_fmt
  3. To replace a template, enter the following command:
    trcupdate
    * /etc/trcfmt
    + 15A 1.0 new_fmt
    Tip: In AIX 6.1 and later versions, this is equivalent to:
    trcupdate
    * /etc/trcfmt
    + 15A0 1.0 new_fmt
  4. In AIX 6.1 and later versions, to add a template for hook ID 0AB0, enter the following command:
    trcupdate
    * /etc/trcfmt
    + 0AB0 1.0 new_fmt
    
    The above command is equivalent to the following command:
    trcupdate
    * /etc/trcfmt
    +0AB 1.0 new_fmt
  5. In AIX 6.1 and above, to add a template for hook ID 1AB1, enter the following command:
    trcupdate
    * /etc/trcfmt
    + 1AB1 1.0 new_fmt

Files

Item Description
/usr/bin/trcupdate Contains the trcupdate command.
/etc/trcfmt Contains the trace format file.
/usr/include/sys/trcmacros.h Defines trchook and utrchook macros.