From patchwork Thu Oct 24 07:08:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 21241 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D54EA20F5A for ; Thu, 24 Oct 2013 07:09:34 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id qd12sf5692436ieb.6 for ; Thu, 24 Oct 2013 00:09:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state: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=UHzCLkRQerAILfFQZe+HwTGRPKgUNmcrDSXaNar9OCA=; b=LdMpy+1hTQBYB00jXisYF459YTmMjA7ATQwJ6o5IgmijJ2pzHoj3cv8KMVdIl/MQaU U9+sV8qpf8HihW39XOGWmQGa2tdjdcrmAgDyaGv9lBxqsjzZw/olcNPQXe/nRj++el+9 ljE672pqMOjBg4+v/W5Dz+w61D8sv/PVCIdqntFnrg9JlwX9sGenMn+U/MbWKfObf/XV RU6yslw7BTDrTZYO8VDnlBsfMHragtNKIwopwJYxaKDAJJHJVuz0v51ndLDYw2aswhiy LQmVlTxMPme176/0JUpEqd1uTlwNgEkW1/JBrOly47ZQ1dLSAc3SM13xWkCiv61GLDz5 C8iA== X-Received: by 10.182.153.35 with SMTP id vd3mr443740obb.37.1382598574467; Thu, 24 Oct 2013 00:09:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.68 with SMTP id f4ls738393qer.72.gmail; Thu, 24 Oct 2013 00:09:34 -0700 (PDT) X-Received: by 10.52.32.37 with SMTP id f5mr545543vdi.17.1382598574358; Thu, 24 Oct 2013 00:09:34 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id tw10si42375vec.6.2013.10.24.00.09.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 00:09:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.172; Received: by mail-vc0-f172.google.com with SMTP id ks9so1061632vcb.31 for ; Thu, 24 Oct 2013 00:09:32 -0700 (PDT) X-Gm-Message-State: ALoCoQlajCocjXG3mObVeo9JwnpP8MLzPKngxxspsIOMs9tCiEP7L5QRDNQxQOfPr25oyjG66Znp X-Received: by 10.58.246.136 with SMTP id xw8mr65142vec.41.1382598572399; Thu, 24 Oct 2013 00:09:32 -0700 (PDT) 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 u4csp368364vcz; Thu, 24 Oct 2013 00:09:31 -0700 (PDT) X-Received: by 10.66.121.68 with SMTP id li4mr1726142pab.33.1382598569732; Thu, 24 Oct 2013 00:09:29 -0700 (PDT) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx.google.com with ESMTPS id bc2si1056793pad.245.2013.10.24.00.09.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 00:09:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of takahiro.akashi@linaro.org) client-ip=209.85.220.43; Received: by mail-pa0-f43.google.com with SMTP id hz1so2063703pad.2 for ; Thu, 24 Oct 2013 00:09:29 -0700 (PDT) X-Received: by 10.68.194.97 with SMTP id hv1mr1370059pbc.162.1382598569281; Thu, 24 Oct 2013 00:09:29 -0700 (PDT) Received: from localhost.localdomain (KD182249089040.au-net.ne.jp. [182.249.89.40]) by mx.google.com with ESMTPSA id go4sm374799pbb.15.2013.10.24.00.09.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Oct 2013 00:09:28 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, linux-arm-kernel@lists.infradead.org, gkulkarni@caviumnetworks.com, AKASHI Takahiro Subject: [PATCH v2 4/6] ftrace: Add arm64 support to recordmcount Date: Thu, 24 Oct 2013 16:08:06 +0900 Message-Id: <1382598488-13511-5-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1382598488-13511-1-git-send-email-takahiro.akashi@linaro.org> References: <1382598488-13511-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.220.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 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 scans every object, finds out all the locations of calling _mcount() and puts them into __mcount_loc section. linker compiles all the information in between __start_mcount_loc and __stop_mcount_loc for later use by ftrace. There are two types of implementation, C or Perl. In arm64, only C version is used since HAVE_C_RECORDMCOUNT is defined. 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 c150430..4f4a0dc 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -19,11 +19,13 @@ 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 select HAVE_DMA_ATTRS select HAVE_DYNAMIC_FTRACE + 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 a674fd5..ae8b0fe 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";