]> Git Repo - linux.git/commit
perf tools: Fix arm64 build error with gcc-11
authorJianlin Lv <[email protected]>
Thu, 18 Feb 2021 03:12:45 +0000 (11:12 +0800)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 18 Feb 2021 19:24:43 +0000 (16:24 -0300)
commit067012974c8ae31a8886046df082aeba93592972
tree160ecb6e5b9d59ae855fa4e4ed79ffea56832080
parent865eb3fb3bf0fe072a8920004ced8fccaf9f53c2
perf tools: Fix arm64 build error with gcc-11

gcc version: 11.0.0 20210208 (experimental) (GCC)

Following build error on arm64:

.......
In function ‘printf’,
    inlined from ‘regs_dump__printf’ at util/session.c:1141:3,
    inlined from ‘regs__printf’ at util/session.c:1169:2:
/usr/include/aarch64-linux-gnu/bits/stdio2.h:107:10: \
  error: ‘%-5s’ directive argument is null [-Werror=format-overflow=]

107 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, \
                __va_arg_pack ());

......
In function ‘fprintf’,
  inlined from ‘perf_sample__fprintf_regs.isra’ at \
    builtin-script.c:622:14:
/usr/include/aarch64-linux-gnu/bits/stdio2.h:100:10: \
    error: ‘%5s’ directive argument is null [-Werror=format-overflow=]
  100 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
  101 |                         __va_arg_pack ());

cc1: all warnings being treated as errors
.......

This patch fixes Wformat-overflow warnings. Add helper function to
convert NULL to "unknown".

Signed-off-by: Jianlin Lv <[email protected]>
Reviewed-by: John Garry <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Albert Ou <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Anju T Sudhakar <[email protected]>
Cc: Athira Jajeev <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Kajol Jain <[email protected]>
Cc: Leo Yan <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Mathieu Poirier <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/arch/arm/include/perf_regs.h
tools/perf/arch/arm64/include/perf_regs.h
tools/perf/arch/csky/include/perf_regs.h
tools/perf/arch/powerpc/include/perf_regs.h
tools/perf/arch/riscv/include/perf_regs.h
tools/perf/arch/s390/include/perf_regs.h
tools/perf/arch/x86/include/perf_regs.h
tools/perf/util/perf_regs.h
This page took 0.094242 seconds and 4 git commands to generate.