tmp_suning_uos_patched/tools/perf/bench
Thomas Richter c5af341747 perf bench numa: Address compiler error on s390
[ Upstream commit f8ac1c478424a9a14669b8cef7389b1e14e5229d ]

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 09:18:00 +02:00
..
bench.h
Build
epoll-ctl.c
epoll-wait.c
find-bit-bench.c
futex-hash.c
futex-lock-pi.c perf bench futex: Fix memory leak of perf_cpu_map__new() 2021-11-26 10:39:13 +01:00
futex-requeue.c perf bench futex: Fix memory leak of perf_cpu_map__new() 2021-11-26 10:39:13 +01:00
futex-wake-parallel.c perf bench futex: Fix memory leak of perf_cpu_map__new() 2021-11-26 10:39:13 +01:00
futex-wake.c perf bench futex: Fix memory leak of perf_cpu_map__new() 2021-11-26 10:39:13 +01:00
futex.h
inject-buildid.c perf bench inject-buildid: Handle writen() errors 2021-09-22 12:28:04 +02:00
kallsyms-parse.c
mem-functions.c
mem-memcpy-arch.h
mem-memcpy-x86-64-asm-def.h
mem-memcpy-x86-64-asm.S
mem-memset-arch.h
mem-memset-x86-64-asm-def.h
mem-memset-x86-64-asm.S
numa.c perf bench numa: Address compiler error on s390 2022-05-25 09:18:00 +02:00
sched-messaging.c
sched-pipe.c
synthesize.c
syscall.c