Mar 292010
 

I’m working on some experimental futex operations to reduce userspace dependency on the ill-defined sched_yield system call. Anyone who has worked with futexes know that they are racy by their very nature as they share control of a userspace address between userspace and the kernel. After spending a couple _days_ verifying there was nothing wrong with the actual algorithm I used to implement FUTEX_LOCK, I started adding instrumenting the kernel (aka grasping at straws) with ftrace via my new favorite kernel debugging tool, trace_printk. This only provides half of the picture. In order to correlate events in the testcase (userspace) with the traces from the kernel I turned to the trace_marker feature of ftrace. By opening /debug/tracing/trace_marker and writing debug messages there I could correlate kernel and userspace progress in a single trace. Thanks to Steven Rostedt and the other tracing guys for such an excellent tool! See Steven’s series of articles on LWN for more details on ftrace. This trace led me right to the offending code… which, yes, was my own fault :-)

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>