From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Oleg Nesterov <oleg@redhat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [for-next-3.11][PATCH 3/5] tracing: Add comment to describe special break case in probe_remove_event_call()
Date: Thu, 01 Aug 2013 22:49:28 -0400 [thread overview]
Message-ID: <20130802025553.476238847@goodmis.org> (raw)
In-Reply-To: 20130802024924.999067099@goodmis.org
[-- Attachment #1: 0003-tracing-Add-comment-to-describe-special-break-case-i.patch --]
[-- Type: text/plain, Size: 1256 bytes --]
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
The "break" used in the do_for_each_event_file() is used as an optimization
as the loop is really a double loop. The loop searches all event files
for each trace_array. There's only one matching event file per trace_array
and after we find the event file for the trace_array, the break is used
to jump to the next trace_array and start the search there.
As this is not a standard way of using "break" in C code, it requires
a comment right before the break to let people know what is going on.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace_events.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index ec04836..29a7ebc 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1732,6 +1732,12 @@ static int probe_remove_event_call(struct ftrace_event_call *call)
*/
if (file->flags & FTRACE_EVENT_FL_ENABLED)
return -EBUSY;
+ /*
+ * The do_for_each_event_file_safe() is
+ * a double loop. After finding the call for this
+ * trace_array, we use break to jump to the next
+ * trace_array.
+ */
break;
} while_for_each_event_file();
--
1.7.10.4
next prev parent reply other threads:[~2013-08-02 2:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 2:49 [for-next-3.11][PATCH 0/5] tracing: Final fixes for the race between open event file and deleting event Steven Rostedt
2013-08-02 2:49 ` [for-next-3.11][PATCH 1/5] debugfs: debugfs_remove_recursive() must not rely on list_empty(d_subdirs) Steven Rostedt
2013-08-02 2:49 ` [for-next-3.11][PATCH 2/5] tracing: trace_remove_event_call() should fail if call/file is in use Steven Rostedt
2013-08-02 2:49 ` Steven Rostedt [this message]
2013-08-02 2:49 ` [for-next-3.11][PATCH 4/5] tracing/kprobes: Fail to unregister if probe event files are " Steven Rostedt
2013-08-02 2:49 ` [for-next-3.11][PATCH 5/5] tracing/uprobes: " Steven Rostedt
2013-08-02 13:45 ` [for-next-3.11][PATCH 0/5] tracing: Final fixes for the race between open event file and deleting event Oleg Nesterov
2013-08-02 14:04 ` 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=20130802025553.476238847@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
/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