perf tools: Add unit_number__scnprintf function
authorJiri Olsa <jolsa@kernel.org>
Mon, 9 Jan 2017 09:51:55 +0000 (10:51 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 11 Jan 2017 19:48:01 +0000 (16:48 -0300)
commit9808143ba2e54818a3cf445d9b69b3f5f15451ee
tree00c2425c5e06608fda53fc24d875cd4e1dabce63
parente978be9ea2990f1af60fe10eadd2312a6250e0b8
perf tools: Add unit_number__scnprintf function

Add unit_number__scnprintf function to display size units and use it in
-m option info message.

Before:
  $ perf record -m 10M ls
  rounding mmap pages size to 16777216 bytes (4096 pages)
  ...

After:
  $ perf record -m 10M ls
  rounding mmap pages size to 16M (4096 pages)
  ...

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1483955520-29063-2-git-send-email-jolsa@kernel.org
[ Rename it to unit_number__scnprintf for consistency ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/Build
tools/perf/tests/builtin-test.c
tools/perf/tests/tests.h
tools/perf/tests/unit_number__scnprintf.c [new file with mode: 0644]
tools/perf/util/evlist.c
tools/perf/util/util.c
tools/perf/util/util.h