diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-06-26 12:45:30 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-08-07 03:46:39 -0400 |
commit | ee6ab6012870a6a3b60dc75560bb5118a37992d0 (patch) | |
tree | 12287ab82c60407f0f13c971b4993cad2217da43 /kernel | |
parent | 5ef7e2dad47bce26ce3afd0c402f6cc185e75ad6 (diff) |
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.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a4c8c093f6bc..5a51ce671fd2 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -86,6 +86,8 @@ | |||
86 | #include "../workqueue_internal.h" | 86 | #include "../workqueue_internal.h" |
87 | #include "../smpboot.h" | 87 | #include "../smpboot.h" |
88 | 88 | ||
89 | #include <litmus/trace.h> | ||
90 | |||
89 | #define CREATE_TRACE_POINTS | 91 | #define CREATE_TRACE_POINTS |
90 | #include <trace/events/sched.h> | 92 | #include <trace/events/sched.h> |
91 | 93 | ||
@@ -2742,6 +2744,8 @@ void scheduler_tick(void) | |||
2742 | 2744 | ||
2743 | sched_clock_tick(); | 2745 | sched_clock_tick(); |
2744 | 2746 | ||
2747 | TS_TICK_START(current); | ||
2748 | |||
2745 | raw_spin_lock(&rq->lock); | 2749 | raw_spin_lock(&rq->lock); |
2746 | update_rq_clock(rq); | 2750 | update_rq_clock(rq); |
2747 | update_cpu_load_active(rq); | 2751 | update_cpu_load_active(rq); |
@@ -2755,6 +2759,8 @@ void scheduler_tick(void) | |||
2755 | trigger_load_balance(rq, cpu); | 2759 | trigger_load_balance(rq, cpu); |
2756 | #endif | 2760 | #endif |
2757 | rq_last_tick_reset(rq); | 2761 | rq_last_tick_reset(rq); |
2762 | |||
2763 | TS_TICK_END(current); | ||
2758 | } | 2764 | } |
2759 | 2765 | ||
2760 | #ifdef CONFIG_NO_HZ_FULL | 2766 | #ifdef CONFIG_NO_HZ_FULL |
@@ -2966,6 +2972,8 @@ need_resched: | |||
2966 | rcu_note_context_switch(cpu); | 2972 | rcu_note_context_switch(cpu); |
2967 | prev = rq->curr; | 2973 | prev = rq->curr; |
2968 | 2974 | ||
2975 | TS_SCHED_START; | ||
2976 | |||
2969 | schedule_debug(prev); | 2977 | schedule_debug(prev); |
2970 | 2978 | ||
2971 | if (sched_feat(HRTICK)) | 2979 | if (sched_feat(HRTICK)) |
@@ -3012,7 +3020,10 @@ need_resched: | |||
3012 | rq->curr = next; | 3020 | rq->curr = next; |
3013 | ++*switch_count; | 3021 | ++*switch_count; |
3014 | 3022 | ||
3023 | TS_SCHED_END(next); | ||
3024 | TS_CXS_START(next); | ||
3015 | context_switch(rq, prev, next); /* unlocks the rq */ | 3025 | context_switch(rq, prev, next); /* unlocks the rq */ |
3026 | TS_CXS_END(current); | ||
3016 | /* | 3027 | /* |
3017 | * The context switch have flipped the stack from under us | 3028 | * The context switch have flipped the stack from under us |
3018 | * and restored the local variables which were saved when | 3029 | * and restored the local variables which were saved when |
@@ -3021,12 +3032,19 @@ need_resched: | |||
3021 | */ | 3032 | */ |
3022 | cpu = smp_processor_id(); | 3033 | cpu = smp_processor_id(); |
3023 | rq = cpu_rq(cpu); | 3034 | rq = cpu_rq(cpu); |
3024 | } else | 3035 | } else { |
3036 | TS_SCHED_END(prev); | ||
3025 | raw_spin_unlock_irq(&rq->lock); | 3037 | raw_spin_unlock_irq(&rq->lock); |
3038 | } | ||
3039 | |||
3040 | TS_SCHED2_START(prev); | ||
3026 | 3041 | ||
3027 | post_schedule(rq); | 3042 | post_schedule(rq); |
3028 | 3043 | ||
3029 | sched_preempt_enable_no_resched(); | 3044 | sched_preempt_enable_no_resched(); |
3045 | |||
3046 | TS_SCHED2_END(prev); | ||
3047 | |||
3030 | if (need_resched()) | 3048 | if (need_resched()) |
3031 | goto need_resched; | 3049 | goto need_resched; |
3032 | } | 3050 | } |