From 9808143ba2e54818a3cf445d9b69b3f5f15451ee Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Mon, 9 Jan 2017 10:51:55 +0100 Subject: 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 Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan 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 --- tools/perf/tests/builtin-test.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/perf/tests/builtin-test.c') diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index a77dcc0d24e3..37e326bfd2dc 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -246,6 +246,10 @@ static struct test generic_tests[] = { .get_desc = test__clang_subtest_get_desc, } }, + { + .desc = "unit_number__scnprintf", + .func = test__unit_number__scnprint, + }, { .func = NULL, }, -- cgit v1.2.3