Re: [kvm-unit-tests PATCH 5/8] pretty_print_stacks: addr2line may need a cross prefix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 19, 2016 at 7:28 AM, Andrew Jones <drjones@xxxxxxxxxx> wrote:
> Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
> ---
>  configure                      | 2 ++
>  scripts/pretty_print_stacks.py | 9 ++++++++-
>  2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index ba6c55b3bc5b3..ca0ef83b942e5 100755
> --- a/configure
> +++ b/configure
> @@ -7,6 +7,7 @@ ld=ld
>  objcopy=objcopy
>  objdump=objdump
>  ar=ar
> +addr2line=addr2line
>  arch=`uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/'`
>  host=$arch
>  cross_prefix=
> @@ -154,6 +155,7 @@ LD=$cross_prefix$ld
>  OBJCOPY=$cross_prefix$objcopy
>  OBJDUMP=$cross_prefix$objdump
>  AR=$cross_prefix$ar
> +ADDR2LINE=$cross_prefix$addr2line
>  API=$api
>  TEST_DIR=$testdir
>  FIRMWARE=$firmware
> diff --git a/scripts/pretty_print_stacks.py b/scripts/pretty_print_stacks.py
> index db2f145323c45..336fc681e45b2 100755
> --- a/scripts/pretty_print_stacks.py
> +++ b/scripts/pretty_print_stacks.py
> @@ -5,6 +5,8 @@ import subprocess
>  import sys
>  import traceback
>
> +config = {}
> +
>  # Subvert output buffering.
>  def puts(string):
>      sys.stdout.write(string)
> @@ -25,7 +27,7 @@ def pretty_print_stack(binary, line):
>      # Output like this:
>      #        0x004002be: start64 at path/to/kvm-unit-tests/x86/cstart64.S:208
>      #         (inlined by) test_ept_violation at path/to/kvm-unit-tests/x86/vmx_tests.c:1719 (discriminator 1)
> -    cmd = ['addr2line', '-e', binary, '-i', '-f', '--pretty', '--address']
> +    cmd = [config["ADDR2LINE"], '-e', binary, '-i', '-f', '--pretty', '--address']

Perhaps config.get('ADDR2LINE', 'addr2line') so my old config still works?

>      cmd.extend(addrs)
>
>      p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
> @@ -60,6 +62,11 @@ def main():
>
>      binary = sys.argv[1].replace("flat", "elf")
>
> +    with open("config.mak") as config_file:
> +        for line in config_file:
> +            name, val = line.partition("=")[::2]

Very elegant trick here! I always do name, _, val = line.partition("=")!

> +            config[name.strip()] = val.strip()
> +
>      try:
>          while True:
>              # Subvert input buffering.
> --
> 2.4.11
>

Otherwise, reviewed-by: Peter Feiner <pfeiner@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux