From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [kvm-unit-tests PATCH 5/8] pretty_print_stacks: addr2line may need a cross prefix Date: Tue, 19 Apr 2016 17:45:26 +0200 Message-ID: <20160419154526.h7dubgl4auesfjdx@hawk.localdomain> References: <1461076090-24308-1-git-send-email-drjones@redhat.com> <1461076090-24308-6-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, Paolo Bonzini , rkrcmar@redhat.com To: Peter Feiner Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50773 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932694AbcDSPpa (ORCPT ); Tue, 19 Apr 2016 11:45:30 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Apr 19, 2016 at 08:33:26AM -0700, Peter Feiner wrote: > On Tue, Apr 19, 2016 at 7:28 AM, Andrew Jones wrote: > > Signed-off-by: Andrew Jones > > --- > > 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? OK, will do in v2. > > > 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 > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html