android_kernel_xiaomi_sdm845/tools/perf
Arnaldo Carvalho de Melo c423f186b6 perf map: Tighten snprintf() string precision to pass gcc check on some 32-bit arches
commit 77d02bd00cea9f1a87afe58113fa75b983d6c23a upstream.

Noticed on a debian:experimental mips and mipsel cross build build
environment:

  perfbuilder@ec265a086e9b:~$ mips-linux-gnu-gcc --version | head -1
  mips-linux-gnu-gcc (Debian 10.2.1-3) 10.2.1 20201224
  perfbuilder@ec265a086e9b:~$

    CC       /tmp/build/perf/util/map.o
  util/map.c: In function 'map__new':
  util/map.c:109:5: error: '%s' directive output may be truncated writing between 1 and 2147483645 bytes into a region of size 4096 [-Werror=format-truncation=]
    109 |    "%s/platforms/%s/arch-%s/usr/lib/%s",
        |     ^~
  In file included from /usr/mips-linux-gnu/include/stdio.h:867,
                   from util/symbol.h:11,
                   from util/map.c:2:
  /usr/mips-linux-gnu/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output 32 or more bytes (assuming 4294967321) into a destination of size 4096
     67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     68 |        __bos (__s), __fmt, __va_arg_pack ());
        |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Since we have the lenghts for what lands in that place, use it to give
the compiler more info and make it happy.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-16 11:59:12 +02:00
..
arch perf record: Fix module size on s390 2019-08-25 10:51:21 +02:00
bench perf bench numa: Fix cpu0 binding 2019-09-06 10:19:33 +02:00
Documentation perf record/stat: Explicitly call out event modifiers in the documentation 2020-09-12 11:47:32 +02:00
jvmti
pmu-events perf jevents: Fix period for Intel fixed counters 2019-11-06 12:18:06 +01:00
python
scripts
tests perf test: Fix unaligned access in sample parsing test 2021-03-03 17:44:39 +01:00
trace
ui perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc 2020-03-11 07:53:08 +01:00
util perf map: Tighten snprintf() string precision to pass gcc check on some 32-bit arches 2021-04-16 11:59:12 +02:00
.gitignore
Build
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-config.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-help.c perf help: Remove needless use of strncpy() 2019-07-10 09:55:36 +02:00
builtin-inject.c
builtin-kmem.c perf kmem: Fix memory leak in compact_gfp_flags() 2019-11-10 11:23:16 +01:00
builtin-kvm.c
builtin-list.c
builtin-lock.c perf lock: Don't free "lock_seq_stat" if read_count isn't zero 2020-11-24 13:03:02 +01:00
builtin-mem.c
builtin-probe.c perf probe: Do not show the skipped events 2020-06-20 10:24:22 +02:00
builtin-record.c
builtin-report.c perf report: Fix NULL pointer dereference in hists__fprintf_nr_sample_events() 2020-06-30 15:38:30 -04:00
builtin-sched.c
builtin-script.c perf tools: Fix snprint warnings for gcc 8 2020-07-31 16:44:07 +02:00
builtin-stat.c perf stat: Reset previous counts on repeat with interval 2019-10-17 13:42:17 -07:00
builtin-timechart.c
builtin-top.c perf top: Fix stdio interface input handling with glibc 2.28+ 2020-10-14 09:48:15 +02:00
builtin-trace.c
builtin-version.c
builtin.h
check-headers.sh tools include: Adopt linux/bits.h 2019-05-31 06:48:13 -07:00
command-list.txt
CREDITS
design.txt
Makefile tools: Let O= makes handle a relative path with -C option 2020-04-02 17:20:36 +02:00
Makefile.config
Makefile.perf
MANIFEST
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c
perf.h perf tools: Increase MAX_NR_CPUS and MAX_CACHES 2019-08-04 09:33:22 +02:00