linux-stable/tools
Thomas Richter eb3d6cdf8a perf bench numa: Address compiler error on s390
[ Upstream commit f8ac1c4784 ]

The compilation on s390 results in this error:

  # make DEBUG=y bench/numa.o
  ...
  bench/numa.c: In function ‘__bench_numa’:
  bench/numa.c:1749:81: error: ‘%d’ directive output may be truncated
              writing between 1 and 11 bytes into a region of size between
              10 and 20 [-Werror=format-truncation=]
  1749 |        snprintf(tname, sizeof(tname), "process%d:thread%d", p, t);
                                                               ^~
  ...
  bench/numa.c:1749:64: note: directive argument in the range
                 [-2147483647, 2147483646]
  ...
  #

The maximum length of the %d replacement is 11 characters because of the
negative sign.  Therefore extend the array by two more characters.

Output after:

  # make  DEBUG=y bench/numa.o > /dev/null 2>&1; ll bench/numa.o
  -rw-r--r-- 1 root root 418320 May 19 09:11 bench/numa.o
  #

Fixes: 3aff8ba0a4 ("perf bench numa: Avoid possible truncation when using snprintf()")
Suggested-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20220520081158.2990006-1-tmricht@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-25 08:41:21 +02:00
..
accounting tools/accounting/getdelays.c: fix netlink attribute length 2020-04-13 10:34:33 +02:00
arch x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE 2022-03-11 10:13:28 +01:00
build tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts 2022-04-20 09:08:30 +02:00
cgroup
firewire
gpio tools: gpio-hammer: Avoid potential overflow in main 2020-10-01 13:12:39 +02:00
hv
iio
include perf tools: Correct SNOOPX field offset 2020-09-09 19:03:09 +02:00
kvm/kvm_stat tweewide: Fix most Shebang lines 2021-06-03 08:36:11 +02:00
laptop
leds
lib libsubcmd: Fix use-after-free for realloc(..., 0) 2022-02-23 11:57:34 +01:00
net
nfsd
objtool objtool: Support Clang non-section symbols in ORC generation 2021-02-10 09:12:08 +01:00
pci tools: PCI: Fix broken pcitest compilation 2019-11-24 08:23:34 +01:00
pcmcia
perf perf bench numa: Address compiler error on s390 2022-05-25 08:41:21 +02:00
power tweewide: Fix most Shebang lines 2021-06-03 08:36:11 +02:00
scripts tools: Let O= makes handle a relative path with -C option 2020-04-02 16:34:30 +02:00
spi
testing selftests/x86: Add validity check and allow field splitting 2022-04-20 09:08:12 +02:00
thermal/tmon
time
usb usb: testusb: Fix for showing the connection speed 2021-10-09 14:09:46 +02:00
virtio
vm tools/vm: fix cross-compile build 2020-05-02 17:24:22 +02:00
Makefile