[RFC patch 00/21] TIF_KERNEL_TRACE thread flags

Mathieu Desnoyers
2009-03-15T19:34:03Z

Hello,

This is the implementatino of TIF_KERNEL_TRACE thread flags I did in the LTTng
tree. Basically, it offers :

- Setting a per-thread flag for _all_ threads to enable system-wide syscall
tracing.
- No performance impact when disabled, no need to stop threads upon
activation/deactivation (does not add latency to userspace threads upon
activation).

The most tricky bits are in the x86_64 architecture, because its entry_64.S
code does not expect the thread flags to be changed concurrently while the
thread is running. I modified entry_64.S so that the architecture does not
suffer of any performance impact when syscall audit or secure computing is
enabled, but tests for the TIF_KERNEL_TRACE flag upon return to userspace too.

Given this looks very much like what Frederic is currently doing, I think it's
good to post it for comments.

utrace tracehooks could potentially make this patchset obsolete, but I an not
yet convinced that utrace offers the same low-latency guarantees as this code.

It applies on top of kernel 2.6.29-rc7.

Mathieu