summaryrefslogtreecommitdiff
path: root/schulung_tools/sleep_wake/README
blob: 5e4da5c1c8200bbcc86b0e3b2b7ac5523417e33d (plain)
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
#!/bin/sh

sudo trace-cmd record \
	-e syscalls:sys_enter_nanosleep \
	-e timer:hrtimer_start \
	-e sched:sched_switch \
	-e irq_vectors:local_timer_entry \
	-e timer:hrtimer_expire_entry \
	-e sched:sched_wakeup \
	-e syscalls:sys_exit_nanosleep \
	chrt -f 98 /bin/sleep 2

# Notice the chain of events (and their latencies!):
#
# sys_enter_nanosleep    (call to clock_nanosleep())
# hrtimer_start          (hrtimer set)
# sched_switch           (go to sleep)
#
# ... about 2 seconds later ...
#
# local_timer_entry      (cpu in irq vector)
# hrtimer_expire_entry   (hrtimer callback)
# sched_wakeup           (wake the sleeping task)
# sched_switch           (task scheduled)
# sys_exit_nanosleep     (return from clock_nanosleep())

kernelshark