android_kernel_oneplus_msm8998/tools/perf
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 probe powerpc: Ignore SyS symbols irrespective of endianness 2018-10-10 08:52:12 +02:00
bench perf bench numa: Fixup discontiguous/sparse numa nodes 2018-02-25 11:03:39 +01:00
config perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/ 2018-07-19 15:35:57 +02:00
Documentation perf stat: Document --detailed option 2016-05-04 14:48:53 -07:00
python perf python: Support the PERF_RECORD_SWITCH event 2015-10-07 19:41:50 -03:00
scripts perf script python: Fix export-to-postgresql.py occasional failure 2018-10-20 09:52:34 +02:00
tests perf test session topology: Fix test on s390 2018-08-24 13:26:56 +02:00
trace/strace/groups
ui perf annotate: Fix broken arrow at row 0 connecting jmp instruction to its target 2017-07-27 15:06:09 -07:00
util perf pmu: Suppress potential format-truncation warning 2019-01-13 10:05:30 +01:00
.gitignore
Build
builtin-annotate.c
builtin-bench.c perf bench: Run benchmarks, don't test them 2015-10-19 16:10:25 -03:00
builtin-buildid-cache.c
builtin-buildid-list.c perf buildid-list: Fix return value of perf buildid-list -k 2015-12-07 12:02:10 -03:00
builtin-data.c
builtin-diff.c
builtin-evlist.c perf tools: Introduce usage_with_options_msg() 2015-10-27 09:28:44 -03:00
builtin-help.c perf help: Change 'usage' to 'Usage' for consistency 2015-10-19 16:51:44 -03:00
builtin-inject.c perf inject: Also re-pipe lost_samples event 2015-11-13 12:23:12 -03:00
builtin-kmem.c perf machine: Add method for common kernel_map(FUNCTION) operation 2015-09-30 18:34:29 -03:00
builtin-kvm.c
builtin-list.c perf list: Do event name substring search as last resort when no events found 2015-10-01 12:12:22 -03:00
builtin-lock.c
builtin-mem.c
builtin-probe.c perf probe: Return errno when not hitting any event 2018-03-22 09:23:20 +01:00
builtin-record.c perf record: Add clang options for compiling BPF scripts 2015-10-29 17:16:22 -03:00
builtin-report.c perf symbols: Allow forcing reading of non-root owned files by root 2015-11-12 18:58:18 -03:00
builtin-sched.c perf sched latency: Fix thread pid reuse issue 2015-11-05 12:51:00 -03:00
builtin-script.c perf script: Use readdir() instead of deprecated readdir_r() 2017-07-15 11:57:48 +02:00
builtin-stat.c perf stat: Make stat options global 2015-11-05 17:54:34 -03:00
builtin-timechart.c
builtin-top.c perf top: Fix window dimensions change handling 2018-02-25 11:03:39 +01:00
builtin-trace.c perf trace: Add mmap alias for s390 2018-04-13 19:50:16 +02:00
builtin.h
command-list.txt
CREDITS
design.txt
Makefile perf tools: Disable parallelism for 'make clean' 2018-11-10 07:41:41 -08:00
Makefile.perf perf tools: Install tools/lib/traceevent plugins with install-bin 2017-08-06 19:19:46 -07:00
MANIFEST perf tools: Make perf depend on libbpf 2015-10-28 12:48:12 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/ 2018-07-19 15:35:57 +02:00
perf-with-kcore.sh
perf.c perf tools: Enable passing bpf object file to --event 2015-10-28 12:48:12 -03:00
perf.h perf tools: Allow overriding MAX_NR_CPUS at compile time 2018-09-19 22:48:57 +02:00