From: Arnaldo Carvalho de Melo Date: Thu, 6 Oct 2011 13:56:05 +0000 (-0300) Subject: perf hists browser: Update the browser.nr_entries after the timer X-Git-Tag: next-20111011~22^2~3^2^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=be83f5ed6bc46cd89b4a102b6e341ecddf7abf91;p=karo-tx-linux.git perf hists browser: Update the browser.nr_entries after the timer Previously the hist_browser dealt with a static tree of entries, now it needs to update the nr_entries in the browser after the timer runs. A better solution will come when moving using another thread for the collapse_resort, etc, but for now this is ok. Cc: David Ahern Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-9eno2iq55sjr4iyo899buzaw@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c index ef6ccefad432..e64d9527f14e 100644 --- a/tools/perf/util/ui/browsers/hists.c +++ b/tools/perf/util/ui/browsers/hists.c @@ -332,6 +332,13 @@ static int hist_browser__run(struct hist_browser *self, const char *ev_name, case -1: /* FIXME we need to check if it was es.reason == NEWT_EXIT_TIMER */ timer(arg); + /* + * The timer may have changed the number of entries. + * XXX: Find better way to keep this in synch, probably + * removing this timer function altogether and just sync + * using the hists->lock... + */ + self->b.nr_entries = self->hists->nr_entries; hists__browser_title(self->hists, title, sizeof(title), ev_name, self->dso_filter, self->thread_filter);