CC: linux-kernel(a)vger.kernel.org
TO: Tom Zanussi <zanussi(a)kernel.org>
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/zanussi/linux-trace.git
ftrace/cleanup-hist-func-v2
head: 84eb6a8a61565e308b9908cbc63a897fde300c57
commit: 84eb6a8a61565e308b9908cbc63a897fde300c57 [2/2] tracing: Have existing
event_command implementations use helpers
config: riscv-buildonly-randconfig-r004-20211113 (attached as .config)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
c3dddeeafb529e769cde87bd29ef6271ac6bfa5c)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
#
https://git.kernel.org/pub/scm/linux/kernel/git/zanussi/linux-trace.git/c...
git remote add zanussi-trace
https://git.kernel.org/pub/scm/linux/kernel/git/zanussi/linux-trace.git
git fetch --no-tags zanussi-trace ftrace/cleanup-hist-func-v2
git checkout 84eb6a8a61565e308b9908cbc63a897fde300c57
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
> ld.lld: error: arch/riscv/built-in.a(kernel/ptrace.o):(function
__traceiter_sys_exit: .text+0x9a): relocation R_RISCV_HI20 out of range: 531906 is not in
[-524288, 524287]; references __tracepoint_sys_exit
>> referenced by ptrace.c
>> defined in arch/riscv/built-in.a(kernel/ptrace.o)
--
> ld.lld: error: arch/riscv/built-in.a(kernel/signal.o):(function
sys_rt_sigreturn: .text+0x1c): relocation R_RISCV_HI20 out of range: 524323 is not in
[-524288, 524287]; references do_no_restart_syscall
>> referenced by signal.c
>> defined in kernel/built-in.a(signal.o)
--
> ld.lld: error: kernel/built-in.a(fork.o):(function
__traceiter_task_newtask: .text+0x1a): relocation R_RISCV_HI20 out of range: 531906 is not
in [-524288, 524287]; references __tracepoint_task_newtask
>> referenced by fork.c
>> defined in kernel/built-in.a(fork.o)
--
In file included from kernel/trace/trace_events_trigger.c:15:
In file included from kernel/trace/trace.h:9:
In file included from include/linux/clocksource.h:22:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro
'__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from kernel/trace/trace_events_trigger.c:15:
In file included from kernel/trace/trace.h:9:
In file included from include/linux/clocksource.h:22:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro
'__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from kernel/trace/trace_events_trigger.c:15:
In file included from kernel/trace/trace.h:9:
In file included from include/linux/clocksource.h:22:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
> kernel/trace/trace_events_trigger.c:797:26: warning: variable
'trigger_ops' is uninitialized when used here [-Wuninitialized]
cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file);
^~~~~~~~~~~
kernel/trace/trace_events_trigger.c:782:39: note: initialize the variable
'trigger_ops' to silence this warning
struct event_trigger_ops *trigger_ops;
^
= NULL
8 warnings generated.
vim +/trigger_ops +797 kernel/trace/trace_events_trigger.c
2b228845d7aa04 Tom Zanussi 2021-11-05 759
2a2df321158817 Tom Zanussi 2013-10-24 760 /**
2a2df321158817 Tom Zanussi 2013-10-24 761 * event_trigger_callback -
Generic event_command @func implementation
2a2df321158817 Tom Zanussi 2013-10-24 762 * @cmd_ops: The command ops,
used for trigger registration
7f1d2f8210195c Steven Rostedt (Red Hat 2015-05-05 763) * @file: The trace_event_file
associated with the event
2a2df321158817 Tom Zanussi 2013-10-24 764 * @glob: The raw string used to
register the trigger
2a2df321158817 Tom Zanussi 2013-10-24 765 * @cmd: The cmd portion of the
string used to register the trigger
2a2df321158817 Tom Zanussi 2013-10-24 766 * @param: The params portion of
the string used to register the trigger
2a2df321158817 Tom Zanussi 2013-10-24 767 *
2a2df321158817 Tom Zanussi 2013-10-24 768 * Common implementation for
event command parsing and trigger
2a2df321158817 Tom Zanussi 2013-10-24 769 * instantiation.
2a2df321158817 Tom Zanussi 2013-10-24 770 *
2a2df321158817 Tom Zanussi 2013-10-24 771 * Usually used directly as the
@func method in event command
2a2df321158817 Tom Zanussi 2013-10-24 772 * implementations.
2a2df321158817 Tom Zanussi 2013-10-24 773 *
2a2df321158817 Tom Zanussi 2013-10-24 774 * Return: 0 on success, errno
otherwise
2a2df321158817 Tom Zanussi 2013-10-24 775 */
2a2df321158817 Tom Zanussi 2013-10-24 776 static int
2a2df321158817 Tom Zanussi 2013-10-24 777 event_trigger_callback(struct
event_command *cmd_ops,
7f1d2f8210195c Steven Rostedt (Red Hat 2015-05-05 778) struct trace_event_file
*file,
2a2df321158817 Tom Zanussi 2013-10-24 779 char *glob, char *cmd,
char *param)
2a2df321158817 Tom Zanussi 2013-10-24 780 {
2a2df321158817 Tom Zanussi 2013-10-24 781 struct event_trigger_data
*trigger_data;
2a2df321158817 Tom Zanussi 2013-10-24 782 struct event_trigger_ops
*trigger_ops;
2a2df321158817 Tom Zanussi 2013-10-24 783 char *trigger = NULL;
84eb6a8a61565e Tom Zanussi 2021-11-05 784 bool remove;
2a2df321158817 Tom Zanussi 2013-10-24 785 int ret;
2a2df321158817 Tom Zanussi 2013-10-24 786
84eb6a8a61565e Tom Zanussi 2021-11-05 787 ret = event_trigger_check(glob,
&trigger, ¶m, &remove, false, true);
84eb6a8a61565e Tom Zanussi 2021-11-05 788 if (ret)
84eb6a8a61565e Tom Zanussi 2021-11-05 789 return ret;
2a2df321158817 Tom Zanussi 2013-10-24 790
2a2df321158817 Tom Zanussi 2013-10-24 791 ret = -ENOMEM;
84eb6a8a61565e Tom Zanussi 2021-11-05 792 trigger_data =
event_trigger_alloc(cmd_ops, trigger, cmd, file);
2a2df321158817 Tom Zanussi 2013-10-24 793 if (!trigger_data)
2a2df321158817 Tom Zanussi 2013-10-24 794 goto out;
2a2df321158817 Tom Zanussi 2013-10-24 795
84eb6a8a61565e Tom Zanussi 2021-11-05 796 if (remove) {
2a2df321158817 Tom Zanussi 2013-10-24 @797 cmd_ops->unreg(glob+1,
trigger_ops, trigger_data, file);
2a2df321158817 Tom Zanussi 2013-10-24 798 ret = 0;
2a2df321158817 Tom Zanussi 2013-10-24 799 goto out;
2a2df321158817 Tom Zanussi 2013-10-24 800 }
2a2df321158817 Tom Zanussi 2013-10-24 801
84eb6a8a61565e Tom Zanussi 2021-11-05 802 ret =
event_trigger_parse_num(trigger, trigger_data);
2a2df321158817 Tom Zanussi 2013-10-24 803 if (ret)
2a2df321158817 Tom Zanussi 2013-10-24 804 goto out_free;
2a2df321158817 Tom Zanussi 2013-10-24 805
84eb6a8a61565e Tom Zanussi 2021-11-05 806 ret =
event_trigger_set_filter(cmd_ops, file, param, trigger_data);
2a2df321158817 Tom Zanussi 2013-10-24 807 if (ret < 0)
2a2df321158817 Tom Zanussi 2013-10-24 808 goto out_free;
2a2df321158817 Tom Zanussi 2013-10-24 809
1863c387259b62 Steven Rostedt (VMware 2018-07-24 810) /* Up the trigger_data count to
make sure reg doesn't free it on failure */
1863c387259b62 Steven Rostedt (VMware 2018-07-24 811) event_trigger_init(trigger_ops,
trigger_data);
84eb6a8a61565e Tom Zanussi 2021-11-05 812
84eb6a8a61565e Tom Zanussi 2021-11-05 813 ret =
event_trigger_register(cmd_ops, file, glob, cmd, trigger, trigger_data, NULL);
84eb6a8a61565e Tom Zanussi 2021-11-05 814 if (ret)
84eb6a8a61565e Tom Zanussi 2021-11-05 815 goto out_free;
1863c387259b62 Steven Rostedt (VMware 2018-07-24 816)
1863c387259b62 Steven Rostedt (VMware 2018-07-24 817) /* Down the counter of
trigger_data or free it if not used anymore */
1863c387259b62 Steven Rostedt (VMware 2018-07-24 818) event_trigger_free(trigger_ops,
trigger_data);
2a2df321158817 Tom Zanussi 2013-10-24 819 out:
2a2df321158817 Tom Zanussi 2013-10-24 820 return ret;
2a2df321158817 Tom Zanussi 2013-10-24 821 out_free:
84eb6a8a61565e Tom Zanussi 2021-11-05 822
event_trigger_reset_filter(cmd_ops, trigger_data);
2a2df321158817 Tom Zanussi 2013-10-24 823 kfree(trigger_data);
2a2df321158817 Tom Zanussi 2013-10-24 824 goto out;
2a2df321158817 Tom Zanussi 2013-10-24 825 }
2a2df321158817 Tom Zanussi 2013-10-24 826
:::::: The code at line 797 was first introduced by commit
:::::: 2a2df321158817811c5dc206dce808e0aa9f6d89 tracing: Add 'traceon' and
'traceoff' event trigger commands
:::::: TO: Tom Zanussi <tom.zanussi(a)linux.intel.com>
:::::: CC: Steven Rostedt <rostedt(a)goodmis.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org