aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/sched-migration.py
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-08-01 08:55:45 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-08-01 19:32:00 -0400
commit1b0ff06e68155de606f86e7e69eb238f14e05ba0 (patch)
treeada6010932fc96014822e95b702b40912e0f7ef7 /tools/perf/scripts/python/sched-migration.py
parentdf92b40848616596c50b3b9e6d6ce8252af606ee (diff)
perf, sched migration: Librarize task states and event headers helpers
Librarize the task state and event headers helpers as they can be generally useful. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.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: Nikhil Rao <ncrao@google.com> Cc: Tom Zanussi <tzanussi@gmail.com>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
-rw-r--r--tools/perf/scripts/python/sched-migration.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/tools/perf/scripts/python/sched-migration.py b/tools/perf/scripts/python/sched-migration.py
index 983463050f04..b934383c3364 100644
--- a/tools/perf/scripts/python/sched-migration.py
+++ b/tools/perf/scripts/python/sched-migration.py
@@ -31,36 +31,6 @@ threads = { 0 : "idle"}
31def thread_name(pid): 31def thread_name(pid):
32 return "%s:%d" % (threads[pid], pid) 32 return "%s:%d" % (threads[pid], pid)
33 33
34class EventHeaders:
35 def __init__(self, common_cpu, common_secs, common_nsecs,
36 common_pid, common_comm):
37 self.cpu = common_cpu
38 self.secs = common_secs
39 self.nsecs = common_nsecs
40 self.pid = common_pid
41 self.comm = common_comm
42
43 def ts(self):
44 return (self.secs * (10 ** 9)) + self.nsecs
45
46 def ts_format(self):
47 return "%d.%d" % (self.secs, int(self.nsecs / 1000))
48
49
50def taskState(state):
51 states = {
52 0 : "R",
53 1 : "S",
54 2 : "D",
55 64: "DEAD"
56 }
57
58 if state not in states:
59 return "Unknown"
60
61 return states[state]
62
63
64class RunqueueEventUnknown: 34class RunqueueEventUnknown:
65 @staticmethod 35 @staticmethod
66 def color(): 36 def color():