ptrace() isn't undocumented, it has a fairly long manpage: http://man7.org/linux/man-pages/man2/ptrace.2.html
It's certainly pretty hairy, but on the other hand only a handful of programs (debuggers, strace, similar debug type tools) are ever going to need to use it.