From: Jiri Olsa <jolsa@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@redhat.com>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>, Namhyung Kim <namhyung@kernel.org>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
David Ahern <dsahern@gmail.com>
Subject: [PATCH 04/22] perf tools: Add --list report option
Date: Sun, 2 Feb 2014 22:38:52 +0100 [thread overview]
Message-ID: <1391377150-23920-5-git-send-email-jolsa@redhat.com> (raw)
In-Reply-To: <1391377150-23920-1-git-send-email-jolsa@redhat.com>
Adding --list report option to display entries sequentialy:
$ perf report --list --stdio
...
0.00% 13151.543527 +000000.000000 ls [kernel.kallsyms] [k] native_write_msr_safe
0.00% 13151.543530 +000000.000003 ls [kernel.kallsyms] [k] native_write_msr_safe
0.00% 13151.543532 +000000.000005 ls [kernel.kallsyms] [k] native_write_msr_safe
0.00% 13151.543534 +000000.000007 ls [kernel.kallsyms] [k] native_write_msr_safe
0.05% 13151.543536 +000000.000009 ls [kernel.kallsyms] [k] native_write_msr_safe
0.92% 13151.543538 +000000.000011 ls [kernel.kallsyms] [k] perf_event_comm
14.52% 13151.543560 +000000.000033 ls [kernel.kallsyms] [k] uprobe_mmap
30.10% 13151.543878 +000000.000351 ls ld-2.17.so [.] _dl_setup_hash
29.30% 13151.544531 +000000.001004 ls ls [.] gobble_file.constprop.49
25.09% 13151.545613 +000000.002086 ls [kernel.kallsyms] [k] _cond_resched
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
---
tools/perf/builtin-report.c | 6 +++++-
tools/perf/util/hist.c | 3 +++
tools/perf/util/sort.c | 26 ++++++++++++++++++++++++++
tools/perf/util/sort.h | 1 +
tools/perf/util/symbol.h | 3 ++-
5 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 3dbf2b8..a752687 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -731,7 +731,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_BOOLEAN(0, "source", &symbol_conf.annotate_src,
"Interleave source code with assembly code (default)"),
OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw,
- "Display raw encoding of assembly instructions (default)"),
+ "display raw encoding of assembly instructions (default)"),
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
"Specify disassembler style (e.g. -M intel for intel syntax)"),
OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
@@ -749,6 +749,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
"Don't show entries under that percent", parse_percent_limit),
OPT_CALLBACK(0, "percentage", NULL, "relative|absolute",
"how to display percentage of filtered entries", parse_percentage),
+ OPT_BOOLEAN(0, "list", &symbol_conf.show_list, "Show events list"),
OPT_END()
};
struct perf_data_file file = {
@@ -891,6 +892,9 @@ repeat:
sort__setup_elide(stdout);
+ if (symbol_conf.show_list)
+ sort__setup_list();
+
ret = __cmd_report(&report);
if (ret == K_SWITCH_INPUT_DATA) {
perf_session__delete(session);
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 2ecb976..43241ea 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1073,6 +1073,9 @@ static int hist_entry__sort_on_period(struct hist_entry *a,
struct hist_entry *pair;
u64 *periods_a, *periods_b;
+ if (symbol_conf.show_list)
+ return b->idx - a->idx;
+
if (symbol_conf.cumulate_callchain) {
/*
* Put caller above callee when they have equal period.
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 5607edb..4ddf934 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1102,6 +1102,21 @@ static struct sort_dimension memory_sort_dimensions[] = {
#undef DIM
+static void __sort_dimension__prep(struct sort_dimension *sd,
+ enum sort_type idx)
+{
+ if (sd->taken)
+ return;
+
+ if (sd->entry->se_collapse)
+ sort__need_collapse = 1;
+
+ sort__first_dimension = idx;
+
+ list_add(&sd->entry->list, &hist_entry__sort_list);
+ sd->taken = 1;
+}
+
static void __sort_dimension__add(struct sort_dimension *sd, enum sort_type idx)
{
if (sd->taken)
@@ -1271,3 +1286,14 @@ void sort__setup_elide(FILE *output)
list_for_each_entry(se, &hist_entry__sort_list, list)
se->elide = false;
}
+
+void sort__setup_list(void)
+{
+ struct sort_dimension *sd_idx = &common_sort_dimensions[SORT_IDX];
+ struct sort_dimension *sd_time = &common_sort_dimensions[SORT_TIME];
+
+ __sort_dimension__prep(sd_time, SORT_TIME);
+ __sort_dimension__prep(sd_idx, SORT_IDX);
+
+ sd_idx->entry->elide = true;
+}
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 666bf0b..c2fa361 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -211,6 +211,7 @@ extern struct list_head hist_entry__sort_list;
int setup_sorting(void);
extern int sort_dimension__add(const char *);
void sort__setup_elide(FILE *fp);
+void sort__setup_list(void);
int report_parse_ignore_callees_opt(const struct option *opt, const char *arg, int unset);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 0657e72..423e55c 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -106,7 +106,8 @@ struct symbol_conf {
annotate_src,
event_group,
demangle,
- filter_relative;
+ filter_relative,
+ show_list;
const char *vmlinux_name,
*kallsyms_name,
*source_prefix,
--
1.8.3.1
next prev parent reply other threads:[~2014-02-02 21:39 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 21:38 [RFC 00/22] perf tools: Display tracepoint enahncements Jiri Olsa
2014-02-02 21:38 ` [PATCH 01/22] perf tools: Fix memory leak in event_format__print function Jiri Olsa
2014-02-05 1:41 ` Namhyung Kim
2014-02-22 17:57 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-02-02 21:38 ` [PATCH 02/22] perf tools: Add time sort entry Jiri Olsa
2014-02-02 21:38 ` [PATCH 03/22] perf tools: Add idx " Jiri Olsa
2014-02-02 21:38 ` Jiri Olsa [this message]
2014-02-05 1:50 ` [PATCH 04/22] perf tools: Add --list report option Namhyung Kim
2014-02-05 9:14 ` Jiri Olsa
2014-02-02 21:38 ` [PATCH 05/22] perf tools: Add sort_entry struct into sort entries callbacks Jiri Olsa
2014-02-02 21:38 ` [PATCH 06/22] perf tools: Add selected bool into se_snprintf sort entries callback Jiri Olsa
2014-02-02 21:38 ` [PATCH 07/22] perf tools: Implement selected bool se_snprintf callback logic Jiri Olsa
2014-02-02 21:38 ` [PATCH 08/22] perf tools: Implement selected logic for time sort entry Jiri Olsa
2014-02-02 21:38 ` [PATCH 09/22] perf tools: Factor ui_browser ops out of ui_browser struct Jiri Olsa
2014-02-02 21:38 ` [PATCH 10/22] perf tools: Add header callback into ui_browser_ops struct Jiri Olsa
2014-02-02 21:38 ` [PATCH 11/22] perf tools: Remove ev_name argument from perf_evsel__hists_browse Jiri Olsa
2014-02-02 21:39 ` [PATCH 12/22] perf tools: Add header callback to hist browser Jiri Olsa
2014-02-02 21:39 ` [PATCH 13/22] perf tools: Factor hpp_arg struct to carry hist_browser Jiri Olsa
2014-02-02 21:39 ` [PATCH 14/22] perf tools tui: Display columns header text on 'H' press Jiri Olsa
2014-02-02 21:39 ` [PATCH 15/22] tools lib traceevent: Factor print_event_fields function Jiri Olsa
2014-02-02 21:39 ` [PATCH 16/22] tools lib traceevent: Make the name output optional in pevent_field_info Jiri Olsa
2014-02-02 21:39 ` [PATCH 17/22] tools lib traceevent: Add pevent_field_cmp function Jiri Olsa
2014-02-02 21:39 ` [PATCH 18/22] perf tools: Factor sort entries loops Jiri Olsa
2014-02-02 21:39 ` [PATCH 19/22] perf tools: Add local hists sort entry list Jiri Olsa
2014-02-02 21:39 ` [PATCH 20/22] perf tools: Make hists col_len dynamicaly alocated Jiri Olsa
2014-02-02 21:39 ` [PATCH 21/22] perf tools: Add raw info into hist entry Jiri Olsa
2014-02-02 21:39 ` [PATCH 22/22] perf tools: Add support for tracepoint fields Jiri Olsa
2014-02-02 21:45 ` [RFC 00/22] perf tools: Display tracepoint enahncements Jiri Olsa
2014-02-05 1:40 ` Namhyung Kim
2014-02-05 9:15 ` Jiri Olsa
2014-02-05 1:58 ` Namhyung Kim
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=1391377150-23920-5-git-send-email-jolsa@redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
/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