Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269089
b: refs/heads/master
c: 437cfe7
h: refs/heads/master
i:
  269087: 90edcbd
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Oct 14, 2011
1 parent 22c8c8a commit f49324c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 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: 18eaf0b8e60a2fa54667b2192197970174f1c061
refs/heads/master: 437cfe7a37df07e2201036fb0903cadae6b08e74
1 change: 1 addition & 0 deletions trunk/tools/perf/util/ui/browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ void ui_browser__update_nr_entries(struct ui_browser *browser, u32 nr_entries)
browser->top_idx += offset;
}

browser->top = NULL;
browser->seek(browser, browser->top_idx, SEEK_SET);
}

Expand Down
15 changes: 13 additions & 2 deletions trunk/tools/perf/util/ui/browsers/hists.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,14 +600,23 @@ static int hist_browser__show_entry(struct hist_browser *self,
return printed;
}

static void ui_browser__hists_init_top(struct ui_browser *browser)
{
if (browser->top == NULL) {
struct hist_browser *hb;

hb = container_of(browser, struct hist_browser, b);
browser->top = rb_first(&hb->hists->entries);
}
}

static unsigned int hist_browser__refresh(struct ui_browser *self)
{
unsigned row = 0;
struct rb_node *nd;
struct hist_browser *hb = container_of(self, struct hist_browser, b);

if (self->top == NULL)
self->top = rb_first(&hb->hists->entries);
ui_browser__hists_init_top(self);

for (nd = self->top; nd; nd = rb_next(nd)) {
struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node);
Expand Down Expand Up @@ -659,6 +668,8 @@ static void ui_browser__hists_seek(struct ui_browser *self,
if (self->nr_entries == 0)
return;

ui_browser__hists_init_top(self);

switch (whence) {
case SEEK_SET:
nd = hists__filter_entries(rb_first(self->entries));
Expand Down

0 comments on commit f49324c

Please sign in to comment.