linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Yunlong Song <yunlong.song@huawei.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Wang Nan <wangnan0@huawei.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 08/25] perf tools: Remove (null) value of "Sort order" for perf mem report
Date: Tue, 24 Mar 2015 13:19:23 -0300	[thread overview]
Message-ID: <1427213980-9015-9-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1427213980-9015-1-git-send-email-acme@kernel.org>

From: Yunlong Song <yunlong.song@huawei.com>

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 <yunlong.song@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1427082605-12881-1-git-send-email-yunlong.song@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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 0ae482689e3c..81c2f3b97c50 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 9c01b83eebca..846036a921dc 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;
-- 
1.9.3


  parent reply	other threads:[~2015-03-24 16:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 16:19 [GIT PULL 00/25] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 01/25] perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 02/25] perf tools: Use kmod_path__parse in decompress_kmodule Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 03/25] perf tools: Use kmod_path__parse in is_kernel_module Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 04/25] perf tools: Remove compressed argument from is_kernel_module Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 05/25] perf tools: Remove is_kmodule_extension function Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 06/25] perf tools: Try to lookup kernel module map before creating one Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 07/25] perf annotate: Allow annotation for decompressed kernel modules Arnaldo Carvalho de Melo
2015-03-24 16:19 ` Arnaldo Carvalho de Melo [this message]
2015-03-24 16:19 ` [PATCH 09/25] perf probe: Fix to get ummapped symbol address on kernel Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 10/25] tools lib traceevent: Factor out allocating and processing args Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 11/25] perf kmem: Print big numbers using thousands' group Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 13/25] perf target: Simplify handling of strerror_r return Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 14/25] perf symbols: Save DSO loading errno to better report errors Arnaldo Carvalho de Melo
2015-03-27 10:32   ` Borislav Petkov
2015-03-27 14:37     ` Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 15/25] tools lib traceevent: Handle NULL comm name Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 16/25] tools lib traceevent: Copy trace_clock and free it Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 17/25] tools lib traceevent: Handle %z in bprint format Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 18/25] tools lib traceevent: Add pevent_data_pid_from_comm() Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 19/25] tools lib traceevent: Make plugin options either string or boolean Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 21/25] tools lib traceevent: Add way to find sub buffer boundary Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 22/25] tools lib traceevent: Free filter tokens in process_filter() Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 23/25] tools lib traceevent: Add support for __print_array() Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 24/25] perf diff: Add kallsyms option Arnaldo Carvalho de Melo
2015-03-24 16:19 ` [PATCH 25/25] perf tools: Add pid/tid filtering to report and script commands Arnaldo Carvalho de Melo
2015-03-24 16:26 ` [GIT PULL 00/25] perf/core improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427213980-9015-9-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=wangnan0@huawei.com \
    --cc=yunlong.song@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).