[PATCH 1/3] perf ui/tui: fixup for header window on perf-top

From: Namhyung Kim
Date: Thu Dec 19 2013 - 19:14:23 EST


It should check whether header.env is valid.

Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/ui/browsers/hists.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index d710c6403a14..c25859cae32d 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1488,7 +1488,9 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
tui__log_window();
continue;
case 'i':
- tui__header_window(env);
+ /* env->arch is NULL for live-mode (i.e. perf top) */
+ if (env->arch)
+ tui__header_window(env);
continue;
case K_F1:
case 'h':
--
1.7.11.7


I'll fold it to the original patch.

>
> But it's a nice feature nevertheless!

Thanks! :)

>
> Btw., it would be nice if 'P' worked on these screens, so any
> interesting data can be extracted! Cut & paste is usually a PITA due
> to the graphical TUI characters.

Ah, okay. I think it should be easy, will cook a patch.

>
> Btw., in case you are taking TUI usability bugreports, here's a few I
> noticed while playing with your changes:

Hmm.. I'll take a look at them next week too. :)

>
> 1)
>
> In histogram view it would be nice if 'P' gave some status bar
> indication that it just wrote to perf.hist.0 or so - otherwise the
> user is kept in the dark.
>
> 2)
>
> Likewise, in a TUI every keypress must produce some tangible feedback
> to the user. Try hitting 'o' for example - it should probably output
> into the status bar that 'o' is not a bound keypress or so.
>
> 3)
>
> Same goes for page up / page down in histogram view if we are at the
> end of the list: some low-key, single-character feedback should be
> given that the keypress was seen but we are at the end of the list.
> For exampe the scrollbar 'diamond' character could briefly
> inverse-flash or so.
>
> Thanks,
>
> Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/