aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:18:45 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2017-05-26 17:12:23 -0400
commit8dbebee16f9e8f35ff0396516426318636997b96 (patch)
tree301fd252eb81a68934b61af346ef455cac8bb9ab
parent3adfeae8db15fd5aa4027a906f7f4b1b609cb2f9 (diff)
Add SCHED, SCHED2, 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.
-rw-r--r--kernel/sched/core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6440fe53d1a8..32bffe174d75 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -88,6 +88,8 @@
88#include "../workqueue_internal.h" 88#include "../workqueue_internal.h"
89#include "../smpboot.h" 89#include "../smpboot.h"
90 90
91#include <litmus/trace.h>
92
91#define CREATE_TRACE_POINTS 93#define CREATE_TRACE_POINTS
92#include <trace/events/sched.h> 94#include <trace/events/sched.h>
93 95
@@ -3345,6 +3347,8 @@ static void __sched notrace __schedule(bool preempt)
3345 struct rq *rq; 3347 struct rq *rq;
3346 int cpu; 3348 int cpu;
3347 3349
3350 TS_SCHED_START;
3351
3348 cpu = smp_processor_id(); 3352 cpu = smp_processor_id();
3349 rq = cpu_rq(cpu); 3353 rq = cpu_rq(cpu);
3350 prev = rq->curr; 3354 prev = rq->curr;
@@ -3406,13 +3410,19 @@ static void __sched notrace __schedule(bool preempt)
3406 ++*switch_count; 3410 ++*switch_count;
3407 3411
3408 trace_sched_switch(preempt, prev, next); 3412 trace_sched_switch(preempt, prev, next);
3413 TS_SCHED_END(next);
3414 TS_CXS_START(next);
3409 rq = context_switch(rq, prev, next, cookie); /* unlocks the rq */ 3415 rq = context_switch(rq, prev, next, cookie); /* unlocks the rq */
3416 TS_CXS_END(current);
3410 } else { 3417 } else {
3411 lockdep_unpin_lock(&rq->lock, cookie); 3418 lockdep_unpin_lock(&rq->lock, cookie);
3419 TS_SCHED_END(prev);
3412 raw_spin_unlock_irq(&rq->lock); 3420 raw_spin_unlock_irq(&rq->lock);
3413 } 3421 }
3414 3422
3423 TS_SCHED2_START(prev);
3415 balance_callback(rq); 3424 balance_callback(rq);
3425 TS_SCHED2_END(prev);
3416} 3426}
3417 3427
3418void __noreturn do_task_dead(void) 3428void __noreturn do_task_dead(void)