source: rtems/doc/posix_users/gen_size_report @ 11be37d

4.115
Last change on this file since 11be37d was 11be37d, checked in by Joel Sherrill <joel.sherrill@…>, on 06/17/10 at 18:45:36

2010-06-17 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac, index.html.in, develenv/direct.t, posix_users/gen_size_report, started/nextstep.t, started_ada/buildada.t, user/conf.t, user/object.t: Remove ITRON API.
  • itron3.0/.cvsignore, itron3.0/Makefile.am, itron3.0/config.t, itron3.0/eventflags.t, itron3.0/fixedblock.t, itron3.0/gen_all, itron3.0/gen_section, itron3.0/gen_status_shell, itron3.0/interrupt.t, itron3.0/itron.texi, itron3.0/mailbox.t, itron3.0/memorypool.t, itron3.0/msgbuffer.t, itron3.0/network.t, itron3.0/preface.texi, itron3.0/rendezvous.t, itron3.0/semaphore.t, itron3.0/stamp-vti, itron3.0/status.t, itron3.0/task.t, itron3.0/tasksync.t, itron3.0/time.t, itron3.0/version.texi: Removed.
  • Property mode set to 100644
File size: 5.5 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
34#
35#  All customization should be above this point
36#
37
38check_objs()
39{
40  for i in *.o
41  do
42    ${nm} $i | grep "T ${symprefix}${1}$" >/dev/null
43    if [ $? -eq  0 ] ; then
44      echo $i
45      return 0
46    fi
47  done
48  return 1
49}
50per_manager()
51{
52  docfile=$1
53  shift
54  subdirs=$*
55  grep ^@item ${docfile} | grep "@code.* - " | \
56    grep -v "@item E" | \
57    grep -v "@code{CONFIGURE" | \
58    grep -v "@value{RPREFIX" | \
59    sed -e 's/@value{DIRPREFIX}/rtems_/' | \
60    cut -d'{' -f2 | sed -e 's/}//' | cut -d'-' -f1 >/tmp/XXX.size
61
62  if [ `wc -c </tmp/XXX.size` -eq 1 ]  ; then
63    return
64  fi
65  echo "====> `grep ^@chapter ${docfile} | sed -e 's/@chapter //'`"
66  cat /tmp/XXX.size | while read line
67  do
68    # echo $line
69    found=no
70    for subd in ${subdirs}
71    do
72      if [ ${found} = "no" ] ; then
73        cd ${objdir}/${subd}/o-optimize/
74        objfile=`check_objs $line`
75        if [ $? -eq 0 ] ; then
76           found=yes
77           #echo ${objfile}
78           objcode=`${size} ${objfile} | tail -1 | cut -f1`
79           objdata=`${size} ${objfile} | tail -1 | cut -f2`
80           objbss=`${size} ${objfile} | tail -1 | cut -f3`
81           objcode=`echo ${objcode}`
82           objdata=`echo ${objdata}`
83           objbss=`echo ${objbss}`
84           echo "${line} - ${objcode}, ${objdata}, ${objbss}"
85        fi
86      fi
87    done
88    if [ ${found} = "no" ] ; then
89      echo "$line - macro or not implemented"
90    fi
91   
92  done
93}
94
95
96# extract libc
97if [ ! -d ${objdir}/newlib_extract/o-optimize ] ; then
98  mkdir -p ${objdir}/newlib_extract/o-optimize
99  cd ${objdir}/newlib_extract/o-optimize
100  list=`${ar} t ${libc}`
101  for i in $list
102  do
103    ${ar} x ${libc} ${i}
104  done
105fi
106
107# extract libm
108if [ ! -d ${objdir}/libm_extract/o-optimize ] ; then
109  mkdir -p ${objdir}/libm_extract/o-optimize
110  cd ${objdir}/libm_extract/o-optimize
111  list=`${ar} t ${libm}`
112  for i in $list
113  do
114    ${ar} x ${libm} ${i}
115  done
116fi
117
118# grab the size of the Classic API
119#
120#  NOTE: This API is always configured.
121#
122cd ${docdir}/user
123echo
124echo "=============================================================="
125echo "=============================================================="
126echo "====                                                      ===="
127echo "====            CLASSIC API SIZE INFORMATION              ===="
128echo "====                                                      ===="
129echo "=============================================================="
130echo "=============================================================="
131echo
132if [ -r ${objdir}/../../../${bsp}/lib/librtems.a ] ; then
133  for i in *.t
134  do
135    per_manager $i exec/rtems/src exec/sapi/src lib/libc
136  done
137else
138  echo "RTEMS Classic API not configured."
139fi
140
141# Grab the size of the POSIX API
142cd ${docdir}/posix_users
143echo
144echo "=============================================================="
145echo "=============================================================="
146echo "====                                                      ===="
147echo "====         POSIX 1003.1b API SIZE INFORMATION           ===="
148echo "====                                                      ===="
149echo "=============================================================="
150echo "=============================================================="
151echo
152if [ -r ${objdir}/../../../${bsp}/lib/libposix.a ] ; then
153  for i in `ls -1 *.t | grep -v libc.t | grep -v libm.t`
154  do
155    per_manager $i exec/posix/src lib/libc newlib_extract
156  done
157else
158  echo "POSIX API not configured."
159fi
160
161# Grab the size of the POSIX routines provided by the C Library
162cd ${docdir}/posix_users
163echo
164echo "=============================================================="
165echo "=============================================================="
166echo "====                                                      ===="
167echo "====             LIBC API SIZE INFORMATION                ===="
168echo "====                                                      ===="
169echo "=============================================================="
170echo "=============================================================="
171echo
172for i in libc.t
173do
174  per_manager $i exec/posix/src lib/libc newlib_extract
175done
176
177# Grab the size of the libm routines
178cd ${docdir}/posix_users
179echo
180echo "=============================================================="
181echo "=============================================================="
182echo "====                                                      ===="
183echo "====             LIBM API SIZE INFORMATION                ===="
184echo "====                                                      ===="
185echo "=============================================================="
186echo "=============================================================="
187echo
188for i in libm.t
189do
190  per_manager $i exec/posix/src lib/libc libm_extract
191done
192
193
Note: See TracBrowser for help on using the repository browser.