From patchwork Fri Feb 7 10:18:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 24288 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3AE662096A for ; Fri, 7 Feb 2014 10:20:04 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id z6sf7798665yhz.10 for ; Fri, 07 Feb 2014 02:20:04 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=nwFptzSkieQbln5fOFV+LVYnGGvZMPT99iySq9VA/L0=; b=BajmAcn+zgl6j76DWiVU3e3Fbcg5KBTtIG9gx8QwlwbIyrD80nf226A2JfoSI77iLp hyDPli0mNneO8x0so0DQLI6zDlj0H4xs1gAl78Y+nBA+v8jjqqArBYRsRDEbB252A5Tf J9lNEWii+q1zN5vfDJ0V1O4J0Rl1icD3IsUcYnTlmBNOWOQmjMus+4VSi1Sxuh0uKhqS CatjTs7u1h9f4SrxoO0vZ6zJkChb4BRzY9O35RoVqiw9v+OYZsZ67APiSssxJaM3DiO7 WGcUlF9ufAGlHR8tSrapGv2A6chZOG1+iKBbugXLyOxXYfil1eA4TlEki9yxRubKM1+G QPvg== X-Gm-Message-State: ALoCoQl9APyX6l2La4chXP8B4nZWtxhzb9eu/U0JElxbwe6QfibHf+putSVhJOl3GLPJ1PZlI4Di X-Received: by 10.58.35.74 with SMTP id f10mr3557019vej.23.1391768404208; Fri, 07 Feb 2014 02:20:04 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.41 with SMTP id f38ls942088qge.55.gmail; Fri, 07 Feb 2014 02:20:04 -0800 (PST) X-Received: by 10.220.53.66 with SMTP id l2mr56121vcg.33.1391768404077; Fri, 07 Feb 2014 02:20:04 -0800 (PST) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id k10si1163737vca.124.2014.02.07.02.20.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:20:04 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.44 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.44; Received: by mail-vb0-f44.google.com with SMTP id f12so2431211vbg.17 for ; Fri, 07 Feb 2014 02:20:04 -0800 (PST) X-Received: by 10.220.92.135 with SMTP id r7mr9676362vcm.11.1391768404002; Fri, 07 Feb 2014 02:20:04 -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.220.174.196 with SMTP id u4csp91628vcz; Fri, 7 Feb 2014 02:20:03 -0800 (PST) X-Received: by 10.68.133.163 with SMTP id pd3mr18637595pbb.166.1391768400451; Fri, 07 Feb 2014 02:20:00 -0800 (PST) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx.google.com with ESMTPS id s7si4458127pae.272.2014.02.07.02.20.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:20:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.181 is neither permitted nor denied by best guess record for domain of takahiro.akashi@linaro.org) client-ip=209.85.192.181; Received: by mail-pd0-f181.google.com with SMTP id y10so2942225pdj.26 for ; Fri, 07 Feb 2014 02:20:00 -0800 (PST) X-Received: by 10.66.243.103 with SMTP id wx7mr6764487pac.107.1391768399961; Fri, 07 Feb 2014 02:19:59 -0800 (PST) Received: from localhost.localdomain (KD182249085115.au-net.ne.jp. [182.249.85.115]) by mx.google.com with ESMTPSA id e6sm12093179pbg.4.2014.02.07.02.19.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:19:58 -0800 (PST) From: AKASHI Takahiro To: rostedt@goodmis.org, fweisbec@gmail.com, mingo@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, gkulkarni@caviumnetworks.com, tim.bird@sonymobile.com Cc: arndb@arndb.de, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, patches@linaro.org, AKASHI Takahiro Subject: [PATCH v3 4/6] ftrace: Add arm64 support to recordmcount Date: Fri, 7 Feb 2014 19:18:54 +0900 Message-Id: <1391768336-5642-5-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1391768336-5642-1-git-send-email-takahiro.akashi@linaro.org> References: <1382598488-13511-1-git-send-email-takahiro.akashi@linaro.org> <1391768336-5642-1-git-send-email-takahiro.akashi@linaro.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.212.44 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: , 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 4d81791..43fce76 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";