Re: [PATCH 04/22] perf tools: Add --list report option

2014-02-05 Thread Jiri Olsa
On Wed, Feb 05, 2014 at 10:50:36AM +0900, Namhyung Kim wrote:
> On Sun,  2 Feb 2014 22:38:52 +0100, Jiri Olsa wrote:
> > Adding --list report option to display entries sequentialy:
> >
> >   $ perf report --list --stdio
> >   ...
> >0.00%   13151.543527 +00.00   ls  [kernel.kallsyms]  
> > [k] native_write_msr_safe
> >0.00%   13151.543530 +00.03   ls  [kernel.kallsyms]  
> > [k] native_write_msr_safe
> >0.00%   13151.543532 +00.05   ls  [kernel.kallsyms]  
> > [k] native_write_msr_safe
> >0.00%   13151.543534 +00.07   ls  [kernel.kallsyms]  
> > [k] native_write_msr_safe
> >0.05%   13151.543536 +00.09   ls  [kernel.kallsyms]  
> > [k] native_write_msr_safe
> >0.92%   13151.543538 +00.11   ls  [kernel.kallsyms]  
> > [k] perf_event_comm
> >   14.52%   13151.543560 +00.33   ls  [kernel.kallsyms]  
> > [k] uprobe_mmap
> >   30.10%   13151.543878 +00.000351   ls  ld-2.17.so 
> > [.] _dl_setup_hash
> >   29.30%   13151.544531 +00.001004   ls  ls 
> > [.] gobble_file.constprop.49
> >   25.09%   13151.545613 +00.002086   ls  [kernel.kallsyms]  
> > [k] _cond_resched
> 
> Hmm.. it seems what this --list option does is very similar to
> what "perf script -f time,comm,dso,sym,ip" tries to do, no?

correct.. it's just byproduct which I need for lock browser
I'm working on.. but this basic output seemed usefull and
actually missing from report portfolio ;-)

but as I said, it's a byproduct and I can leave it for
the lock change patchset

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 04/22] perf tools: Add --list report option

2014-02-04 Thread Namhyung Kim
On Sun,  2 Feb 2014 22:38:52 +0100, Jiri Olsa wrote:
> Adding --list report option to display entries sequentialy:
>
>   $ perf report --list --stdio
>   ...
>0.00%   13151.543527 +00.00   ls  [kernel.kallsyms]  
> [k] native_write_msr_safe
>0.00%   13151.543530 +00.03   ls  [kernel.kallsyms]  
> [k] native_write_msr_safe
>0.00%   13151.543532 +00.05   ls  [kernel.kallsyms]  
> [k] native_write_msr_safe
>0.00%   13151.543534 +00.07   ls  [kernel.kallsyms]  
> [k] native_write_msr_safe
>0.05%   13151.543536 +00.09   ls  [kernel.kallsyms]  
> [k] native_write_msr_safe
>0.92%   13151.543538 +00.11   ls  [kernel.kallsyms]  
> [k] perf_event_comm
>   14.52%   13151.543560 +00.33   ls  [kernel.kallsyms]  
> [k] uprobe_mmap
>   30.10%   13151.543878 +00.000351   ls  ld-2.17.so 
> [.] _dl_setup_hash
>   29.30%   13151.544531 +00.001004   ls  ls 
> [.] gobble_file.constprop.49
>   25.09%   13151.545613 +00.002086   ls  [kernel.kallsyms]  
> [k] _cond_resched

Hmm.. it seems what this --list option does is very similar to
what "perf script -f time,comm,dso,sym,ip" tries to do, no?

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 04/22] perf tools: Add --list report option

2014-02-02 Thread Jiri Olsa
Adding --list report option to display entries sequentialy:

  $ perf report --list --stdio
  ...
   0.00%   13151.543527 +00.00   ls  [kernel.kallsyms]  [k] 
native_write_msr_safe
   0.00%   13151.543530 +00.03   ls  [kernel.kallsyms]  [k] 
native_write_msr_safe
   0.00%   13151.543532 +00.05   ls  [kernel.kallsyms]  [k] 
native_write_msr_safe
   0.00%   13151.543534 +00.07   ls  [kernel.kallsyms]  [k] 
native_write_msr_safe
   0.05%   13151.543536 +00.09   ls  [kernel.kallsyms]  [k] 
native_write_msr_safe
   0.92%   13151.543538 +00.11   ls  [kernel.kallsyms]  [k] 
perf_event_comm
  14.52%   13151.543560 +00.33   ls  [kernel.kallsyms]  [k] 
uprobe_mmap
  30.10%   13151.543878 +00.000351   ls  ld-2.17.so [.] 
_dl_setup_hash
  29.30%   13151.544531 +00.001004   ls  ls [.] 
gobble_file.constprop.49
  25.09%   13151.545613 +00.002086   ls  [kernel.kallsyms]  [k] 
_cond_resched

Signed-off-by: Jiri Olsa 
Cc: Corey Ashford 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Arnaldo Carvalho de Melo 
Cc: David Ahern 
---
 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
inde