Re: [PATCH 1/3] ftrace: Add module to ftrace_make_call() parameters

2018-02-25 Thread kbuild test robot
Hi Alexander,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tip/perf/core]
[also build test WARNING on v4.16-rc2 next-20180223]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Alexander-Sverdlin/ARM-Implement-MODULE_PLT-support-in-FTRACE/20180225-191957
config: i386-randconfig-h1-02251623 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   kernel/trace/ftrace.c: In function 'ftrace_module_enable':
>> kernel/trace/ftrace.c:5851:39: warning: passing argument 1 of 
>> '__ftrace_replace_code' from incompatible pointer type
   int failed = __ftrace_replace_code(rec, 1);
  ^
   kernel/trace/ftrace.c:2424:1: note: expected 'struct module *' but argument 
is of type 'struct dyn_ftrace *'
__ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int 
enable)
^
   kernel/trace/ftrace.c:5851:44: warning: passing argument 2 of 
'__ftrace_replace_code' makes pointer from integer without a cast
   int failed = __ftrace_replace_code(rec, 1);
   ^
   kernel/trace/ftrace.c:2424:1: note: expected 'struct dyn_ftrace *' but 
argument is of type 'int'
__ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int 
enable)
^
   kernel/trace/ftrace.c:5851:17: error: too few arguments to function 
'__ftrace_replace_code'
   int failed = __ftrace_replace_code(rec, 1);
^
   kernel/trace/ftrace.c:2424:1: note: declared here
__ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int 
enable)
^

vim +/__ftrace_replace_code +5851 kernel/trace/ftrace.c

93eb677d Steven Rostedt   2009-04-15  5797  
7dcd182b Jessica Yu   2016-02-16  5798  void 
ftrace_module_enable(struct module *mod)
b7bb Steven Rostedt (Red Hat  2016-01-07  5799) {
b7bb Steven Rostedt (Red Hat  2016-01-07  5800) struct dyn_ftrace *rec;
b7bb Steven Rostedt (Red Hat  2016-01-07  5801) struct ftrace_page *pg;
b7bb Steven Rostedt (Red Hat  2016-01-07  5802) 
b7bb Steven Rostedt (Red Hat  2016-01-07  5803) 
mutex_lock(_lock);
b7bb Steven Rostedt (Red Hat  2016-01-07  5804) 
b7bb Steven Rostedt (Red Hat  2016-01-07  5805) if (ftrace_disabled)
b7bb Steven Rostedt (Red Hat  2016-01-07  5806) goto out_unlock;
b7bb Steven Rostedt (Red Hat  2016-01-07  5807) 
b7bb Steven Rostedt (Red Hat  2016-01-07  5808) /*
b7bb Steven Rostedt (Red Hat  2016-01-07  5809)  * If the tracing is 
enabled, go ahead and enable the record.
b7bb Steven Rostedt (Red Hat  2016-01-07  5810)  *
b7bb Steven Rostedt (Red Hat  2016-01-07  5811)  * The reason not to 
enable the record immediatelly is the
b7bb Steven Rostedt (Red Hat  2016-01-07  5812)  * inherent check of 
ftrace_make_nop/ftrace_make_call for
b7bb Steven Rostedt (Red Hat  2016-01-07  5813)  * correct previous 
instructions.  Making first the NOP
b7bb Steven Rostedt (Red Hat  2016-01-07  5814)  * conversion puts the 
module to the correct state, thus
b7bb Steven Rostedt (Red Hat  2016-01-07  5815)  * passing the 
ftrace_make_call check.
b7bb Steven Rostedt (Red Hat  2016-01-07  5816)  *
b7bb Steven Rostedt (Red Hat  2016-01-07  5817)  * We also delay this 
to after the module code already set the
b7bb Steven Rostedt (Red Hat  2016-01-07  5818)  * text to read-only, 
as we now need to set it back to read-write
b7bb Steven Rostedt (Red Hat  2016-01-07  5819)  * so that we can 
modify the text.
b7bb Steven Rostedt (Red Hat  2016-01-07  5820)  */
b7bb Steven Rostedt (Red Hat  2016-01-07  5821) if (ftrace_start_up)
b7bb Steven Rostedt (Red Hat  2016-01-07  5822) 
ftrace_arch_code_modify_prepare();
b7bb Steven Rostedt (Red Hat  2016-01-07  5823) 
b7bb Steven Rostedt (Red Hat  2016-01-07  5824) 
do_for_each_ftrace_rec(pg, rec) {
b7bb Steven Rostedt (Red Hat  2016-01-07  5825) int cnt;
b7bb Steven Rostedt (Red Hat  2016-01-07  5826) /*
b7bb Steven Rostedt (Red Hat  2016-01-07  5827)  * 
do_for_each_ftrace_rec() is a double loop.
b7bb Steven Rostedt (Red Hat  2016-01-07  5828)  * module text 
shares the pg. If a record is
b7bb Steven Rostedt (Red Hat  2016-01-07  5829)  * not part of 
this module, then skip this pg,
b7bb Steven Rostedt (Red Hat  2016-01-07  5830)  * which the 
"break" will do.
b7bb Steven Rostedt (Red Hat  2016-01-07  5831)  */
3e234289 Steven Rostedt (VMware   2017-03-03  5832) if 
(!within_module_core(rec->ip, mod) &&
3e234289 Steven Rostedt (VMware   

Re: [PATCH 1/3] ftrace: Add module to ftrace_make_call() parameters

2018-02-25 Thread kbuild test robot
Hi Alexander,

I love your patch! Yet something to improve:

[auto build test ERROR on tip/perf/core]
[also build test ERROR on v4.16-rc2 next-20180223]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Alexander-Sverdlin/ARM-Implement-MODULE_PLT-support-in-FTRACE/20180225-191957
config: x86_64-randconfig-x011-201808 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   kernel/trace/ftrace.c: In function 'ftrace_module_enable':
>> kernel/trace/ftrace.c:5851:39: error: passing argument 1 of 
>> '__ftrace_replace_code' from incompatible pointer type 
>> [-Werror=incompatible-pointer-types]
   int failed = __ftrace_replace_code(rec, 1);
  ^~~
   kernel/trace/ftrace.c:2424:1: note: expected 'struct module *' but argument 
is of type 'struct dyn_ftrace *'
__ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int 
enable)
^
>> kernel/trace/ftrace.c:5851:44: warning: passing argument 2 of 
>> '__ftrace_replace_code' makes pointer from integer without a cast 
>> [-Wint-conversion]
   int failed = __ftrace_replace_code(rec, 1);
   ^
   kernel/trace/ftrace.c:2424:1: note: expected 'struct dyn_ftrace *' but 
argument is of type 'int'
__ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int 
enable)
^
>> kernel/trace/ftrace.c:5851:17: error: too few arguments to function 
>> '__ftrace_replace_code'
   int failed = __ftrace_replace_code(rec, 1);
^
   kernel/trace/ftrace.c:2424:1: note: declared here
__ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int 
enable)
^
   cc1: some warnings being treated as errors

vim +/__ftrace_replace_code +5851 kernel/trace/ftrace.c

93eb677d Steven Rostedt   2009-04-15  5797  
7dcd182b Jessica Yu   2016-02-16  5798  void 
ftrace_module_enable(struct module *mod)
b7bb Steven Rostedt (Red Hat  2016-01-07  5799) {
b7bb Steven Rostedt (Red Hat  2016-01-07  5800) struct dyn_ftrace *rec;
b7bb Steven Rostedt (Red Hat  2016-01-07  5801) struct ftrace_page *pg;
b7bb Steven Rostedt (Red Hat  2016-01-07  5802) 
b7bb Steven Rostedt (Red Hat  2016-01-07  5803) 
mutex_lock(_lock);
b7bb Steven Rostedt (Red Hat  2016-01-07  5804) 
b7bb Steven Rostedt (Red Hat  2016-01-07  5805) if (ftrace_disabled)
b7bb Steven Rostedt (Red Hat  2016-01-07  5806) goto out_unlock;
b7bb Steven Rostedt (Red Hat  2016-01-07  5807) 
b7bb Steven Rostedt (Red Hat  2016-01-07  5808) /*
b7bb Steven Rostedt (Red Hat  2016-01-07  5809)  * If the tracing is 
enabled, go ahead and enable the record.
b7bb Steven Rostedt (Red Hat  2016-01-07  5810)  *
b7bb Steven Rostedt (Red Hat  2016-01-07  5811)  * The reason not to 
enable the record immediatelly is the
b7bb Steven Rostedt (Red Hat  2016-01-07  5812)  * inherent check of 
ftrace_make_nop/ftrace_make_call for
b7bb Steven Rostedt (Red Hat  2016-01-07  5813)  * correct previous 
instructions.  Making first the NOP
b7bb Steven Rostedt (Red Hat  2016-01-07  5814)  * conversion puts the 
module to the correct state, thus
b7bb Steven Rostedt (Red Hat  2016-01-07  5815)  * passing the 
ftrace_make_call check.
b7bb Steven Rostedt (Red Hat  2016-01-07  5816)  *
b7bb Steven Rostedt (Red Hat  2016-01-07  5817)  * We also delay this 
to after the module code already set the
b7bb Steven Rostedt (Red Hat  2016-01-07  5818)  * text to read-only, 
as we now need to set it back to read-write
b7bb Steven Rostedt (Red Hat  2016-01-07  5819)  * so that we can 
modify the text.
b7bb Steven Rostedt (Red Hat  2016-01-07  5820)  */
b7bb Steven Rostedt (Red Hat  2016-01-07  5821) if (ftrace_start_up)
b7bb Steven Rostedt (Red Hat  2016-01-07  5822) 
ftrace_arch_code_modify_prepare();
b7bb Steven Rostedt (Red Hat  2016-01-07  5823) 
b7bb Steven Rostedt (Red Hat  2016-01-07  5824) 
do_for_each_ftrace_rec(pg, rec) {
b7bb Steven Rostedt (Red Hat  2016-01-07  5825) int cnt;
b7bb Steven Rostedt (Red Hat  2016-01-07  5826) /*
b7bb Steven Rostedt (Red Hat  2016-01-07  5827)  * 
do_for_each_ftrace_rec() is a double loop.
b7bb Steven Rostedt (Red Hat  2016-01-07  5828)  * module text 
shares the pg. If a record is
b7bb Steven Rostedt (Red Hat  2016-01-07  5829)  * not part of 
this module, then skip this pg,
b7bb Steven Rostedt (Red Hat  2016-01-07  5830)  * which the 
"break" will do.
b7bb