Main CS97 Page
 
Top

Teams, projects, etc.

We are getting to the time when you really need to be in a team. We will have a little team match-making during lab today.

strace Tutorial

strace is a relatively simple tool. In its default configuration it observes some process and prints out information about the system calls that the process makes as they happen. However, it's still darn useful for peaking under the covers at what applications are doing.

Trace ls

Trace a simple command, like ls. To save the output, redirect standard error to a file, like so:

strace ls 2> /tmp/ls.txt

Notice how many system calls there are for even such a humble application. See how many of the system calls you can interpret sensibly.

Trace a Running Process

Note: This might not work on the lab machines.

Find a running process that belongs to your user with the top or ps command. Take a look at its system calls with:

strace -p <process number>

Check Out Some Aggregate Statistics

The -c flag tells strace to gather aggregate statistics. Run a few commands with this flag and think about how it might be useful for a CS97 project.