coolcommands.com - the search engine for unix sysadmins :: unix commands and scripts
Saturday October 25, 2014


 Home
 Search
 Advanced Search
 Category Search
 Affiliates
 Acknowledgements
 Cool Links

Username

Password

Remember me
Forgot your password?

Who's Online
We have 24 guests online

Newest Member

nbewwmbxog

Hit Counter
14794158 Visitors

cool Statistics
coolcommands:1346
Categories:83
Total queries:641464
Members:22813





Category Search coolcommands.com
Select Category:


coolcommand

trace - how to record selected system events in IBM AIX
Description

The trace daemon configures a trace session and starts the collection of system events. The data collected by the trace function is recorded in the trace log. A report from the trace log can be generated with the trcrpt command.

# trace [ -a [ -g ] ] [ -f | -l ] [ -b | -B] [ -c] [ -C [ CPUList | all ]] [ -d ] [ -h ] [ -j Event [ ,Event ] ] [ -k Event [ ,Event ] ] [ -J Event-group [ ,Event-group ]] [ -K Event-group [ ,Event-group ]] [ -m Message ] [ -n ] [ -o Name ] [ -o- ] [ -p ] [ -s ] [ -L Size ] [ -T Size ]

where :

-a : runs the trace daemon as a background task. Once trace has been started this way, you can use the trcon, trcoff, and trcstop commands to respectively start tracing, stop tracing, or exit the trace session.

-b : allocate buffers from the kernel heap.

-B : allocate buffers in separate segments (the 32-bit kernel only).

-c : saves the trace log file, adding .old to its name.

-C [ CPUList | all ] : traces using one set of buffers per CPU in the CPUList. The CPUs can be separated by commas, or enclosed in double quotation marks and separated by commas or blanks. To trace all CPUs, specify all.

-d : disables the automatic start of trace data collection. Use the trcon command to start the collection of trace data.

-f : causes the collection of trace data to stop as soon as the in-memory buffer is filled up.

-g : starts a trace session on a generic trace channel (channels 1 through 7). This flag works only when trace is run asynchronously (-a). To stop the generic trace session, use the command trcstop -.

-h : omits the header record from the trace log.

-j Event[,Event] : specifies the user-defined events for which you want to collect trace data.

-k Event[,Event] : specifies the user-defined events for which you want to exclude trace data.

The Event list items can be separated by commas, or enclosed in double quotation marks and separated by commas or blanks.

Note: The following events are used to determine the pid, the cpuid and the
exec path name in the trcrpt report:

106 DISPATCH

10C DISPATCH IDLE PROCESS

134 EXEC SYSTEM CALL

139 FORK SYSTEM CALL

465 KTHREAD CREATE


-J Event-group [, Event-group ] : specifies the event groups to be included.

-K Event-group [ ,Event-group ] : specifies the event groups to be excluded.

-l Runs trace in a circular mode log file.i

-L Size : overrides the default trace log file size of 1MB with the value stated.

-m Message : specifies text to be included in the message field of the trace log header record.

-n : adds information to the trace log header: lock information, hardware information, and, for each loader entry, the symbol name, address, and type.

-o Name : overrides the /var/adm/ras/trcfile default trace log file and writes trace data to a user-defined file.

-o - Overrides the default trace log name and writes trace data to standard output.

-p : includes the cpuid of the current processor with each hook (64-bit kernel traces only).

-s : stops tracing when the trace log fills.

-T Size : overrides the default trace buffer size of 128KB with the value stated.

Note: When run interactively, trace recognizes the following subcommands:

trcon : starts the collection of trace data.

trcoff : stops the collection of trace data.

q or quit : stops the collection of trace data and exits trace.

! Command : runs the shell command specified by the Command parameter.

? Displays the summary of trace subcommands.

Example use trace interactively:

# trace
> !anycmd
> q

Example to avoid delays when the command finishes, start trace asynchronously:

# trace -a; anycmd; trcstop

Example to trace the system itself for a period of 10 seconds:

# trace -a; sleep 10; trcstop

Example to output trace data to a specific trace log file:

# trace -a -o /tmp/my_trace_log; anycmd; trcstop

Example to capture the execution of a cp command, excluding the lockl and unlockl functions events from the collection process:

# trace -a -k "20e,20f"; cp /bin/track /tmp/junk; trcstop

Example to trace hook 234 and the hooks that will allow you to see the process names:

# trace -a -j 234 -J tidhk

Example to have trace use one set of buffers per CPU:

# trace -aC all

Note: The files produced are /var/adm/ras/trcfile, /var/adm/ras/trcfile-0, /var/adm/ras/trcfile-1, etc. up to /var/adm/ras/trcfile-(n-1), where n is the number of CPUs in the system.
Example

trace -a; anycmd; trcstop

Return to search results

Random coolcommands

coolcommand: fw - how to display the Checkpoint FireWall-1 version number
Example: fw ver
[show me the details]
coolcommand: vxmend - how to set a plex to a clean state in Veritas Volume Manager
Example: vxmend fix clean plex-80
[show me the details]
coolcommand: DB2 - license information on IBM AIX
Example: /var/ifor/nodelock; /var/ifor/*
[show me the details]
coolcommand: how to recursively copy directories preserving permission
Example: find . -depth | cpio -pdmv /newpath
[show me the details]

coolcommands.com - the search engine for UNIX sysadmins :: unix commands and scripts



FREE
myPMS

Password
Management
System

by

LVOware.com




Top 5 Submitters

lvo1167
audet37
kah00na32
Mariom24
lebjf00015

Top 5 Searches

Category General UNIX53430
Category Solaris53317
Category AIX52417
solaris23814
aix23283

Terms of Use
Privacy
Contact


 
coolcommands.com © 2014. All Right Reserved.
Programming by PRATTICO Consulting . Hosting by Apricusum