head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	99.01.30.04.37.56;	author vadim;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Checkpoint:

- added automake support. Now, it should be more like a turnkey solution:
./configure && make && make install.

- Documentation and indentation conventions update.

- All the fixes to the JServ logging system were tested here.

If I missed something, it'll be updated as soon as I check out and test the
CVS version.
@
text
@#! /bin/bash
# $Id: footprint,v 1.1 1999/01/21 22:37:16 vt Exp $
#
# This script
#
#	1. Appends " -verbose" to the J4WRAPPER environment variable (for
#	   the j4wrapper script)
#
#	2. Runs the command line, redirecting the stderr output to the file
#	3. Looks for the gnu.j4.* classes loaded, finds the *.class files in
#	   the source directory and calculates the binary footprint for all
#	   the files.
#
# Required conditions:
#
#	- Target application stops (should be fixed in the future).
#	- If the target application is invoked directly with java (as
#	  opposed to j4wrapper), the -verbose option must be specified.
#	  Otherwise, you'll get the zero footprint.

export J4WRAPPER="${J4WRAPPER} -verbose"

TREES="\
gnu\.j4\. \
gnu\.j4\.config \
gnu\.j4\.core \
gnu\.j4\.getopt \
gnu\.j4\.io \
gnu\.j4\.sem \
gnu\.j4\.service \
gnu\.j4\.service\.ApplicationWrapper \
gnu\.j4\.service\.net \
gnu\.j4\.framework \
";

TARGET="/tmp/footprint";
CLASS="/export/home/vt/J4/sunny/i386-pc-solaris2.6/JVM1.2/java"
SOURCE="/export/home/vt/J4/src/java"

$* 2>${TARGET}

for TREE in $TREES; do
	SET=`grep $TREE $TARGET|grep Loaded|tr -d "]"|cut -f 2 -d " "|tr "." "/"|sort|uniq`
#	echo $SET
	TOTAL="0";
	for FILE in $SET; do
		TOTAL="$TOTAL + `ls -l $CLASS/$FILE.class|tr -s " "|cut -f 5 -d " "`"
	done
	echo "Class set: $TREE, size: `echo $TOTAL|bc`"
done

echo ""

for TREE in $TREES; do
	SET=`grep $TREE $TARGET|grep Loaded|grep -v "\\\\$"|tr -d "]"|cut -f 2 -d " "|tr "." "/"|sort|uniq`
#	echo $SET
	TOTAL="0";
	for FILE in $SET; do
#		echo $FILE
		TOTAL="$TOTAL + `wc -l $SOURCE/$FILE.java|tr -s " "|cut -f 2 -d " "`"
	done
	echo "Class set: $TREE, lines: `echo $TOTAL|bc`"
done
@
