New and easy strace framework.
authorRonald G. Minnich <rminnich@gmail.com>
Mon, 25 Jan 2016 22:26:22 +0000 (14:26 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 3 Feb 2016 23:31:54 +0000 (18:31 -0500)
commit47341e4900dead535ab786d887607f8f8e2ea194
tree7e2a382fa095118384b01f1793948a693f7ed344
parent1fe2ed47726fc0a19f2193494cd22020ae199923
New and easy strace framework.

echo straceon > /proc/pid/strace
cat /proc/pid/strace

echo straceme if you don't want inheritance.
echo straceoff > /proc/pid/strace to stop it.

That's it. strace acts like a file.

and you'll see syscall info (enter and exit) for the process.

So strace is now spelled cat, dd, grep, or, well,
anything that reads files.

Inheritance is working.

But this is a very efficient way to trace processes, even better than
the tracer I wrote for Plan 9.
A single read from strace can read many system call records.

This now dumps read, write, and open information.

Included is a sample strace program which works. You can even
strace a shell now and watch the children.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
[ various fixups, side by side with Ron! ]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/proc.c
kern/include/env.h
kern/include/kdebug.h
kern/include/kthread.h
kern/include/syscall.h
kern/src/hexdump.c
kern/src/ns/sysfile.c
kern/src/process.c
kern/src/syscall.c
tests/strace.c [new file with mode: 0644]