android_kernel_oneplus_msm8998/tools
Ben Hutchings efe22fbaa3 perf pmu: Suppress potential format-truncation warning
commit 11a64a05dc649815670b1be9fe63d205cb076401 upstream.

Depending on which functions are inlined in util/pmu.c, the snprintf()
calls in perf_pmu__parse_{scale,unit,per_pkg,snapshot}() might trigger a
warning:

  util/pmu.c: In function 'pmu_aliases':
  util/pmu.c:178:31: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
    snprintf(path, PATH_MAX, "%s/%s.unit", dir, name);
                               ^~

I found this when trying to build perf from Linux 3.16 with gcc 8.
However I can reproduce the problem in mainline if I force
__perf_pmu__new_alias() to be inlined.

Suppress this by using scnprintf() as has been done elsewhere in perf.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20181111184524.fux4taownc6ndbx6@decadent.org.uk
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13 10:05:30 +01:00
..
arch perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/ 2018-07-19 15:35:57 +02:00
build Kbuild: fix # escaping in .cmd files for future Make 2018-07-19 15:35:57 +02:00
cgroup
firewire
hv Tools: hv: Fix a bug in the key delete code 2018-09-26 08:35:07 +02:00
iio iio: generic_buffer: be helpful about enabling channels 2015-08-16 10:51:26 +01:00
include tools include: Add a __fallthrough statement 2017-07-15 11:57:47 +02:00
laptop/freefall Move freefall program from Documentation/ to tools/ 2015-06-08 16:42:07 -06:00
lguest tools/lguest: Clean up include dir 2015-08-26 06:12:35 +02:00
lib tools/libbpf: handle issues with bpf ELF objects containing .eh_frames 2018-05-30 07:48:57 +02:00
net tools/net: Use include/uapi with __EXPORTED_HEADERS__ 2015-11-15 17:24:33 -05:00
nfsd
perf perf pmu: Suppress potential format-truncation warning 2019-01-13 10:05:30 +01:00
power tools/power turbostat: Read extended processor family from CPUID 2018-09-05 09:18:36 +02:00
scripts Kbuild: fix # escaping in .cmd files for future Make 2018-07-19 15:35:57 +02:00
testing selftests: Move networking/timestamping from Documentation 2018-12-17 21:55:17 +01:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-05-30 07:49:10 +02:00
time
usb tools: usb: ffs-test: Fix build on big endian systems 2018-09-05 09:18:34 +02:00
virtio tools/virtio: fix byteswap logic 2015-12-07 17:28:10 +02:00
vm tools/vm/page-types.c: fix "defined but not used" warning 2018-10-10 08:52:11 +02:00
Makefile tools: Add a "make all" rule 2015-11-12 18:58:10 -03:00