From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCHv2] scripts/sstate-diff.sh: add simple script to compare sstate checksums between MACHINEs
Date: Tue, 4 Dec 2012 13:07:54 +0100 [thread overview]
Message-ID: <1354622874-4038-1-git-send-email-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <cc05da7f236a0c8367c3cff3b4a0d297fe6a8dd7.1349356755.git.Martin.Jansa@gmail.com>
* takes tmpdir, machines and targets from command arguments or env variables
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
scripts/sstate-diff.sh | 107 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
create mode 100755 scripts/sstate-diff.sh
diff --git a/scripts/sstate-diff.sh b/scripts/sstate-diff.sh
new file mode 100755
index 0000000..f2c151a
--- /dev/null
+++ b/scripts/sstate-diff.sh
@@ -0,0 +1,107 @@
+#!/bin/sh
+
+# Used to compare sstate checksums between MACHINES
+# Execute script and compare generated list.M files
+
+# It's also usefull to keep older sstate checksums
+# to be able to find out why something is rebuilding
+# after updating metadata
+
+# $ diff \
+# sstate-diff/1349348392/fake-cortexa8/list.M \
+# sstate-diff/1349348392/fake-cortexa9/list.M \
+# | wc -l
+# 538
+
+# Then to compare sigdata use something like:
+# $ ls sstate-diff/1349348392/*/armv7a-vfp-neon*/linux-libc-headers/*do_configure*sigdata*
+# sstate-diff/1349348392/fake-cortexa8/armv7a-vfp-neon-oe-linux-gnueabi/linux-libc-headers/3.4.3-r0.do_configure.sigdata.cb73b3630a7b8191e72fc469c5137025
+# sstate-diff/1349348392/fake-cortexa9/armv7a-vfp-neon-oe-linux-gnueabi/linux-libc-headers/3.4.3-r0.do_configure.sigdata.f37ada177bf99ce8af85914df22b5a0b
+# $ bitbake-diffsigs stamps.1349348392/*/armv7a-vfp-neon*/linux-libc-headers/*do_configure*sigdata*
+# basehash changed from 8d0bd67bb1da6f68717760fc3ef43171 to e869fa61426e88e9c30726ba88a1216a
+# Variable TUNE_CCARGS value changed from -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 to -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9
+
+# Global vars
+tmpdir=
+machines=
+targets=
+default_machines="qemuarm qemux86 qemux86-64"
+default_targets="core-image-base"
+
+usage () {
+ cat << EOF
+Welcome to utility to compare sstate checksums between different MACHINEs.
+$0 <OPTION>
+
+Options:
+ -h, --help
+ Display this help and exit.
+
+ --tmpdir=<tmpdir>
+ Specify tmpdir, will use the environment variable TMPDIR if it is not specified.
+ Something like /OE/oe-core/tmp-eglibc (no / at the end).
+
+ --machines=<machines>
+ List of MACHINEs separated by space, will use the environment variable MACHINES if it is not specified.
+ Default value is "qemuarm qemux86 qemux86-64".
+
+ --targets=<targets>
+ List of targets separated by space, will use the environment variable TARGETS if it is not specified.
+ Default value is "core-image-base".
+EOF
+}
+
+# Print error information and exit.
+echo_error () {
+ echo "ERROR: $1" >&2
+ exit 1
+}
+
+while [ -n "$1" ]; do
+ case $1 in
+ --tmpdir=*)
+ tmpdir=`echo $1 | sed -e 's#^--tmpdir=##' | xargs readlink -e`
+ [ -d "$tmpdir" ] || echo_error "Invalid argument to --tmpdir"
+ shift
+ ;;
+ --machines=*)
+ machines=`echo $1 | sed -e 's#^--machines="*\([^"]*\)"*#\1#'`
+ shift
+ ;;
+ --targets=*)
+ targets=`echo $1 | sed -e 's#^--targets="*\([^"]*\)"*#\1#'`
+ shift
+ ;;
+ --help|-h)
+ usage
+ exit 0
+ ;;
+ *)
+ echo "Invalid arguments $*"
+ echo_error "Try '$0 -h' for more information."
+ ;;
+ esac
+done
+
+# tmpdir directory, use environment variable TMPDIR
+# if it was not specified, otherwise, error.
+[ -n "$tmpdir" ] || tmpdir=$TMPDIR
+[ -n "$tmpdir" ] || echo_error "No tmpdir found!"
+[ -d "$tmpdir" ] || echo_error "Invalid tmpdir \"$tmpdir\""
+[ -n "$machines" ] || machines=$MACHINES
+[ -n "$machines" ] || machines=$default_machines
+[ -n "$targets" ] || targets=$TARGETS
+[ -n "$targets" ] || targets=$default_targets
+
+OUTPUT=${tmpdir}/sstate-diff/`date "+%s"`
+
+for M in ${machines}; do
+ find ${tmpdir}/stamps/ -name \*sigdata\* | xargs rm -f
+ mkdir -p ${OUTPUT}/${M}
+ export MACHINE=${M}; bitbake -S ${targets} | tee -a ${OUTPUT}/${M}/log;
+ cp -ra ${tmpdir}/stamps/* ${OUTPUT}/${M}
+ find ${OUTPUT}/${M} -name \*sigdata\* | sed "s#${OUTPUT}/${M}/##g" | sort > ${OUTPUT}/${M}/list
+ M_UNDERSCORE=`echo ${M} | sed 's/-/_/g'`
+ sed "s/${M_UNDERSCORE}/MACHINE/g; s/${M}/MACHINE/g" ${OUTPUT}/${M}/list | sort > ${OUTPUT}/${M}/list.M
+ find ${tmpdir}/stamps/ -name \*sigdata\* | xargs rm -f
+done
--
1.8.0
next prev parent reply other threads:[~2012-12-04 12:22 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-22 16:51 [RFC 0/5] OPTDEFAULTTUNE for arm tune files Martin Jansa
2012-09-22 16:51 ` [RFC 1/5] arch-arm: add ARMPKGSFX_CPU to TUNE_PKGARCH because we're using different TUNE_CCARGS Martin Jansa
2012-09-22 16:51 ` [RFC 2/5] tune-xscale, tune-arm926ejs: add OPTDEFAULTTUNE variable and use more generic DEFAULTTUNE as default Martin Jansa
2012-09-22 17:45 ` Richard Purdie
2012-09-27 8:37 ` Martin Jansa
2012-09-27 18:58 ` Mark Hatle
2012-09-27 19:12 ` Martin Jansa
2012-09-27 19:18 ` Mark Hatle
2012-09-27 19:40 ` Martin Jansa
2012-09-27 19:53 ` Mark Hatle
2012-09-27 20:16 ` Martin Jansa
2012-09-28 11:02 ` Phil Blundell
2012-09-28 18:21 ` Martin Jansa
2012-10-02 18:43 ` Martin Jansa
2012-10-02 20:36 ` Mark Hatle
2012-10-02 20:38 ` Martin Jansa
2012-10-02 20:47 ` Mark Hatle
2012-09-22 16:51 ` [RFC 3/5] optimized-tune.inc: add optional distro include Martin Jansa
2012-09-22 16:51 ` [RFC 4/5] bitbake.conf: add TUNE_CCARGS[vardepvalue] Martin Jansa
2012-09-22 16:51 ` [RFC 5/5] tune-xscale, tune-arm926ejs: drop ARMPKGSFX_CPU, change ARMPKGARCH instead Martin Jansa
2012-10-04 13:23 ` [PATCH 0/7] conf/machine: fix arm tune files Martin Jansa
2012-10-04 13:23 ` [PATCH 1/7] tune-xscale: replace TUNE_CCARGS for webkit-gtk and cairo only with xscale in TUNE_FEATURES Martin Jansa
2012-10-04 16:55 ` Khem Raj
2012-10-04 17:13 ` Martin Jansa
2012-10-04 13:23 ` [PATCH 2/7] bitbake.conf: add TUNE_CCARGS[vardepvalue] Martin Jansa
2012-10-04 13:23 ` [PATCH 3/7] tune-cortexr4: fix march value Martin Jansa
2012-10-04 16:55 ` Khem Raj
2012-10-04 13:23 ` [PATCH 4/7] arm/arch-arm*: define ARMPKGARCH_tune-* for default tunes Martin Jansa
2012-10-04 13:23 ` [PATCH 5/7] arch-arm: define different ARMPKGARCH when different CCARGS are used Martin Jansa
2012-10-04 13:23 ` [PATCH 6/7] tune-*: define more generic DEFAULTTUNE to share feed between machines Martin Jansa
2012-10-04 13:23 ` [PATCH 7/7] scripts/sstate-diff.sh: add simple script to compare sstate checksums between MACHINEs Martin Jansa
2012-12-04 12:07 ` Martin Jansa [this message]
2012-12-04 13:03 ` [PATCHv2] " Richard Purdie
2012-12-04 15:24 ` [PATCHv3] " Martin Jansa
2012-12-04 15:26 ` [PATCHv4] scripts/sstate-diff-machines.sh: " Martin Jansa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354622874-4038-1-git-send-email-Martin.Jansa@gmail.com \
--to=martin.jansa@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox