From patchwork Tue Feb 25 09:23:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 25255 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5E86A20558 for ; Tue, 25 Feb 2014 09:24:44 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf339770oag.4 for ; Tue, 25 Feb 2014 01:24:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=rSU67zD4SjTH3gwPKVKVZ+3KBldbm0AO/+x0suvOnc0=; b=TJUlqiyuy5vNtjQ1TwuB40XfibVGcdYkodufuOBrpweK5KJGudiVCh/75tZNgkSaJe JkEXSJ7HIjBMavCqXcAT98Tp2bwRTW2N/gssQIUFEsnFQG1N28YFIjhuD51jwYfCCoty mkb7pRjYhco9uxujTzI35NDMkX3W6RqVT+iYRsuDhmcIcFARZzDDKBTbpljnAsrn8KO+ XQHPQPOlFhwvDkxuSG3QVApHFZqJEQgyA6kLKwyJUJRttE0OSbdRdiOtQMtgkSAvfuK6 c1nFICmPAzYa1Y4LgUl304FP6fMG6RN3bIpabU2o/RTo/tXgNGtbGjgL3Q41WUoz74s+ Z40w== X-Gm-Message-State: ALoCoQlr/0IDgBk9XRHX2kfAD+QzPIerEAFn+YIy2d1sFTgfpbaVTwIs21TPHPLknySlOUY99EMK X-Received: by 10.182.213.5 with SMTP id no5mr129551obc.15.1393320283924; Tue, 25 Feb 2014 01:24:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.70 with SMTP id l64ls71296qge.16.gmail; Tue, 25 Feb 2014 01:24:43 -0800 (PST) X-Received: by 10.52.243.164 with SMTP id wz4mr55566vdc.31.1393320283821; Tue, 25 Feb 2014 01:24:43 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id at8si6659810vec.113.2014.02.25.01.24.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 01:24:43 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jx11so113634veb.31 for ; Tue, 25 Feb 2014 01:24:43 -0800 (PST) X-Received: by 10.220.147.16 with SMTP id j16mr198557vcv.28.1393320283686; Tue, 25 Feb 2014 01:24:43 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp123919vcz; Tue, 25 Feb 2014 01:24:43 -0800 (PST) X-Received: by 10.68.36.41 with SMTP id n9mr5162140pbj.99.1393320282638; Tue, 25 Feb 2014 01:24:42 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uc9si20058444pac.239.2014.02.25.01.24.41; Tue, 25 Feb 2014 01:24:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753240AbaBYJYd (ORCPT + 26 others); Tue, 25 Feb 2014 04:24:33 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:39892 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318AbaBYJY0 (ORCPT ); Tue, 25 Feb 2014 04:24:26 -0500 Received: by mail-pa0-f47.google.com with SMTP id kp14so7817131pab.34 for ; Tue, 25 Feb 2014 01:24:26 -0800 (PST) X-Received: by 10.68.143.231 with SMTP id sh7mr5405679pbb.7.1393320265913; Tue, 25 Feb 2014 01:24:25 -0800 (PST) Received: from localhost.localdomain (KD182249093189.au-net.ne.jp. [182.249.93.189]) by mx.google.com with ESMTPSA id iq10sm8497678pbc.14.2014.02.25.01.24.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 01:24:24 -0800 (PST) From: AKASHI Takahiro To: rostedt@goodmis.org, fweisbec@gmail.com, mingo@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, tim.bird@sonymobile.com Cc: gkulkarni@caviumnetworks.com, dsaxena@linaro.org, arndb@arndb.de, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, AKASHI Takahiro Subject: [PATCH v4 4/7] ftrace: Add arm64 support to recordmcount Date: Tue, 25 Feb 2014 18:23:13 +0900 Message-Id: <1393320196-2942-5-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393320196-2942-1-git-send-email-takahiro.akashi@linaro.org> References: <1391768336-5642-1-git-send-email-takahiro.akashi@linaro.org> <1393320196-2942-1-git-send-email-takahiro.akashi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: takahiro.akashi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.172 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Recordmcount utility under scripts is run, after compiling each object, to find out all the locations of calling _mcount() and put them into specific seciton named __mcount_loc. Then linker collects all such information into a table in the kernel image (between __start_mcount_loc and __stop_mcount_loc) for later use by ftrace. This patch adds arm64 specific definitions to identify such locations. There are two types of implementation, C and Perl. On arm64, only C version is used to build the kernel now that CONFIG_HAVE_C_RECORDMCOUNT is on. But Perl version is also maintained. Signed-off-by: AKASHI Takahiro --- arch/arm64/Kconfig | 2 ++ scripts/recordmcount.c | 4 ++++ scripts/recordmcount.pl | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index b176bc0..6954959 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -27,6 +27,7 @@ config ARM64 select HARDIRQS_SW_RESEND select HAVE_ARCH_JUMP_LABEL select HAVE_ARCH_TRACEHOOK + select HAVE_C_RECORDMCOUNT select HAVE_DEBUG_BUGVERBOSE select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_API_DEBUG @@ -34,6 +35,7 @@ config ARM64 select HAVE_DMA_CONTIGUOUS select HAVE_DYNAMIC_FTRACE select HAVE_EFFICIENT_UNALIGNED_ACCESS + select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_GRAPH_TRACER select HAVE_GENERIC_DMA_COHERENT diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index 9c22317..b92d9f7 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c @@ -347,6 +347,10 @@ do_file(char const *const fname) case EM_ARM: reltype = R_ARM_ABS32; altmcount = "__gnu_mcount_nc"; break; + case EM_AARCH64: + reltype = R_AARCH64_ABS64; + altmcount = "_mcount"; + break; case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; case EM_METAG: reltype = R_METAG_ADDR32; altmcount = "_mcount_wrapper"; diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 91280b8..397b6b8 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -279,6 +279,11 @@ if ($arch eq "x86_64") { $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_ARM_(CALL|PC24|THM_CALL)" . "\\s+(__gnu_mcount_nc|mcount)\$"; +} elsif ($arch eq "arm64") { + $alignment = 3; + $section_type = '%progbits'; + $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_AARCH64_CALL26\\s+_mcount\$"; + $type = ".quad"; } elsif ($arch eq "ia64") { $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$"; $type = "data8";