mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>
Subject: [PATCH 1/8] perf ui browser: Return the current color when setting a new one
Date: Sat,  7 Apr 2012 17:54:02 -0300	[thread overview]
Message-ID: <1333832049-2399-2-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1333832049-2399-1-git-send-email-acme@infradead.org>

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

Tools that want to change parts of the line to a different color and
then restore the previous one will use this, starting with the annotate
browser that will change the color of addresses if not on the current
entry, i.e. the selected one.

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-uiajpevhxo4mzrvna6remb4a@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browser.c |    5 ++++-
 tools/perf/util/ui/browser.h |    3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/ui/browser.c b/tools/perf/util/ui/browser.c
index 5568291..076a5ff 100644
--- a/tools/perf/util/ui/browser.c
+++ b/tools/perf/util/ui/browser.c
@@ -27,9 +27,12 @@ static int ui_browser__percent_color(struct ui_browser *browser,
 	return HE_COLORSET_NORMAL;
 }
 
-void ui_browser__set_color(struct ui_browser *self __used, int color)
+int ui_browser__set_color(struct ui_browser *browser, int color)
 {
+	int ret = browser->current_color;
+	browser->current_color = color;
 	SLsmg_set_color(color);
+	return ret;
 }
 
 void ui_browser__set_percent_color(struct ui_browser *self,
diff --git a/tools/perf/util/ui/browser.h b/tools/perf/util/ui/browser.h
index 6ee82f6..65b2592 100644
--- a/tools/perf/util/ui/browser.h
+++ b/tools/perf/util/ui/browser.h
@@ -15,6 +15,7 @@ struct ui_browser {
 	u64	      index, top_idx;
 	void	      *top, *entries;
 	u16	      y, x, width, height;
+	int	      current_color;
 	void	      *priv;
 	const char    *title;
 	char	      *helpline;
@@ -27,7 +28,7 @@ struct ui_browser {
 	bool	      use_navkeypressed;
 };
 
-void ui_browser__set_color(struct ui_browser *self, int color);
+int  ui_browser__set_color(struct ui_browser *browser, int color);
 void ui_browser__set_percent_color(struct ui_browser *self,
 				   double percent, bool current);
 bool ui_browser__is_current_entry(struct ui_browser *self, unsigned row);
-- 
1.7.9.2.358.g22243


  reply	other threads:[~2012-04-07 20:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-07 20:54 [GIT PULL 0/8] perf/urgent new features Arnaldo Carvalho de Melo
2012-04-07 20:54 ` Arnaldo Carvalho de Melo [this message]
2012-04-07 20:54 ` [PATCH 2/8] perf annotate: Allow printing objdump line addr in different color Arnaldo Carvalho de Melo
2012-04-07 20:54 ` [PATCH 3/8] perf ui annotate browser: Allow toggling addr offset view Arnaldo Carvalho de Melo
2012-04-07 20:54 ` [PATCH 4/8] perf ui annotate browser: Move callq handling to separate function Arnaldo Carvalho de Melo
2012-04-07 20:54 ` [PATCH 5/8] perf ui annotate browser: Add list based search for addr offset Arnaldo Carvalho de Melo
2012-04-07 20:54 ` [PATCH 6/8] perf annotate browser: Initial support for navigating jump instructions Arnaldo Carvalho de Melo
2012-04-09  2:02   ` David Ahern
2012-04-07 20:54 ` [PATCH 7/8] perf report: Correct display of samples and events in header Arnaldo Carvalho de Melo
2012-04-07 20:54 ` [PATCH 8/8] perf annotate browser: string search: /?n Arnaldo Carvalho de Melo
2012-04-08 22:24 ` [GIT PULL 0/8] perf/urgent new features Namhyung Kim
2012-04-13 18:19   ` [tip:perf/core] perf annotate: Fix a build error tip-bot for Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333832049-2399-2-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®