From patchwork Thu Jan 16 12:26:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 23269 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 51376203C4 for ; Thu, 16 Jan 2014 12:26:55 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id q10sf953740pdj.2 for ; Thu, 16 Jan 2014 04:26:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=Ww4Soujxe5e7g/DOiCgohT3SfEfxr0mi1bcfQYtE71E=; b=L4NorR81hA2hNRouIm7+EVUzBHWtmTci0utF9bXY09nrDOkPM+L0Qi0moUhWGprXvn 0MM2uJRP0gthMe4TjBr6NDhTd9dfrCNXKla1JTjAZJTD0vCGWwLgL/KwCme5/58xhpBK mqYyzxT/3yxKUpIMVdIXKqhFQbgMoPTiOh8qqXLUzFWJzfHaOWYYYa0n0nr863gRUpYv 2FvVrgju0TT4LjdI86h+jel/YzO9C9Lq4Nk5BwVHa1tXW05M4zofwMXAcp1Du9z48how PBHmRslo08zsG9bIR6GYCAIfE6vX5KmKnv1AJcngy5iHMv+ceqT7LnWbSdmfquIgF+US 5NXA== X-Gm-Message-State: ALoCoQnKLsDDmn3I0bCWBJevk2BE1lq+h8CgxNQz7gveQlYj2FiNWcpqiiRDWsI6ehDHPXaDAPsh X-Received: by 10.68.197.137 with SMTP id iu9mr3096688pbc.3.1389875214424; Thu, 16 Jan 2014 04:26:54 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.102 with SMTP id o6ls870209qek.28.gmail; Thu, 16 Jan 2014 04:26:54 -0800 (PST) X-Received: by 10.52.237.228 with SMTP id vf4mr5401887vdc.3.1389875214324; Thu, 16 Jan 2014 04:26:54 -0800 (PST) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id kn3si3299328veb.54.2014.01.16.04.26.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jan 2014 04:26:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id p6so931388vbe.34 for ; Thu, 16 Jan 2014 04:26:54 -0800 (PST) X-Received: by 10.52.231.130 with SMTP id tg2mr5460143vdc.16.1389875214238; Thu, 16 Jan 2014 04:26:54 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp342906ved; Thu, 16 Jan 2014 04:26:53 -0800 (PST) X-Received: by 10.58.119.161 with SMTP id kv1mr2330803veb.21.1389875213898; Thu, 16 Jan 2014 04:26:53 -0800 (PST) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id q19si3289243vea.101.2014.01.16.04.26.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jan 2014 04:26:53 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of jean.pihet@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id 11so928593vbe.38 for ; Thu, 16 Jan 2014 04:26:53 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.58.181.230 with SMTP id dz6mr18354vec.35.1389875213762; Thu, 16 Jan 2014 04:26:53 -0800 (PST) Received: by 10.58.100.79 with HTTP; Thu, 16 Jan 2014 04:26:53 -0800 (PST) In-Reply-To: <20140116115634.GE30257@mudshark.cambridge.arm.com> References: <1389869123-5884-1-git-send-email-jean.pihet@linaro.org> <20140116115634.GE30257@mudshark.cambridge.arm.com> Date: Thu, 16 Jan 2014 13:26:53 +0100 Message-ID: Subject: Re: [PATCH] ARM64: perf: support dwarf unwinding in compat mode From: Jean Pihet To: Will Deacon Cc: "linux-kernel@vger.kernel.org" , "linaro-kernel@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" , Arnaldo , "patches@linaro.org" , Jiri Olsa , Ingo Molnar X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jean.pihet@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 16 January 2014 12:56, Will Deacon wrote: > Hi Jean, > > On Thu, Jan 16, 2014 at 10:45:23AM +0000, Jean Pihet wrote: >> Add support for unwinding using the dwarf information in compat >> mode. Using the correct user stack pointer allows perf to record >> the frames correctly in the native and compat modes. >> >> Note that although the dwarf frame unwinding works ok using >> libunwind in native mode (on ARMv7 & ARMv8), some changes are >> required to the libunwind code for the compat mode. Those changes >> are posted separately on the libunwind mailing list. >> >> Tested on ARMv8 platform with v8 and compat v7 binaries, the latter >> are statically built. > > I guess it makes sense to include this with your earlier series adding > support for compat backtracing? > >> Signed-off-by: Jean Pihet >> --- >> arch/arm64/include/asm/ptrace.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h >> index fbb0020..86d5b54 100644 >> --- a/arch/arm64/include/asm/ptrace.h >> +++ b/arch/arm64/include/asm/ptrace.h >> @@ -133,7 +133,7 @@ struct pt_regs { >> (!((regs)->pstate & PSR_F_BIT)) >> >> #define user_stack_pointer(regs) \ >> - ((regs)->sp) >> + (!compat_user_mode(regs)) ? ((regs)->sp) : ((regs)->compat_sp) > > In your previous series, compat backtracing is actually split out into a > separate function (compat_user_backtrace), so it would be more consistent to > have a compat_user_stack_pointer macro, rather than add this check here. Do you mean this change instead? If so let me prepare/test and re-submit this. Thx! Jean > > Will diff --git a/kernel/events/internal.h b/kernel/events/internal.h index 569b2187..9b88d2e 100644 --- a/kernel/events/internal.h +++ b/kernel/events/internal.h @@ -185,7 +185,8 @@ static inline bool arch_perf_have_user_stack_dump(void) return true; } -#define perf_user_stack_pointer(regs) user_stack_pointer(regs) +#define perf_user_stack_pointer(regs) \ + (!compat_user_mode(regs)) ? ((regs)->sp) : ((regs)->compat_sp) #else static inline bool arch_perf_have_user_stack_dump(void) {