From: jolsa@redhat.com
To: mingo@elte.hu, rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/3] tracing: removing struct module* parameter from ftrace_init_module code path
Date: Thu, 16 Jul 2009 19:44:27 +0000 [thread overview]
Message-ID: <1247773468-11594-3-git-send-email-jolsa@redhat.com> (raw)
In-Reply-To: <1247773468-11594-1-git-send-email-jolsa@redhat.com>
The "struct module*" is not being used in the ftrace_init_module code path,
removing it.
wbr,
jirka
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
arch/x86/kernel/ftrace.c | 3 +--
include/linux/ftrace.h | 4 +---
kernel/trace/ftrace.c | 25 +++++++++++--------------
3 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index d94e1ea..b5c22fb 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -255,8 +255,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
return 0;
}
-int ftrace_make_nop(struct module *mod,
- struct dyn_ftrace *rec, unsigned long addr)
+int ftrace_make_nop(struct dyn_ftrace *rec, unsigned long addr)
{
unsigned char *new, *old;
unsigned long ip = rec->ip;
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index dc3b132..efe0fb3 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -184,7 +184,6 @@ static inline int ftrace_disable_ftrace_graph_caller(void) { return 0; }
/**
* ftrace_make_nop - convert code into nop
- * @mod: module structure if called by module load initialization
* @rec: the mcount call site record
* @addr: the address that the call site should be calling
*
@@ -203,8 +202,7 @@ static inline int ftrace_disable_ftrace_graph_caller(void) { return 0; }
* -EPERM on error writing to the location
* Any other value will be considered a failure.
*/
-extern int ftrace_make_nop(struct module *mod,
- struct dyn_ftrace *rec, unsigned long addr);
+extern int ftrace_make_nop(struct dyn_ftrace *rec, unsigned long addr);
/**
* ftrace_make_call - convert a nop call site into a call to addr
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1dc08ab..c4dfcff 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1080,7 +1080,7 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
if (rec->flags & FTRACE_FL_ENABLED)
return ftrace_make_call(rec, ftrace_addr);
else
- return ftrace_make_nop(NULL, rec, ftrace_addr);
+ return ftrace_make_nop(rec, ftrace_addr);
}
static void ftrace_replace_code(int enable)
@@ -1123,14 +1123,14 @@ static void ftrace_replace_code(int enable)
}
static int
-ftrace_code_disable(struct module *mod, struct dyn_ftrace *rec)
+ftrace_code_disable(struct dyn_ftrace *rec)
{
unsigned long ip;
int ret;
ip = rec->ip;
- ret = ftrace_make_nop(mod, rec, MCOUNT_ADDR);
+ ret = ftrace_make_nop(rec, MCOUNT_ADDR);
if (ret) {
ftrace_bug(ret, ip);
rec->flags |= FTRACE_FL_FAILED;
@@ -1280,7 +1280,7 @@ static cycle_t ftrace_update_time;
static unsigned long ftrace_update_cnt;
unsigned long ftrace_update_tot_cnt;
-static int ftrace_update_code(struct module *mod)
+static int ftrace_update_code(void)
{
struct dyn_ftrace *p;
cycle_t start, stop;
@@ -1299,7 +1299,7 @@ static int ftrace_update_code(struct module *mod)
p->flags = 0L;
/* convert record (i.e, patch mcount-call with NOP) */
- if (ftrace_code_disable(mod, p)) {
+ if (ftrace_code_disable(p)) {
p->flags |= FTRACE_FL_CONVERTED;
ftrace_update_cnt++;
} else
@@ -2751,8 +2751,7 @@ static __init int ftrace_init_dyn_debugfs(struct dentry *d_tracer)
return 0;
}
-static int ftrace_convert_nops(struct module *mod,
- unsigned long *start,
+static int ftrace_convert_nops(unsigned long *start,
unsigned long *end)
{
unsigned long *p;
@@ -2776,7 +2775,7 @@ static int ftrace_convert_nops(struct module *mod,
/* disable interrupts to prevent kstop machine */
local_irq_save(flags);
- ftrace_update_code(mod);
+ ftrace_update_code();
local_irq_restore(flags);
mutex_unlock(&ftrace_lock);
@@ -2808,12 +2807,11 @@ void ftrace_release(void *start, void *end)
mutex_unlock(&ftrace_lock);
}
-static void ftrace_init_module(struct module *mod,
- unsigned long *start, unsigned long *end)
+static void ftrace_init_module(unsigned long *start, unsigned long *end)
{
if (ftrace_disabled || start = end)
return;
- ftrace_convert_nops(mod, start, end);
+ ftrace_convert_nops(start, end);
}
static int ftrace_module_notify(struct notifier_block *self,
@@ -2823,7 +2821,7 @@ static int ftrace_module_notify(struct notifier_block *self,
switch (val) {
case MODULE_STATE_COMING:
- ftrace_init_module(mod, mod->ftrace_callsites,
+ ftrace_init_module(mod->ftrace_callsites,
mod->ftrace_callsites +
mod->num_ftrace_callsites);
break;
@@ -2876,8 +2874,7 @@ void __init ftrace_init(void)
last_ftrace_enabled = ftrace_enabled = 1;
- ret = ftrace_convert_nops(NULL,
- __start_mcount_loc,
+ ret = ftrace_convert_nops(__start_mcount_loc,
__stop_mcount_loc);
ret = register_module_notifier(&ftrace_module_nb);
--
1.6.2.5
next prev parent reply other threads:[~2009-07-16 19:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 19:44 [PATCH 0/3] tracing: minor bugs jolsa
2009-07-16 19:44 ` [PATCH 1/3] tracing: removing not used variables jolsa
2009-07-16 19:44 ` jolsa [this message]
2009-07-18 10:16 ` [PATCH 2/3] tracing: removing struct module* parameter from Ingo Molnar
2009-07-19 18:47 ` Jiri Olsa
2009-07-16 19:44 ` [PATCH 3/3] tracing: removing .globl in the scripts/recordmcount.pl doc jolsa
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=1247773468-11594-3-git-send-email-jolsa@redhat.com \
--to=jolsa@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.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