Re: [PATCH 1/2] perf tools: Add --tui and --stdio to choose the UI

Previous thread: [PATCH 2/2] perf tools: add test for strlcpy() by Arnaldo Carvalho de Melo on Saturday, August 21, 2010 - 10:45 am. (1 message)

Next thread: [GIT PULL 0/2] perf/core improvements by Arnaldo Carvalho de Melo on Saturday, August 21, 2010 - 10:45 am. (2 messages)
From: Arnaldo Carvalho de Melo
Date: Saturday, August 21, 2010 - 10:45 am

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Relying just on ~/.perfconfig or rebuilding the tool disabling support
for the TUI is too cumbersome, so allow specifying which UI to use and
make the command line switch override whatever is in ~/.perfconfig.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-annotate.txt |   11 +++++++++--
 tools/perf/Documentation/perf-report.txt   |    7 +++++++
 tools/perf/builtin-annotate.c              |    9 ++++++++-
 tools/perf/builtin-report.c                |   11 ++++++++++-
 4 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
index 5164a65..b2c6330 100644
--- a/tools/perf/Documentation/perf-annotate.txt
+++ b/tools/perf/Documentation/perf-annotate.txt
@@ -8,7 +8,7 @@ perf-annotate - Read perf.data (created by perf record) and display annotated co
 SYNOPSIS
 --------
 [verse]
-'perf annotate' [-i <file> | --input=file] symbol_name
+'perf annotate' [-i <file> | --input=file] [symbol_name]
 
 DESCRIPTION
 -----------
@@ -24,6 +24,13 @@ OPTIONS
 --input=::
         Input file name. (default: perf.data)
 
+--stdio:: Use the stdio interface.
+
+--tui:: Use the TUI interface Use of --tui requires a tty, if one is not
+	present, as when piping to other commands, the stdio interface is
+	used. This interfaces starts by centering on the line with more
+	samples, TAB/UNTAB cycles thru the lines with more samples.
+
 SEE ALSO
 --------
-linkperf:perf-record[1]
+linkperf:perf-record[1], linkperf:perf-report[1]
diff --git a/tools/perf/Documentation/perf-report.txt ...
From: Christoph Hellwig
Date: Saturday, August 21, 2010 - 10:47 am

Much better than the current situation, thanks!

I still thinks commands like perf report should not be overloaded for
two different user interfaces, that is a

	perf report

should always be the line oriented interface, and the newt UI should be
something like

	perf treport

Btw, am I the only one that doesn't find the next interface too helpful?
In general the line oriented interface seem to present the information
much better, and in the cases where it gets too complicated the newt
interface doesn't really helper either.  A real gtk/qt interface with
a proper tree widget would seem like the more useful interface for that.

--

From: Arnaldo Carvalho de Melo
Date: Saturday, August 21, 2010 - 11:26 am

What would a gtk/qt interface buy us that is not present on the TUI
right now?

I'm not saying it wouldn't buy something, just interested in what is
this something :)

And yes, gtk/qt interfaces should be added. The experience with the TUI
is helping organize the data structures for that.

- Arnaldo
--

From: Christoph Hellwig
Date: Sunday, August 22, 2010 - 1:20 am

- it uses the space available in a terminal window much more
   efficiently.  Output starts in row 0, column 0 and expands all the
   way that's needed.
 - it incluses a descruption of what the columns of output mean
 - it provides percentages for the individual callchains parts after
   branching out
 - in graph/fractal modes there are lines that show how the parts
   are connected, making it possible to read the output, unlinke
   the TUI mode where the "expanind" nodes are very hard to follow.
 - just running perf reports gets an overview of all callchains instead
   of having to expand dozens of things
 - the colour scheme is the normal shell one (light gray on black for

Generally for tree/graph like data structures a real X GUI provides much
nicer rendering.  It'll allow to render the connected lines just as in
the line oriented interface, but in a nicer way using real thin lines
in a tree widget.  It'll also genereally allow better text placement
in the window compared to the single centered window in the newt
interface.   Also the GUI programs follow the common color scheme of the
rest of the desktop instead of hurting your eye.  In addition to that
scrollbars (horizontal / vertical) are a lot more intuitive in a typical
X GUI than in newt.

--

From: Arnaldo Carvalho de Melo
Date: Sunday, August 22, 2010 - 7:11 am

Cool, connected lines is something that indeed has to happen, just like


Ok, thanks for the detailed description of the problems.

- Arnaldo
--

From: tip-bot for Arnaldo Carvalho de Melo
Date: Monday, September 13, 2010 - 10:51 am

Commit-ID:  469917ce8717b9f8c5298bf279fa138859baab8d
Gitweb:     http://git.kernel.org/tip/469917ce8717b9f8c5298bf279fa138859baab8d
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Mon, 13 Sep 2010 10:25:04 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 13 Sep 2010 10:25:04 -0300

perf ui browser: Don't use windows, slang is enough

They are useless and take away precious columns and lines, so stop using
windows.

One more step in removing newt code, that after all is not being useful
at all for the coalescing TUI model in perf.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <20100822082003.GB7365@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browser.c        |   24 +++++++++-----------
 tools/perf/util/ui/browsers/hists.c |   41 ++++++++++++++++------------------
 tools/perf/util/ui/browsers/map.c   |    9 +++----
 3 files changed, 34 insertions(+), 40 deletions(-)

diff --git a/tools/perf/util/ui/browser.c b/tools/perf/util/ui/browser.c
index 930c4ac..6d0df80 100644
--- a/tools/perf/util/ui/browser.c
+++ b/tools/perf/util/ui/browser.c
@@ -130,13 +130,10 @@ void ui_browser__refresh_dimensions(struct ui_browser *self)
 	int cols, rows;
 	newtGetScreenSize(&cols, &rows);
 
-	if (self->width > cols - 4)
-		self->width = cols - 4;
-	self->height = rows - 5;
-	if (self->height > self->nr_entries)
-		self->height = self->nr_entries;
-	self->y  = (rows - self->height) / 2;
-	self->x = (cols - self->width) / 2;
+	self->width = cols - 1;
+	self->height = rows - 2;
+	self->y = 1;
+	self->x = 0;
 }
 
 void ui_browser__reset_index(struct ...
Previous thread: [PATCH 2/2] perf tools: add test for strlcpy() by Arnaldo Carvalho de Melo on Saturday, August 21, 2010 - 10:45 am. (1 message)

Next thread: [GIT PULL 0/2] perf/core improvements by Arnaldo Carvalho de Melo on Saturday, August 21, 2010 - 10:45 am. (2 messages)