tests: disassemble-asm.sh: generate AML in readable format
PATCH 1/1 tests: disassemble-asm.sh: generate AML in readable format
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/.
--- tests/data/acpi/disassemle-aml.sh | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tests/data/acpi/disassemle-aml.sh
tests/data/acpi/disassemle-aml.sh new file +52 -0
@@ -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
Signature · 1 line
MST
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
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/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
On Thu, 11 Jun 2020 12:51:16 -0400
"Michael S. Tsirkin" <[email protected]> wrote:
subj: s/asm/asl/
Quoted 4 lines
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.
Quoted 65 lines
Signed-off-by Michael S. Tsirkin <[email protected]>--- tests/data/acpi/disassemle-aml.sh | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tests/data/acpi/disassemle-aml.shtests/data/acpi/disassemle-aml.sh new file +52
-0@@ -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