From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Namhyung Kim <namhyung@kernel.org>
Subject: [for-next][PATCH 18/21] tracing: Add ftrace_graph_notrace boot parameter
Date: Thu, 03 Jul 2014 12:05:21 -0400 [thread overview]
Message-ID: <20140703161226.536421069@goodmis.org> (raw)
In-Reply-To: 20140703160503.006976702@goodmis.org
[-- Attachment #1: 0018-tracing-Add-ftrace_graph_notrace-boot-parameter.patch --]
[-- Type: text/plain, Size: 3401 bytes --]
From: Namhyung Kim <namhyung@kernel.org>
The ftrace_graph_notrace option is for specifying notrace filter for
function graph tracer at boot time. It can be altered after boot
using set_graph_notrace file on the debugfs.
Link: http://lkml.kernel.org/p/1402590233-22321-2-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
Documentation/kernel-parameters.txt | 6 ++++++
kernel/trace/ftrace.c | 24 ++++++++++++++++++++----
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index c1b9aa8c5a52..19c0a9096a02 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1097,6 +1097,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
that can be changed at run time by the
set_graph_function file in the debugfs tracing directory.
+ ftrace_graph_notrace=[function-list]
+ [FTRACE] Do not trace from the functions specified in
+ function-list. This list is a comma separated list of
+ functions that can be changed at run time by the
+ set_graph_notrace 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 232b898eebbd..17885a27281c 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3884,6 +3884,7 @@ __setup("ftrace_filter=", set_ftrace_filter);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
+static char ftrace_graph_notrace_buf[FTRACE_FILTER_SIZE] __initdata;
static int ftrace_set_func(unsigned long *array, int *idx, int size, char *buffer);
static int __init set_graph_function(char *str)
@@ -3893,16 +3894,29 @@ static int __init set_graph_function(char *str)
}
__setup("ftrace_graph_filter=", set_graph_function);
-static void __init set_ftrace_early_graph(char *buf)
+static int __init set_graph_notrace_function(char *str)
+{
+ strlcpy(ftrace_graph_notrace_buf, str, FTRACE_FILTER_SIZE);
+ return 1;
+}
+__setup("ftrace_graph_notrace=", set_graph_notrace_function);
+
+static void __init set_ftrace_early_graph(char *buf, int enable)
{
int ret;
char *func;
+ unsigned long *table = ftrace_graph_funcs;
+ int *count = &ftrace_graph_count;
+
+ if (!enable) {
+ table = ftrace_graph_notrace_funcs;
+ count = &ftrace_graph_notrace_count;
+ }
while (buf) {
func = strsep(&buf, ",");
/* we allow only one expression at a time */
- ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count,
- FTRACE_GRAPH_MAX_FUNCS, func);
+ ret = ftrace_set_func(table, count, FTRACE_GRAPH_MAX_FUNCS, func);
if (ret)
printk(KERN_DEBUG "ftrace: function %s not "
"traceable\n", func);
@@ -3931,7 +3945,9 @@ static void __init set_ftrace_early_filters(void)
ftrace_set_early_filter(&global_ops, ftrace_notrace_buf, 0);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
if (ftrace_graph_buf[0])
- set_ftrace_early_graph(ftrace_graph_buf);
+ set_ftrace_early_graph(ftrace_graph_buf, 1);
+ if (ftrace_graph_notrace_buf[0])
+ set_ftrace_early_graph(ftrace_graph_notrace_buf, 0);
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
}
--
2.0.0
next prev parent reply other threads:[~2014-07-03 16:16 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 16:05 [for-next][PATCH 00/21] tracing: Updates for 3.17 Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 01/21] ftrace: Allow no regs if no more callbacks require it Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 02/21] ftrace: Use macros for numbers in ftrace rec shift bits Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 03/21] ftrace: Add ftrace_rec_counter() macro to simplify the code Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 04/21] ftrace: Optimize function graph to be called directly Steven Rostedt
2014-07-10 17:45 ` Tuomas Tynkkynen
2014-07-10 18:01 ` Steven Rostedt
2014-07-12 3:36 ` Steven Rostedt
2014-07-12 3:37 ` Steven Rostedt
2014-07-14 13:46 ` Tuomas Tynkkynen
2014-07-14 16:14 ` Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 05/21] ftrace: Add trampolines to enabled_functions debug file Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 06/21] tracing: Change trace event sample to use strlcpy instead of strncpy Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 07/21] ftrace: Simplify ftrace_hash_disable/enable path in ftrace_hash_move Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 08/21] tracing: Move the trace_seq_* functions into its own trace_seq.c file Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 09/21] tracing: Clean up trace_seq.c Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 10/21] tracing: Make trace_seq_putmem_hex() more robust Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 11/21] tracing: Remove trace_seq_reserve() Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 12/21] tracing: Remove unnecessary null test before debugfs_remove() Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 13/21] tracing: Add trace_seq_buffer_ptr() helper function Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 14/21] ftrace: Get rid of obsolete global_start_up variable Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 15/21] ftrace: Fix memory leak on failure path in ftrace_allocate_pages() Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 16/21] ftrace: Do not copy hash if O_TRUNC is set Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 17/21] tracing: Convert pr_warning() to pr_warn() in trace_events.c Steven Rostedt
2014-07-03 16:05 ` Steven Rostedt [this message]
2014-07-03 16:05 ` [for-next][PATCH 19/21] tracing: Improve message of empty set_graph_notrace file Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 20/21] tracing: Improve message of empty set_ftrace_notrace file Steven Rostedt
2014-07-03 16:05 ` [for-next][PATCH 21/21] tracing: Add description of set_graph_notrace to tracing/README Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140703161226.536421069@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox