1
0
Fork 0
remarkable-linux/tools/perf
Jiri Olsa d0c9f9f9fb perf tools: Fix snprint warnings for gcc 8
commit 77f18153c0 upstream.

With gcc 8 we get new set of snprintf() warnings that breaks the
compilation, one example:

  tests/mem.c: In function ‘check’:
  tests/mem.c:19:48: error: ‘%s’ directive output may be truncated writing \
        up to 99 bytes into a region of size 89 [-Werror=format-truncation=]
    snprintf(failure, sizeof failure, "unexpected %s", out);

The gcc docs says:

 To avoid the warning either use a bigger buffer or handle the
 function's return value which indicates whether or not its output
 has been truncated.

Given that all these warnings are harmless, because the code either
properly fails due to uncomplete file path or we don't care for
truncated output at all, I'm changing all those snprintf() calls to
scnprintf(), which actually 'checks' for the snprint return value so the
gcc stays silent.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Link: http://lkml.kernel.org/r/20180319082902.4518-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ignat Korchagin <ignat@cloudflare.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-18 09:16:28 +02:00
..
Documentation perf record: Fix documentation for a inexistent option '-l' 2017-10-17 09:05:36 -03:00
arch perf probe powerpc: Ignore SyS symbols irrespective of endianness 2018-10-10 08:54:23 +02:00
bench perf bench: Fix numa report output code 2018-08-24 13:09:07 +02:00
jvmti perf tools: Fix compilation errors on gcc8 2018-08-24 13:09:16 +02:00
pmu-events perf vendor events: Add Goldmont Plus V1 event file 2018-07-03 11:25:01 +02:00
python License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
scripts perf script python: Fix export-to-sqlite.py sample columns 2018-10-18 09:16:23 +02:00
tests perf tools: Fix snprint warnings for gcc 8 2018-10-18 09:16:28 +02:00
trace License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ui perf report: Fix wrong jump arrow 2018-05-30 07:52:40 +02:00
util perf tools: Fix snprint warnings for gcc 8 2018-10-18 09:16:28 +02:00
.gitignore perf tools: Add trace/beauty/generated/ into .gitignore 2018-05-30 12:19:59 +02:00
Build perf trace: Only build tools/perf/trace/beauty/ when building 'perf trace' 2017-07-18 23:13:52 -03:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
MANIFEST perf tools: Get all of tools/{arch,include}/ in the MANIFEST 2017-09-25 10:39:43 -03:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.config perf tools: Robustify detection of clang binary 2017-08-28 16:44:46 -03:00
Makefile.perf perf tools: Fix perf builds with clang support 2018-05-30 07:52:23 +02:00
builtin-annotate.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-bench.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-buildid-cache.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-buildid-list.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-c2c.c perf c2c report: Fix crash for empty browser 2018-09-19 22:43:40 +02:00
builtin-config.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-data.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-diff.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-evlist.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-ftrace.c tools include: Adopt strstarts() from the kernel 2017-07-20 15:46:10 -03:00
builtin-help.c perf help: Fix a bug during strstart() conversion 2018-02-25 11:07:54 +01:00
builtin-inject.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-kallsyms.c perf tools: Including missing inttypes.h header 2017-04-19 13:01:46 -03:00
builtin-kmem.c kmemcheck: remove whats left of NOTRACK flags 2018-02-22 15:42:23 +01:00
builtin-kvm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-list.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-lock.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-mem.c perf tools: Fix leaking rec_argv in error cases 2017-12-10 13:40:43 +01:00
builtin-probe.c perf buildid-cache: Support binary objects from other namespaces 2017-07-18 23:14:11 -03:00
builtin-record.c Revert "perf record: Fix crash in pipe mode" 2018-05-30 12:19:59 +02:00
builtin-report.c perf unwind: Do not look just at the global callchain_param.record_mode 2018-04-26 11:02:06 +02:00
builtin-sched.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin-script.c perf tools: Fix snprint warnings for gcc 8 2018-10-18 09:16:28 +02:00
builtin-stat.c perf stat: Fix core dump when flag T is used 2018-05-30 07:52:31 +02:00
builtin-timechart.c perf tools: Fix leaking rec_argv in error cases 2017-12-10 13:40:43 +01:00
builtin-top.c perf top: Fix top.call-graph config option reading 2018-05-30 07:52:31 +02:00
builtin-trace.c perf tools: Fix leaking rec_argv in error cases 2017-12-10 13:40:43 +01:00
builtin-version.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
builtin.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
check-headers.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
command-list.txt perf tools: Missing c2c command in command-list 2017-03-13 10:59:31 -03:00
design.txt perf tools: Update some code references in design.txt 2014-03-18 18:17:06 -03:00
perf-archive.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-completion.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-read-vdso.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-sys.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf-with-kcore.sh perf tools: Fix perf-with-kcore handling of arguments containing spaces 2015-08-06 16:48:27 -03:00
perf.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf.h perf tools: Allow overriding MAX_NR_CPUS at compile time 2018-09-19 22:43:40 +02:00