* [PATCH] ftrace: fix updating of ftrace_update_cnt
@ 2008-05-24 18:40 Abhishek Sagar
2008-05-25 0:46 ` Steven Rostedt
2008-05-27 15:43 ` Thomas Gleixner
0 siblings, 2 replies; 3+ messages in thread
From: Abhishek Sagar @ 2008-05-24 18:40 UTC (permalink / raw)
To: Ingo Molnar, rostedt; +Cc: LKML
Hi Ingo/Steven,
Ftrace currently maintains an update count which includes false updates, i.e, updates which failed. If anything, such failures should be tracked by some separate variable, but this patch provides a minimal fix.
Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com>
---
fix updating of ftrace_update_cnt
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index bfba25c..14e086f 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -443,7 +443,7 @@ static void ftrace_shutdown_replenish(void)
ftrace_pages->next = (void *)get_zeroed_page(GFP_KERNEL);
}
-static void
+static int
ftrace_code_disable(struct dyn_ftrace *rec)
{
unsigned long ip;
@@ -459,7 +459,9 @@ ftrace_code_disable(struct dyn_ftrace *rec)
if (failed) {
rec->flags |= FTRACE_FL_FAILED;
ftrace_free_rec(rec);
+ return 0;
}
+ return 1;
}
static int __ftrace_modify_code(void *data)
@@ -607,8 +609,8 @@ static int __ftrace_update_code(void *ignore)
/* all CPUS are stopped, we are safe to modify code */
hlist_for_each_entry(p, t, &head, node) {
- ftrace_code_disable(p);
- ftrace_update_cnt++;
+ if (ftrace_code_disable(p))
+ ftrace_update_cnt++;
}
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ftrace: fix updating of ftrace_update_cnt
2008-05-24 18:40 [PATCH] ftrace: fix updating of ftrace_update_cnt Abhishek Sagar
@ 2008-05-25 0:46 ` Steven Rostedt
2008-05-27 15:43 ` Thomas Gleixner
1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2008-05-25 0:46 UTC (permalink / raw)
To: Abhishek Sagar; +Cc: Ingo Molnar, LKML
On Sun, 25 May 2008, Abhishek Sagar wrote:
> Hi Ingo/Steven,
>
> Ftrace currently maintains an update count which includes false updates, i.e, updates which failed. If anything, such failures should be tracked by some separate variable, but this patch provides a minimal fix.
>
> Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com>
Acked-by: Steven Rostedt <srostedt@redhat.com>
-- Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ftrace: fix updating of ftrace_update_cnt
2008-05-24 18:40 [PATCH] ftrace: fix updating of ftrace_update_cnt Abhishek Sagar
2008-05-25 0:46 ` Steven Rostedt
@ 2008-05-27 15:43 ` Thomas Gleixner
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2008-05-27 15:43 UTC (permalink / raw)
To: Abhishek Sagar; +Cc: Ingo Molnar, rostedt, LKML
On Sun, 25 May 2008, Abhishek Sagar wrote:
> Hi Ingo/Steven,
>
> Ftrace currently maintains an update count which includes false
> updates, i.e, updates which failed. If anything, such failures
> should be tracked by some separate variable, but this patch provides
> a minimal fix.
Good catch. Applied, thanks
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-27 15:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-24 18:40 [PATCH] ftrace: fix updating of ftrace_update_cnt Abhishek Sagar
2008-05-25 0:46 ` Steven Rostedt
2008-05-27 15:43 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox