mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@redhat.com>, PaX Team <pageexec@freemail.hu>,
	Mathias Krause <minipli@googlemail.com>
Subject: [for-next][PATCH 7/8] ftrace: Statically initialize pm notifier block
Date: Thu, 24 Apr 2014 12:02:39 -0400	[thread overview]
Message-ID: <20140424160320.831795066@goodmis.org> (raw)
In-Reply-To: <20140424160232.271454710@goodmis.org>

[-- Attachment #1: 0007-ftrace-Statically-initialize-pm-notifier-block.patch --]
[-- Type: text/plain, Size: 1636 bytes --]

From: Mathias Krause <minipli@googlemail.com>

Instead of initializing the pm notifier block in register_ftrace_graph(),
initialize it statically. This safes us some code.

Found in the PaX patch, written by the PaX Team.

Link: http://lkml.kernel.org/p/1396186310-3156-1-git-send-email-minipli@googlemail.com

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: PaX Team <pageexec@freemail.hu>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 8f61ef7..846888e 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4860,7 +4860,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 
 static int ftrace_graph_active;
-static struct notifier_block ftrace_suspend_notifier;
 
 int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
 {
@@ -5036,6 +5035,10 @@ static void update_function_graph_func(void)
 		ftrace_graph_entry = ftrace_graph_entry_test;
 }
 
+static struct notifier_block ftrace_suspend_notifier = {
+	.notifier_call = ftrace_suspend_notifier_call,
+};
+
 int register_ftrace_graph(trace_func_graph_ret_t retfunc,
 			trace_func_graph_ent_t entryfunc)
 {
@@ -5049,7 +5052,6 @@ int register_ftrace_graph(trace_func_graph_ret_t retfunc,
 		goto out;
 	}
 
-	ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call;
 	register_pm_notifier(&ftrace_suspend_notifier);
 
 	ftrace_graph_active++;
-- 
1.8.5.3



  parent reply	other threads:[~2014-04-24 16:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 16:02 [for-next][PATCH 0/8] tracing: Mulitple tracers and other updates Steven Rostedt
2014-04-24 16:02 ` [for-next][PATCH 1/8] ftrace: Remove global function list and call function directly Steven Rostedt
2014-04-24 16:02 ` [for-next][PATCH 2/8] tracing: Move tracing_max_latency into trace_array Steven Rostedt
2014-04-24 16:02 ` [for-next][PATCH 3/8] tracing: Move ftrace_max_lock " Steven Rostedt
2014-04-24 16:02 ` [for-next][PATCH 4/8] tracing: Allow wakeup tracers to be used by instances Steven Rostedt
2014-04-24 16:02 ` [for-next][PATCH 5/8] tracing: Allow irq/preempt " Steven Rostedt
2014-04-24 16:02 ` [for-next][PATCH 6/8] ftrace/x86: Fix order of warning messages when ftrace modifies code Steven Rostedt
2014-04-24 16:02 ` Steven Rostedt [this message]
2014-04-24 16:02 ` [for-next][PATCH 8/8] tracing: Add static to local functions 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=20140424160320.831795066@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=minipli@googlemail.com \
    --cc=pageexec@freemail.hu \
    /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

Powered by JetHome