Skip to contentSkip to conversation

perf/tui: Change default selection background color to yellow

PATCH In review Ingo Molnar 4 participants 5 messages Mar 5, 2015 – Dec 10, 2015 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf/tui: Change default selection background color to yellow

Boris reported that 'perf top' is unusable on his default 'black on white' terminal, which uses (eye friendly) light-grey as a background color.

The reason is that the TUI cursor for the current selection line uses HE_COLORSET_SELECTED, and that has a default background color of 'lightgrey' - which is a common terminal background choice and thus the colors conflict.

Use yellow as the background color instead: that should be an uncommon terminal background, yet it's still ergonomic on both black and white/grey terminals.

[ It would be a better solution to straight out detect color
collisions and resolve them reasonably by converting them to RGB and calculating color space distances, but I was unable to find proper documentation for SLtt_get_color_object() to recover the current color scheme so I gave up ... Yellow works well enough. ]

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc David Binderman <[email protected]>
Cc Jiri Olsa <[email protected]>
---
 tools/perf/ui/browser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/ui/browser.c +1 -1
index 6680fa5cb9dd..688acb94c01f 100644
@@ -499,7 +499,7 @@ static struct ui_browser_colorset {
 		.colorset = HE_COLORSET_SELECTED,
 		.name	  = "selected",
 		.fg	  = "black",
-		.bg	  = "lightgray",
+		.bg	  = "yellow",
 	},
 	{
 		.colorset = HE_COLORSET_CODE,
#1 lore raw
Quoted 14 lines · Ingo Molnar

Boris reported that 'perf top' is unusable on his default 'black on white' terminal, which uses (eye friendly) light-grey as a background color.

The reason is that the TUI cursor for the current selection line uses HE_COLORSET_SELECTED, and that has a default background color of 'lightgrey' - which is a common terminal background choice and thus the colors conflict.

Use yellow as the background color instead: that should be an uncommon terminal background, yet it's still ergonomic on both black and white/grey terminals.

Quoted 7 lines

[ It would be a better solution to straight out detect color
collisions and resolve them reasonably by converting them to RGB and calculating color space distances, but I was unable to find proper documentation for SLtt_get_color_object() to recover the current color scheme so I gave up ... Yellow works well enough. ]

-and-tested-by: Boris

Thanks.

Signature · 5 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
#2 lore raw
In reply to Ingo Molnar

Em Thu, Mar 05, 2015 at 11:32:13AM +0100, Ingo Molnar escreveu:

Quoted 13 lines

Boris reported that 'perf top' is unusable on his default 'black on white' terminal, which uses (eye friendly) light-grey as a background color.

The reason is that the TUI cursor for the current selection line uses HE_COLORSET_SELECTED, and that has a default background color of 'lightgrey' - which is a common terminal background choice and thus the colors conflict.

Use yellow as the background color instead: that should be an uncommon terminal background, yet it's still ergonomic on both black and white/grey terminals.

Quoted 5 lines

[ It would be a better solution to straight out detect color
collisions and resolve them reasonably by converting them to RGB and calculating color space distances, but I was unable to find proper documentation for SLtt_get_color_object() to recover the current color scheme so I gave up ... Yellow works well enough. ]

Thanks, applying.

BTW, I started with newt, thinking it would give me good widgets, only to, after having reached its limitations write my own, this time just on, like newt, top of slang's tui libraries, eventually I think I'll move to ncurses or even just use the kernel tty interface directly ;-)

- Arnaldo

#3 lore raw
Quoted 20 lines · Arnaldo Carvalho de Melo

Em Thu, Mar 05, 2015 at 11:32:13AM +0100, Ingo Molnar escreveu:

Quoted 13 lines

Boris reported that 'perf top' is unusable on his default 'black on white' terminal, which uses (eye friendly) light-grey as a background color.

The reason is that the TUI cursor for the current selection line uses HE_COLORSET_SELECTED, and that has a default background color of 'lightgrey' - which is a common terminal background choice and thus the colors conflict.

Use yellow as the background color instead: that should be an uncommon terminal background, yet it's still ergonomic on both black and white/grey terminals.

Quoted 5 lines

[ It would be a better solution to straight out detect color
collisions and resolve them reasonably by converting them to RGB and calculating color space distances, but I was unable to find proper documentation for SLtt_get_color_object() to recover the current color scheme so I gave up ... Yellow works well enough. ]

Quoted 7 lines

Thanks, applying.

BTW, I started with newt, thinking it would give me good widgets, only to, after having reached its limitations write my own, this time just on, like newt, top of slang's tui libraries, eventually I think I'll move to ncurses or even just use the kernel tty interface directly ;-)

LOL! :-)

Btw., a related problem: X terminals are pretty high overhead unfortunately, I cringe every time I run 'perf top' on a very fast system:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                               
 4240 mingo     20   0 1031088 176112 106648 S   5.9  0.3 101:54.30 konsole                                                                                               
 1985 root      20   0  649412 194760 157464 S   3.0  0.3  41:49.94 Xorg                                                                                                  
 2395 mingo     20   0 2283956 526044 127108 S   2.0  0.8  34:40.23 compiz                     
13258 mingo     20   0  207588  70916  12112 S   1.3  0.1   0:03.01 perf                                                                                                  

10%+ of GUI CPU overhead with a refresh every 2 seconds (i.e. only 0.5 fps) - ridiculous!

So to fix this I think we eventually want a raw OpenGL client for local system 'perf top' use and such: that would be (by far) the lowest overhead UI interface to run profiling from without disturbing the system, with UI overhead in the ~1% range at most.

Raw (no toolkits) OpenGL would also allow us to do a lot of other UI and performance tricks.

Would you have any fundamental objections against OpenGL UI clients?

Thanks,

Ingo

#4 lore raw

[tip:perf/core] perf tui: Change default selection background color to yellow

In reply to Ingo Molnar
perf tui: Change default selection background color to yellow
Commit-ID:  8d7d377c2bea16afa6b600a4517615a9eebb259b
Gitweb:     http://git.kernel.org/tip/8d7d377c2bea16afa6b600a4517615a9eebb259b
Author:     Ingo Molnar <[email protected]>
AuthorDate: Thu, 5 Mar 2015 11:32:13 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 9 Dec 2015 13:41:55 -0300

perf tui: Change default selection background color to yellow

Boris reported that 'perf top' is unusable on his default 'black on white' terminal, which uses (eye friendly) light-grey as a background color.

The reason is that the TUI cursor for the current selection line uses HE_COLORSET_SELECTED, and that has a default background color of 'lightgrey' - which is a common terminal background choice and thus the colors conflict.

Use yellow as the background color instead: that should be an uncommon terminal background, yet it's still ergonomic on both black and white/grey terminals.

[ It would be a better solution to straight out detect color
collisions and resolve them reasonably by converting them to RGB and calculating color space distances, but I was unable to find proper documentation for SLtt_get_color_object() to recover the current color scheme so I gave up ... Yellow works well enough. ]

---
 tools/perf/ui/browser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/ui/browser.c +1 -1
index e9703c0..d372021 100644
@@ -528,7 +528,7 @@ static struct ui_browser_colorset {
 		.colorset = HE_COLORSET_SELECTED,
 		.name	  = "selected",
 		.fg	  = "black",
-		.bg	  = "lightgray",
+		.bg	  = "yellow",
 	},
 	{
 		.colorset = HE_COLORSET_CODE,