* [PATCH 1/2] ftrace: Remove the unused variant ftrace_update_time
@ 2015-07-26 15:55 Minfei Huang
2015-07-26 15:55 ` [PATCH 2/2] ftrace: Make if condition correctly due to the operator order Minfei Huang
0 siblings, 1 reply; 4+ messages in thread
From: Minfei Huang @ 2015-07-26 15:55 UTC (permalink / raw)
To: rostedt, mingo; +Cc: linux-kernel, mhuang, Minfei Huang
Since the patch "ftrace: remove daemon(cb7be3b)" remove the function
ftraced, the variant ftrace_update_time never be used any more.
Remove the unused variant ftrace_update_time.
Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
---
kernel/trace/ftrace.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index eb11011..c04dff9 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2761,7 +2761,6 @@ static void ftrace_shutdown_sysctl(void)
}
}
-static cycle_t ftrace_update_time;
unsigned long ftrace_update_tot_cnt;
static inline int ops_traces_mod(struct ftrace_ops *ops)
@@ -2821,7 +2820,6 @@ static int ftrace_update_code(struct module *mod, struct ftrace_page *new_pgs)
{
struct ftrace_page *pg;
struct dyn_ftrace *p;
- cycle_t start, stop;
unsigned long update_cnt = 0;
unsigned long ref = 0;
bool test = false;
@@ -2847,8 +2845,6 @@ static int ftrace_update_code(struct module *mod, struct ftrace_page *new_pgs)
}
}
- start = ftrace_now(raw_smp_processor_id());
-
for (pg = new_pgs; pg; pg = pg->next) {
for (i = 0; i < pg->index; i++) {
@@ -2889,8 +2885,6 @@ static int ftrace_update_code(struct module *mod, struct ftrace_page *new_pgs)
}
}
- stop = ftrace_now(raw_smp_processor_id());
- ftrace_update_time = stop - start;
ftrace_update_tot_cnt += update_cnt;
return 0;
--
2.4.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] ftrace: Make if condition correctly due to the operator order
2015-07-26 15:55 [PATCH 1/2] ftrace: Remove the unused variant ftrace_update_time Minfei Huang
@ 2015-07-26 15:55 ` Minfei Huang
2015-07-27 2:20 ` yalin wang
0 siblings, 1 reply; 4+ messages in thread
From: Minfei Huang @ 2015-07-26 15:55 UTC (permalink / raw)
To: rostedt, mingo; +Cc: linux-kernel, mhuang, Minfei Huang
The if condition will be always true, since the operator & has the high
priority than operator ||.
Use () to quote them to make the if condition correctly.
Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
---
kernel/trace/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index c04dff9..d9acc6a 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -254,7 +254,7 @@ static ftrace_func_t ftrace_ops_get_list_func(struct ftrace_ops *ops)
* If this is a dynamic ops or we force list func,
* then it needs to call the list anyway.
*/
- if (ops->flags & FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC)
+ if (ops->flags & (FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC))
return ftrace_ops_list_func;
return ftrace_ops_get_func(ops);
--
2.4.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] ftrace: Make if condition correctly due to the operator order
2015-07-26 15:55 ` [PATCH 2/2] ftrace: Make if condition correctly due to the operator order Minfei Huang
@ 2015-07-27 2:20 ` yalin wang
2015-07-27 2:42 ` Minfei Huang
0 siblings, 1 reply; 4+ messages in thread
From: yalin wang @ 2015-07-27 2:20 UTC (permalink / raw)
To: Minfei Huang; +Cc: rostedt, mingo, linux-kernel, mhuang
> On Jul 26, 2015, at 23:55, Minfei Huang <mnfhuang@gmail.com> wrote:
>
> The if condition will be always true, since the operator & has the high
> priority than operator ||.
>
> Use () to quote them to make the if condition correctly.
>
> Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
> ---
> kernel/trace/ftrace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index c04dff9..d9acc6a 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -254,7 +254,7 @@ static ftrace_func_t ftrace_ops_get_list_func(struct ftrace_ops *ops)
> * If this is a dynamic ops or we force list func,
> * then it needs to call the list anyway.
> */
> - if (ops->flags & FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC)
> + if (ops->flags & (FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC))
> return ftrace_ops_list_func;
>
> return ftrace_ops_get_func(ops);
> —
i think the original code is correct, while your change is wrong from logic.
am i missing something ?
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] ftrace: Make if condition correctly due to the operator order
2015-07-27 2:20 ` yalin wang
@ 2015-07-27 2:42 ` Minfei Huang
0 siblings, 0 replies; 4+ messages in thread
From: Minfei Huang @ 2015-07-27 2:42 UTC (permalink / raw)
To: yalin wang; +Cc: Minfei Huang, rostedt, mingo, linux-kernel
On 07/27/15 at 10:20am, yalin wang wrote:
>
> > On Jul 26, 2015, at 23:55, Minfei Huang <mnfhuang@gmail.com> wrote:
> >
> > The if condition will be always true, since the operator & has the high
> > priority than operator ||.
> >
> > Use () to quote them to make the if condition correctly.
> >
> > Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
> > ---
> > kernel/trace/ftrace.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index c04dff9..d9acc6a 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -254,7 +254,7 @@ static ftrace_func_t ftrace_ops_get_list_func(struct ftrace_ops *ops)
> > * If this is a dynamic ops or we force list func,
> > * then it needs to call the list anyway.
> > */
> > - if (ops->flags & FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC)
> > + if (ops->flags & (FTRACE_OPS_FL_DYNAMIC || FTRACE_FORCE_LIST_FUNC))
> > return ftrace_ops_list_func;
> >
> > return ftrace_ops_get_func(ops);
> > —
> i think the original code is correct, while your change is wrong from logic.
> am i missing something ?
> Thanks
>
Thanks for your correction.
Yes. The previous code matches the logic.
Nacked.
Thanks
Minfei
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-27 2:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-26 15:55 [PATCH 1/2] ftrace: Remove the unused variant ftrace_update_time Minfei Huang
2015-07-26 15:55 ` [PATCH 2/2] ftrace: Make if condition correctly due to the operator order Minfei Huang
2015-07-27 2:20 ` yalin wang
2015-07-27 2:42 ` Minfei Huang
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