question: how to trace programs in unix?? HELP

question: how to trace programs in unix?? HELP

Post by CHOUHA RAN » Sat, 20 May 1995 04:00:00



If anybody can help me figure out how to write a script file to trace all
commands and all programs that i run . The script file should give me the time
and the date of whatever i run from the point i log on to the point i logoff
example: if i started let's say 'pine (the mail tool)' at 4:30pm and i closed
it at 4:35pm. The script file should tell me that pine was started at 4:30 pm
and ended at 4:35pm . this output of the script file should be written to a
file in my directory. Also the script file should inform me about the date  and
time i logged on and the date and time i logged off so it has to run in the
background and not killed when i logoff (this is easy with the nohup command)
I tried to find some commands in unix like: ps, trace, history but they didn't
help very much.. so if anybody has anysuggstions plz reply..thankss


 
 
 

question: how to trace programs in unix?? HELP

Post by Steffen Ullri » Sun, 21 May 1995 04:00:00


: If anybody can help me figure out how to write a script file to trace all
: commands and all programs that i run . The script file should give me the time
: and the date of whatever i run from the point i log on to the point i logoff
: example: if i started let's say 'pine (the mail tool)' at 4:30pm and i closed
: it at 4:35pm. The script file should tell me that pine was started at 4:30 pm
: and ended at 4:35pm . this output of the script file should be written to a
: file in my directory. Also the script file should inform me about the date  and
: time i logged on and the date and time i logged off so it has to run in the
: background and not killed when i logoff (this is easy with the nohup command)
: I tried to find some commands in unix like: ps, trace, history but they didn't
: help very much.. so if anybody has anysuggstions plz reply..thankss

you could patch the shell you are using
another option for the superman is to use a systemwide protocolling of the use
of selected systemcalls, like exe. you will find this possibility e.g. on SCO UNIX.

 
 
 

1. Problems calling a gdb stack trace from inside the program thats being traced.

I'm trying to get my C program to stack trace itself using gdb.

Upon detecting an error my program does a

system("gdb -x configfile programname programPID > outputfile");

Where the configfile contains the lines:-

bt
quit

Now that works fine from a bash shell but all I get when my program
hits it is a frozen program that needs a Ctrl-C.

Whats going on? Can I use this technique to stack trace my program?

It is a multi-threaded (pthreads) program, compiled using -gstabs+ in
the compile line, with gcc 3.1.

I don't want to have to write my own stack tracing routines!

Thanks,

Joe

2. Compiling kernel

3. NEED HELP WITH PROGRAMMING POP3 MAIL PROGRAM TO RETRIEVE MAIL ON UNIX-TO-UNIX

4. linking against newer lib?

5. Is there any way to trace a C program in UNIX?

6. boot net

7. Where is LinuxPPC?

8. Unix Programming & Linux Programming Question

9. Help: Looking for program to trace client requests to a server

10. Q: A UNIX COMMUNICATION PROGRAMMING QUESTION. NEED HELP!

11. Help the Space Program Unix Question

12. pick script in The UNIX Programming Environment (The UNIX Programming Environment )