Received: by 10.223.148.5 with SMTP id 5csp7694779wrq; Thu, 18 Jan 2018 08:27:13 -0800 (PST) X-Google-Smtp-Source: ACJfBoswVVgCM8kFhMoNaeFL7ydOb3QhMhYmMAshGuho7XOhQQfKCQTPkLzb4HwU60YotKq+p7lo X-Received: by 2002:a17:902:47:: with SMTP id 65-v6mr45600pla.282.1516292833586; Thu, 18 Jan 2018 08:27:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516292833; cv=none; d=google.com; s=arc-20160816; b=BQtXtX2Pllzyp29OiJIVbuJonil2kCia3HqE4LT9tgZfQzpBkSbiBc3b9ewmdnEdn5 a/HIMWrNmGwqgeazz79sOOZv8LJ47lINBkA0366M56AjrM9eAsxttyVuW/5XVIe71Wkn esIHc74OfIhCszPb03HvSAAPeBRMs32efXDyz5q1VSUl7Nm3z8CDQAkLmL4z9towwQgQ 8M1YHPc0/het+xqYiDN1A1TlZhorKgX4nt7ynCMlbzhXULBDbufvPcNstyPLVoJOfrKR /zQnQN5kWzwA4HgxnKNpEmcynAx8s23VR0h+Bths2oLyjJg2SQLgnpuZtDMKVi0QetPU PXfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=I0bEI0WFaRmvzFlz4EBFqLvT2/ahvgcrrpYLk5fFk/M=; b=o9RPXmntuACg1eQVvpWVTGxhIXVbtH9jb7/rT9JeniqGIjxFsLIC08Mp1fcI+qhkLu +lqhAihEozrW+3SzIq5gzM+OoInp5F72oPXDsh1ZAa9KapUItx9dina2wXbopDyjNky6 mlyLXXISH4ID2YJoFb9ugT+A9VNpYyt+F9FNEcD6BtIVCTEBi0YagD1J5IJK5b4ddCNE sfGLvT4Pl3HWRYrngcnmZ8VlH3Jd8DHHgqSQftLHCZBDIZoOGDKhjTKKFBtJsTirPfqi wwdpQoPxS2MZGMAb7wwBue7MZ1lbHhUs1vKlr28A3cuuOX/SMzN4DHthhiXPBE0JacMe iGmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qV1vazJH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r88si7143439pfi.263.2018.01.18.08.26.58; Thu, 18 Jan 2018 08:27:13 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qV1vazJH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932907AbeARPvy (ORCPT + 99 others); Thu, 18 Jan 2018 10:51:54 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:37444 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932887AbeARPvs (ORCPT ); Thu, 18 Jan 2018 10:51:48 -0500 Received: by mail-pf0-f195.google.com with SMTP id p1so14901607pfh.4 for ; Thu, 18 Jan 2018 07:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=I0bEI0WFaRmvzFlz4EBFqLvT2/ahvgcrrpYLk5fFk/M=; b=qV1vazJHswhGdIq6F77WIJ+B1p+o4gTGF7+UH5NiX1tfpy7cw5VE7s6q+8TU2eTxDQ CiQIgeFCTwoI0VDdmbMq2WIBCLPsUFE3COdT4PQF9Q5w0ZFwhbtDq1zsYJ4CihoSACjG M9ulbiJ/LtL9x6Q1F7BhkfgZwNx3wGsbJ5evntZ2wr2YGILI2xUU244U91XKW+gMzWj+ 8zKu6aRNUC62sfmrZ9JGcyYVTDnsGsGzi80kmcoTfi55BnVsLWaCFPiYbFjXwHwGIiQ/ PsoDEM3xdcBoGqOP6ReVZw1L2LhhrxSNOq5ICnY3Hfe4S5cqxmlUpWfnpysnXh9LCl8c fOeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=I0bEI0WFaRmvzFlz4EBFqLvT2/ahvgcrrpYLk5fFk/M=; b=uV9F1P/sY+DVV3Ko4+jq2EEPYQmBbB9XTee15VljXjcQuuUy58jAGbsgRWPYXK0J6I 4iCKSrdotqzdXKFF0GpwrL45PTYYw9sln3dButmhWm+WPrJ7CywhbDjL4LauugyVO01O dRxoqbbslIBtr9rLtzFRkd9Y1qI2P/HeJk5iHPECjVJS3CA1gP/kp1gW9zLEAGkPKITH /PjENf1ZrjjdrOY9ccbr3FJQuAj7bdkflQny/nGbG1E7ZbapBEdRf0ao0YUr3ctn2/Ck jhTIx6s6Bc4NaUe2gBiN7WC6arYP3MrI/2FEtaANFsqxbOCSYZTW8aUwwVca+SKiLrx3 OwNg== X-Gm-Message-State: AKGB3mIazFyQG8rbXN1QRro3Qx0OMNJ3d953cpqZGFuZeI0FHU+H3nQp rhREYYJ5XqCWBSU7Z2+JiZ4= X-Received: by 10.98.98.5 with SMTP id w5mr42258853pfb.233.1516290366837; Thu, 18 Jan 2018 07:46:06 -0800 (PST) Received: from localhost.localdomain (114-37-171-238.dynamic-ip.hinet.net. [114.37.171.238]) by smtp.gmail.com with ESMTPSA id f188sm14571465pfc.22.2018.01.18.07.46.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 07:46:05 -0800 (PST) From: Alan Kao X-Google-Original-From: Alan Kao To: Palmer Dabbelt , Albert Ou , Steven Rostedt , Ingo Molnar , Masahiro Yamada , Kamil Rytarowski , Andrew Morton , patches@groups.riscv.org, linux-kernel@vger.kernel.org, Stefan O'Rear Cc: Alan Kao , Greentime Hu Subject: [PATCH v3 1/6] riscv/ftrace: Add RECORD_MCOUNT support Date: Thu, 18 Jan 2018 23:45:40 +0800 Message-Id: <20180118154545.17987-2-alankao@andestech.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180118154545.17987-1-alankao@andestech.com> References: <20180118154545.17987-1-alankao@andestech.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now recordmcount.pl recognizes RISC-V object files. For the mechanism to work, we have to disable the linker relaxation. Cc: Greentime Hu Signed-off-by: Alan Kao --- arch/riscv/Kconfig | 1 + arch/riscv/Makefile | 3 +++ scripts/recordmcount.pl | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 40a67fc12328..1f45a76f412e 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -117,6 +117,7 @@ config ARCH_RV64I select 64BIT select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_GRAPH_TRACER + select HAVE_FTRACE_MCOUNT_RECORD endchoice diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 6719dd30ec5b..899226e0da7d 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -11,6 +11,9 @@ LDFLAGS := OBJCOPYFLAGS := -O binary LDFLAGS_vmlinux := +ifeq ($(CONFIG_DYNAMIC_FTRACE),y) + LDFLAGS_vmlinux := --no-relax +endif KBUILD_AFLAGS_MODULE += -fPIC KBUILD_CFLAGS_MODULE += -fPIC diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 2033af758173..d44d55db7c06 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -376,6 +376,11 @@ if ($arch eq "x86_64") { $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$"; $type = ".quad"; $alignment = 8; +} elsif ($arch eq "riscv") { + $function_regex = "^([0-9a-fA-F]+)\\s+<([^.0-9][0-9a-zA-Z_\\.]+)>:"; + $mcount_regex = "^\\s*([0-9a-fA-F]+):\\sR_RISCV_CALL\\s_mcount\$"; + $type = ".quad"; + $alignment = 2; } else { die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD"; } -- 2.15.1