From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 214D1C4646D for ; Wed, 15 Aug 2018 09:35:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAC1B2168D for ; Wed, 15 Aug 2018 09:35:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAC1B2168D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728980AbeHOM1V (ORCPT ); Wed, 15 Aug 2018 08:27:21 -0400 Received: from exmail.andestech.com ([59.124.169.137]:58910 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728576AbeHOM1U (ORCPT ); Wed, 15 Aug 2018 08:27:20 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w7F9Y1lP011234; Wed, 15 Aug 2018 17:34:01 +0800 (GMT-8) (envelope-from zong@andestech.com) Received: from atcsqa06.andestech.com (10.0.1.85) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Wed, 15 Aug 2018 17:35:27 +0800 From: Zong Li To: , , , , , CC: , , Zong Li Subject: [PATCH 0/6] Support ftrace on NDS32 architecture Date: Wed, 15 Aug 2018 17:35:17 +0800 Message-ID: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.1.85] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w7F9Y1lP011234 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set implements the ftrace function and function graph tracer on NDS32 architecture. We try to use C code to do everything, so we don't need to separate the implementation to assembly code and C code, we just need one ftrace.c file. In mcount function, we use the prologue/epilogue which generated by compiler to help us to save/restore the status. On the other hand, we use naked attribute of gcc to avoid to generate the prologue/epilogue when we don't need it(such as ftrace_stub and return_to_handler). We pass the following tests: 1. FTRACE_STARTUP_TEST: PASS 2. tools/testing/selftests/ftrace/: # of passed: 28 # of failed: 1 # of unresolved: 0 # of untested: 0 # of unsupported: 38 # of xfailed: 0 # of undefined(test bug): 0 The failed case is func-filter-glob.tc. When setting the '*aw*lock' to the set_ftrace_filter in this test case, we got the error because we have no these functions such as _raw_spin_lock, _raw_spin_trylock and so on in our kernel. Zong Li (6): nds32/ftrace: Support static function tracer nds32/ftrace: Support static function graph tracer nds32/ftrace: Add RECORD_MCOUNT support nds32/ftrace: Support dynamic function tracer nds32/ftrace: Support dynamic function graph tracer nds32/stack: Get real return address by using ftrace_graph_ret_addr arch/nds32/Kconfig | 4 + arch/nds32/Makefile | 4 + arch/nds32/include/asm/ftrace.h | 46 +++++++ arch/nds32/kernel/Makefile | 6 + arch/nds32/kernel/ftrace.c | 297 ++++++++++++++++++++++++++++++++++++++++ arch/nds32/kernel/stacktrace.c | 4 + arch/nds32/kernel/traps.c | 30 +--- scripts/recordmcount.pl | 3 + 8 files changed, 370 insertions(+), 24 deletions(-) create mode 100644 arch/nds32/include/asm/ftrace.h create mode 100644 arch/nds32/kernel/ftrace.c -- 2.7.4