When you see the ftrace presentation or read through the presentations, you get an overload. It's just too much at once. That's why I decided to write up this little cheat sheet for ftrace with commands from Steve's presentations.

Reset everything:

echo | tee set_*

echo 0 | tee tracing_enabled tracing_max_latency

Trace fsyncs:
trace-cmd record -g '*fsync*' -p function_graph -s 10000 -b 10000
Makes a nice small log only of the fsyncs on your system. Good to check what's waking up your hard disk. The low frequency (-s) effects your system less and the large buffer (-b) makes sure no tracing data is lost.

And if that's all unclear or not enough, try to catch one of Steve's presentations and check his slides.

And if you wonder why in his slides he likes to use 'cat | head' instead of just 'head', here's his answer to that: Most of these tools are not efficient with non-linear reads. So cat is slower to type, but works faster as it forces a linear read.

2 comments:

What I meant to say is: check the presentation, then notice you couldn't remember it all, then look here for a very short summary.but see e.g. here for an intro https://rt.wiki.kernel.org/index.php/Ftrace