kernel_optimize_test/tools/perf/bench
Arnaldo Carvalho de Melo 16cab3226f Revert "perf bench futex: Sanitize numeric parameters"
This reverts commit 60758d6668.

Now that libsubcmd makes sure that OPT_UINTEGER options will not
return negative values, we can revert this patch while addressing
the problem it solved:

  # perf bench futex hash -t  -4
  # Running 'futex/hash' benchmark:
   Error: switch `t' expects an unsigned numerical value
   Usage: perf bench futex hash <options>

      -t, --threads <n>     Specify amount of threads
  # perf bench futex hash -t-4
  # Running 'futex/hash' benchmark:
   Error: switch `t' expects an unsigned numerical value
   Usage: perf bench futex hash <options>

      -t, --threads <n>     Specify amount of threads
  #

IMO it is more reasonable to flat out refuse to process a negative
number than to silently turn it into an absolute value.

This also helps in silencing clang's complaint about asking for an
absolute value of an unsigned integer:

  bench/futex-hash.c:133:10: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
          nsecs = futexbench_sanitize_numeric(nsecs);
                ^
  bench/futex.h:104:42: note: expanded from macro 'futexbench_sanitize_numeric'
  #define futexbench_sanitize_numeric(__n) abs((__n))
                                           ^
  bench/futex-hash.c:133:10: note: remove the call to 'abs' since unsigned values cannot be negative

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-2kl68v22or31vw643m2exz8x@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-02-14 15:19:17 -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 Revert "perf bench futex: Sanitize numeric parameters" 2017-02-14 15:19:17 -03:00
futex-lock-pi.c Revert "perf bench futex: Sanitize numeric parameters" 2017-02-14 15:19:17 -03:00
futex-requeue.c Revert "perf bench futex: Sanitize numeric parameters" 2017-02-14 15:19:17 -03:00
futex-wake-parallel.c Revert "perf bench futex: Sanitize numeric parameters" 2017-02-14 15:19:17 -03:00
futex-wake.c Revert "perf bench futex: Sanitize numeric parameters" 2017-02-14 15:19:17 -03:00
futex.h Revert "perf bench futex: Sanitize numeric parameters" 2017-02-14 15:19:17 -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