-
Notifications
You must be signed in to change notification settings - Fork 2
/
sched-list.py
executable file
·29 lines (26 loc) · 1.03 KB
/
sched-list.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
import sys
import events
import filters
import argparse
parser = argparse.ArgumentParser(description='List scheduling history')
parser.add_argument('--wakeup-granularity', type=float, default=0.000010)
filters.add_all_filters(parser)
args = parser.parse_args()
filter = filters.get_filter(args)
wakeup_granularity = args.wakeup_granularity
for elem in events.get_sched_timeline(sys.stdin, generate_runnable=False):
if not filter(elem):
continue
flags = ''
if elem.state == events.TimelineElement.WOKEN:
delta = elem.wakeup_vruntime_delta
if delta:
delta_str = '%f [s]' % delta
if delta < wakeup_granularity:
flags += '!'
else:
delta_str = '?'
print("[%03d] %-20s %f: duration=%f [s] %-10s vruntime_delta=%-13s %5s" % (elem.cpu, elem.proc, elem.start, elem.duration, elem.state, delta_str, flags))
else:
print("[%03d] %-20s %f: duration=%f [s] %-10s" % (elem.cpu, elem.proc, elem.start, elem.duration, elem.state))