Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933083AbcKOUbv (ORCPT ); Tue, 15 Nov 2016 15:31:51 -0500 Received: from mail-pf0-f171.google.com ([209.85.192.171]:33713 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753761AbcKOUbo (ORCPT ); Tue, 15 Nov 2016 15:31:44 -0500 From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: Steven Rostedt , Joel Fernandes , Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck Subject: [PATCH v2 2/2] pstore: Use global ftrace filters for function trace filtering Date: Tue, 15 Nov 2016 12:31:21 -0800 Message-Id: <1479241881-75221-2-git-send-email-joelaf@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1479241881-75221-1-git-send-email-joelaf@google.com> References: <1479241881-75221-1-git-send-email-joelaf@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1278 Lines: 37 Currently, pstore doesn't have any filters setup for function tracing. This has the associated overhead and may not be useful for users looking for tracing specific set of functions. ftrace's regular function trace filtering is done writing to tracing/set_ftrace_filter however this is not available if not requested. Inorder to be able to use this feature, the support to request global filtering introduced earlier in the series should be requested before registering the ftrace ops. Here we do the same. Signed-off-by: Joel Fernandes --- fs/pstore/ftrace.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/pstore/ftrace.c b/fs/pstore/ftrace.c index d488770..6887fbe 100644 --- a/fs/pstore/ftrace.c +++ b/fs/pstore/ftrace.c @@ -71,10 +71,13 @@ static ssize_t pstore_ftrace_knob_write(struct file *f, const char __user *buf, if (!on ^ pstore_ftrace_enabled) goto out; - if (on) + if (on) { + ftrace_ops_set_global_filter(&pstore_ftrace_ops); ret = register_ftrace_function(&pstore_ftrace_ops); - else + } else { ret = unregister_ftrace_function(&pstore_ftrace_ops); + } + if (ret) { pr_err("%s: unable to %sregister ftrace ops: %zd\n", __func__, on ? "" : "un", ret); -- 2.8.0.rc3.226.g39d4020