From bdd72ea40e761db68dfbf564af6d18a545f84382 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Sun, 9 Aug 2015 13:18:45 +0200 Subject: Add SCHED, SCHED2, TICK, and CXS overhead tracepoints This patch integrates the overhead tracepoints into the Linux scheduler that are compatible with plain vanilla Linux (i.e., not specific to LITMUS^RT plugins). This can be used to measure the overheads of an otherwise unmodified kernel. --- kernel/sched/core.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f286554e3395..50f9f4c45ce9 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -87,6 +87,8 @@ #include "../workqueue_internal.h" #include "../smpboot.h" +#include + #define CREATE_TRACE_POINTS #include @@ -2748,6 +2750,8 @@ static void __sched __schedule(void) rcu_note_context_switch(); prev = rq->curr; + TS_SCHED_START; + schedule_debug(prev); if (sched_feat(HRTICK)) @@ -2800,14 +2804,24 @@ static void __sched __schedule(void) rq->curr = next; ++*switch_count; + TS_SCHED_END(next); + TS_CXS_START(next); rq = context_switch(rq, prev, next); /* unlocks the rq */ + TS_CXS_END(current); + cpu = cpu_of(rq); - } else + } else { + TS_SCHED_END(prev); raw_spin_unlock_irq(&rq->lock); + } + + TS_SCHED2_START(prev); post_schedule(rq); sched_preempt_enable_no_resched(); + + TS_SCHED2_END(prev); } static inline void sched_submit_work(struct task_struct *tsk) -- cgit v1.2.2