qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org, Ani Sinha <ani@anisinha.ca>,
	Igor Mammedov <imammedo@redhat.com>
Subject: duplicate acpi files
Date: Thu, 2 Mar 2023 01:41:36 -0500	[thread overview]
Message-ID: <20230302013223-mutt-send-email-mst@kernel.org> (raw)

Hi guys,
I got annoyed that whenever I run ./tests/data/acpi/rebuild-expected-aml.sh
then my tree gets polluted with duplicate acpi files.
If I forget to blow them away then later they become stale
and bios table test fails.

So wrote a script to find these hoping to teach rebuild-expected-aml.sh
not to generate these:

find tests/data/acpi/ -type f -exec sha256sum '{}' ';'|sort -d|uniq -w 64 --all-repeated=separate

Turns out we have lots of duplicates already!
These generally increase churn and make review and maintainance of aml
harder - I will remove the trivial ones but slightly harder issues:
- unifying pc and q35 - I guess we can teach bios table test to look
  for expected files one
  directory up and put pc and q35 in a shared directory.
- teaching rebuild-expected-aml.sh to remove duplicates.
- we really should first generate in some temp directory,
  then have a separate script to move files over, this way we can also
  do useful things like tell user what changed - or even pre-generate
  a good git commit message.

I have been using the following script but it expects files to
already be in git, not ideal:

SCM=`pwd`
temp=$(mktemp -d)
status=$?
[ -z "${file}" ] || exit $status
cd ${temp}
rm -fr old new
git clone ${SCM} old
git clone ${SCM} new
cd ${temp}/old
git checkout ${1}
./tests/data/acpi/disassemle-aml.sh -o ${temp}/old/asl
cd ${temp}/new
git checkout ${2}
./tests/data/acpi/disassemle-aml.sh -o ${temp}/new/asl
cd ${temp}
# skip irrelevant header fields
# prefix diff output so it's can be safely included in git log
diff -ru -N -IDisassembly -IChecksum -I'*     Length           ' old/asl new/asl | sed -e 's/^---\|+++\|@@\|diff/:&/'
rm -fr ${temp}


One of you want to try improving on these issues?

-- 
MST



                 reply	other threads:[~2023-03-02  6:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230302013223-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).