kernel_optimize_test/tools/perf/bench
Arnaldo Carvalho de Melo 3aff8ba0a4 perf bench numa: Avoid possible truncation when using snprintf()
Addressing this warning from gcc 7:

    CC       /tmp/build/perf/bench/numa.o
  bench/numa.c: In function '__bench_numa':
  bench/numa.c:1582:42: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 8 and 17 [-Werror=format-truncation=]
       snprintf(tname, 32, "process%d:thread%d", p, t);
                                            ^~
  bench/numa.c:1582:25: note: directive argument in the range [0, 2147483647]
       snprintf(tname, 32, "process%d:thread%d", p, t);
                           ^~~~~~~~~~~~~~~~~~~~
  In file included from /usr/include/stdio.h:939:0,
                   from bench/../util/util.h:47,
                   from bench/../builtin.h:4,
                   from bench/numa.c:11:
  /usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 17 and 35 bytes into a destination of size 32
     return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          __bos (__s), __fmt, __va_arg_pack ());
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

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: Petr Holasek <pholasek@redhat.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-twa37vsfqcie5gwpqwnjuuz9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-02-09 14:39:42 -03:00
..
bench.h perf tools: Remove needless 'extern' from function prototypes 2016-03-23 15:06:35 -03:00
Build perf bench: Rename 'mem-memcpy.c' => 'mem-functions.c' 2015-10-19 15:39:39 -03:00
futex-hash.c perf bench futex: Sanitize numeric parameters 2016-10-25 09:50:53 -03:00
futex-lock-pi.c perf bench futex: Fix lock-pi help string 2016-12-20 09:37:40 -03:00
futex-requeue.c perf bench futex: Sanitize numeric parameters 2016-10-25 09:50:53 -03:00
futex-wake-parallel.c perf bench futex: Sanitize numeric parameters 2016-10-25 09:50:53 -03:00
futex-wake.c perf bench futex: Sanitize numeric parameters 2016-10-25 09:50:53 -03:00
futex.h perf bench futex: Sanitize numeric parameters 2016-10-25 09:50:53 -03:00
mem-functions.c perf bench mem: Move boilerplate memory allocation to the infrastructure 2016-10-24 11:07:43 -03:00
mem-memcpy-arch.h perf tools: Remove needless 'extern' from function prototypes 2016-03-23 15:06:35 -03:00
mem-memcpy-x86-64-asm-def.h perf/bench: Fix mem* routines usage after alternatives change 2015-03-03 18:01:10 +01:00
mem-memcpy-x86-64-asm.S perf bench: Copy kernel files needed to build mem{cpy,set} x86_64 benchmarks 2016-07-12 15:20:32 -03:00
mem-memset-arch.h perf tools: Remove needless 'extern' from function prototypes 2016-03-23 15:06:35 -03:00
mem-memset-x86-64-asm-def.h perf/bench: Fix mem* routines usage after alternatives change 2015-03-03 18:01:10 +01:00
mem-memset-x86-64-asm.S perf bench: Copy kernel files needed to build mem{cpy,set} x86_64 benchmarks 2016-07-12 15:20:32 -03:00
numa.c perf bench numa: Avoid possible truncation when using snprintf() 2017-02-09 14:39:42 -03:00
sched-messaging.c perf bench sched-messaging: Use USEC_PER_MSEC 2016-08-23 15:37:33 -03:00
sched-pipe.c perf bench sched-pipe: Use linux/time64.h, USEC_PER_SEC 2016-08-23 15:37:33 -03:00