source: rtems/doc/posix_users/gen_size_report @ ea6af4f

4.104.114.84.95
Last change on this file since ea6af4f was ea6af4f, checked in by Joel Sherrill <joel.sherrill@…>, on 01/04/00 at 23:33:46

Updated dates and miscellaneous.

  • Property mode set to 100644
File size: 6.1 KB
Line 
1#
2#  Hack of a script to generate a very long list which contains
3#  the size information for every service listed in this manual
4#
5#  This script must be modified by the user to tailor it for their
6#  environment.  This is VERY ugly and could be replaced by something
7#  nicer in the future if this report style is useful.
8#
9#  $Id$
10#
11
12#cpu=sparc
13#bsp=erc32
14
15#cpu=powerpc
16#bsp=mcp750
17
18cpu=v850
19bsp=bare
20symprefix=_
21
22#objdir=/usr1/rtems/build/build-${cpu}-rtems/${cpu}-rtems/c/${bsp}/
23#libc=/opt/rtems/${cpu}-rtems/lib/libc.a
24#libm=/opt/rtems/${cpu}-rtems/lib/libm.a
25objdir=/usr1/rtems/work/tools-v850/b-rtems/${cpu}-rtems/c/${bsp}/
26libc=/usr2/test-v850/${cpu}-rtems/lib/libc.a
27libm=/usr2/test-v850/${cpu}-rtems/lib/libm.a
28srcdir=$r/src
29docdir=$d
30nm=${cpu}-rtems-nm
31size=${cpu}-rtems-size
32ar=${cpu}-rtems-ar
33
34check_objs()
35{
36  for i in *.o
37  do
38    ${nm} $i | grep "T ${symprefix}${1}$" >/dev/null
39    if [ $? -eq  0 ] ; then
40      echo $i
41      return 0
42    fi
43  done
44  return 1
45}
46per_manager()
47{
48  docfile=$1
49  shift
50  subdirs=$*
51  grep ^@item ${docfile} | grep "@code.* - " | \
52    grep -v "@item E" | \
53    grep -v "@code{CONFIGURE" | \
54    grep -v "@value{RPREFIX" | \
55    sed -e 's/@value{DIRPREFIX}/rtems_/' | \
56    cut -d'{' -f2 | sed -e 's/}//' | cut -d'-' -f1 >/tmp/XXX.size
57
58  if [ `wc -c </tmp/XXX.size` -eq 1 ]  ; then
59    return
60  fi
61  echo "====> `grep ^@chapter ${docfile} | sed -e 's/@chapter //'`"
62  cat /tmp/XXX.size | while read line
63  do
64    # echo $line
65    found=no
66    for subd in ${subdirs}
67    do
68      if [ ${found} = "no" ] ; then
69        cd ${objdir}/${subd}/o-optimize/
70        objfile=`check_objs $line`
71        if [ $? -eq 0 ] ; then
72           found=yes
73           #echo ${objfile}
74           objcode=`${size} ${objfile} | tail -1 | cut -f1`
75           objdata=`${size} ${objfile} | tail -1 | cut -f2`
76           objbss=`${size} ${objfile} | tail -1 | cut -f3`
77           objcode=`echo ${objcode}`
78           objdata=`echo ${objdata}`
79           objbss=`echo ${objbss}`
80           echo "${line} - ${objcode}, ${objdata}, ${objbss}"
81        fi
82      fi
83    done
84    if [ ${found} = "no" ] ; then
85      echo "$line - macro or not implemented"
86    fi
87   
88  done
89}
90
91
92# extract libc
93if [ ! -d ${objdir}/newlib_extract/o-optimize ] ; then
94  mkdir -p ${objdir}/newlib_extract/o-optimize
95  cd ${objdir}/newlib_extract/o-optimize
96  list=`${ar} t ${libc}`
97  for i in $list
98  do
99    ${ar} x ${libc} ${i}
100  done
101fi
102
103# extract libm
104if [ ! -d ${objdir}/libm_extract/o-optimize ] ; then
105  mkdir -p ${objdir}/libm_extract/o-optimize
106  cd ${objdir}/libm_extract/o-optimize
107  list=`${ar} t ${libm}`
108  for i in $list
109  do
110    ${ar} x ${libm} ${i}
111  done
112fi
113
114# grab the size of the Classic API
115#
116#  NOTE: This API is always configured.
117#
118cd ${docdir}/user
119echo
120echo "=============================================================="
121echo "=============================================================="
122echo "====                                                      ===="
123echo "====            CLASSIC API SIZE INFORMATION              ===="
124echo "====                                                      ===="
125echo "=============================================================="
126echo "=============================================================="
127echo
128if [ -r ${objdir}/../../../${bsp}/lib/librtems.a ] ; then
129  for i in *.t
130  do
131    per_manager $i exec/rtems/src exec/sapi/src lib/libc
132  done
133else
134  echo "RTEMS Classic API not configured."
135fi
136
137# Grab the size of the POSIX API
138cd ${docdir}/posix_users
139echo
140echo "=============================================================="
141echo "=============================================================="
142echo "====                                                      ===="
143echo "====         POSIX 1003.1b API SIZE INFORMATION           ===="
144echo "====                                                      ===="
145echo "=============================================================="
146echo "=============================================================="
147echo
148if [ -r ${objdir}/../../../${bsp}/lib/libposix.a ] ; then
149  for i in `ls -1 *.t | grep -v libc.t | grep -v libm.t`
150  do
151    per_manager $i exec/posix/src lib/libc newlib_extract
152  done
153else
154  echo "POSIX API not configured."
155fi
156
157# Grab the size of the POSIX routines provided by the C Library
158cd ${docdir}/posix_users
159echo
160echo "=============================================================="
161echo "=============================================================="
162echo "====                                                      ===="
163echo "====             LIBC API SIZE INFORMATION                ===="
164echo "====                                                      ===="
165echo "=============================================================="
166echo "=============================================================="
167echo
168for i in libc.t
169do
170  per_manager $i exec/posix/src lib/libc newlib_extract
171done
172
173# Grab the size of the libm routines
174cd ${docdir}/posix_users
175echo
176echo "=============================================================="
177echo "=============================================================="
178echo "====                                                      ===="
179echo "====             LIBM API SIZE INFORMATION                ===="
180echo "====                                                      ===="
181echo "=============================================================="
182echo "=============================================================="
183echo
184for i in libm.t
185do
186  per_manager $i exec/posix/src lib/libc libm_extract
187done
188
189# Grab the size of the ITRON API
190cd ${docdir}/itron3.0
191echo
192echo "=============================================================="
193echo "=============================================================="
194echo "====                                                      ===="
195echo "====           ITRON 3.0 API SIZE INFORMATION             ===="
196echo "====                                                      ===="
197echo "=============================================================="
198echo "=============================================================="
199echo
200if [ -r ${objdir}/../../../${bsp}/lib/libitron.a ] ; then
201  for i in *.t
202  do
203    per_manager $i exec/itron/src
204  done
205else
206  echo "ITRON API not configured."
207fi
208
209
Note: See TracBrowser for help on using the repository browser.