重生之月光少年宠吗:HP-UX: Truss-Like System Tracing Using 'tusc'

来源:百度文库 编辑:九乡新闻网 时间:2024/04/28 16:09:14
PURPOSE
-------

This short article introduces 'tusc'.

SCOPE & APPLICATION
-------------------

In the context given, the article is aimed primarily at Support Analysts and
DBAs.  For many years, SVR4 type UNIX has offered 'truss' as a method of tracing system
calls. On HP-UX 11, such diagnostics can be obtained using 'tusc'.

tusc can be downloaded from

http://hpux.connect.org.uk/

At the time of writing, the current version is at:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.3/

Search for the latest version at

http://hpux.connect.org.uk/hppd/cgi-bin/search

  - enter 'tusc' in the search box

The man page, or alternatively executing tusc without arguments describes usage.
For convenience, a quick reference is given below, for the most common types
of usage for diagnostics required by Oracle Support Services.

Usage:
tusc [-] -OR-

Most common options:
    -f: follow forks
    -p: print pid values
    -e: show environment variables
    -a: show arguments to the exec() call
    -o file : send output to file
    -v: verbose output for calls that have this instrumented
    -T format: print timestamps in the given format
               see 'man 3c strftime' for possible formats

Typical invocations:
    1. execute sqlplus, and follow children. Send output to /tmp/tusc.out
       % tusc -faepo /tmp/tusc.out sqlplus scott/tiger

    2. as (1), but be verbose
       % tusc -faepo /tmp/tusc.out -v sqlplus scott/tiger

    3. as (1), but print timestamps
       % tusc -faepo /tmp/tusc.out -T %H:%M:%S sqlplus scott/tiger

    4. attach to a running process. Send output to /tmp/tusc.out
       % tusc -faepo /tmp/tusc.out -p

    Unless advised otherwise, the minimum options used should be:
       % tusc -faepo .... 
  • HP: The tusc command can be used to generate stacks:
    $ tusc -aefl -o ora_tusc.out -p  --PROCESS ID--