summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-08-10 18:56:11 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-08-11 00:25:54 -0500
commit067bfe2aa8b63b9b3ceb584b7895dc6687e3d4f1 (patch)
tree14fb376edce728c08da3890a8b70969c88b478df /src
parent068d68fdc716da1ad4443f66068b7494525e681f (diff)
downloadtalos-hostboot-067bfe2aa8b63b9b3ceb584b7895dc6687e3d4f1.tar.gz
talos-hostboot-067bfe2aa8b63b9b3ceb584b7895dc6687e3d4f1.zip
New 'hb objsizes' command
Change-Id: I6693c0d70170794f448f29165266732f8e6d2682 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/246 Tested-by: Jenkins Server Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/build/tools/hb32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/build/tools/hb b/src/build/tools/hb
index f2cfac8de..cfe345c36 100755
--- a/src/build/tools/hb
+++ b/src/build/tools/hb
@@ -117,6 +117,16 @@ hb_helptext()
echo " in it, while /.../foo/ will create a subdirectory within foo"
echo " by the name of your repository's directory name."
;;
+ objsizes)
+ echo " Topic 'objsizes'"
+ echo
+ echo " Usage:"
+ echo " hb objsizes"
+ echo
+ echo " Reads the ELF header information from all of the hostboot"
+ echo " modules and generates a CSV output of the sizes of the text"
+ echo " and data sections of the modules."
+ ;;
customrc)
echo " Topic 'customrc'"
echo
@@ -146,7 +156,7 @@ hb_helptext()
echo " hb help [<cmd>|<topic>]"
echo
echo " Available Commands:"
- echo " workon, simsetup, prime, startsimics, rsync"
+ echo " workon, simsetup, prime, startsimics, rsync, objsizes"
echo
echo " Additional Help Topics:"
echo " customrc"
@@ -263,6 +273,23 @@ hb_rsync()
fi
}
+hb_objsizes()
+{
+ [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1
+
+ echo "Object,Text Size,Data Size"
+
+ objdump -h ${HOSTBOOTROOT}/img/*.elf ${HOSTBOOTROOT}/img/*.so | \
+ grep -e ".elf" -e ".so:" -e ".text " -e ".data " | \
+ sed "s/.so:.*/.so/" | \
+ sed "s/.elf:.*/.elf/" | \
+ sed 's/.*\.text *\([0-9a-f]*\).*/,0x\1/' | \
+ sed "s/.*\.data *\([0-9a-f]*\).*/,0x\1/" | \
+ sed "N ; N ; s/\n//g" | \
+ xargs -n1 perl -e 'printf "%s,%d,%d\n", map { 0 == hex $_ ? $_ : hex $_ } split /\,/,shift;' | \
+ sed "s/.*\///"
+}
+
if [ 0 == $# ]; then
hb_helptext
exit -1
@@ -287,6 +314,9 @@ startsimics)
rsync)
hb_rsync $*
;;
+objsizes)
+ hb_objsizes $*
+ ;;
*)
hb_helptext $*
exit -1
OpenPOWER on IntegriCloud