diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:18:50 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2017-05-26 17:12:30 -0400 |
commit | 2c2328ebc9dbc50e76023d54bbf4fab17197c5d4 (patch) | |
tree | 31fcb562c665ac0b96d4d73249a40a4e35ac7e8a /kernel | |
parent | 9cd62c8dc5bad42f2de65e9a50fed0fe2608a162 (diff) |
Hookup sched_trace_XXX() tracing in Linux scheduler
This patch adds context switch tracing to the main Linux scheduler.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 435d755cf9bf..1f8d205a8b7f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -89,6 +89,7 @@ | |||
89 | #include "../smpboot.h" | 89 | #include "../smpboot.h" |
90 | 90 | ||
91 | #include <litmus/trace.h> | 91 | #include <litmus/trace.h> |
92 | #include <litmus/sched_trace.h> | ||
92 | 93 | ||
93 | #define CREATE_TRACE_POINTS | 94 | #define CREATE_TRACE_POINTS |
94 | #include <trace/events/sched.h> | 95 | #include <trace/events/sched.h> |
@@ -2858,6 +2859,8 @@ asmlinkage __visible void schedule_tail(struct task_struct *prev) | |||
2858 | 2859 | ||
2859 | rq = finish_task_switch(prev); | 2860 | rq = finish_task_switch(prev); |
2860 | 2861 | ||
2862 | sched_trace_task_switch_to(current); | ||
2863 | |||
2861 | if (unlikely(sched_state_validate_switch())) | 2864 | if (unlikely(sched_state_validate_switch())) |
2862 | litmus_reschedule_local(); | 2865 | litmus_reschedule_local(); |
2863 | 2866 | ||
@@ -3352,13 +3355,14 @@ static void __sched notrace __schedule(bool preempt) | |||
3352 | int cpu; | 3355 | int cpu; |
3353 | 3356 | ||
3354 | TS_SCHED_START; | 3357 | TS_SCHED_START; |
3355 | |||
3356 | sched_state_entered_schedule(); | 3358 | sched_state_entered_schedule(); |
3357 | 3359 | ||
3358 | cpu = smp_processor_id(); | 3360 | cpu = smp_processor_id(); |
3359 | rq = cpu_rq(cpu); | 3361 | rq = cpu_rq(cpu); |
3360 | prev = rq->curr; | 3362 | prev = rq->curr; |
3361 | 3363 | ||
3364 | sched_trace_task_switch_away(prev); | ||
3365 | |||
3362 | schedule_debug(prev); | 3366 | schedule_debug(prev); |
3363 | 3367 | ||
3364 | if (sched_feat(HRTICK)) | 3368 | if (sched_feat(HRTICK)) |
@@ -3431,6 +3435,7 @@ static void __sched notrace __schedule(bool preempt) | |||
3431 | } | 3435 | } |
3432 | 3436 | ||
3433 | TS_SCHED2_START(prev); | 3437 | TS_SCHED2_START(prev); |
3438 | sched_trace_task_switch_to(current); | ||
3434 | 3439 | ||
3435 | if (unlikely(sched_state_validate_switch())) | 3440 | if (unlikely(sched_state_validate_switch())) |
3436 | litmus_reschedule_local(); | 3441 | litmus_reschedule_local(); |