alistair23-linux/tools/perf
Jiri Olsa dab0f4ebb2 perf jvmti: Address gcc string overflow warning for strncpy()
We are getting false positive gcc warning when we compile with gcc9 (9.1.1):

     CC       jvmti/libjvmti.o
   In file included from /usr/include/string.h:494,
                    from jvmti/libjvmti.c:5:
   In function ‘strncpy’,
       inlined from ‘copy_class_filename.constprop’ at jvmti/libjvmti.c:166:3:
   /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
     106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   jvmti/libjvmti.c: In function ‘copy_class_filename.constprop’:
   jvmti/libjvmti.c:165:26: note: length computed here
     165 |   size_t file_name_len = strlen(file_name);
         |                          ^~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors

As per Arnaldo's suggestion use strlcpy(), which does the same thing and keeps
gcc silent.

Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ben Gainey <ben.gainey@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20190531131321.GB1281@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-07-07 12:33:32 -03:00
..
arch Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-06-29 19:39:17 +08:00
bench perf bench numa: Add define for RUSAGE_THREAD if not present 2019-05-02 16:00:20 -04:00
Documentation treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
examples/bpf perf augmented_raw_syscalls: Use a PERCPU_ARRAY map to copy more string bytes 2019-04-01 14:49:24 -03:00
include/bpf perf bpf: Automatically add BTF ELF markers 2019-03-06 09:45:37 -03:00
jvmti perf jvmti: Address gcc string overflow warning for strncpy() 2019-07-07 12:33:32 -03:00
pmu-events perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events 2019-05-15 16:36:49 -03:00
python treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 407 2019-06-05 17:37:14 +02:00
scripts treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166 2019-05-30 11:26:39 -07:00
tests perf tests: Fix record+probe_libc_inet_pton.sh for powerpc64 2019-07-06 14:31:01 -03:00
trace perf trace beauty renameat: No need to include linux/fs.h 2019-04-01 14:49:24 -03:00
ui perf annotate TUI browser: Do not use member from variable within its own initialization 2019-07-06 16:59:11 -03:00
util perf python: Remove -fstack-protector-strong if clang doesn't have it 2019-07-07 12:32:46 -03:00
.gitignore
Build perf tools: Rename build libperf to perf 2019-02-14 15:18:08 -03:00
builtin-annotate.c perf annotate: Remove hist__account_cycles() from callback 2019-05-15 16:36:46 -03:00
builtin-bench.c perf bench: Add epoll_ctl(2) benchmark 2018-11-21 22:39:55 -03:00
builtin-buildid-cache.c perf data: Add global path holder 2019-02-22 16:52:07 -03:00
builtin-buildid-list.c perf data: Add global path holder 2019-02-22 16:52:07 -03:00
builtin-c2c.c perf c2c: Fix c2c report for empty numa node 2019-03-06 18:15:24 -03:00
builtin-config.c perf config: Show the configuration when no arguments are provided 2018-12-18 12:24:00 -03:00
builtin-data.c
builtin-diff.c perf diff: Support --pid/--tid filter options 2019-03-06 18:06:16 -03:00
builtin-evlist.c perf data: Add global path holder 2019-02-22 16:52:07 -03:00
builtin-ftrace.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 433 2019-06-05 17:37:16 +02:00
builtin-help.c perf help: Remove needless use of strncpy() 2018-12-17 14:59:18 -03:00
builtin-inject.c perf inject: Enable COMPRESSED record decompression 2019-05-15 16:36:49 -03:00
builtin-kallsyms.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 251 2019-06-05 17:30:26 +02:00
builtin-kmem.c perf tools, tools lib traceevent: Rename "pevent" member of struct tep_event to "tep" 2019-04-01 15:18:10 -03:00
builtin-kvm.c perf data: Add global path holder 2019-02-22 16:52:07 -03:00
builtin-list.c perf list: Output tool events 2019-04-01 14:49:25 -03:00
builtin-lock.c perf data: Add global path holder 2019-02-22 16:52:07 -03:00
builtin-mem.c perf data: Add global path holder 2019-02-22 16:52:07 -03:00
builtin-probe.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
builtin-record.c perf parse-regs: Split parse_regs 2019-05-15 16:36:49 -03:00
builtin-report.c perf report: Implement perf.data record decompression 2019-05-15 16:36:49 -03:00
builtin-sched.c perf data: Add global path holder 2019-02-22 16:52:07 -03:00
builtin-script.c perf script: Support relative time 2019-03-19 16:52:03 -03:00
builtin-stat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 251 2019-06-05 17:30:26 +02:00
builtin-timechart.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
builtin-top.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 251 2019-06-05 17:30:26 +02:00
builtin-trace.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 251 2019-06-05 17:30:26 +02:00
builtin-version.c tools build: Implement libzstd feature check, LIBZSTD_DIR and NO_LIBZSTD defines 2019-04-01 15:18:10 -03:00
builtin.h perf script: Add array bound checking to list_scripts 2019-03-11 16:33:19 -03:00
check-headers.sh tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h 2019-03-28 14:31:56 -03:00
command-list.txt perf help: Add missing subcommand version 2018-09-19 14:53:36 -03:00
CREDITS
design.txt perf/doc: Update design.txt for exclude_{host|guest} flags 2019-01-21 11:01:18 +01:00
Makefile perf tools: Disable parallelism for 'make clean' 2018-08-20 08:54:58 -03:00
Makefile.config treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile.perf treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-read-vdso.c perf tools: Make find_vdso_map() more modular 2019-01-08 13:28:13 -03:00
perf-sys.h
perf-with-kcore.sh treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
perf.c perf bpf: Save bpf_prog_info in a rbtree in perf_env 2019-03-19 16:52:06 -03:00
perf.h perf record: Implement COMPRESSED event record and its attributes 2019-05-15 16:36:49 -03:00