[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 5

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:

+ 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 later than 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

-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: Only the root user can run this command.

Examples

  1. To add a template, enter:

    trcupdate
    * /etc/trcfmt
    + 15A 1.0 new_fmt
  2. To delete a template, enter:

    trcupdate
    * /etc/trcfmt
    - 15A 1.0 new_fmt
  3. To replace a template, enter:

    trcupdate
    * /etc/trcfmt
    + 15A 1.0 new_fmt

Files

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

Related Information

The trcdead command, trcrpt command.

The trace daemon.

The trcfmt file format.

The Trace Facility Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]