* [for-next][PATCH 0/2] tracing: A couple of cleanups for 4.4
@ 2015-11-08 17:09 Steven Rostedt
2015-11-08 17:09 ` [for-next][PATCH 1/2] tracing: Make tracing work when debugfs is not configured in Steven Rostedt
2015-11-08 17:09 ` [for-next][PATCH 2/2] tracing: Remove unused ftrace_cpu_disabled per cpu variable Steven Rostedt
0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2015-11-08 17:09 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next
Head SHA1: 03e88ae6b369da2a26a6e09ad165e57d210789cd
Dmitry Safonov (1):
tracing: Remove unused ftrace_cpu_disabled per cpu variable
Jiaxing Wang (1):
tracing: Make tracing work when debugfs is not configured in
----
kernel/trace/trace.c | 10 +++-------
kernel/trace/trace.h | 1 -
kernel/trace/trace_functions_graph.c | 6 ------
3 files changed, 3 insertions(+), 14 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [for-next][PATCH 1/2] tracing: Make tracing work when debugfs is not configured in
2015-11-08 17:09 [for-next][PATCH 0/2] tracing: A couple of cleanups for 4.4 Steven Rostedt
@ 2015-11-08 17:09 ` Steven Rostedt
2015-11-08 17:09 ` [for-next][PATCH 2/2] tracing: Remove unused ftrace_cpu_disabled per cpu variable Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2015-11-08 17:09 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Jiaxing Wang
[-- Attachment #1: 0001-tracing-Make-tracing-work-when-debugfs-is-not-config.patch --]
[-- Type: text/plain, Size: 1263 bytes --]
From: Jiaxing Wang <hello.wjx@gmail.com>
Currently tracing_init_dentry() returns -ENODEV when debugfs is not
configured in, which causes tracefs not populated with tracing files and
directories, so we will get an empty directory even after we manually
mount tracefs.
We can make tracing_init_dentry() return NULL if debugfs is not
configured in and can manually mount tracefs. But return -ENODEV
if debugfs is configured in but not initialized or failed to create
automount point as that would break backward compatibility with older
tools.
Link: http://lkml.kernel.org/r/1446797056-11683-1-git-send-email-hello.wjx@gmail.com
Signed-off-by: Jiaxing Wang <hello.wjx@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2198a630ef58..08af79c106e1 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6847,7 +6847,9 @@ struct dentry *tracing_init_dentry(void)
if (tr->dir)
return NULL;
- if (WARN_ON(!debugfs_initialized()))
+ if (WARN_ON(!tracefs_initialized()) ||
+ (IS_ENABLED(CONFIG_DEBUG_FS) &&
+ WARN_ON(!debugfs_initialized())))
return ERR_PTR(-ENODEV);
/*
--
2.6.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [for-next][PATCH 2/2] tracing: Remove unused ftrace_cpu_disabled per cpu variable
2015-11-08 17:09 [for-next][PATCH 0/2] tracing: A couple of cleanups for 4.4 Steven Rostedt
2015-11-08 17:09 ` [for-next][PATCH 1/2] tracing: Make tracing work when debugfs is not configured in Steven Rostedt
@ 2015-11-08 17:09 ` Steven Rostedt
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2015-11-08 17:09 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Dmitry Safonov
[-- Attachment #1: 0002-tracing-Remove-unused-ftrace_cpu_disabled-per-cpu-va.patch --]
[-- Type: text/plain, Size: 2888 bytes --]
From: Dmitry Safonov <0x7f454c46@gmail.com>
Since the ring buffer is lockless, there is no need to disable ftrace on
CPU. And no one doing so: after commit 68179686ac67cb ("tracing: Remove
ftrace_disable/enable_cpu()") ftrace_cpu_disabled stays the same after
initialization, nothing changes it.
ftrace_cpu_disabled shouldn't be used by any external module since it
disables only function and graph_function tracers but not any other
tracer.
Link: http://lkml.kernel.org/r/1446836846-22239-1-git-send-email-0x7f454c46@gmail.com
Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace.c | 6 ------
kernel/trace/trace.h | 1 -
kernel/trace/trace_functions_graph.c | 6 ------
3 files changed, 13 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 08af79c106e1..b11582618991 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -100,8 +100,6 @@ static DEFINE_PER_CPU(bool, trace_cmdline_save);
*/
static int tracing_disabled = 1;
-DEFINE_PER_CPU(int, ftrace_cpu_disabled);
-
cpumask_var_t __read_mostly tracing_buffer_mask;
/*
@@ -1775,10 +1773,6 @@ trace_function(struct trace_array *tr,
struct ring_buffer_event *event;
struct ftrace_entry *entry;
- /* If we are reading the ring buffer, don't trace */
- if (unlikely(__this_cpu_read(ftrace_cpu_disabled)))
- return;
-
event = trace_buffer_lock_reserve(buffer, TRACE_FN, sizeof(*entry),
flags, pc);
if (!event)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index dd7620802e72..919d9d07686f 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -667,7 +667,6 @@ extern int DYN_FTRACE_TEST_NAME2(void);
extern bool ring_buffer_expanded;
extern bool tracing_selftest_disabled;
-DECLARE_PER_CPU(int, ftrace_cpu_disabled);
#ifdef CONFIG_FTRACE_STARTUP_TEST
extern int trace_selftest_startup_function(struct tracer *trace,
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 92382af7a213..a663cbb84107 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -288,9 +288,6 @@ int __trace_graph_entry(struct trace_array *tr,
struct ring_buffer *buffer = tr->trace_buffer.buffer;
struct ftrace_graph_ent_entry *entry;
- if (unlikely(__this_cpu_read(ftrace_cpu_disabled)))
- return 0;
-
event = trace_buffer_lock_reserve(buffer, TRACE_GRAPH_ENT,
sizeof(*entry), flags, pc);
if (!event)
@@ -403,9 +400,6 @@ void __trace_graph_return(struct trace_array *tr,
struct ring_buffer *buffer = tr->trace_buffer.buffer;
struct ftrace_graph_ret_entry *entry;
- if (unlikely(__this_cpu_read(ftrace_cpu_disabled)))
- return;
-
event = trace_buffer_lock_reserve(buffer, TRACE_GRAPH_RET,
sizeof(*entry), flags, pc);
if (!event)
--
2.6.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-08 17:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-08 17:09 [for-next][PATCH 0/2] tracing: A couple of cleanups for 4.4 Steven Rostedt
2015-11-08 17:09 ` [for-next][PATCH 1/2] tracing: Make tracing work when debugfs is not configured in Steven Rostedt
2015-11-08 17:09 ` [for-next][PATCH 2/2] tracing: Remove unused ftrace_cpu_disabled per cpu variable Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox