From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932656AbbCXQbb (ORCPT ); Tue, 24 Mar 2015 12:31:31 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56812 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932643AbbCXQb2 (ORCPT ); Tue, 24 Mar 2015 12:31:28 -0400 Date: Tue, 24 Mar 2015 09:30:55 -0700 From: tip-bot for Yunlong Song Message-ID: Cc: linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com, yunlong.song@huawei.com, acme@redhat.com, a.p.zijlstra@chello.nl, mingo@kernel.org, wangnan0@huawei.com, namhyung@kernel.org, tglx@linutronix.de Reply-To: hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, acme@redhat.com, a.p.zijlstra@chello.nl, yunlong.song@huawei.com, tglx@linutronix.de, wangnan0@huawei.com, namhyung@kernel.org, mingo@kernel.org In-Reply-To: <1427082605-12881-1-git-send-email-yunlong.song@huawei.com> References: <1427082605-12881-1-git-send-email-yunlong.song@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Remove (null) value of "Sort order" for perf mem report Git-Commit-ID: 228f14f2cbf481e0ec0bd0c7f947383cfa2d5167 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: 228f14f2cbf481e0ec0bd0c7f947383cfa2d5167 Gitweb: http://git.kernel.org/tip/228f14f2cbf481e0ec0bd0c7f947383cfa2d5167 Author: Yunlong Song AuthorDate: Mon, 23 Mar 2015 11:50:05 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 24 Mar 2015 12:06:55 -0300 perf tools: Remove (null) value of "Sort order" for perf mem report When '--sort' is not set, 'perf mem report" will print a null pointer as the output value of sort order, so fix it. Example: Before this patch: $ perf mem report # To display the perf.data header info, please use --header/--header-only options. # # Samples: 18 of event 'cpu/mem-loads/pp' # Total weight : 188 # Sort order : (null) # ... After this patch: $ perf mem report # To display the perf.data header info, please use --header/--header-only options. # # Samples: 18 of event 'cpu/mem-loads/pp' # Total weight : 188 # Sort order : local_weight,mem,sym,dso,symbol_daddr,dso_daddr,snoop,tlb,locked # ... Signed-off-by: Yunlong Song Acked-by: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1427082605-12881-1-git-send-email-yunlong.song@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-report.c | 2 +- tools/perf/util/sort.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0ae4826..81c2f3b 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -304,7 +304,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report if (rep->mem_mode) { ret += fprintf(fp, "\n# Total weight : %" PRIu64, nr_events); - ret += fprintf(fp, "\n# Sort order : %s", sort_order); + ret += fprintf(fp, "\n# Sort order : %s", sort_order ? : default_mem_sort_order); } else ret += fprintf(fp, "\n# Event count (approx.): %" PRIu64, nr_events); return ret + fprintf(fp, "\n#\n"); diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 9c01b83..846036a 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -44,6 +44,7 @@ extern struct sort_entry sort_dso_to; extern struct sort_entry sort_sym_from; extern struct sort_entry sort_sym_to; extern enum sort_type sort__first_dimension; +extern const char default_mem_sort_order[]; struct he_stat { u64 period;