Received: by 10.223.148.5 with SMTP id 5csp7696048wrq; Thu, 18 Jan 2018 08:28:05 -0800 (PST) X-Google-Smtp-Source: ACJfBosyjtMygWoDQJVuCItOPgeVTXZH5QD5occBaDA9zOd0OfuPhedMiI4AF0yL/XU45T+G1gri X-Received: by 10.99.124.2 with SMTP id x2mr25224771pgc.184.1516292885600; Thu, 18 Jan 2018 08:28:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516292885; cv=none; d=google.com; s=arc-20160816; b=UE3kXndvccivxZnAh9nYNvMfg5zOPsShZNEYDDk4dv1SAwzEiv2zdhSY4Z6JDzHEVs Igya7m+FWpmc4tmkFbLZsgDBldAIa7tltWjVs4FeW57LPOnJXbXvAHqxiYSig9Wm+goj XjkNSogOYsuQBsrDryJoAoPTmdPwTQMfurvLc16uQyiSHNOG3YI5TZLCvg8qDE4jdJc+ wxutdpu+tKxy3B3c7h1z+aZDHfFWLdPfM+SRMof9TpWpMGOIcDUhVYI27gm/oWnXpCN0 ZwDo8qSXzP6fy2BmVbM1OxFarbQlOqPeGGkWI+dKrQFVLxKIF3278Dzkwki4K741HoMo rpEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=wZgnbLs3t7nECo1bjK/b4A46HLxudrf7UbsaEOV/04w=; b=OQDdNdO6xZfn7Pfkx/iHJUGyWcpC691XlxSE7egCfr4d+t6nUwZiS+1TrPkZk+OaZq VqFuC72b0DNpmIWUe0dKqqV1N428fCt0Lebo64L5hCVxt6jjTC+0ulAwpRmFtQoTl8DL 9qGLL6k0tmc7vZOGleP9gnZ+srRSlF3n4Pv+62bdgeaof5NoQ5vqpplu8sVm3TN+BWBe IJJNUJ1MnH8fXYn8RraDtRqpK2HWisp4RrM7cUvm6zhZtLMaAYT7vYkiNYv2qkMm5//m Mzn+6mUfmen3mQi7Rc3peoRdlMRDOXEczHStbjT2O7PlDEmG57zLtEn+95YCPLn0DYZx kLkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CMvl1hyC; 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 u79si2773367pfi.315.2018.01.18.08.27.51; Thu, 18 Jan 2018 08:28:05 -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=CMvl1hyC; 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 S1756195AbeARPxY (ORCPT + 99 others); Thu, 18 Jan 2018 10:53:24 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35310 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932921AbeARPwA (ORCPT ); Thu, 18 Jan 2018 10:52:00 -0500 Received: by mail-pf0-f194.google.com with SMTP id t12so14909641pfg.2 for ; Thu, 18 Jan 2018 07:52:00 -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; bh=wZgnbLs3t7nECo1bjK/b4A46HLxudrf7UbsaEOV/04w=; b=CMvl1hyCdE9Xwl8U51rjZsED5NnfdZ2kGugK1UlWCeCu0j7Y49ip713nrT7vaRBKet w59LaPd9fUPpeMdhbQPnpbhARWmn8wPMQzfvB1nMxuVua4gtczlhg/k5/A4rsCdjmFdu YkhbICBR3XmiicILmxW/l4o1R3NdfC3wTU22V5MaLRbM0hZsEbpAXpbqxwDc86XgbguX pnWxNTesivEMTB1AMswJZy3fhk6IxFUVoFgjvKFKqbfxhveMtzfSxkVh1idhjCtQkTxW cGQqiHRCVlS/BRTRBZ7QXQW6hIpJLClseuq9Uj+y/JoPQlvLCA39YcfyiGUjpsBSIiW4 5NiQ== 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; bh=wZgnbLs3t7nECo1bjK/b4A46HLxudrf7UbsaEOV/04w=; b=mpea6P/xQLZKQE8AoOf5CI4o0SPOsbO9CaSHPtyc6YPfeBQlpDYrqi8biEyVUDIeti GvtLobOHcb9KUedOMNnG0QnkJFwN2oTIwP7VfUX/WAM6q/OhC/imJnvP7Qnda5my0+aN 35Js1v/zQOZIonmOIX/dVXWKm9dZZJ6fW96s2VBaZ4kYj62mVqPhtdixwJw8W4WcX7N8 Z61Mip15d5Xf9YPIsKTQVOOjMmXCha+rYz9Sam8vUaL+B0EtlejnKDWYlJtmllpU0tXU rDWg/vSh2rsk+UPq3MBsyZitI5mkNhnOYACGhXArKVBo0ddN3vS50yaMvNRwGyyxnzd+ Sgeg== X-Gm-Message-State: AKwxytcykcJt+NfA8FQbIjR1nKqHihCptzNoO6Hbjq5AnLD0UxgqNtUm 82VHxXsEZJKQtzywUpRm7iY= X-Received: by 10.98.144.79 with SMTP id a76mr22706670pfe.15.1516290363645; Thu, 18 Jan 2018 07:46:03 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 07:46:02 -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 0/6] Add dynamic ftrace support for RISC-V platforms Date: Thu, 18 Jan 2018 23:45:39 +0800 Message-Id: <20180118154545.17987-1-alankao@andestech.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set includes the building blocks of dynamic ftrace features for RISC-V machines. Changes in v3: - Replace the nops at the tracer call sites into a "call ftrace_stub" instruction for better understanding (1/6 and 2/6) Changes in v2: - Fix the return value as writing to kernel text goes wrong (2/6) - Replace manual comparisons by calling memcmp (2/6) - Simplify the conditional assignment in the Makefile (1/6) Alan Kao (6): riscv/ftrace: Add RECORD_MCOUNT support riscv/ftrace: Add dynamic function tracer support riscv/ftrace: Add dynamic function graph tracer support riscv/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support riscv/ftrace: Add DYNAMIC_FTRACE_WITH_REGS support riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support arch/riscv/Kconfig | 3 + arch/riscv/Makefile | 3 + arch/riscv/include/asm/ftrace.h | 47 ++++++++ arch/riscv/kernel/Makefile | 5 +- arch/riscv/kernel/ftrace.c | 142 ++++++++++++++++++++++- arch/riscv/kernel/mcount-dyn.S | 241 ++++++++++++++++++++++++++++++++++++++++ arch/riscv/kernel/mcount.S | 22 ++-- arch/riscv/kernel/stacktrace.c | 6 + scripts/recordmcount.pl | 5 + 9 files changed, 461 insertions(+), 13 deletions(-) create mode 100644 arch/riscv/kernel/mcount-dyn.S -- 2.15.1