Re: [PATCH] ftrace: fix race between ftrace and insmod

2015-12-16 Thread Zhang, Yanmin
On 2015/12/16 22:28, Steven Rostedt wrote: > On Wed, 16 Dec 2015 18:28:35 +0800 > "Zhang, Yanmin" wrote: > >>> + /* >>> +* If the tracing is enabled, go ahead and enable the record. >>> +* >>> +* The reason not to enable the record immediatelly is the >>> +* inherent check of ftr

Re: [PATCH] ftrace: fix race between ftrace and insmod

2015-12-16 Thread Steven Rostedt
On Wed, 16 Dec 2015 18:28:35 +0800 "Zhang, Yanmin" wrote: > > + /* > > +* If the tracing is enabled, go ahead and enable the record. > > +* > > +* The reason not to enable the record immediatelly is the > > +* inherent check of ftrace_make_nop/ftrace_make_call for > > +* cor

Re: [PATCH] ftrace: fix race between ftrace and insmod

2015-12-16 Thread Zhang, Yanmin
On 2015/12/16 1:37, Steven Rostedt wrote: > On Tue, 15 Dec 2015 11:26:41 +0800 > "Zhang, Yanmin" wrote: > >>> This seems very hackish, although I can't think of a better way at the >>> moment. But I would like not to add more code into module.c if >>> possible, and just use a notifier unless ther

Re: [PATCH] ftrace: fix race between ftrace and insmod

2015-12-15 Thread Zhang, Yanmin
On 2015/12/16 1:37, Steven Rostedt wrote: > On Tue, 15 Dec 2015 11:26:41 +0800 > "Zhang, Yanmin" wrote: > >>> This seems very hackish, although I can't think of a better way at the >>> moment. But I would like not to add more code into module.c if >>> possible, and just use a notifier unless there

Re: [PATCH] ftrace: fix race between ftrace and insmod

2015-12-15 Thread Steven Rostedt
On Tue, 15 Dec 2015 11:26:41 +0800 "Zhang, Yanmin" wrote: > > This seems very hackish, although I can't think of a better way at the > > moment. But I would like not to add more code into module.c if > > possible, and just use a notifier unless there's a real reason we can't > > (as there was whe

Re: [PATCH] ftrace: fix race between ftrace and insmod

2015-12-14 Thread Zhang, Yanmin
On 2015/12/15 9:05, Zhang, Yanmin wrote: > On 2015/12/14 23:51, Steven Rostedt wrote: >> On Mon, 14 Dec 2015 11:16:18 +0800 >> "Qiu, PeiyangX" wrote: >> >>> We hit ftrace_bug report when booting Android on a 64bit ATOM SOC chip. >>> Basically, there is a race between insmod and ftrace_run_update_c

Re: [PATCH] ftrace: fix race between ftrace and insmod

2015-12-14 Thread Zhang, Yanmin
On 2015/12/14 23:51, Steven Rostedt wrote: > On Mon, 14 Dec 2015 11:16:18 +0800 > "Qiu, PeiyangX" wrote: > >> We hit ftrace_bug report when booting Android on a 64bit ATOM SOC chip. >> Basically, there is a race between insmod and ftrace_run_update_code. >> >> After load_module=>ftrace_module_init

Re: [PATCH] ftrace: fix race between ftrace and insmod

2015-12-14 Thread Steven Rostedt
On Mon, 14 Dec 2015 11:16:18 +0800 "Qiu, PeiyangX" wrote: > We hit ftrace_bug report when booting Android on a 64bit ATOM SOC chip. > Basically, there is a race between insmod and ftrace_run_update_code. > > After load_module=>ftrace_module_init, another thread jumps in to call > ftrace_run_upda

[PATCH] ftrace: fix race between ftrace and insmod

2015-12-13 Thread Qiu, PeiyangX
We hit ftrace_bug report when booting Android on a 64bit ATOM SOC chip. Basically, there is a race between insmod and ftrace_run_update_code. After load_module=>ftrace_module_init, another thread jumps in to call ftrace_run_update_code=>ftrace_arch_code_modify_prepare =>se

[PATCH] ftrace: fix race between ftrace and insmod

2015-12-13 Thread Qiu, PeiyangX
We hit ftrace_bug report when booting Android on a 64bit ATOM SOC chip. Basically, there is a race between insmod and ftrace_run_update_code. After load_module=>ftrace_module_init, another thread jumps in to call ftrace_run_update_code=>ftrace_arch_code_modify_prepare =>se