qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests: disassemble-asm.sh: generate AML in readable format
@ 2020-06-11 16:51 Michael S. Tsirkin
  2020-06-12  0:01 ` no-reply
  2020-06-16 13:29 ` Igor Mammedov
  0 siblings, 2 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2020-06-11 16:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Igor Mammedov

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/.

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
-- 
MST



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tests: disassemble-asm.sh: generate AML in readable format
  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
  1 sibling, 0 replies; 3+ messages in thread
From: no-reply @ 2020-06-12  0:01 UTC (permalink / raw)
  To: mst; +Cc: imammedo, qemu-devel

Patchew URL: https://patchew.org/QEMU/20200611165112.30979-1-mst@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20200611165112.30979-1-mst@redhat.com
Subject: [PATCH] tests: disassemble-asm.sh: generate AML in readable format
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
96571e6 tests: disassemble-asm.sh: generate AML in readable format

=== OUTPUT BEGIN ===
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#16: 
new file mode 100755

WARNING: line over 80 characters
#30: FILE: tests/data/acpi/disassemle-aml.sh:10:
+        echo "Usage: ./tests/data/acpi/disassemle-aml.sh [-o <output-directory>]"

ERROR: trailing whitespace
#33: FILE: tests/data/acpi/disassemle-aml.sh:13:
+    $

ERROR: trailing whitespace
#70: FILE: tests/data/acpi/disassemle-aml.sh:50:
+        iasl -d -p ${asl} ${extra} ${aml} $

total: 2 errors, 2 warnings, 52 lines checked

Commit 96571e631bfb (tests: disassemble-asm.sh: generate AML in readable format) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200611165112.30979-1-mst@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tests: disassemble-asm.sh: generate AML in readable format
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Igor Mammedov @ 2020-06-16 13:29 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-16 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).