#
|
#
|
# Hack of a script to generate a very long list which contains
|
# Hack of a script to generate a very long list which contains
|
# the size information for every service listed in this manual
|
# the size information for every service listed in this manual
|
#
|
#
|
# This script must be modified by the user to tailor it for their
|
# This script must be modified by the user to tailor it for their
|
# environment. This is VERY ugly and could be replaced by something
|
# environment. This is VERY ugly and could be replaced by something
|
# nicer in the future if this report style is useful.
|
# nicer in the future if this report style is useful.
|
#
|
#
|
# gen_size_report,v 1.5 2002/01/17 21:47:45 joel Exp
|
# gen_size_report,v 1.5 2002/01/17 21:47:45 joel Exp
|
#
|
#
|
|
|
#cpu=sparc
|
#cpu=sparc
|
#bsp=erc32
|
#bsp=erc32
|
|
|
#cpu=powerpc
|
#cpu=powerpc
|
#bsp=mcp750
|
#bsp=mcp750
|
|
|
cpu=v850
|
cpu=v850
|
bsp=bare
|
bsp=bare
|
symprefix=_
|
symprefix=_
|
|
|
#objdir=/usr1/rtems/build/build-${cpu}-rtems/${cpu}-rtems/c/${bsp}/
|
#objdir=/usr1/rtems/build/build-${cpu}-rtems/${cpu}-rtems/c/${bsp}/
|
#libc=/opt/rtems/${cpu}-rtems/lib/libc.a
|
#libc=/opt/rtems/${cpu}-rtems/lib/libc.a
|
#libm=/opt/rtems/${cpu}-rtems/lib/libm.a
|
#libm=/opt/rtems/${cpu}-rtems/lib/libm.a
|
objdir=/usr1/rtems/work/tools-v850/b-rtems/${cpu}-rtems/c/${bsp}/
|
objdir=/usr1/rtems/work/tools-v850/b-rtems/${cpu}-rtems/c/${bsp}/
|
libc=/usr2/test-v850/${cpu}-rtems/lib/libc.a
|
libc=/usr2/test-v850/${cpu}-rtems/lib/libc.a
|
libm=/usr2/test-v850/${cpu}-rtems/lib/libm.a
|
libm=/usr2/test-v850/${cpu}-rtems/lib/libm.a
|
srcdir=$r/src
|
srcdir=$r/src
|
docdir=$d
|
docdir=$d
|
nm=${cpu}-rtems-nm
|
nm=${cpu}-rtems-nm
|
size=${cpu}-rtems-size
|
size=${cpu}-rtems-size
|
ar=${cpu}-rtems-ar
|
ar=${cpu}-rtems-ar
|
|
|
#
|
#
|
# All customization should be above this point
|
# All customization should be above this point
|
#
|
#
|
|
|
check_objs()
|
check_objs()
|
{
|
{
|
for i in *.o
|
for i in *.o
|
do
|
do
|
${nm} $i | grep "T ${symprefix}${1}$" >/dev/null
|
${nm} $i | grep "T ${symprefix}${1}$" >/dev/null
|
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
echo $i
|
echo $i
|
return 0
|
return 0
|
fi
|
fi
|
done
|
done
|
return 1
|
return 1
|
}
|
}
|
per_manager()
|
per_manager()
|
{
|
{
|
docfile=$1
|
docfile=$1
|
shift
|
shift
|
subdirs=$*
|
subdirs=$*
|
grep ^@item ${docfile} | grep "@code.* - " | \
|
grep ^@item ${docfile} | grep "@code.* - " | \
|
grep -v "@item E" | \
|
grep -v "@item E" | \
|
grep -v "@code{CONFIGURE" | \
|
grep -v "@code{CONFIGURE" | \
|
grep -v "@value{RPREFIX" | \
|
grep -v "@value{RPREFIX" | \
|
sed -e 's/@value{DIRPREFIX}/rtems_/' | \
|
sed -e 's/@value{DIRPREFIX}/rtems_/' | \
|
cut -d'{' -f2 | sed -e 's/}//' | cut -d'-' -f1 >/tmp/XXX.size
|
cut -d'{' -f2 | sed -e 's/}//' | cut -d'-' -f1 >/tmp/XXX.size
|
|
|
if [ `wc -c
|
if [ `wc -c
|
return
|
return
|
fi
|
fi
|
echo "====> `grep ^@chapter ${docfile} | sed -e 's/@chapter //'`"
|
echo "====> `grep ^@chapter ${docfile} | sed -e 's/@chapter //'`"
|
cat /tmp/XXX.size | while read line
|
cat /tmp/XXX.size | while read line
|
do
|
do
|
# echo $line
|
# echo $line
|
found=no
|
found=no
|
for subd in ${subdirs}
|
for subd in ${subdirs}
|
do
|
do
|
if [ ${found} = "no" ] ; then
|
if [ ${found} = "no" ] ; then
|
cd ${objdir}/${subd}/o-optimize/
|
cd ${objdir}/${subd}/o-optimize/
|
objfile=`check_objs $line`
|
objfile=`check_objs $line`
|
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
found=yes
|
found=yes
|
#echo ${objfile}
|
#echo ${objfile}
|
objcode=`${size} ${objfile} | tail -1 | cut -f1`
|
objcode=`${size} ${objfile} | tail -1 | cut -f1`
|
objdata=`${size} ${objfile} | tail -1 | cut -f2`
|
objdata=`${size} ${objfile} | tail -1 | cut -f2`
|
objbss=`${size} ${objfile} | tail -1 | cut -f3`
|
objbss=`${size} ${objfile} | tail -1 | cut -f3`
|
objcode=`echo ${objcode}`
|
objcode=`echo ${objcode}`
|
objdata=`echo ${objdata}`
|
objdata=`echo ${objdata}`
|
objbss=`echo ${objbss}`
|
objbss=`echo ${objbss}`
|
echo "${line} - ${objcode}, ${objdata}, ${objbss}"
|
echo "${line} - ${objcode}, ${objdata}, ${objbss}"
|
fi
|
fi
|
fi
|
fi
|
done
|
done
|
if [ ${found} = "no" ] ; then
|
if [ ${found} = "no" ] ; then
|
echo "$line - macro or not implemented"
|
echo "$line - macro or not implemented"
|
fi
|
fi
|
|
|
done
|
done
|
}
|
}
|
|
|
|
|
# extract libc
|
# extract libc
|
if [ ! -d ${objdir}/newlib_extract/o-optimize ] ; then
|
if [ ! -d ${objdir}/newlib_extract/o-optimize ] ; then
|
mkdir -p ${objdir}/newlib_extract/o-optimize
|
mkdir -p ${objdir}/newlib_extract/o-optimize
|
cd ${objdir}/newlib_extract/o-optimize
|
cd ${objdir}/newlib_extract/o-optimize
|
list=`${ar} t ${libc}`
|
list=`${ar} t ${libc}`
|
for i in $list
|
for i in $list
|
do
|
do
|
${ar} x ${libc} ${i}
|
${ar} x ${libc} ${i}
|
done
|
done
|
fi
|
fi
|
|
|
# extract libm
|
# extract libm
|
if [ ! -d ${objdir}/libm_extract/o-optimize ] ; then
|
if [ ! -d ${objdir}/libm_extract/o-optimize ] ; then
|
mkdir -p ${objdir}/libm_extract/o-optimize
|
mkdir -p ${objdir}/libm_extract/o-optimize
|
cd ${objdir}/libm_extract/o-optimize
|
cd ${objdir}/libm_extract/o-optimize
|
list=`${ar} t ${libm}`
|
list=`${ar} t ${libm}`
|
for i in $list
|
for i in $list
|
do
|
do
|
${ar} x ${libm} ${i}
|
${ar} x ${libm} ${i}
|
done
|
done
|
fi
|
fi
|
|
|
# grab the size of the Classic API
|
# grab the size of the Classic API
|
#
|
#
|
# NOTE: This API is always configured.
|
# NOTE: This API is always configured.
|
#
|
#
|
cd ${docdir}/user
|
cd ${docdir}/user
|
echo
|
echo
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "==== ===="
|
echo "==== ===="
|
echo "==== CLASSIC API SIZE INFORMATION ===="
|
echo "==== CLASSIC API SIZE INFORMATION ===="
|
echo "==== ===="
|
echo "==== ===="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo
|
echo
|
if [ -r ${objdir}/../../../${bsp}/lib/librtems.a ] ; then
|
if [ -r ${objdir}/../../../${bsp}/lib/librtems.a ] ; then
|
for i in *.t
|
for i in *.t
|
do
|
do
|
per_manager $i exec/rtems/src exec/sapi/src lib/libc
|
per_manager $i exec/rtems/src exec/sapi/src lib/libc
|
done
|
done
|
else
|
else
|
echo "RTEMS Classic API not configured."
|
echo "RTEMS Classic API not configured."
|
fi
|
fi
|
|
|
# Grab the size of the POSIX API
|
# Grab the size of the POSIX API
|
cd ${docdir}/posix_users
|
cd ${docdir}/posix_users
|
echo
|
echo
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "==== ===="
|
echo "==== ===="
|
echo "==== POSIX 1003.1b API SIZE INFORMATION ===="
|
echo "==== POSIX 1003.1b API SIZE INFORMATION ===="
|
echo "==== ===="
|
echo "==== ===="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo
|
echo
|
if [ -r ${objdir}/../../../${bsp}/lib/libposix.a ] ; then
|
if [ -r ${objdir}/../../../${bsp}/lib/libposix.a ] ; then
|
for i in `ls -1 *.t | grep -v libc.t | grep -v libm.t`
|
for i in `ls -1 *.t | grep -v libc.t | grep -v libm.t`
|
do
|
do
|
per_manager $i exec/posix/src lib/libc newlib_extract
|
per_manager $i exec/posix/src lib/libc newlib_extract
|
done
|
done
|
else
|
else
|
echo "POSIX API not configured."
|
echo "POSIX API not configured."
|
fi
|
fi
|
|
|
# Grab the size of the POSIX routines provided by the C Library
|
# Grab the size of the POSIX routines provided by the C Library
|
cd ${docdir}/posix_users
|
cd ${docdir}/posix_users
|
echo
|
echo
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "==== ===="
|
echo "==== ===="
|
echo "==== LIBC API SIZE INFORMATION ===="
|
echo "==== LIBC API SIZE INFORMATION ===="
|
echo "==== ===="
|
echo "==== ===="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo
|
echo
|
for i in libc.t
|
for i in libc.t
|
do
|
do
|
per_manager $i exec/posix/src lib/libc newlib_extract
|
per_manager $i exec/posix/src lib/libc newlib_extract
|
done
|
done
|
|
|
# Grab the size of the libm routines
|
# Grab the size of the libm routines
|
cd ${docdir}/posix_users
|
cd ${docdir}/posix_users
|
echo
|
echo
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "==== ===="
|
echo "==== ===="
|
echo "==== LIBM API SIZE INFORMATION ===="
|
echo "==== LIBM API SIZE INFORMATION ===="
|
echo "==== ===="
|
echo "==== ===="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo
|
echo
|
for i in libm.t
|
for i in libm.t
|
do
|
do
|
per_manager $i exec/posix/src lib/libc libm_extract
|
per_manager $i exec/posix/src lib/libc libm_extract
|
done
|
done
|
|
|
# Grab the size of the ITRON API
|
# Grab the size of the ITRON API
|
cd ${docdir}/itron3.0
|
cd ${docdir}/itron3.0
|
echo
|
echo
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "==== ===="
|
echo "==== ===="
|
echo "==== ITRON 3.0 API SIZE INFORMATION ===="
|
echo "==== ITRON 3.0 API SIZE INFORMATION ===="
|
echo "==== ===="
|
echo "==== ===="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo "=============================================================="
|
echo
|
echo
|
if [ -r ${objdir}/../../../${bsp}/lib/libitron.a ] ; then
|
if [ -r ${objdir}/../../../${bsp}/lib/libitron.a ] ; then
|
for i in *.t
|
for i in *.t
|
do
|
do
|
per_manager $i exec/itron/src
|
per_manager $i exec/itron/src
|
done
|
done
|
else
|
else
|
echo "ITRON API not configured."
|
echo "ITRON API not configured."
|
fi
|
fi
|
|
|
|
|
|
|