Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81cce8de authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf browsers: Add live mode to the hists, annotate browsers

This allows passing a timer to be run periodically, which will update
the hists tree that then gers refreshed on the screen, just like the
Live mode (symbol entries, annotation) we already have in 'perf top
--tui'.

Will be used by the new hist_entry/hists based 'top' tool.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-2r44qd8oe4sagzcgoikl8qzc@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1980c2eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -137,7 +137,7 @@ static void hists__find_annotations(struct hists *self, int evidx)
		}
		}


		if (use_browser > 0) {
		if (use_browser > 0) {
			key = hist_entry__tui_annotate(he, evidx);
			key = hist_entry__tui_annotate(he, evidx, NULL, NULL, 0);
			switch (key) {
			switch (key) {
			case KEY_RIGHT:
			case KEY_RIGHT:
				next = rb_next(nd);
				next = rb_next(nd);
+4 −3
Original line number Original line Diff line number Diff line
@@ -327,9 +327,10 @@ static int __cmd_report(void)
		goto out_delete;
		goto out_delete;
	}
	}


	if (use_browser > 0)
	if (use_browser > 0) {
		perf_evlist__tui_browse_hists(session->evlist, help);
		perf_evlist__tui_browse_hists(session->evlist, help,
	else
					      NULL, NULL, 0);
	} else
		perf_evlist__tty_browse_hists(session->evlist, help);
		perf_evlist__tty_browse_hists(session->evlist, help);


out_delete:
out_delete:
+5 −2
Original line number Original line Diff line number Diff line
@@ -91,13 +91,16 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx,
#ifdef NO_NEWT_SUPPORT
#ifdef NO_NEWT_SUPPORT
static inline int symbol__tui_annotate(struct symbol *sym __used,
static inline int symbol__tui_annotate(struct symbol *sym __used,
				       struct map *map __used,
				       struct map *map __used,
				       int evidx __used, int refresh __used)
				       int evidx __used,
				       void(*timer)(void *arg) __used,
				       void *arg __used, int delay_secs __used)
{
{
	return 0;
	return 0;
}
}
#else
#else
int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
			 int refresh);
			 void(*timer)(void *arg), void *arg,
			 int delay_secs);
#endif
#endif


extern const char	*disassembler_style;
extern const char	*disassembler_style;
+6 −0
Original line number Original line Diff line number Diff line
@@ -533,3 +533,9 @@ bool perf_evlist__sample_id_all(const struct perf_evlist *evlist)
	first = list_entry(evlist->entries.next, struct perf_evsel, node);
	first = list_entry(evlist->entries.next, struct perf_evsel, node);
	return first->attr.sample_id_all;
	return first->attr.sample_id_all;
}
}

void perf_evlist__set_selected(struct perf_evlist *evlist,
			       struct perf_evsel *evsel)
{
	evlist->selected = evsel;
}
+4 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ struct perf_evlist {
	struct pollfd	 *pollfd;
	struct pollfd	 *pollfd;
	struct thread_map *threads;
	struct thread_map *threads;
	struct cpu_map	  *cpus;
	struct cpu_map	  *cpus;
	struct perf_evsel *selected;
};
};


struct perf_evsel;
struct perf_evsel;
@@ -56,6 +57,9 @@ void perf_evlist__munmap(struct perf_evlist *evlist);
void perf_evlist__disable(struct perf_evlist *evlist);
void perf_evlist__disable(struct perf_evlist *evlist);
void perf_evlist__enable(struct perf_evlist *evlist);
void perf_evlist__enable(struct perf_evlist *evlist);


void perf_evlist__set_selected(struct perf_evlist *evlist,
			       struct perf_evsel *evsel);

static inline void perf_evlist__set_maps(struct perf_evlist *evlist,
static inline void perf_evlist__set_maps(struct perf_evlist *evlist,
					 struct cpu_map *cpus,
					 struct cpu_map *cpus,
					 struct thread_map *threads)
					 struct thread_map *threads)
Loading