Received: by 10.223.148.5 with SMTP id 5csp7698602wrq; Thu, 18 Jan 2018 08:29:46 -0800 (PST) X-Google-Smtp-Source: ACJfBoszrdcIuaF+cZSAt8iVuBybfiNXtH/o/ZpmPjImdWt1Ish/YYmSTNHry2NeDYmgD7EG1FtX X-Received: by 2002:a17:902:9002:: with SMTP id a2-v6mr49505plp.331.1516292986034; Thu, 18 Jan 2018 08:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516292985; cv=none; d=google.com; s=arc-20160816; b=Q8S+0JbTYzcr8j57U04scBUS+lFVd52HCY5aLuQ0dUAIHARsxmXdosficFbzgIkF04 5jvn53CBkm/aARkHkxBxg6vD3zcgmZM8Q9neqzb+v5XDHwhMIoqUOy38VvuvZodr8icS /Xx1Oin6Wa0Mbxmw/PPKi56AGp6xQR8m8cfjP87t3QsNmpBmGrbORuRurVXtIkuM5cHn +wDA3sXcZ1AR+2krTUQyWOs9rXHTEGXyzykH5+4FIcNB1eGDLMpaoR36jMTsv69eJ5zt rSNAjQpzhAYxlUWkUPhcRX78HMqEItzxJ2acpVUm4aSqto4hXhC3Zv4VF0zY2gFEJM8y yFXA== 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=7o4guTChJctu7fUJmZnZvtVqSfhCQ7Ms8CCn1C+bxAY=; b=CmQ1naG6gpQTd6lIg5oQl4fadeNq3vj+UVZ7ylN6PQh2f0/ba5ZhuboIFH46Mi/WGj QA+hFfiABVTUPgh9Kr1hwRpSPohUsTd2JYO4aXeVBOM5T7sN2BRuh19aiOu1lgRkrD9D FZemM+DXaSOuR5X2FaSCnNDRrzLjcElUuCyPbf0FyJAG4WWgRQwrjPJp9o4wpouxIgP4 Xe6ZZUYkHT3T3JX+yI0wGwjC+ZP7H5aAlujeaDAfADGfaLi2xmFOKuBcE1WeLTS26Ied 9L9AE71Vya9OT2vzs/FGDcXbpjK+vcmieOQ8IYKjzNpfkfkN2E6wQ4Ema84VccXjOspt mQZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gC/jOJB3; 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 y77si7342117pfj.328.2018.01.18.08.29.32; Thu, 18 Jan 2018 08:29:45 -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=gC/jOJB3; 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 S932976AbeARPyB (ORCPT + 99 others); Thu, 18 Jan 2018 10:54:01 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:37797 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756117AbeARPxT (ORCPT ); Thu, 18 Jan 2018 10:53:19 -0500 Received: by mail-pf0-f196.google.com with SMTP id p1so14905079pfh.4 for ; Thu, 18 Jan 2018 07:53:18 -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=7o4guTChJctu7fUJmZnZvtVqSfhCQ7Ms8CCn1C+bxAY=; b=gC/jOJB3wMnzljxxBN29UmI33v6eRZWVn1YVPZiZX6JdWe0E/KX+kcrAe6UFgQmxWX 2K2qsIZ+culQ28LDZj5vklXdM0Hw0NyGjp6VzKw8Cl7mkxOaoYrbFa5LGerl8QRUXq+D U6i+dp9Dk8y2pUXQjoL64YY/64ANMyLY5zw3YbYDmSsTvsPrj0Tn+59aHJ9naxbjs3Br PS0ago/XF+ktQxlWNOQEoD3yOge4LKx/xx1fllIdd+eb0fQbJOsG3q0MmwLks6wfBwDt PqvVLuaYRq2p5dyp75yXJK+KpEuFYEbFsN3C63mByP0LJE/1OFrw1a/zlvdJ7K7VbeYl Hc9A== 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=7o4guTChJctu7fUJmZnZvtVqSfhCQ7Ms8CCn1C+bxAY=; b=ONjX9U4UYvc26ZowvHiERIesWUgPjJrurnpwv61Aedi38mpeUgVeIh2pvKlteUDLlE ldzfnxZsk+I615f5Icb3yu1L//6caVQLG8PhtY1ai7VRZDTpD0rkg2iqU7knjNGls8WO Rw3ao8rWR70yY6jSSlN3gBunWVDp0nJx9yk9K7fZnsCTDE26urvH+FhiipJYl2uK+7DQ 20GAUyG4dXqHjkgQ/dXT9zgozPjpWhA8ZavNlFXoC192k40YCYrE41PEHSxTGH0HsMyd B4T3zjEoSuw1ISKAEIluWLPhopjaBDJDBYJM6veY0/LVxDgnYQqtBuA6aghS2292HKIT 9pXA== X-Gm-Message-State: AKGB3mLoKpH9cIUcAf4BjyO14qV9nCgObxyZvYUuOjldGaeMiCe7g0kB 4WE3ZJ/aRzwnpp39gAw73eE= X-Received: by 10.99.114.23 with SMTP id n23mr30661069pgc.407.1516290376299; Thu, 18 Jan 2018 07:46:16 -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.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 07:46:15 -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 4/6] riscv/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support Date: Thu, 18 Jan 2018 23:45:43 +0800 Message-Id: <20180118154545.17987-5-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 Cc: Greentime Hu Signed-off-by: Alan Kao --- arch/riscv/include/asm/ftrace.h | 1 + arch/riscv/kernel/mcount-dyn.S | 3 +++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/include/asm/ftrace.h b/arch/riscv/include/asm/ftrace.h index acf0c7d001f3..429a6a156645 100644 --- a/arch/riscv/include/asm/ftrace.h +++ b/arch/riscv/include/asm/ftrace.h @@ -9,6 +9,7 @@ #define HAVE_FUNCTION_GRAPH_FP_TEST #endif +#define ARCH_SUPPORTS_FTRACE_OPS 1 #ifndef __ASSEMBLY__ void _mcount(void); static inline unsigned long ftrace_call_adjust(unsigned long addr) diff --git a/arch/riscv/kernel/mcount-dyn.S b/arch/riscv/kernel/mcount-dyn.S index 1ddf8b1a9345..c8959bdd4f38 100644 --- a/arch/riscv/kernel/mcount-dyn.S +++ b/arch/riscv/kernel/mcount-dyn.S @@ -74,9 +74,12 @@ ENTRY(ftrace_caller) /* * a0: the address in the caller when calling ftrace_caller * a1: the caller's return address + * a2: the address of global variable function_trace_op */ ld a1, -8(s0) addi a0, ra, -MCOUNT_INSN_SIZE + la t5, function_trace_op + ld a2, 0(t5) #ifdef CONFIG_FUNCTION_GRAPH_TRACER /* -- 2.15.1