Kernel KVM-PPC virtualization development
 help / color / mirror / Atom feed
* [kvm-ppc-devel] updated kvmstat for kvmppc
@ 2008-04-10 14:45 Christian Ehrhardt
  0 siblings, 0 replies; only message in thread
From: Christian Ehrhardt @ 2008-04-10 14:45 UTC (permalink / raw)
  To: kvm-ppc

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

Our kvmstat script that works without python got updated to display the new instruction statistics.
The new command line switch is "-i" and you should redirect the output to a file because it won't
fit a console ;-)

New script attached



-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization

[-- Attachment #2: kvmstat --]
[-- Type: text/plain, Size: 1544 bytes --]

#!/bin/bash

duration=2
summode="no"
instructions="no"
lph=20
line=-1
width=8

kvmstat_header() {
	for i in $items
	do
		printf "|%"$width"s" `basename $i`
	done
	printf "|\n"
}

USAGE="Usage: `basename $0` [-d arg] [-l arg] [-hsi]"
while getopts hvsid:l: OPT; do
    case "$OPT" in
	h)	echo $USAGE
		echo "d - sleep between reported lines"
		echo "l - number of lines betweeen headers"
		echo "s - summary mode (default is difference since last print)"
		exit 0
		;;
	v)	echo "`basename $0` version 0.1"
		exit 0
		;;
	d)	duration=$OPTARG
		;;
	l)	lph=$OPTARG
		;;
	s)	summode="yes"
		;;
	i)	instructions="yes"
		width=14
		;;
	\?)	# getopts issues an error message
		echo $USAGE >&2
		exit 1
		;;
    esac
done

dir="/sys/kernel/debug/kvm"
elements="$dir/exits $dir/dcr $dir/mmio $dir/sig $dir/light $dir/itlb_v $dir/itlb_r $dir/isi $dir/dtlb_v $dir/dtlb_r $dir/dsi $dir/inst_emu $dir/sysc $dir/dec $dir/ext_intr"

if [ $instructions = "yes" ]
then
	elements="$elements $dir/instr*"
fi

items=`ls -U $elements`

if [ $summode = "no" ]
then
	declare -a values
	counter=0
	for i in $items
	do
		values[$counter]=0
		counter=`expr $counter + 1`
	done
fi


while true
do
	line=`expr $line + 1`
	line=`expr $line % $lph`
	if [ $line -eq "0" ]
	then
		kvmstat_header
	fi

	counter=0
	for i in $items
	do
		val=`cat $i`
		if [ $summode = "no" ]
		then
			cval=$val;
			val=`expr $cval - ${values[$counter]}`
			values[$counter]=$cval
			counter=`expr $counter + 1`	
		fi
        	printf "|%"$width"d" $val
	done
	printf "|\n"

	sleep $duration
done

[-- Attachment #3: Type: text/plain, Size: 320 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

[-- Attachment #4: Type: text/plain, Size: 170 bytes --]

_______________________________________________
kvm-ppc-devel mailing list
kvm-ppc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-10 14:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-10 14:45 [kvm-ppc-devel] updated kvmstat for kvmppc Christian Ehrhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox