public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Nikhil Rao <ncrao@google.com>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Paul Mackerras <paulus@samba.org>,
	Tom Zanussi <tzanussi@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH 07/12] perf, sched migration: Parameterize cpu height and spacing
Date: Mon,  2 Aug 2010 02:13:08 +0200	[thread overview]
Message-ID: <1280707993-6599-8-git-send-regression-fweisbec@gmail.com> (raw)
In-Reply-To: <1280707993-6599-1-git-send-regression-fweisbec@gmail.com>

From: Nikhil Rao <ncrao@google.com>

Without vertical zoom, it is not possible to see all CPUs in a trace
taken on a larger machine. This patch parameterizes the height and
spacing of CPUs so that you can fit more cpus into the screen.

Ideally we should dynamically size/space the CPU rectangles with some
minimum threshold. Until then, this patch is a stop-gap.

Signed-off-by: Nikhil Rao <ncrao@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 tools/perf/scripts/python/sched-migration.py |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/tools/perf/scripts/python/sched-migration.py b/tools/perf/scripts/python/sched-migration.py
index 8b8fb7c..d902668 100644
--- a/tools/perf/scripts/python/sched-migration.py
+++ b/tools/perf/scripts/python/sched-migration.py
@@ -27,6 +27,11 @@ from perf_trace_context import *
 from Core import *
 
 class RootFrame(wx.Frame):
+	Y_OFFSET = 100
+	CPU_HEIGHT = 100
+	CPU_SPACE = 50
+	EVENT_MARKING_WIDTH = 5
+
 	def __init__(self, timeslices, parent = None, id = -1, title = "Migration"):
 		wx.Frame.__init__(self, parent, id, title)
 
@@ -97,8 +102,8 @@ class RootFrame(wx.Frame):
 		if width_px == 0:
 			return
 
-		offset_py = 100 + (cpu * 150)
-		width_py = 100
+		offset_py = RootFrame.Y_OFFSET + (cpu * (RootFrame.CPU_HEIGHT + RootFrame.CPU_SPACE))
+		width_py = RootFrame.CPU_HEIGHT
 
 		if cpu in slice.event_cpus:
 			rgb = rq.event.color()
@@ -107,9 +112,9 @@ class RootFrame(wx.Frame):
 				color = wx.Colour(r, g, b)
 				brush = wx.Brush(color, wx.SOLID)
 				dc.SetBrush(brush)
-				dc.DrawRectangle(offset_px, offset_py, width_px, 5)
-				width_py -= 5
-				offset_py += 5
+				dc.DrawRectangle(offset_px, offset_py, width_px, RootFrame.EVENT_MARKING_WIDTH)
+				width_py -= RootFrame.EVENT_MARKING_WIDTH
+				offset_py += RootFrame.EVENT_MARKING_WIDTH
 
 		red_power = int(0xff - (0xff * load_rate))
 		color = wx.Colour(0xff, red_power, red_power)
@@ -154,11 +159,11 @@ class RootFrame(wx.Frame):
 		self.update_rectangles(dc, start, end)
 
 	def cpu_from_ypixel(self, y):
-		y -= 100
-		cpu = y / 150
-		height = y % 150
+		y -= RootFrame.Y_OFFSET
+		cpu = y / (RootFrame.CPU_HEIGHT + RootFrame.CPU_SPACE)
+		height = y % (RootFrame.CPU_HEIGHT + RootFrame.CPU_SPACE)
 
-		if cpu < 0 or cpu > self.max_cpu or height > 100:
+		if cpu < 0 or cpu > self.max_cpu or height > RootFrame.CPU_HEIGHT:
 			return -1
 
 		return cpu
-- 
1.6.2.3


  parent reply	other threads:[~2010-08-02  0:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02  0:13 [GIT PULL] instrumentation updates Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 01/12] perf: Use tracepoint_synchronize_unregister() to flush any pending tracepoint call Frederic Weisbecker
2010-08-02 15:14   ` Mathieu Desnoyers
2010-08-02  0:13 ` [PATCH 02/12] tracing: Drop cpparg() macro Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 03/12] perf: New migration tool overview Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 04/12] perf, sched migration: Handle ignored migrate out events Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 05/12] perf, sched migration: Ignore unhandled task states Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 06/12] perf, sched migration: Fix key bindings Frederic Weisbecker
2010-08-02  0:13 ` Frederic Weisbecker [this message]
2010-08-02  0:13 ` [PATCH 08/12] perf, sched migration: Make it vertically scrollable Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 09/12] perf, sched migration: Make the GUI class client agnostic Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 10/12] perf, sched migration: Librarize the GUI class Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 11/12] perf, sched migration: Librarize task states and event headers helpers Frederic Weisbecker
2010-08-02  0:13 ` [PATCH 12/12] x86,mmiotrace: Add support for tracing STOS instruction Frederic Weisbecker
2010-08-02  6:28 ` [GIT PULL] instrumentation updates Ingo Molnar

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=1280707993-6599-8-git-send-regression-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=ncrao@google.com \
    --cc=paulus@samba.org \
    --cc=tzanussi@gmail.com \
    /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