1835978 Members
2361 Online
110088 Solutions
New Discussion

questions about TUSC ?

 
SOLVED
Go to solution
Jeff.Z
Frequent Advisor

questions about TUSC ?

(1) want to trace a certain pid and see the "Number of READs" to a file(sqlus.msb)

(2) need the command duration of the pid that being traced

How can I use tusc to achieve this?

Thanks,
Jeff

5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: questions about TUSC ?

In almost all cases, duplicate runs of the same executable/script will reuse the same file descriptors. Unless you have a compelling reason to attach to a running process then I would let tusc run the process. e.g. tusc -o myoutfile my.exe one two three and then examine the outputfile for the open("sqlplus.msb") call. That will give you the file descriptor. You can then do another tusc and specify -dfdes to only show system calls with that file descriptor.
If it ain't broke, I can fix that.
Jeff.Z
Frequent Advisor

Re: questions about TUSC ?

A. Clay,


from what I understand, first direct the pid's call to a output file and look for the FD of open(sqlus.msb), e.g. 12
tusc -ccc -r all -b 512 -f -n -o /bl/sort/tusc.out.Mps -p -T " " -v 27011

then do a tusc again, upon the FD (12)

the summary number of Syscall read is what I want, correct?

Syscall Seconds Calls Errors
read 0.48 4580

thanks,
Jeff

A. Clay Stephenson
Acclaimed Contributor
Solution

Re: questions about TUSC ?

Yes, that should work but there is a possible gotcha. I am making the assumption that this process opens this file and keeps it open. If that's the case, then fdes 12 (for example) will always refer to this file but the process could open the file, read and/or write to it, and close the file and then lather, rinse, repeat so that the same file might use different file descriptoes. It is also possible that the same file is open()'ed more than once concurrently by the process. You have to example the tusc output carefully to see how the file descriptors are used. The open() system call will return a small integer on success; these small integers are the file descriptors.

You may find it simpler to launch the process under tusc, specify an output file using -o, and let the process run to completion. You then process the tusc output file using awk or Perl or even vi plus your eyeball to gather the statistics you are looking for.
If it ain't broke, I can fix that.
Jeff.Z
Frequent Advisor

Re: questions about TUSC ?

A. Clay,

Few open-read-write-close exists here. I'll put the tusc to an output file and awk the result in good shape. Thanks so much for your guidance.

Thanks,
Jeff
Jeff.Z
Frequent Advisor

Re: questions about TUSC ?

found the solution from A. Clay. Thanks.