public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next][PATCH 02/13] ftrace: Fix output of enabled_functions for showing tramp
Date: Thu, 24 Dec 2015 09:27:54 -0500	[thread overview]
Message-ID: <20151224142859.744474369@goodmis.org> (raw)
In-Reply-To: 20151224142752.534947674@goodmis.org

[-- Attachment #1: 0002-ftrace-Fix-output-of-enabled_functions-for-showing-t.patch --]
[-- Type: text/plain, Size: 1696 bytes --]

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

When showing all tramps registered to a ftrace record in the file
enabled_functions, it exits the loop with ops == NULL. But then it is
suppose to show the function on the ops->trampoline and
add_trampoline_func() is called with the given ops. But because ops is now
NULL (to exit the loop), it always shows the static trampoline instead of
the one that is really registered to the record.

The call to add_trampoline_func() that shows the trampoline for the given
ops needs to be called at every iteration.

Fixes: 39daa7b9e895 "ftrace: Show all tramps registered to a record on ftrace_bug()"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b8dfe8138aa2..bf7bebcdad82 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3322,7 +3322,7 @@ static int t_show(struct seq_file *m, void *v)
 
 	seq_printf(m, "%ps", (void *)rec->ip);
 	if (iter->flags & FTRACE_ITER_ENABLED) {
-		struct ftrace_ops *ops = NULL;
+		struct ftrace_ops *ops;
 
 		seq_printf(m, " (%ld)%s%s",
 			   ftrace_rec_count(rec),
@@ -3335,13 +3335,14 @@ static int t_show(struct seq_file *m, void *v)
 					seq_printf(m, "\ttramp: %pS (%pS)",
 						   (void *)ops->trampoline,
 						   (void *)ops->func);
+					add_trampoline_func(m, ops, rec);
 					ops = ftrace_find_tramp_ops_next(rec, ops);
 				} while (ops);
 			} else
 				seq_puts(m, "\ttramp: ERROR!");
-
+		} else {
+			add_trampoline_func(m, NULL, rec);
 		}
-		add_trampoline_func(m, ops, rec);
 	}	
 
 	seq_putc(m, '\n');
-- 
2.6.2



  parent reply	other threads:[~2015-12-24 14:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-24 14:27 [for-next][PATCH 00/13] tracing: More updates for 4.5 Steven Rostedt
2015-12-24 14:27 ` [for-next][PATCH 01/13] ftrace: Fix a typo in comment Steven Rostedt
2015-12-24 14:27 ` Steven Rostedt [this message]
2015-12-24 14:27 ` [for-next][PATCH 03/13] ftrace: Remove use of control list and ops Steven Rostedt
2015-12-24 14:27 ` [for-next][PATCH 04/13] ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too Steven Rostedt
2015-12-24 14:27 ` [for-next][PATCH 05/13] bpf: Constify bpf_verifier_ops structure Steven Rostedt
2015-12-24 14:27 ` [for-next][PATCH 06/13] tracing: Use seq_buf_used() in seq_buf_to_user() instead of len Steven Rostedt
2015-12-24 14:27 ` [for-next][PATCH 07/13] tracing: Introduce TRACE_EVENT_FN_COND macro Steven Rostedt
2015-12-24 14:28 ` [for-next][PATCH 08/13] ftrace: Join functions ftrace_module_init() and ftrace_init_module() Steven Rostedt
2015-12-24 14:28 ` [for-next][PATCH 09/13] ftrace: Clean up ftrace_module_init() code Steven Rostedt
2015-12-24 14:28 ` [for-next][PATCH 10/13] ia64: ftrace: Fix the comments for ftrace_modify_code() Steven Rostedt
2015-12-24 14:28 ` [for-next][PATCH 11/13] sh: " Steven Rostedt
2015-12-24 14:28 ` [for-next][PATCH 12/13] metag: ftrace: Fix the comments for ftrace_modify_code Steven Rostedt
2015-12-24 14:28 ` [for-next][PATCH 13/13] tracing: Fix comment to use tracing_on over tracing_enable 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=20151224142859.744474369@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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