There are, of course, alternate ways to visualize what's running on each processor; we mention a couple here and have saved one other interesting one (LTTng) for Chapter 11, The CPU Scheduler – Part 2, under the Visualization with LTTng and Trace Compass section):
- With perf(1), again, run the sudo perf sched record command; this records activity. Stop by terminating it with the ^C signal, followed by sudo perf sched map to see a (CLI) map of execution on the processor(s).
- Some simple Bash scripting can show what's executing on a given core (a simple wrapper over ps(1)). In the following snippet, we show sample Bash functions; for example, the following c0() function shows what is currently executing on CPU core #0, while c1() does the same for core #1:
# Show thread(s) running on cpu core 'n' - func c'n'
function c0()
{
ps -eLF | awk '{ if($5==0) print...