ftrace: Allow to remove a single function from function graph filter

Previous thread: oprofile/x86: remove node check in AMD IBS initialization by Linux Kernel Mailing List on Sunday, February 28, 2010 - 11:59 am. (1 message)

Next thread: perf: Use format string of printf to align strings by Linux Kernel Mailing List on Sunday, February 28, 2010 - 11:59 am. (1 message)
From: Linux Kernel Mailing List
Date: Sunday, February 28, 2010 - 11:59 am

Gitweb:     http://git.kernel.org/linus/c7c6b1fe9f942c1a30585ec2210a09dfff238506
Commit:     c7c6b1fe9f942c1a30585ec2210a09dfff238506
Parent:     ede55c9d78101fef0d8e620940a5163f14b02f29
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Wed Feb 10 15:43:04 2010 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Thu Feb 11 14:32:38 2010 -0500

    ftrace: Allow to remove a single function from function graph filter
    
    I don't see why we can only clear all functions from the filter.
    
    After patching:
    
      # echo sys_open > set_graph_function
      # echo sys_close >> set_graph_function
      # cat set_graph_function
      sys_open
      sys_close
      # echo '!sys_close' >> set_graph_function
      # cat set_graph_function
      sys_open
    
    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    LKML-Reference: <4B726388.2000408@cn.fujitsu.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c |   51 +++++++++++++++++++++++++++++-------------------
 kernel/trace/trace.h  |    3 +-
 2 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 7968762..43bec99 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2426,6 +2426,7 @@ static const struct file_operations ftrace_notrace_fops = {
 static DEFINE_MUTEX(graph_lock);
 
 int ftrace_graph_count;
+int ftrace_graph_filter_enabled;
 unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly;
 
 static void *
@@ -2448,7 +2449,7 @@ static void *g_start(struct seq_file *m, loff_t *pos)
 	mutex_lock(&graph_lock);
 
 	/* Nothing, tell g_show to print all functions are enabled */
-	if (!ftrace_graph_count && !*pos)
+	if (!ftrace_graph_filter_enabled && !*pos)
 		return (void *)1;
 
 	return __g_next(m, pos);
@@ -2494,6 +2495,7 @@ ftrace_graph_open(struct inode *inode, struct file *file)
 	mutex_lock(&graph_lock);
 	if ((file->f_mode & FMODE_WRITE) &&
 	    ...
Previous thread: oprofile/x86: remove node check in AMD IBS initialization by Linux Kernel Mailing List on Sunday, February 28, 2010 - 11:59 am. (1 message)

Next thread: perf: Use format string of printf to align strings by Linux Kernel Mailing List on Sunday, February 28, 2010 - 11:59 am. (1 message)