diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:18:45 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 06:21:16 -0400 |
| commit | bdd72ea40e761db68dfbf564af6d18a545f84382 (patch) | |
| tree | 1149d68abe471bea5ad04255fd8f57ef7d4d72d2 /kernel | |
| parent | 246fc4491c943b4f2723bf711eadd48c8e4f4045 (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 | 16 |
1 files changed, 15 insertions, 1 deletions
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 @@ | |||
| 87 | #include "../workqueue_internal.h" | 87 | #include "../workqueue_internal.h" |
| 88 | #include "../smpboot.h" | 88 | #include "../smpboot.h" |
| 89 | 89 | ||
| 90 | #include <litmus/trace.h> | ||
| 91 | |||
| 90 | #define CREATE_TRACE_POINTS | 92 | #define CREATE_TRACE_POINTS |
| 91 | #include <trace/events/sched.h> | 93 | #include <trace/events/sched.h> |
| 92 | 94 | ||
| @@ -2748,6 +2750,8 @@ static void __sched __schedule(void) | |||
| 2748 | rcu_note_context_switch(); | 2750 | rcu_note_context_switch(); |
| 2749 | prev = rq->curr; | 2751 | prev = rq->curr; |
| 2750 | 2752 | ||
| 2753 | TS_SCHED_START; | ||
| 2754 | |||
| 2751 | schedule_debug(prev); | 2755 | schedule_debug(prev); |
| 2752 | 2756 | ||
| 2753 | if (sched_feat(HRTICK)) | 2757 | if (sched_feat(HRTICK)) |
| @@ -2800,14 +2804,24 @@ static void __sched __schedule(void) | |||
| 2800 | rq->curr = next; | 2804 | rq->curr = next; |
| 2801 | ++*switch_count; | 2805 | ++*switch_count; |
| 2802 | 2806 | ||
| 2807 | TS_SCHED_END(next); | ||
| 2808 | TS_CXS_START(next); | ||
| 2803 | rq = context_switch(rq, prev, next); /* unlocks the rq */ | 2809 | rq = context_switch(rq, prev, next); /* unlocks the rq */ |
| 2810 | TS_CXS_END(current); | ||
| 2811 | |||
| 2804 | cpu = cpu_of(rq); | 2812 | cpu = cpu_of(rq); |
| 2805 | } else | 2813 | } else { |
| 2814 | TS_SCHED_END(prev); | ||
| 2806 | raw_spin_unlock_irq(&rq->lock); | 2815 | raw_spin_unlock_irq(&rq->lock); |
| 2816 | } | ||
| 2817 | |||
| 2818 | TS_SCHED2_START(prev); | ||
| 2807 | 2819 | ||
| 2808 | post_schedule(rq); | 2820 | post_schedule(rq); |
| 2809 | 2821 | ||
| 2810 | sched_preempt_enable_no_resched(); | 2822 | sched_preempt_enable_no_resched(); |
| 2823 | |||
| 2824 | TS_SCHED2_END(prev); | ||
| 2811 | } | 2825 | } |
| 2812 | 2826 | ||
| 2813 | static inline void sched_submit_work(struct task_struct *tsk) | 2827 | static inline void sched_submit_work(struct task_struct *tsk) |
