#!/bin/sh
#
# Collect RCU-related debugfs data.  Set DEBUGFS_MP to the debugfs
# mount point, defaults to /sys/kernel/debug.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Copyright (C) IBM Corporation, 2010
#
# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

DEBUGFS_MP=/sys/kernel/debug
DRCU=$DEBUGFS_MP/rcu

while :
do
	date
	echo $DRCU/rcugp:
	cat $DRCU/rcugp || echo no $DRCU/rcugp
	echo $DRCU/rcuhier:
	cat $DRCU/rcuhier || echo no $DRCU/rcuhier
	echo $DRCU/rcudata:
	cat $DRCU/rcudata || echo no $DRCU/rcudata
	echo $DRCU/rcu_pending:
	cat $DRCU/rcu_pending || echo no $DRCU/rcu_pending
	echo $DRCU/rcutorture:
	cat $DRCU/rcutorture || echo no $DRCU/rcutorture
	echo $DRCU/rcuboost:
	cat $DRCU/rcuboost || echo no $DRCU/rcuboost
	ps -eo pid,class,sched,rtprio,stat,state,sgi_p,cputime,cmd | grep '\[rcuc[0-9]'
	ps -eo pid,class,sched,rtprio,stat,state,sgi_p,cputime,cmd | grep '\[rcun[0-9]'
	ps -eo pid,class,sched,rtprio,stat,state,sgi_p,cputime,cmd | grep '\[rcub[0-9]'
	echo
	sleep 15
done
