03-26-2008
I'm not sure if you could use it within a script on just one command. Probably could, try it on a test box I guess. But I've not done it, and didn't see any examples in the man pages of doing it that way so I can't say for sure.
Definately use it with the -o option in that case so it saves the truss output separately from whatever else your script would normally be doing.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I'm a DBA so no abuse please! I've for 5 Oracle Forms processes that are spinning and am trying to find out if they're doing anything:
Running HPUX 11.11
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
9 ? 2735 oracle 241 20 24228K 16668K run 2607:29 84.92... (2 Replies)
Discussion started by: fraze
2 Replies
2. Solaris
moved to the Netwoking (0 Replies)
Discussion started by: gogogo
0 Replies
3. IP Networking
I have tried to analyze the log of truss shown below. I haven't found anything clear for me indicating the problem. The process is the server that accepts client connections. To establish the connection it starts the child thread then it should transfer data. In reality it gets only connection.... (1 Reply)
Discussion started by: gogogo
1 Replies
4. UNIX for Advanced & Expert Users
Hi,
We keep getting hanging Oracle process for our ETL. The dba's asked me to do o truss. All I see is pages and pages of the following,:cool:
pollsys(0xFFFFFFFF7FFF38C8, 1, 0xFFFFFFFF7FFF3800, 0x00000000) = 0
pollsys(0xFFFFFFFF7FFF38C8, 1, 0xFFFFFFFF7FFF3800, 0x00000000) = 0... (0 Replies)
Discussion started by: happyadm
0 Replies
5. Shell Programming and Scripting
Hi
I have to get redirect the truss ouput to file.
I am doing truss -p 12121 >> output.txt
But it still displays on the screen adn output.txt is empty
Can some help how to do this?
Thanks in advance
Ammu (1 Reply)
Discussion started by: ammu
1 Replies
6. Shell Programming and Scripting
i have to gather some info about a process and redirect it to a1.txt file. For this i m using truss command
truss -po a1.txt $PID_Detail
where $PID_Detail= 1482944 3362976
--------------------------------------------------------------------------
Below the script:
#!/bin/ksh
for i... (6 Replies)
Discussion started by: ali560045
6 Replies
7. AIX
Hello,
I'm using AIX 5.3.12.5 and trying to understand truss output.
I'm running a job with real time of 16 minutes but only 4 minutes of CPU time. I'm trying to understand what the process is doing.
I'm getting a lot of
kread,
kpread,
kwrite,
kpwrite...
localhost:~ x$ grep... (1 Reply)
Discussion started by: Kovacs
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I want to trace a background java program which runs in infinite loop. I have used truss command for this.
But the program terminated after some hours with below truss output:
Received signal #1, SIGHUP, in lwp_cond_wait()
/1: siginfo: SIG#0
Please let me know what... (0 Replies)
Discussion started by: Hara Prasad
0 Replies
9. UNIX for Advanced & Expert Users
hi, anyone can help on this piece of truss output?
8094: 0.7028 write(4, 0x0043BE90, 236) = 236
8094: T S H \0\0\0EC020101\0\0\0\0\0\0\0\0\0 "02\0\0 303\0\0 I D
8094: \f %\0\0\0\0 2\0F67F\0\0\0\0 @06FFC99A ;
8094: L D6\0 303
8094: ... (6 Replies)
Discussion started by: ghostdog74
6 Replies
10. UNIX for Advanced & Expert Users
Hi,
I want to trace a background java program which runs in infinite loop. I have used truss command for this.
But the program terminated after some hours with below truss output:
Received signal #1, SIGHUP, in lwp_cond_wait()
/1: siginfo: SIG#0
Please let me know what... (5 Replies)
Discussion started by: Hara Prasad
5 Replies
LEARN ABOUT FREEBSD
truss
TRUSS(1) BSD General Commands Manual TRUSS(1)
NAME
truss -- trace system calls
SYNOPSIS
truss [-facedDS] [-o file] [-s strsize] -p pid
truss [-facedDS] [-o file] [-s strsize] command [args]
DESCRIPTION
The truss utility traces the system calls called by the specified process or program. Output is to the specified output file, or standard
error by default. It does this by stopping and restarting the process being monitored via ptrace(2).
The options are as follows:
-f Trace descendants of the original traced process created by fork(2), vfork(2), etc.
-a Show the argument strings that are passed in each execve(2) system call.
-c Do not display individual system calls. Instead, before exiting, print a summary containing for each system call: the total system
time used, the number of times the call was invoked, and the number of times the call returned with an error.
-e Show the environment strings that are passed in each execve(2) system call.
-d Include timestamps in the output showing the time elapsed since the trace was started.
-D Include timestamps in the output showing the time elapsed since the last recorded event.
-S Do not display information about signals received by the process. (Normally, truss displays signal as well as system call events.)
-o file
Print the output to the specified file instead of standard error.
-s strsize
Display strings using at most strsize characters. If the buffer is larger, ``...'' will be displayed at the end of the string. The
default strsize is 32.
-p pid Follow the process specified by pid instead of a new command.
command [args]
Execute command and trace the system calls of it. (The -p and command options are mutually exclusive.)
EXAMPLES
# Follow the system calls used in echoing "hello"
$ truss /bin/echo hello
# Do the same, but put the output into a file
$ truss -o /tmp/truss.out /bin/echo hello
# Follow an already-running process
$ truss -p 34
SEE ALSO
kdump(1), ktrace(1), ptrace(2)
HISTORY
The truss command was written by Sean Eric Fagan for FreeBSD. It was modeled after similar commands available for System V Release 4 and
SunOS.
BSD
May 12, 2009 BSD