From 115114f896fbb1a89467ea07476d2b6d1b18f1b8 Mon Sep 17 00:00:00 2001 From: John Ogness Date: Thu, 28 Mar 2019 15:21:48 +0106 Subject: schulung_tools: add sleep_wake demo A very simple demo that shows the full chain of events from sys_nanosleep_enter to sys_nanosleep_exit. (For the IRQ calculations use expires= and now= from the hrtimer events.) Signed-off-by: John Ogness --- schulung_tools/sleep_wake/README | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 schulung_tools/sleep_wake/README diff --git a/schulung_tools/sleep_wake/README b/schulung_tools/sleep_wake/README new file mode 100644 index 0000000..b18efa9 --- /dev/null +++ b/schulung_tools/sleep_wake/README @@ -0,0 +1,19 @@ +#!/bin/sh + +sudo trace-cmd record -e sched:* -e timer:* -e syscalls:* chrt -f 98 /bin/sleep 2 + +# Notice the chain of events: +# +# sys_enter_nanosleep +# hrtimer_init +# hrtimer_start +# sched_switch +# ... +# hrtimer_cancel +# hrtimer_expire_entry +# sched_wakeup +# hrtimer_expire_exit +# sched_switch +# sys_exit_nanosleep + +kernelshark -- cgit v1.2.3