Hi Tom,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on trace/for-next]
[also build test WARNING on linux/master linus/master v5.10 next-20201217]
[cannot apply to tip/perf/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Tom-Zanussi/tracing-More-synthet...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
config: riscv-randconfig-r014-20201217 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
cee1e7d14f4628d6174b33640d502bff3b54ae45)
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://github.com/0day-ci/linux/commit/aa73dabdbd071e2cb537b974c0b4308d2...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Tom-Zanussi/tracing-More-synthetic-event-error-fixes/20201218-052110
git checkout aa73dabdbd071e2cb537b974c0b4308d24f8d4ef
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE +
(c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:88:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force
__le16)__raw_readw(c)); __r; })
^
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_synth.c:18:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:57:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE +
(c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force
__le32)__raw_readl(c)); __r; })
^
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_synth.c:18:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c)));
__io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from kernel/trace/trace_events_synth.c:18:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c)));
__io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from kernel/trace/trace_events_synth.c:18:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null
pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:61:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c)));
__io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from kernel/trace/trace_events_synth.c:18:
In file included from include/linux/trace_events.h:9:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:13:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:1005: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_synth.c:1508:6: warning: variable
'save_argv' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (!argc)
^~~~~
kernel/trace/trace_events_synth.c:1564:12: note: uninitialized use occurs here
argv_free(save_argv);
^~~~~~~~~
kernel/trace/trace_events_synth.c:1508:2: note: remove the 'if' if its
condition is always false
if (!argc)
^~~~~~~~~~
kernel/trace/trace_events_synth.c:1496:33: note: initialize the variable
'save_argv' to silence this warning
char *name, **argv, **save_argv;
^
= NULL
> kernel/trace/trace_events_synth.c:1508:6: warning: variable
'buf' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (!argc)
^~~~~
kernel/trace/trace_events_synth.c:1566:9: note: uninitialized use occurs here
return buf;
^~~
kernel/trace/trace_events_synth.c:1508:2: note: remove the 'if' if its
condition is always false
if (!argc)
^~~~~~~~~~
kernel/trace/trace_events_synth.c:1500:11: note: initialize the variable 'buf'
to silence this warning
char *buf;
^
= NULL
9 warnings generated.
/tmp/trace_events_synth-97fa74.s: Assembler messages:
/tmp/trace_events_synth-97fa74.s:3701: Error: unrecognized opcode `zext.b a2,a2'
/tmp/trace_events_synth-97fa74.s:4380: Error: unrecognized opcode `zext.b s1,s1'
/tmp/trace_events_synth-97fa74.s:4474: Error: unrecognized opcode `zext.b a5,a0'
/tmp/trace_events_synth-97fa74.s:4705: Error: unrecognized opcode `zext.b a1,a1'
/tmp/trace_events_synth-97fa74.s:5065: Error: unrecognized opcode `zext.b a5,a0'
/tmp/trace_events_synth-97fa74.s:5399: Error: unrecognized opcode `zext.b a5,a0'
/tmp/trace_events_synth-97fa74.s:5459: Error: unrecognized opcode `zext.b a5,a0'
/tmp/trace_events_synth-97fa74.s:5516: Error: unrecognized opcode `zext.b a5,a0'
/tmp/trace_events_synth-97fa74.s:5571: Error: unrecognized opcode `zext.b a5,a0'
/tmp/trace_events_synth-97fa74.s:5648: Error: unrecognized opcode `zext.b a5,a0'
/tmp/trace_events_synth-97fa74.s:5682: Error: unrecognized opcode `zext.b a5,a0'
/tmp/trace_events_synth-97fa74.s:7129: Error: unrecognized opcode `zext.b a3,a3'
clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
vim +1508 kernel/trace/trace_events_synth.c
1492
1493 static char *insert_semicolons(const char *raw_command)
1494 {
1495 int i, argc, consumed = 0, n_fields = 0, semis_added = 0;
1496 char *name, **argv, **save_argv;
1497 int ret = -EINVAL;
1498 struct seq_buf s;
1499 bool added_semi;
1500 char *buf;
1501
1502 argc = 0;
1503
1504 argv = argv_split(GFP_KERNEL, raw_command, &argc);
1505 if (!argv)
1506 return NULL;
1507
1508 if (!argc)
1509 goto out;
1510
1511 name = argv[0];
1512 save_argv = argv;
1513 argv++;
1514 argc--;
1515
1516 buf = kzalloc(MAX_DYNEVENT_CMD_LEN, GFP_KERNEL);
1517 if (!buf) {
1518 ret = -ENOMEM;
1519 goto err;
1520 }
1521
1522 seq_buf_init(&s, buf, MAX_DYNEVENT_CMD_LEN);
1523
1524 seq_buf_puts(&s, name);
1525 seq_buf_putc(&s, ' ');
1526
1527 if (name[0] == '\0' || argc < 1)
1528 goto err;
1529
1530 for (i = 0; i < argc - 1; i++) {
1531 if (strcmp(argv[i], ";") == 0) {
1532 seq_buf_puts(&s, " ; ");
1533 continue;
1534 }
1535
1536 if (n_fields == SYNTH_FIELDS_MAX)
1537 goto err;
1538
1539 ret = save_synth_field(argc - i, &argv[i], &consumed,
1540 &s, &added_semi);
1541 if (ret)
1542 goto err;
1543
1544 if (added_semi)
1545 semis_added++;
1546
1547 i += consumed - 1;
1548 }
1549
1550 if (i < argc && strcmp(argv[i], ";") != 0)
1551 goto err;
1552
1553 if (!semis_added) {
1554 kfree(buf);
1555 buf = NULL;
1556 goto out;
1557 }
1558
1559 if (WARN_ON_ONCE(!seq_buf_buffer_left(&s)))
1560 goto err;
1561
1562 buf[s.len] = '\0';
1563 out:
1564 argv_free(save_argv);
1565
1566 return buf;
1567 err:
1568 kfree(buf);
1569 buf = ERR_PTR(ret);
1570
1571 goto out;
1572 }
1573
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org