* [PATCH 1/3] tracing: removing not used variables
2009-07-16 19:44 [PATCH 0/3] tracing: minor bugs jolsa
@ 2009-07-16 19:44 ` jolsa
2009-07-16 19:44 ` [PATCH 2/3] tracing: removing struct module* parameter from ftrace_init_module code path jolsa
2009-07-16 19:44 ` [PATCH 3/3] tracing: removing .globl in the scripts/recordmcount.pl doc jolsa
2 siblings, 0 replies; 6+ messages in thread
From: jolsa @ 2009-07-16 19:44 UTC (permalink / raw)
To: mingo, rostedt; +Cc: linux-kernel, kernel-janitors
Removing not used variables.
wbr,
jirka
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
kernel/trace/ftrace.c | 3 ---
kernel/trace/trace.c | 3 +--
2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 4521c77..1dc08ab 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1375,7 +1375,6 @@ struct ftrace_iterator {
unsigned flags;
unsigned char buffer[FTRACE_BUFF_MAX+1];
unsigned buffer_idx;
- unsigned filtered;
};
static void *
@@ -2312,7 +2311,6 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
}
if (isspace(ch)) {
- iter->filtered++;
iter->buffer[iter->buffer_idx] = 0;
ret = ftrace_process_regex(iter->buffer,
iter->buffer_idx, enable);
@@ -2443,7 +2441,6 @@ ftrace_regex_release(struct inode *inode, struct file *file, int enable)
iter = file->private_data;
if (iter->buffer_idx) {
- iter->filtered++;
iter->buffer[iter->buffer_idx] = 0;
ftrace_match_records(iter->buffer, iter->buffer_idx, enable);
}
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8bc8d8a..d8bb7fd 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4268,7 +4268,6 @@ void ftrace_dump(void)
__init static int tracer_alloc_buffers(void)
{
- struct trace_array_cpu *data;
int ring_buf_size;
int i;
int ret = -ENOMEM;
@@ -4318,7 +4317,7 @@ __init static int tracer_alloc_buffers(void)
/* Allocate the first page for all buffers */
for_each_tracing_cpu(i) {
- data = global_trace.data[i] = &per_cpu(global_trace_cpu, i);
+ global_trace.data[i] = &per_cpu(global_trace_cpu, i);
max_tr.data[i] = &per_cpu(max_data, i);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/3] tracing: removing struct module* parameter from ftrace_init_module code path
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
2009-07-18 10:16 ` [PATCH 2/3] tracing: removing struct module* parameter from Ingo Molnar
2009-07-16 19:44 ` [PATCH 3/3] tracing: removing .globl in the scripts/recordmcount.pl doc jolsa
2 siblings, 1 reply; 6+ messages in thread
From: jolsa @ 2009-07-16 19:44 UTC (permalink / raw)
To: mingo, rostedt; +Cc: linux-kernel, kernel-janitors
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
^ permalink raw reply related [flat|nested] 6+ messages in thread