You can record a system-wide kernel tracing session as follows (here, we deliberately keep the discussion as simple as possible):
- Create a new session and set the output directory to <dir> for saving tracing metadata:
sudo lttng create <session-name> --output=<dir>
- Simply enable all kernel events (can lead to a large amount of tracing metadata being generated though):
sudo lttng enable-event --kernel --all
- Start recording a "kernel session":
sudo lttng start
Allow some time to elapse (the longer you trace for, the more the disk space that's used by the tracing metadata). During this period, all kernel activity is being recorded by LTTng.
- Stop recording:
sudo lttng stop
- Destroy the session; don't worry, this does not delete the tracing metadata:
sudo lttng destroy
All the preceding commands should be run with admin privileges (or equivalent).
I have a few wrapper scripts to perform tracing with...