All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] tests: disassemble-asm.sh: generate AML in readable format
Date: Tue, 16 Jun 2020 15:29:26 +0200	[thread overview]
Message-ID: <20200616152926.4e08698d@redhat.com> (raw)
In-Reply-To: <20200611165112.30979-1-mst@redhat.com>

On Thu, 11 Jun 2020 12:51:16 -0400
"Michael S. Tsirkin" <mst@redhat.com> wrote:

subj: s/asm/asl/

> On systems where the IASL tool exists, we can convert
> extected ACPI tables to ASL format, which is useful
> for debugging and documentation purposes.
> This script does this for all ACPI tables under tests/data/acpi/. 

for debugging I usually use V=1 env var with test/make check,
as it gives me all diffs vs current blobs.
And it's on rare occasion that I go and decompile ASL file myself,
since test already did that for tables that didn't match. 

> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  tests/data/acpi/disassemle-aml.sh | 52 +++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
>  create mode 100755 tests/data/acpi/disassemle-aml.sh
> 
> diff --git a/tests/data/acpi/disassemle-aml.sh b/tests/data/acpi/disassemle-aml.sh
> new file mode 100755
> index 0000000000..42a1b51df0
> --- /dev/null
> +++ b/tests/data/acpi/disassemle-aml.sh
> @@ -0,0 +1,52 @@
> +#!/usr/bin/bash
> +
> +outdir=
> +while getopts "o:" arg; do
> +  case ${arg} in
> +    o )
> +        outdir=$OPTARG
> +        ;;
> +    \? )
> +        echo "Usage: ./tests/data/acpi/disassemle-aml.sh [-o <output-directory>]"
> +        exit 1
> +        ;;
> +    
> +  esac
> +done
> +
> +for machine in tests/data/acpi/*
> +do
> +    if [[ ! -d "$machine" ]];
> +    then
> +        continue
> +    fi
> +
> +    if [[ "${outdir}" ]];
> +    then
> +        mkdir -p "${outdir}"/${machine} || exit $?
> +    fi
> +    for aml in $machine/*
> +    do
> +        if [[ "$aml" == $machine/*.dsl ]];
> +        then
> +            continue
> +        fi
> +        if [[ "$aml" == $machine/SSDT*.* ]];
> +        then
> +            dsdt=${aml/SSDT*./DSDT.}
> +            extra="-e ${dsdt}"
> +        elif [[ "$aml" == $machine/SSDT* ]];
> +        then
> +            dsdt=${aml/SSDT*/DSDT};
> +            extra="-e ${dsdt}"
> +        else
> +            extra=""
> +        fi
> +        asl=${aml}.dsl
> +        if [[ "${outdir}" ]];
> +        then
> +            asl="${outdir}"/${machine}/${asl}
> +        fi
> +        iasl -d -p ${asl} ${extra} ${aml} 
> +    done
> +done



      parent reply	other threads:[~2020-06-16 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 16:51 [PATCH] tests: disassemble-asm.sh: generate AML in readable format Michael S. Tsirkin
2020-06-12  0:01 ` no-reply
2020-06-16 13:29 ` Igor Mammedov [this message]

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=20200616152926.4e08698d@redhat.com \
    --to=imammedo@redhat.com \
    --cc=mst@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.