alistair23-linux/tools/perf
Arnaldo Carvalho de Melo 2e2bbc039f perf tests: Avoid possible truncation with dirent->d_name + snprintf
Addressing a few cases spotted by a new warning in gcc 7:

  tests/parse-events.c: In function 'test_pmu_events':
  tests/parse-events.c:1790:39: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 90 [-Werror=format-truncation=]
     snprintf(name, MAX_NAME, "cpu/event=%s/u", ent->d_name);
                                       ^~
  In file included from /usr/include/stdio.h:939:0,
                   from /git/linux/tools/perf/util/map.h:9,
                   from /git/linux/tools/perf/util/symbol.h:7,
                   from /git/linux/tools/perf/util/evsel.h:10,
                   from tests/parse-events.c:3:
  /usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 13 and 268 bytes into a destination of size 100
     return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          __bos (__s), __fmt, __va_arg_pack ());
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  tests/parse-events.c:1798:29: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 100 [-Werror=format-truncation=]
     snprintf(name, MAX_NAME, "%s:u,cpu/event=%s/u", ent->d_name, ent->d_name);

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 945aea220b ("perf tests: Move test objects into 'tests' directory")
Link: http://lkml.kernel.org/n/tip-ty4q2p8zp1dp3mskvubxskm5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-02-09 14:48:46 -03:00
..
arch perf tools arm64: Add support for generating bpf prologue 2017-02-08 08:55:01 -03:00
bench perf bench numa: Avoid possible truncation when using snprintf() 2017-02-09 14:39:42 -03:00
Documentation perf ftrace: Introduce new 'ftrace' tool 2017-01-26 11:43:01 -03:00
jvmti perf kvmti: Remove unused Makefile file 2016-11-14 12:42:56 -03:00
pmu-events perf vendor events intel: Add uncore events for Broadwell DE 2017-02-08 16:38:25 -03:00
python perf python: Add tracepoint example 2016-07-12 16:23:35 -03:00
scripts perf/core improvements and fixes: 2016-08-04 11:02:38 +02:00
tests perf tests: Avoid possible truncation with dirent->d_name + snprintf 2017-02-09 14:48:46 -03:00
trace perf trace: Check if MAP_32BIT is defined (again) 2016-12-20 09:37:40 -03:00
ui Merge remote-tracking branch 'tip/perf/urgent' into perf/core 2017-02-06 11:09:26 -03:00
util perf header: Fix handling of PERF_EVENT_UPDATE__SCALE 2017-02-08 22:06:18 -03:00
.gitignore perf tools: Add arch/*/include/generated/ to .gitignore 2016-05-30 12:41:46 -03:00
Build perf ftrace: Introduce new 'ftrace' tool 2017-01-26 11:43:01 -03:00
builtin-annotate.c perf annotate: Add branch stack / basic block 2016-09-08 13:44:03 -03:00
builtin-bench.c
builtin-buildid-cache.c tools: Introduce str_error_r() 2016-07-12 15:19:47 -03:00
builtin-buildid-list.c
builtin-c2c.c perf c2c report: Coalesce by default only by pid,iaddr 2017-01-20 16:52:56 -03:00
builtin-config.c perf config: Mark where are config items from (user or system) 2016-11-14 13:10:37 -03:00
builtin-data.c perf data ctf: Add '--all' option for 'perf data convert' 2016-06-28 10:54:57 -03:00
builtin-diff.c perf diff: Fix -o/--order option behavior (again) 2017-02-02 11:39:09 -03:00
builtin-evlist.c perf evlist: Rename for_each() macros to for_each_entry() 2016-06-23 11:26:15 -03:00
builtin-ftrace.c perf ftrace: Add ftrace.tracer config option 2017-01-31 16:20:09 -03:00
builtin-help.c perf tools: Propagate perf_config() errors 2017-01-27 12:23:33 -03:00
builtin-inject.c perf symbols: Remove symbol_filter_t machinery 2016-09-05 11:14:50 -03:00
builtin-kallsyms.c perf kallsyms: Introduce tool to look for extended symbol information on the running kernel 2017-01-11 16:48:01 -03:00
builtin-kmem.c perf tools: Propagate perf_config() errors 2017-01-27 12:23:33 -03:00
builtin-kvm.c perf kvm: Use NSEC_PER_USEC 2016-08-23 15:37:33 -03:00
builtin-list.c perf list: Add debug support for outputing alias string 2017-02-08 08:55:04 -03:00
builtin-lock.c
builtin-mem.c perf mem: Fix --all-user/--all-kernel options 2016-12-15 16:25:45 -03:00
builtin-probe.c perf probe: Add option --symfs 2017-02-08 09:41:10 -03:00
builtin-record.c perf tools: Propagate perf_config() errors 2017-01-27 12:23:33 -03:00
builtin-report.c perf tools: Propagate perf_config() errors 2017-01-27 12:23:33 -03:00
builtin-sched.c perf sched timehist: Show total wait times for summary 2017-01-17 11:36:44 -03:00
builtin-script.c perf script: Also allow forcing reading of non-root owned files by root 2017-01-16 14:59:15 -03:00
builtin-stat.c perf tools: Remove some needless __maybe_unused 2016-12-15 16:25:45 -03:00
builtin-timechart.c perf timechart: Use NSEC_PER_U?SEC 2016-08-23 15:37:33 -03:00
builtin-top.c perf top: Use __fallthrough 2017-02-08 17:31:22 -03:00
builtin-trace.c perf trace: Allow specifying list of syscalls and events in -e/--expr/--event 2017-01-11 16:48:01 -03:00
builtin-version.c
builtin.h perf ftrace: Introduce new 'ftrace' tool 2017-01-26 11:43:01 -03:00
check-headers.sh perf tools: Move headers check into bash script 2016-12-15 16:25:44 -03:00
command-list.txt perf ftrace: Introduce new 'ftrace' tool 2017-01-26 11:43:01 -03:00
CREDITS
design.txt
Makefile
Makefile.config perf tools: Remove unneccessary feature-dwarf warning 2017-01-16 14:59:15 -03:00
Makefile.perf perf jvmti: Create libdir directory before installing libperf-jvmti.so 2017-01-11 16:48:00 -03:00
MANIFEST tools lib: Add for_each_clear_bit macro 2016-10-24 11:07:33 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h perf powerpc: Fix build-test failure 2016-09-08 13:44:07 -03:00
perf-with-kcore.sh
perf.c perf tools: Propagate perf_config() errors 2017-01-27 12:23:33 -03:00
perf.h perf evsel: Allow to ignore missing pid 2016-12-15 16:25:46 -03:00