public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [for-next][PATCH 0/2] tracing: Small fixes for 4.4
@ 2016-01-14 14:24 Steven Rostedt
  2016-01-14 14:24 ` [for-next][PATCH 1/2] tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs() Steven Rostedt
  2016-01-14 14:24 ` [for-next][PATCH 2/2] ftrace: Remove unused nr_trampolines var Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2016-01-14 14:24 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: 88e68efcf2846ca5241de59d2c7db7f23199245e


Dmitry Safonov (1):
      ftrace: Remove unused nr_trampolines var

Steven Rostedt (Red Hat) (1):
      tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs()

----
 include/linux/ftrace.h | 1 -
 kernel/trace/trace.c   | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

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

* [for-next][PATCH 1/2] tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs()
  2016-01-14 14:24 [for-next][PATCH 0/2] tracing: Small fixes for 4.4 Steven Rostedt
@ 2016-01-14 14:24 ` Steven Rostedt
  2016-01-14 14:24 ` [for-next][PATCH 2/2] ftrace: Remove unused nr_trampolines var Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2016-01-14 14:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, stable, Brendan Gregg

[-- Attachment #1: 0001-tracing-Fix-stacktrace-skip-depth-in-trace_buffer_un.patch --]
[-- Type: text/plain, Size: 2546 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

While cleaning the stacktrace code I unintentially changed the skip depth of
trace_buffer_unlock_commit_regs() from 0 to 6. kprobes uses this function,
and with skipping 6 call backs, it can easily produce no stack.

Here's how I tested it:

 # echo 'p:ext4_sync_fs ext4_sync_fs ' > /sys/kernel/debug/tracing/kprobe_events
 # echo 1 > /sys/kernel/debug/tracing/events/kprobes/enable
 # cat /sys/kernel/debug/trace
            sync-2394  [005]   502.457060: ext4_sync_fs: (ffffffff81317650)
            sync-2394  [005]   502.457063: kernel_stack:         <stack trace>
            sync-2394  [005]   502.457086: ext4_sync_fs: (ffffffff81317650)
            sync-2394  [005]   502.457087: kernel_stack:         <stack trace>
            sync-2394  [005]   502.457091: ext4_sync_fs: (ffffffff81317650)

After putting back the skip stack to zero, we have:

            sync-2270  [000]   748.052693: ext4_sync_fs: (ffffffff81317650)
            sync-2270  [000]   748.052695: kernel_stack:         <stack trace>
 => iterate_supers (ffffffff8126412e)
 => sys_sync (ffffffff8129c4b6)
 => entry_SYSCALL_64_fastpath (ffffffff8181f0b2)
            sync-2270  [000]   748.053017: ext4_sync_fs: (ffffffff81317650)
            sync-2270  [000]   748.053019: kernel_stack:         <stack trace>
 => iterate_supers (ffffffff8126412e)
 => sys_sync (ffffffff8129c4b6)
 => entry_SYSCALL_64_fastpath (ffffffff8181f0b2)
            sync-2270  [000]   748.053381: ext4_sync_fs: (ffffffff81317650)
            sync-2270  [000]   748.053383: kernel_stack:         <stack trace>
 => iterate_supers (ffffffff8126412e)
 => sys_sync (ffffffff8129c4b6)
 => entry_SYSCALL_64_fastpath (ffffffff8181f0b2)

Cc: stable@vger.kernel.org # v4.4+
Fixes: 73dddbb57bb0 "tracing: Only create stacktrace option when STACKTRACE is configured"
Reported-by: Brendan Gregg <brendan.d.gregg@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 87fb9801bd9e..d9293402ee68 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1751,7 +1751,7 @@ void trace_buffer_unlock_commit_regs(struct trace_array *tr,
 {
 	__buffer_unlock_commit(buffer, event);
 
-	ftrace_trace_stack(tr, buffer, flags, 6, pc, regs);
+	ftrace_trace_stack(tr, buffer, flags, 0, pc, regs);
 	ftrace_trace_userstack(buffer, flags, pc);
 }
 EXPORT_SYMBOL_GPL(trace_buffer_unlock_commit_regs);
-- 
2.6.4

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

* [for-next][PATCH 2/2] ftrace: Remove unused nr_trampolines var
  2016-01-14 14:24 [for-next][PATCH 0/2] tracing: Small fixes for 4.4 Steven Rostedt
  2016-01-14 14:24 ` [for-next][PATCH 1/2] tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs() Steven Rostedt
@ 2016-01-14 14:24 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2016-01-14 14:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Dmitry Safonov

[-- Attachment #1: 0002-ftrace-Remove-unused-nr_trampolines-var.patch --]
[-- Type: text/plain, Size: 877 bytes --]

From: Dmitry Safonov <0x7f454c46@gmail.com>

It's not needed & not used since introducing old_hash: commit fef5aeeee9e371
("ftrace: Replace tramp_hash with old_*_hash to save space").

Link: http://lkml.kernel.org/r/1452699598-27610-1-git-send-email-0x7f454c46@gmail.com

Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/ftrace.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 60048c50404e..65460ad93c7b 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -164,7 +164,6 @@ struct ftrace_ops {
 	ftrace_func_t			saved_func;
 	int __percpu			*disabled;
 #ifdef CONFIG_DYNAMIC_FTRACE
-	int				nr_trampolines;
 	struct ftrace_ops_hash		local_hash;
 	struct ftrace_ops_hash		*func_hash;
 	struct ftrace_ops_hash		old_hash;
-- 
2.6.4

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

end of thread, other threads:[~2016-01-14 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-14 14:24 [for-next][PATCH 0/2] tracing: Small fixes for 4.4 Steven Rostedt
2016-01-14 14:24 ` [for-next][PATCH 1/2] tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs() Steven Rostedt
2016-01-14 14:24 ` [for-next][PATCH 2/2] ftrace: Remove unused nr_trampolines var Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox