All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] tracing/core updates
@ 2009-10-13  7:38 Frederic Weisbecker
  2009-10-13  7:38 ` [PATCH 1/3] ftrace: add kernel command line graph function filtering Frederic Weisbecker
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2009-10-13  7:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Stefan Assmann, Steven Rostedt,
	Li Zefan

Ingo,

Please pull the tracing/core branch that can be found at

  git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
	tracing/core

Thanks.

Frederic Weisbecker (2):
      tracing: Rename set_ftrace to set_bootup_ftrace
      tracing: Remove unused ftrace_trace_addr helper

Stefan Assmann (1):
      ftrace: add kernel command line graph function filtering

 Documentation/kernel-parameters.txt |    7 +++++++
 kernel/trace/ftrace.c               |   34 ++++++++++++++++++++++++++++++++++
 kernel/trace/trace.c                |    4 ++--
 kernel/trace/trace.h                |    4 ----
 4 files changed, 43 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] ftrace: add kernel command line graph function filtering
  2009-10-13  7:38 [GIT PULL] tracing/core updates Frederic Weisbecker
@ 2009-10-13  7:38 ` Frederic Weisbecker
  2009-10-13  8:06   ` Li Zefan
  2009-10-13  7:38 ` [PATCH 2/3] tracing: Rename set_ftrace to set_bootup_ftrace Frederic Weisbecker
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Frederic Weisbecker @ 2009-10-13  7:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Stefan Assmann, Steven Rostedt, Li Zefan,
	Frederic Weisbecker

From: Stefan Assmann <sassmann@redhat.com>

Add a command line parameter to allow limiting the function graphs
that are traced on boot up from the given top-level callers , when
ftrace=function_graph is specified.

This patch adds the following command line option:
ftrace_graph_filter=function-list

Where function-list is a comma separated list of functions to filter.

[fweisbec@gmail.com: picked the documentation changes from the v2 patch]

Signed-off-by: Stefan Assmann <sassmann@redhat.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <4AD2DEB9.2@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 Documentation/kernel-parameters.txt |    7 +++++++
 kernel/trace/ftrace.c               |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 6fa7292..1dc4b9c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -778,6 +778,13 @@ and is between 256 and 4096 characters. It is defined in the file
 			by the set_ftrace_notrace file in the debugfs
 			tracing directory.
 
+	ftrace_graph_filter=[function-list]
+			[FTRACE] Limit the top level callers functions traced
+			by the function graph tracer at boot up.
+			function-list is a comma separated list of functions
+			that can be changed at run time by the
+			set_graph_function file in the debugfs tracing directory.
+
 	gamecon.map[2|3]=
 			[HW,JOY] Multisystem joystick and NES/SNES/PSX pad
 			support via parallel port (up to 5 devices per port)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 9a72853..91283d4 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -78,6 +78,10 @@ ftrace_func_t ftrace_trace_function __read_mostly = ftrace_stub;
 ftrace_func_t __ftrace_trace_function __read_mostly = ftrace_stub;
 ftrace_func_t ftrace_pid_function __read_mostly = ftrace_stub;
 
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+static int ftrace_set_func(unsigned long *array, int *idx, char *buffer);
+#endif
+
 static void ftrace_list_func(unsigned long ip, unsigned long parent_ip)
 {
 	struct ftrace_ops *op = ftrace_list;
@@ -2248,6 +2252,7 @@ void ftrace_set_notrace(unsigned char *buf, int len, int reset)
 #define FTRACE_FILTER_SIZE		COMMAND_LINE_SIZE
 static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata;
 static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;
+static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
 
 static int __init set_ftrace_notrace(char *str)
 {
@@ -2263,6 +2268,31 @@ static int __init set_ftrace_filter(char *str)
 }
 __setup("ftrace_filter=", set_ftrace_filter);
 
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+static int __init set_graph_function(char *str)
+{
+	strncpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
+	return 1;
+}
+__setup("ftrace_graph_filter=", set_graph_function);
+
+static void __init set_ftrace_early_graph(char *buf)
+{
+	int ret;
+	char *func;
+
+	while (buf) {
+		func = strsep(&buf, ",");
+		/* we allow only one expression at a time */
+		ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count,
+				      func);
+		if (ret)
+			printk(KERN_DEBUG "ftrace: function %s not "
+					  "traceable\n", func);
+	}
+}
+#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
+
 static void __init set_ftrace_early_filter(char *buf, int enable)
 {
 	char *func;
@@ -2279,6 +2309,10 @@ static void __init set_ftrace_early_filters(void)
 		set_ftrace_early_filter(ftrace_filter_buf, 1);
 	if (ftrace_notrace_buf[0])
 		set_ftrace_early_filter(ftrace_notrace_buf, 0);
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+	if (ftrace_graph_buf[0])
+		set_ftrace_early_graph(ftrace_graph_buf);
+#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 }
 
 static int
-- 
1.6.2.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] tracing: Rename set_ftrace to set_bootup_ftrace
  2009-10-13  7:38 [GIT PULL] tracing/core updates Frederic Weisbecker
  2009-10-13  7:38 ` [PATCH 1/3] ftrace: add kernel command line graph function filtering Frederic Weisbecker
@ 2009-10-13  7:38 ` Frederic Weisbecker
  2009-10-13 13:22   ` Steven Rostedt
  2009-10-13  7:39 ` [PATCH 3/3] tracing: Remove unused ftrace_trace_addr helper Frederic Weisbecker
  2009-10-13 10:04 ` [GIT PULL] tracing/core updates Ingo Molnar
  3 siblings, 1 reply; 10+ messages in thread
From: Frederic Weisbecker @ 2009-10-13  7:38 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML, Frederic Weisbecker, Steven Rostedt, Li Zefan

Do this rename because set_ftrace is too much generic and not enough
self-explainable as a name.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
---
 kernel/trace/trace.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 4506826..866daf8 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -129,7 +129,7 @@ static int tracing_set_tracer(const char *buf);
 static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata;
 static char *default_bootup_tracer;
 
-static int __init set_ftrace(char *str)
+static int __init set_bootup_ftrace(char *str)
 {
 	strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
 	default_bootup_tracer = bootup_tracer_buf;
@@ -137,7 +137,7 @@ static int __init set_ftrace(char *str)
 	ring_buffer_expanded = 1;
 	return 1;
 }
-__setup("ftrace=", set_ftrace);
+__setup("ftrace=", set_bootup_ftrace);
 
 static int __init set_ftrace_dump_on_oops(char *str)
 {
-- 
1.6.2.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] tracing: Remove unused ftrace_trace_addr helper
  2009-10-13  7:38 [GIT PULL] tracing/core updates Frederic Weisbecker
  2009-10-13  7:38 ` [PATCH 1/3] ftrace: add kernel command line graph function filtering Frederic Weisbecker
  2009-10-13  7:38 ` [PATCH 2/3] tracing: Rename set_ftrace to set_bootup_ftrace Frederic Weisbecker
@ 2009-10-13  7:39 ` Frederic Weisbecker
  2009-10-13 10:04 ` [GIT PULL] tracing/core updates Ingo Molnar
  3 siblings, 0 replies; 10+ messages in thread
From: Frederic Weisbecker @ 2009-10-13  7:39 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML, Frederic Weisbecker, Steven Rostedt, Li Zefan

Remove the ftrace_trace_addr() function as only its off-case is
implemented and there are no users of it currently.

But we keep ftrace_graph_addr() off-case, in case someone come to use
the function graph tracer to profit from top-level callers filtering.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
---
 kernel/trace/trace.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 365fb19..f22a7ac 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -483,10 +483,6 @@ static inline int ftrace_graph_addr(unsigned long addr)
 	return 0;
 }
 #else
-static inline int ftrace_trace_addr(unsigned long addr)
-{
-	return 1;
-}
 static inline int ftrace_graph_addr(unsigned long addr)
 {
 	return 1;
-- 
1.6.2.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] ftrace: add kernel command line graph function filtering
  2009-10-13  7:38 ` [PATCH 1/3] ftrace: add kernel command line graph function filtering Frederic Weisbecker
@ 2009-10-13  8:06   ` Li Zefan
  2009-10-13  8:58     ` Frédéric Weisbecker
  0 siblings, 1 reply; 10+ messages in thread
From: Li Zefan @ 2009-10-13  8:06 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: Ingo Molnar, LKML, Stefan Assmann, Steven Rostedt

> +#ifdef CONFIG_FUNCTION_GRAPH_TRACER
> +static int __init set_graph_function(char *str)
> +{
> +	strncpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);

should use strlcpy().

> +	return 1;
> +}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] ftrace: add kernel command line graph function  filtering
  2009-10-13  8:06   ` Li Zefan
@ 2009-10-13  8:58     ` Frédéric Weisbecker
  0 siblings, 0 replies; 10+ messages in thread
From: Frédéric Weisbecker @ 2009-10-13  8:58 UTC (permalink / raw)
  To: Li Zefan; +Cc: Ingo Molnar, LKML, Stefan Assmann, Steven Rostedt

2009/10/13 Li Zefan <lizf@cn.fujitsu.com>:
>> +#ifdef CONFIG_FUNCTION_GRAPH_TRACER
>> +static int __init set_graph_function(char *str)
>> +{
>> +     strncpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
>
> should use strlcpy().
>

Right, I'll fix, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [GIT PULL] tracing/core updates
  2009-10-13  7:38 [GIT PULL] tracing/core updates Frederic Weisbecker
                   ` (2 preceding siblings ...)
  2009-10-13  7:39 ` [PATCH 3/3] tracing: Remove unused ftrace_trace_addr helper Frederic Weisbecker
@ 2009-10-13 10:04 ` Ingo Molnar
  3 siblings, 0 replies; 10+ messages in thread
From: Ingo Molnar @ 2009-10-13 10:04 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: LKML, Stefan Assmann, Steven Rostedt, Li Zefan


* Frederic Weisbecker <fweisbec@gmail.com> wrote:

> Ingo,
> 
> Please pull the tracing/core branch that can be found at
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
> 	tracing/core
> 
> Thanks.
> 
> Frederic Weisbecker (2):
>       tracing: Rename set_ftrace to set_bootup_ftrace
>       tracing: Remove unused ftrace_trace_addr helper
> 
> Stefan Assmann (1):
>       ftrace: add kernel command line graph function filtering
> 
>  Documentation/kernel-parameters.txt |    7 +++++++
>  kernel/trace/ftrace.c               |   34 ++++++++++++++++++++++++++++++++++
>  kernel/trace/trace.c                |    4 ++--
>  kernel/trace/trace.h                |    4 ----
>  4 files changed, 43 insertions(+), 6 deletions(-)

Pulled, thanks Frederic!

	Ingo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] tracing: Rename set_ftrace to set_bootup_ftrace
  2009-10-13  7:38 ` [PATCH 2/3] tracing: Rename set_ftrace to set_bootup_ftrace Frederic Weisbecker
@ 2009-10-13 13:22   ` Steven Rostedt
  2009-10-13 13:35     ` Frederic Weisbecker
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2009-10-13 13:22 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: Ingo Molnar, LKML, Li Zefan

On Tue, 2009-10-13 at 09:38 +0200, Frederic Weisbecker wrote:
> Do this rename because set_ftrace is too much generic and not enough
> self-explainable as a name.
> 
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Li Zefan <lizf@cn.fujitsu.com>
> ---
>  kernel/trace/trace.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 4506826..866daf8 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -129,7 +129,7 @@ static int tracing_set_tracer(const char *buf);
>  static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata;
>  static char *default_bootup_tracer;
>  
> -static int __init set_ftrace(char *str)
> +static int __init set_bootup_ftrace(char *str)
>  {
>  	strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
>  	default_bootup_tracer = bootup_tracer_buf;
> @@ -137,7 +137,7 @@ static int __init set_ftrace(char *str)
>  	ring_buffer_expanded = 1;
>  	return 1;
>  }
> -__setup("ftrace=", set_ftrace);
> +__setup("ftrace=", set_bootup_ftrace);

Actually, it probably should be called, set_cmdline_ftrace. Since it
came from the command line, and that is what is matching.

-- Steve

>  
>  static int __init set_ftrace_dump_on_oops(char *str)
>  {


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] tracing: Rename set_ftrace to set_bootup_ftrace
  2009-10-13 13:22   ` Steven Rostedt
@ 2009-10-13 13:35     ` Frederic Weisbecker
  2009-10-13 13:41       ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Frederic Weisbecker @ 2009-10-13 13:35 UTC (permalink / raw)
  To: rostedt; +Cc: Ingo Molnar, LKML, Li Zefan

2009/10/13 Steven Rostedt <rostedt@goodmis.org>:
> On Tue, 2009-10-13 at 09:38 +0200, Frederic Weisbecker wrote:
>> Do this rename because set_ftrace is too much generic and not enough
>> self-explainable as a name.
>>
>> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
>> Cc: Steven Rostedt <rostedt@goodmis.org>
>> Cc: Li Zefan <lizf@cn.fujitsu.com>
>> ---
>>  kernel/trace/trace.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
>> index 4506826..866daf8 100644
>> --- a/kernel/trace/trace.c
>> +++ b/kernel/trace/trace.c
>> @@ -129,7 +129,7 @@ static int tracing_set_tracer(const char *buf);
>>  static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata;
>>  static char *default_bootup_tracer;
>>
>> -static int __init set_ftrace(char *str)
>> +static int __init set_bootup_ftrace(char *str)
>>  {
>>       strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
>>       default_bootup_tracer = bootup_tracer_buf;
>> @@ -137,7 +137,7 @@ static int __init set_ftrace(char *str)
>>       ring_buffer_expanded = 1;
>>       return 1;
>>  }
>> -__setup("ftrace=", set_ftrace);
>> +__setup("ftrace=", set_bootup_ftrace);
>
> Actually, it probably should be called, set_cmdline_ftrace. Since it
> came from the command line, and that is what is matching.
>
> -- Steve

No problem, I can change that in another request that also addresses
Li's suggestion.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] tracing: Rename set_ftrace to set_bootup_ftrace
  2009-10-13 13:35     ` Frederic Weisbecker
@ 2009-10-13 13:41       ` Steven Rostedt
  0 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2009-10-13 13:41 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: Ingo Molnar, LKML, Li Zefan

On Tue, 2009-10-13 at 15:35 +0200, Frederic Weisbecker wrote:
> 2009/10/13 Steven Rostedt <rostedt@goodmis.org>:

> >> -__setup("ftrace=", set_ftrace);
> >> +__setup("ftrace=", set_bootup_ftrace);
> >
> > Actually, it probably should be called, set_cmdline_ftrace. Since it
> > came from the command line, and that is what is matching.
> >
> > -- Steve
> 
> No problem, I can change that in another request that also addresses
> Li's suggestion.

Yeah, I would label this as an extreme NON-critical change ;-)

-- Steve



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-10-13 13:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-13  7:38 [GIT PULL] tracing/core updates Frederic Weisbecker
2009-10-13  7:38 ` [PATCH 1/3] ftrace: add kernel command line graph function filtering Frederic Weisbecker
2009-10-13  8:06   ` Li Zefan
2009-10-13  8:58     ` Frédéric Weisbecker
2009-10-13  7:38 ` [PATCH 2/3] tracing: Rename set_ftrace to set_bootup_ftrace Frederic Weisbecker
2009-10-13 13:22   ` Steven Rostedt
2009-10-13 13:35     ` Frederic Weisbecker
2009-10-13 13:41       ` Steven Rostedt
2009-10-13  7:39 ` [PATCH 3/3] tracing: Remove unused ftrace_trace_addr helper Frederic Weisbecker
2009-10-13 10:04 ` [GIT PULL] tracing/core updates Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.