Received: by 10.223.176.5 with SMTP id f5csp209427wra; Thu, 1 Feb 2018 18:42:14 -0800 (PST) X-Google-Smtp-Source: AH8x227mv/KjaX5NCIUa+FOM4Xlv3Bqav3y5Il9AZiGlLsQE5NPS6nieYU1o3/nLFKpFwA4HPHU9 X-Received: by 2002:a17:902:aa0b:: with SMTP id be11-v6mr17757464plb.250.1517539333914; Thu, 01 Feb 2018 18:42:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517539333; cv=none; d=google.com; s=arc-20160816; b=RTZF31qKb896RZ6vwgivhks+8hjDeCXq38krzBhMCztR+eEaSEUim4HvNa7Im3F4S2 GKypjKMrohQvwE2khnnrxNcrUwpr6lneXCwc/4OIb7IX21dBRqDPZTtaNiKvZiigq87p B3/KiIgEAlU2pRS8qb4biWMsFWKmPJ4lnEfrWUSX55QgWoLBSsZZw67aHl72v1bzk3ZI Oo1j5qP97+4nqHZ9kYoGd/0nkqZWrksg8k12ywdOJ/vdQvWGdnvE4ii+7XbbIcgAkCyj 2Lhiio03FLOWl936B5YMbb30BZlQ/9gEGnYwMr7eF5OPx8Hub6QMpovmAxAEokO90uxG SFRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=ozszEAoabpl2t3OU6LKoS2UrXlOr6rZLF9tyX/dhke8=; b=eqomn/MRmM1JYYKCfJebK3KKOMJnN7GUN22RRNSxLtkO0QNM3npb1+hobEo/jarGak zryMhGozWefCcpE5C51rcjGpyg3EyKxP8nWXJ1Z8Ew3vTWlPNbyYSfbbYHJmftABXeyK oFYHyWLAo3HXI4znBWpia+o9VObn0nC1rtSIvFkCifmb6L4lQRVTNDloivMTd9wqeGdO YQTHbw5h4Rg3VNEghnP07shS3fnkoLX/btiq3JVsBgVz27zhkzTLMvZbxqm5wyUfNgKv PiDDSM/6eX5uHqibIHjvMNo3xS56oZdtd6/RYms5FcYxOlnQtWVtOzQOm8OGU8XmcNbI 3QzA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si848194plj.456.2018.02.01.18.41.57; Thu, 01 Feb 2018 18:42: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755188AbeBBCYI (ORCPT + 99 others); Thu, 1 Feb 2018 21:24:08 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:38745 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754363AbeBBCYD (ORCPT ); Thu, 1 Feb 2018 21:24:03 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 3AD616DF8C94F; Fri, 2 Feb 2018 10:23:58 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.361.1; Fri, 2 Feb 2018 10:23:50 +0800 From: Yisheng Xie To: , CC: , Yisheng Xie Subject: [PATCH] ftrace: nuke clear_ftrace_function Date: Fri, 2 Feb 2018 10:14:49 +0800 Message-ID: <1517537689-34947-1-git-send-email-xieyisheng1@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clear_ftrace_function is not used outside of ftrace.c and is not help to use a function, so nuke it per Steve's suggestion. Suggested-by: Steven Rostedt Signed-off-by: Yisheng Xie --- include/linux/ftrace.h | 2 -- kernel/trace/ftrace.c | 13 +------------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 9c3c9a3..15518b5 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -223,7 +223,6 @@ enum ftrace_tracing_type_t { */ int register_ftrace_function(struct ftrace_ops *ops); int unregister_ftrace_function(struct ftrace_ops *ops); -void clear_ftrace_function(void); extern void ftrace_stub(unsigned long a0, unsigned long a1, struct ftrace_ops *op, struct pt_regs *regs); @@ -239,7 +238,6 @@ static inline int ftrace_nr_registered_ops(void) { return 0; } -static inline void clear_ftrace_function(void) { } static inline void ftrace_kill(void) { } static inline void ftrace_free_init_mem(void) { } static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { } diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index dabd9d1..6263a98 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -192,17 +192,6 @@ static void ftrace_pid_func(unsigned long ip, unsigned long parent_ip, op->saved_func(ip, parent_ip, op, regs); } -/** - * clear_ftrace_function - reset the ftrace function - * - * This NULLs the ftrace function and in essence stops - * tracing. There may be lag - */ -void clear_ftrace_function(void) -{ - ftrace_trace_function = ftrace_stub; -} - static void ftrace_sync(struct work_struct *work) { /* @@ -6691,7 +6680,7 @@ void ftrace_kill(void) { ftrace_disabled = 1; ftrace_enabled = 0; - clear_ftrace_function(); + ftrace_trace_function = ftrace_stub; } /** -- 1.7.12.4