2010-07-18 01:49:22

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: [GIT PULL 0/3] perf/core improvements

Hi Ingo,

Please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (3):
perf ui: Make END go to the last entry, not the top of the last page
perf ui: Make ui_browser__run exit on unhandled hot keys
perf hists: Factor out duplicated code

tools/perf/util/hist.c | 36 ++++++++++++++++++------------------
tools/perf/util/newt.c | 14 +++++---------
2 files changed, 23 insertions(+), 27 deletions(-)


2010-07-18 01:49:12

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: [PATCH 2/3] perf ui: Make ui_browser__run exit on unhandled hot keys

From: Arnaldo Carvalho de Melo <[email protected]>

Right now ENTER doesn't always exits the newt tree widget, as it is used
for expanding/collapsing branches, but with the new tree widget being
developed we need to regain control to handle it, expanding/collapsing
branches.

In fact its really up to the ui_browser user to state what extra keys
should stop ui_browser__run, and it should handle just the ones needed
for basic browsing.

Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/util/newt.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index 932f124..7979003 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -498,12 +498,8 @@ static int ui_browser__run(struct ui_browser *self, struct newtExitStruct *es)
self->first_visible_entry_idx = self->index - offset;
self->seek(self, -offset, SEEK_END);
break;
- case NEWT_KEY_RIGHT:
- case NEWT_KEY_LEFT:
- case NEWT_KEY_TAB:
- return es->u.key;
default:
- continue;
+ return es->u.key;
}
if (ui_browser__refresh_entries(self) < 0)
return -1;
--
1.6.2.5

2010-07-18 01:49:20

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: [PATCH 1/3] perf ui: Make END go to the last entry, not the top of the last page

From: Arnaldo Carvalho de Melo <[email protected]>

Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/util/newt.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index 06f248f..932f124 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -491,11 +491,11 @@ static int ui_browser__run(struct ui_browser *self, struct newtExitStruct *es)
break;
case NEWT_KEY_END:
offset = self->height - 1;
+ if (offset >= self->nr_entries)
+ offset = self->nr_entries - 1;

- if (offset > self->nr_entries)
- offset = self->nr_entries;
-
- self->index = self->first_visible_entry_idx = self->nr_entries - 1 - offset;
+ self->index = self->nr_entries - 1;
+ self->first_visible_entry_idx = self->index - offset;
self->seek(self, -offset, SEEK_END);
break;
case NEWT_KEY_RIGHT:
--
1.6.2.5

2010-07-18 01:49:36

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: [PATCH 3/3] perf hists: Factor out duplicated code

From: Arnaldo Carvalho de Melo <[email protected]>

Introducing hists__remove_entry_filter.

Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/util/hist.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 68d288c..7b5848c 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -795,6 +795,21 @@ enum hist_filter {
HIST_FILTER__THREAD,
};

+static void hists__remove_entry_filter(struct hists *self, struct hist_entry *h,
+ enum hist_filter filter)
+{
+ h->filtered &= ~(1 << filter);
+ if (h->filtered)
+ return;
+
+ ++self->nr_entries;
+ self->stats.total_period += h->period;
+ self->stats.nr_events[PERF_RECORD_SAMPLE] += h->nr_events;
+
+ if (h->ms.sym && self->max_sym_namelen < h->ms.sym->namelen)
+ self->max_sym_namelen = h->ms.sym->namelen;
+}
+
void hists__filter_by_dso(struct hists *self, const struct dso *dso)
{
struct rb_node *nd;
@@ -814,15 +829,7 @@ void hists__filter_by_dso(struct hists *self, const struct dso *dso)
continue;
}

- h->filtered &= ~(1 << HIST_FILTER__DSO);
- if (!h->filtered) {
- ++self->nr_entries;
- self->stats.total_period += h->period;
- self->stats.nr_events[PERF_RECORD_SAMPLE] += h->nr_events;
- if (h->ms.sym &&
- self->max_sym_namelen < h->ms.sym->namelen)
- self->max_sym_namelen = h->ms.sym->namelen;
- }
+ hists__remove_entry_filter(self, h, HIST_FILTER__DSO);
}
}

@@ -841,15 +848,8 @@ void hists__filter_by_thread(struct hists *self, const struct thread *thread)
h->filtered |= (1 << HIST_FILTER__THREAD);
continue;
}
- h->filtered &= ~(1 << HIST_FILTER__THREAD);
- if (!h->filtered) {
- ++self->nr_entries;
- self->stats.total_period += h->period;
- self->stats.nr_events[PERF_RECORD_SAMPLE] += h->nr_events;
- if (h->ms.sym &&
- self->max_sym_namelen < h->ms.sym->namelen)
- self->max_sym_namelen = h->ms.sym->namelen;
- }
+
+ hists__remove_entry_filter(self, h, HIST_FILTER__THREAD);
}
}

--
1.6.2.5

2010-07-18 07:17:33

by Ingo Molnar

[permalink] [raw]
Subject: Re: [GIT PULL 0/3] perf/core improvements


* Arnaldo Carvalho de Melo <[email protected]> wrote:

> Hi Ingo,
>
> Please pull from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core
>
> Regards,
>
> - Arnaldo
>
> Arnaldo Carvalho de Melo (3):
> perf ui: Make END go to the last entry, not the top of the last page
> perf ui: Make ui_browser__run exit on unhandled hot keys
> perf hists: Factor out duplicated code
>
> tools/perf/util/hist.c | 36 ++++++++++++++++++------------------
> tools/perf/util/newt.c | 14 +++++---------
> 2 files changed, 23 insertions(+), 27 deletions(-)

Pulled, thanks Arnaldo!

FYI, i'm still seeing problems with 'perf report --parent xyz' functionality,
as the Newt interface segfaults:

#0 0x00007ffff7dddcdb in ?? () from /usr/lib64/libnewt.so.0.52
#1 0x00007ffff7dd5ab6 in ?? () from /usr/lib64/libnewt.so.0.52
#2 0x00007ffff7dd5260 in ?? () from /usr/lib64/libnewt.so.0.52
#3 0x00007ffff7dd61ff in newtFormRun () from /usr/lib64/libnewt.so.0.52
#4 0x00000000004552a1 in hists__browse (self=0xa302b0, helpline=<value optimized out>,
ev_name=0x4e5dde "cycles") at util/newt.c:968
#5 0x0000000000455bc0 in hists__tui_browse_tree (self=<value optimized out>,
help=0x4e0710 "For a higher level overview, try: perf report --sort comm,dso")
at util/newt.c:1142
#6 0x00000000004109e3 in __cmd_report (argc=<value optimized out>, argv=<value optimized out>,
prefix=<value optimized out>) at builtin-report.c:346
#7 cmd_report (argc=<value optimized out>, argv=<value optimized out>,
prefix=<value optimized out>) at builtin-report.c:508
#8 0x0000000000406188 in run_builtin (p=0x722590, argc=3, argv=0x7fffffffe570) at perf.c:286
#9 0x0000000000406be6 in handle_internal_command (argc=3, argv=0x7fffffffe570) at perf.c:357
#10 run_argv (argc=3, argv=0x7fffffffe570) at perf.c:401
#11 main (argc=3, argv=0x7fffffffe570) at perf.c:487

newt-0.52.11-2.fc13.x86_64

perf version 2.6.35.rc5.1194.g16950e5

Thanks,

Ingo

2010-07-19 09:51:48

by Frederic Weisbecker

[permalink] [raw]
Subject: Re: [GIT PULL 0/3] perf/core improvements

2010/7/18 Ingo Molnar <[email protected]>:
>
> * Arnaldo Carvalho de Melo <[email protected]> wrote:
>
>> Hi Ingo,
>>
>> ? ? ? ? Please pull from:
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf/core
>>
>> Regards,
>>
>> - Arnaldo
>>
>> Arnaldo Carvalho de Melo (3):
>> ? perf ui: Make END go to the last entry, not the top of the last page
>> ? perf ui: Make ui_browser__run exit on unhandled hot keys
>> ? perf hists: Factor out duplicated code
>>
>> ?tools/perf/util/hist.c | ? 36 ++++++++++++++++++------------------
>> ?tools/perf/util/newt.c | ? 14 +++++---------
>> ?2 files changed, 23 insertions(+), 27 deletions(-)
>
> Pulled, thanks Arnaldo!
>
> FYI, i'm still seeing problems with 'perf report --parent xyz' functionality,
> as the Newt interface segfaults:


Hmm, I've fixed the --parent thing in ascii but did not test with newt.
I hope I haven't added some breakage with this fix :-s

I'll have a look.


>
> #0 ?0x00007ffff7dddcdb in ?? () from /usr/lib64/libnewt.so.0.52
> #1 ?0x00007ffff7dd5ab6 in ?? () from /usr/lib64/libnewt.so.0.52
> #2 ?0x00007ffff7dd5260 in ?? () from /usr/lib64/libnewt.so.0.52
> #3 ?0x00007ffff7dd61ff in newtFormRun () from /usr/lib64/libnewt.so.0.52
> #4 ?0x00000000004552a1 in hists__browse (self=0xa302b0, helpline=<value optimized out>,
> ? ?ev_name=0x4e5dde "cycles") at util/newt.c:968
> #5 ?0x0000000000455bc0 in hists__tui_browse_tree (self=<value optimized out>,
> ? ?help=0x4e0710 "For a higher level overview, try: perf report --sort comm,dso")
> ? ?at util/newt.c:1142
> #6 ?0x00000000004109e3 in __cmd_report (argc=<value optimized out>, argv=<value optimized out>,
> ? ?prefix=<value optimized out>) at builtin-report.c:346
> #7 ?cmd_report (argc=<value optimized out>, argv=<value optimized out>,
> ? ?prefix=<value optimized out>) at builtin-report.c:508
> #8 ?0x0000000000406188 in run_builtin (p=0x722590, argc=3, argv=0x7fffffffe570) at perf.c:286
> #9 ?0x0000000000406be6 in handle_internal_command (argc=3, argv=0x7fffffffe570) at perf.c:357
> #10 run_argv (argc=3, argv=0x7fffffffe570) at perf.c:401
> #11 main (argc=3, argv=0x7fffffffe570) at perf.c:487
>
> newt-0.52.11-2.fc13.x86_64
>
> perf version 2.6.35.rc5.1194.g16950e5
>
> Thanks,
>
> ? ? ? ?Ingo
>