Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191368
b: refs/heads/master
c: 9d192e1
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed May 16, 2010
1 parent be1a30b commit 8c14bb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29351db6a05e7e42be457569428425520a18beec
refs/heads/master: 9d192e118a094087494997ea1c8a2faf39af38c5
23 changes: 20 additions & 3 deletions trunk/tools/perf/util/newt.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,10 @@ static int hist_browser__populate(struct hist_browser *self, struct hists *hists

newtFormAddHotKey(self->form, 'A');
newtFormAddHotKey(self->form, 'a');
newtFormAddHotKey(self->form, 'D');
newtFormAddHotKey(self->form, 'd');
newtFormAddHotKey(self->form, 'T');
newtFormAddHotKey(self->form, 't');
newtFormAddHotKey(self->form, NEWT_KEY_RIGHT);
newtFormAddHotKey(self->form, NEWT_KEY_LEFT);
newtFormAddComponents(self->form, self->tree, NULL);
Expand Down Expand Up @@ -834,9 +838,20 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na
annotate = -2, zoom_dso = -2, zoom_thread = -2;

newtFormRun(browser->form, &es);

thread = hist_browser__selected_thread(browser);
dso = browser->selection->map ? browser->selection->map->dso : NULL;

if (es.reason == NEWT_EXIT_HOTKEY) {
if (toupper(es.u.key) == 'A')
switch (toupper(es.u.key)) {
case 'A':
goto do_annotate;
case 'D':
goto zoom_dso;
case 'T':
goto zoom_thread;
default:;
}
if (toupper(es.u.key) == 'Q' ||
es.u.key == CTRL('c'))
break;
Expand Down Expand Up @@ -866,15 +881,13 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na
browser->selection->sym->name) > 0)
annotate = nr_options++;

thread = hist_browser__selected_thread(browser);
if (thread != NULL &&
asprintf(&options[nr_options], "Zoom %s %s(%d) thread",
(thread_filter ? "out of" : "into"),
(thread->comm_set ? thread->comm : ""),
thread->pid) > 0)
zoom_thread = nr_options++;

dso = browser->selection->map ? browser->selection->map->dso : NULL;
if (dso != NULL &&
asprintf(&options[nr_options], "Zoom %s %s DSO",
(dso_filter ? "out of" : "into"),
Expand Down Expand Up @@ -910,12 +923,15 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na

hist_entry__annotate_browser(he);
} else if (choice == zoom_dso) {
zoom_dso:
if (dso_filter) {
pstack__remove(fstack, &dso_filter);
zoom_out_dso:
ui_helpline__pop();
dso_filter = NULL;
} else {
if (dso == NULL)
continue;
ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"",
dso->kernel ? "the Kernel" : dso->short_name);
dso_filter = dso;
Expand All @@ -927,6 +943,7 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na
if (hist_browser__populate(browser, self, msg) < 0)
goto out;
} else if (choice == zoom_thread) {
zoom_thread:
if (thread_filter) {
pstack__remove(fstack, &thread_filter);
zoom_out_thread:
Expand Down

0 comments on commit 8c14bb3

Please sign in to comment.