[PATCH 3/4] printk: add offloading takeover traces

Sergey Senozhatsky
2017-12-04T13:55:35Z

*** FOR TESTING ***

Add more trace events for printing offloading (handoff).

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
kernel/printk/printk.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 01626f2f42bd..a34a839e6045 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -620,6 +620,8 @@ static unsigned long spinning_waiter_handoff_disable(void)

static void console_handoff_printing(void)
{
+ trace_offloading_rcuidle("handoff", " ", 0);
+
WRITE_ONCE(console_handoff_waiter, DONT_HANDOFF);
/* The waiter is now free to continue */
spin_release(&console_owner_dep_map, 1, _THIS_IP_);
@@ -3172,6 +3174,9 @@ static int printk_kthread_func(void *data)
WRITE_ONCE(console_handoff_waiter,
SLEEPING_WAITER_HANDOFF);
}
+
+ trace_offloading_rcuidle("set", "console_handoff_waiter",
+ READ_ONCE(console_handoff_waiter));
raw_spin_unlock(&console_owner_lock);

if (spin) {
--
2.15.1