From patchwork Fri Feb 28 05:18:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 25507 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2DB6F2055D for ; Fri, 28 Feb 2014 05:20:13 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf515975yho.8 for ; Thu, 27 Feb 2014 21:20:12 -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=hbuPGpGZksv+krnRNAhmEHDeC6LnqlF0vrfoGk1l12iyRa9EoMS5TTtIXUAuljHzvB HQzL238GgmZA6CPz+8hCt2cObbyJ43UM3ZZa5293oCQES2bpU28jz4nBUEpbilaM6kjw bajvMAOxKgywQZcuFrhjzNAALbcFrxT6Gln9CmwvvOmQGi0af6Sgv6oLeCfqPKRwnhbq 2PN+52Eh3GlidsK/frCedFDUk8Qc+swtok2SGv9UspFqsZ0kGdPWY1qIn0Lzs1bN8+xq xIiAq1UjP4Lp0IbwN2sVpd+u3Pwi5CeCjGPQX8R3QVALMV5pmlp5+1v89n0fpcINPxKB hpOQ== X-Gm-Message-State: ALoCoQk9IM3SWeCrKYuVzFGbdCTDZ+V81LyHlBC9g6OW1dSWmvS0HRlxYwnoVsCytLBSnaqc+zq9 X-Received: by 10.236.190.199 with SMTP id e47mr259466yhn.53.1393564812951; Thu, 27 Feb 2014 21:20:12 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.113 with SMTP id p104ls937656qga.41.gmail; Thu, 27 Feb 2014 21:20:12 -0800 (PST) X-Received: by 10.52.113.1 with SMTP id iu1mr1375304vdb.35.1393564812852; Thu, 27 Feb 2014 21:20:12 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id j20si1170321vcx.94.2014.02.27.21.20.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Feb 2014 21:20:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 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.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so234989veb.25 for ; Thu, 27 Feb 2014 21:20:12 -0800 (PST) X-Received: by 10.52.135.65 with SMTP id pq1mr11814482vdb.13.1393564812760; Thu, 27 Feb 2014 21:20:12 -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.130.193 with SMTP id u1csp28929vcs; Thu, 27 Feb 2014 21:20:12 -0800 (PST) X-Received: by 10.69.31.43 with SMTP id kj11mr1136554pbd.67.1393564811829; Thu, 27 Feb 2014 21:20:11 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nc5si643716pab.39.2014.02.27.21.20.11; Thu, 27 Feb 2014 21:20:11 -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 S1752071AbaB1FUA (ORCPT + 26 others); Fri, 28 Feb 2014 00:20:00 -0500 Received: from mail-pb0-f43.google.com ([209.85.160.43]:55949 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbaB1FT6 (ORCPT ); Fri, 28 Feb 2014 00:19:58 -0500 Received: by mail-pb0-f43.google.com with SMTP id um1so267472pbc.30 for ; Thu, 27 Feb 2014 21:19:57 -0800 (PST) X-Received: by 10.66.136.103 with SMTP id pz7mr1247533pab.140.1393564797743; Thu, 27 Feb 2014 21:19:57 -0800 (PST) Received: from localhost.localdomain (KD182249084248.au-net.ne.jp. [182.249.84.248]) by mx.google.com with ESMTPSA id vn10sm1790978pbc.21.2014.02.27.21.19.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Feb 2014 21:19:56 -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 v5 4/7] ftrace: Add arm64 support to recordmcount Date: Fri, 28 Feb 2014 14:18:41 +0900 Message-Id: <1393564724-3966-5-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393564724-3966-1-git-send-email-takahiro.akashi@linaro.org> References: <1393320196-2942-1-git-send-email-takahiro.akashi@linaro.org> <1393564724-3966-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.180 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";