Showing posts with label boot. Show all posts
Showing posts with label boot. Show all posts
Friday, February 19, 2010
Wednesday, December 24, 2008
Boot charts for 2008.11 and snv101
Bootchart is a great tool for performance analysis and visualization of the Linux boot process. Eric Schrock and Dan Price worked on a Bootchart port using DTrace but I can't find any recipes on their blogs.
I've viewed bootchart source files for two days and by means of several hacks managed to receive boot charts for OpenSolaris. First of all I need to get uptime values in bootchart format (this is /proc/uptime content on linux). I've written the small utility (upt.c):
Now the main script for logging (/boot/bootchartd):
Let’s create directory /var/log/bootchart:
Next I move /sbin/init to /bin:
and create a new init:
Now it's possible to reboot. After booting I write a header file:
and create boot chart:
This was the first boot chart created for OpenSolaris 2008.11 (Intel CPU 2.26GHz 512mb RAM). No disk and cpu utilization information yet:

Here the boot chart for snv101:
I've viewed bootchart source files for two days and by means of several hacks managed to receive boot charts for OpenSolaris. First of all I need to get uptime values in bootchart format (this is /proc/uptime content on linux). I've written the small utility (upt.c):
#include <sys/times.h>
#include <limits.h>
#include <dat/dat_platform_specific.h>
main {
struct tms ts;
clock_t t = times(&ts);
//we need jiffies from uptime value for bootchart
printf("%u\n",(unsigned long) ((DAT_UINT64) t*100 /CLK_TCK));
}
Now the main script for logging (/boot/bootchartd):
#!/usr/bin/bash
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/gnu/bin:$PATH"
# mounting dir for logging
mount -F tmpfs -o size=32m swap /var/log/bootchart
# start time hack for java parser
echo "001" > /var/log/bootchart/ps.log
echo " PID PPID S %CPU COMMAND" >> /var/log/bootchart/ps.log
echo " 1 0 S 0.0 kernel" >> /var/log/bootchart/ps.log
echo >> /var/log/bootchart/ps.log
while true; do
# uptime jiffies
uptime=`/sbin/upt`
echo $uptime
# Log the command output and removing pid 0 for preventing "No processes found" error
eval "ps -e -o pid,ppid,s,pcpu,comm"|grep -v sched
echo
/usr/gnu/bin/sleep 0.2
done >> /var/log/bootchart/ps.log
Let’s create directory /var/log/bootchart:
mkdir /var/log/bootchart
Next I move /sbin/init to /bin:
mv /sbin/init /bin
and create a new init:
cat /sbin/init
#!/bin/sh
/boot/bootchartd &
exec /bin/init
Now it's possible to reboot. After booting I write a header file:
echo "title = Boot chart for $( hostname | sed q ) ($( date ))" > /var/log/bootchart/header
echo "system.uname = $( uname -srvm | sed q )" >> /var/log/bootchart/header
if [ -f /etc/release ]; then
echo "system.release = $( sed q /etc/release )" >> /var/log/bootchart/header
else
echo "system.release = $( sed 's/\\.//g;q' /etc/issue )" >> /var/log/bootchart/header
fi
and create boot chart:
java -jar bootchart.jar
Parsing /var/log/bootchart
Wrote image: ./bootchart.png
This was the first boot chart created for OpenSolaris 2008.11 (Intel CPU 2.26GHz 512mb RAM). No disk and cpu utilization information yet:

Here the boot chart for snv101:
Subscribe to:
Posts (Atom)
How to determine PXE mac address when booting illumos via PXELinux/iPXE
In illumos, if you need to determine the interface which was used for booting via PXE then it's possible to use "boot-mac" pro...
-
This summer I decided то build something compact and modern for my two SunFire servers using IPS. Meet v9os - minimalist illumos-based ...
-
I've tried to compile the last Conky 1.7.2 version with Lua Cairo bindings on OpenSolaris and should say it impress me. It was necessary...