[plug] SMP queries ...
Matt Kemner
zombie at networx.net.au
Thu Nov 25 11:35:58 WST 1999
On Thu, 25 Nov 1999, Trevor Phillips wrote:
> Two queries:
>
> Any suggestions on how to set up a system (pref Debian) with both an SMP
> kernel, and a non-SMP kernel, with modules support?
Either have a seperate kernel version for the non-SMP kernel (eg have
2.2.13 as SMP and 2.2.12 as non-SMP) or write a small script that runs
if `uname -v|grep SMP`
then
rm -f /lib/modules/2.2.13
ln -s /lib/modules/2.2.13-SMP /lib/modules/2.2.13
else
rm -f /lib/modules/2.2.13
ln -s /lib/modules/2.2.13-UP /lib/modules/2.2.13
fi
And then stick your modules in the appropriate directories.
> and Non-SMP. Is there an easy way to have two Module dirs for the same kernel
> vers and tell the kernel to use a different one?
The kernel doesn't care where the modules are, modprobe etc do. You could
modify those instead, but I think the shell script is neater.
(You can even modify /usr/src/linux/Makefile so make modules_install puts
the modules in the right directory)
> Secondly, any ideas on monitoring CPU activity? Basically, I'm after "top" or
> similar meter (pref that doesn't require XWin for logging), which logs to a
> file and can display an analysis/graph of stored entries... I'm after the
> utilisation of SMP when running certain apps (Ok, so it's Quake3Arena Demo,
> mainly. ^_^), where watching a procmeter in a window doesn't cut it.
You could have a small perl script watching the first 3 lines /proc/stat
and writing those, and timestamp to a file - then you can easily plot it
with gnuplot.
The 4 numbers after "cpu" are CPU_USER, CPU_NICE, CPU_SYS and CPU_IDLE
(total time since boot)
To get a percentage of CPU usage, you take 2 readings, then you subtract
the values of the first reading from the second reading to get your
"delta" values, then you divide the sum of the deltas of CPU_USER,
CPU_NICE and CPU_SYS by the sum of all deltas.
(At least that's the way procmeter3 does it if I read the source right)
You've got me keen on hacking something up now, just wish I had
the time. :(
Let me know if you get anywhere.
- Matt
More information about the plug
mailing list