From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755215AbbCXQcS (ORCPT ); Tue, 24 Mar 2015 12:32:18 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56838 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752767AbbCXQcO (ORCPT ); Tue, 24 Mar 2015 12:32:14 -0400 Date: Tue, 24 Mar 2015 09:31:55 -0700 From: tip-bot for Namhyung Kim Message-ID: Cc: hpa@zytor.com, js1304@gmail.com, tglx@linutronix.de, minchan@kernel.org, linux-kernel@vger.kernel.org, jolsa@redhat.com, namhyung@kernel.org, acme@redhat.com, mingo@kernel.org, dsahern@gmail.com, a.p.zijlstra@chello.nl Reply-To: a.p.zijlstra@chello.nl, mingo@kernel.org, acme@redhat.com, dsahern@gmail.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, jolsa@redhat.com, minchan@kernel.org, tglx@linutronix.de, hpa@zytor.com, js1304@gmail.com In-Reply-To: <1427092244-22764-2-git-send-email-namhyung@kernel.org> References: <1427092244-22764-2-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf kmem: Print big numbers using thousands' group Git-Commit-ID: 77cfe388767572586b7d4fd533c38f902d020f17 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 77cfe388767572586b7d4fd533c38f902d020f17 Gitweb: http://git.kernel.org/tip/77cfe388767572586b7d4fd533c38f902d020f17 Author: Namhyung Kim AuthorDate: Mon, 23 Mar 2015 15:30:40 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 24 Mar 2015 12:07:06 -0300 perf kmem: Print big numbers using thousands' group Like perf stat, this makes easy to read the numbers on stat like below: # perf kmem stat SUMMARY ======= Total bytes requested: 9,770,900 Total bytes allocated: 9,782,712 Total bytes wasted on internal fragmentation: 11,812 Internal fragmentation: 0.120744% Cross CPU allocations: 74/152,819 Suggested-by: Ingo Molnar Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Jiri Olsa Cc: Joonsoo Kim Cc: Minchan Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1427092244-22764-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-kmem.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 8c85aeb..64d3623 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -20,6 +20,7 @@ #include #include +#include struct alloc_stat; typedef int (*sort_fn_t)(struct alloc_stat *, struct alloc_stat *); @@ -325,13 +326,13 @@ static void __print_result(struct rb_root *root, struct perf_session *session, static void print_summary(void) { printf("\nSUMMARY\n=======\n"); - printf("Total bytes requested: %lu\n", total_requested); - printf("Total bytes allocated: %lu\n", total_allocated); - printf("Total bytes wasted on internal fragmentation: %lu\n", + printf("Total bytes requested: %'lu\n", total_requested); + printf("Total bytes allocated: %'lu\n", total_allocated); + printf("Total bytes wasted on internal fragmentation: %'lu\n", total_allocated - total_requested); printf("Internal fragmentation: %f%%\n", fragmentation(total_requested, total_allocated)); - printf("Cross CPU allocations: %lu/%lu\n", nr_cross_allocs, nr_allocs); + printf("Cross CPU allocations: %'lu/%'lu\n", nr_cross_allocs, nr_allocs); } static void print_result(struct perf_session *session) @@ -706,6 +707,8 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused) symbol__init(&session->header.env); if (!strcmp(argv[0], "stat")) { + setlocale(LC_ALL, ""); + if (cpu__setup_cpunode_map()) goto out_delete;