pure_test.sh revision e64031e20c39650a7bc902a3e1aba613b9415dee
# $Id$
## @file
# pure_test.sh - test the effect of __attribute__((pure)) on a set of
# functions.
#
# Mark the functions with EXPERIMENT_PURE where the attribute normally would,
# go update this script so it points to the right header and execute it. At
# the end you'll get a pt-report.txt showing the fluctuations in the text size.
#
#
# Copyright (C) 2010 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
set -e
set -x
BINDIR="../../../out/linux.amd64/release/bin/"
DLLEXT="so"
NAMES=`kmk_sed -e '/EXPERIMENT_PURE/!d' -e '/^#/d' -e 's/^[^()]*([^()]*)[[:space:]]*\([^() ]*\)(.*$/\1/' ${HEADER}.bak `
#
# baseline
#
exec < "pt-baseline.txt"
read buf # ignore
kmk_cp -f "pt-baseline.txt" "${REPORT}"
#
# Now, do each of the names.
#
do
kmk_sed \
-e 's/EXPERIMENT_PURE//' \
exec < "pt-${name}.txt"
read buf # ignore
kmk_printf -- "%7d %7d %7d ${name}\n" \
`kmk_expr ${baseline_r0} - ${cur_r0} ` \
`kmk_expr ${baseline_rc} - ${cur_rc} ` \
`kmk_expr ${baseline_r3} - ${cur_r3} ` \
>> "${REPORT}"
done
# clean up