diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched_fair.c | 3 | ||||
-rw-r--r-- | kernel/trace/trace.c | 6 | ||||
-rw-r--r-- | kernel/trace/trace_sched_switch.c | 24 |
3 files changed, 30 insertions, 3 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index e24ecd39c4b8..dc1856f10795 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1061,6 +1061,8 @@ wake_affine(struct rq *rq, struct sched_domain *this_sd, struct rq *this_rq, | |||
1061 | if (!(this_sd->flags & SD_WAKE_AFFINE)) | 1061 | if (!(this_sd->flags & SD_WAKE_AFFINE)) |
1062 | return 0; | 1062 | return 0; |
1063 | 1063 | ||
1064 | ftrace_special(__LINE__, curr->se.avg_overlap, sync); | ||
1065 | ftrace_special(__LINE__, p->se.avg_overlap, -1); | ||
1064 | /* | 1066 | /* |
1065 | * If the currently running task will sleep within | 1067 | * If the currently running task will sleep within |
1066 | * a reasonable amount of time then attract this newly | 1068 | * a reasonable amount of time then attract this newly |
@@ -1238,6 +1240,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) | |||
1238 | if (unlikely(se == pse)) | 1240 | if (unlikely(se == pse)) |
1239 | return; | 1241 | return; |
1240 | 1242 | ||
1243 | ftrace_special(__LINE__, p->pid, se->last_wakeup); | ||
1241 | cfs_rq_of(pse)->next = pse; | 1244 | cfs_rq_of(pse)->next = pse; |
1242 | 1245 | ||
1243 | /* | 1246 | /* |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 3a4032492fcb..b87a26414892 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1251,7 +1251,7 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) | |||
1251 | comm); | 1251 | comm); |
1252 | break; | 1252 | break; |
1253 | case TRACE_SPECIAL: | 1253 | case TRACE_SPECIAL: |
1254 | trace_seq_printf(s, " %ld %ld %ld\n", | 1254 | trace_seq_printf(s, "# %ld %ld %ld\n", |
1255 | entry->special.arg1, | 1255 | entry->special.arg1, |
1256 | entry->special.arg2, | 1256 | entry->special.arg2, |
1257 | entry->special.arg3); | 1257 | entry->special.arg3); |
@@ -1335,7 +1335,7 @@ static int print_trace_fmt(struct trace_iterator *iter) | |||
1335 | return 0; | 1335 | return 0; |
1336 | break; | 1336 | break; |
1337 | case TRACE_SPECIAL: | 1337 | case TRACE_SPECIAL: |
1338 | ret = trace_seq_printf(s, " %ld %ld %ld\n", | 1338 | ret = trace_seq_printf(s, "# %ld %ld %ld\n", |
1339 | entry->special.arg1, | 1339 | entry->special.arg1, |
1340 | entry->special.arg2, | 1340 | entry->special.arg2, |
1341 | entry->special.arg3); | 1341 | entry->special.arg3); |
@@ -1400,7 +1400,7 @@ static int print_raw_fmt(struct trace_iterator *iter) | |||
1400 | break; | 1400 | break; |
1401 | case TRACE_SPECIAL: | 1401 | case TRACE_SPECIAL: |
1402 | case TRACE_STACK: | 1402 | case TRACE_STACK: |
1403 | ret = trace_seq_printf(s, " %ld %ld %ld\n", | 1403 | ret = trace_seq_printf(s, "# %ld %ld %ld\n", |
1404 | entry->special.arg1, | 1404 | entry->special.arg1, |
1405 | entry->special.arg2, | 1405 | entry->special.arg2, |
1406 | entry->special.arg3); | 1406 | entry->special.arg3); |
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c index 5a217e863586..bddf676914ed 100644 --- a/kernel/trace/trace_sched_switch.c +++ b/kernel/trace/trace_sched_switch.c | |||
@@ -103,6 +103,30 @@ ftrace_wake_up_task(void *__rq, struct task_struct *wakee, | |||
103 | wakeup_sched_wakeup(wakee, curr); | 103 | wakeup_sched_wakeup(wakee, curr); |
104 | } | 104 | } |
105 | 105 | ||
106 | void | ||
107 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) | ||
108 | { | ||
109 | struct trace_array *tr = ctx_trace; | ||
110 | struct trace_array_cpu *data; | ||
111 | unsigned long flags; | ||
112 | long disabled; | ||
113 | int cpu; | ||
114 | |||
115 | if (!tracer_enabled) | ||
116 | return; | ||
117 | |||
118 | local_irq_save(flags); | ||
119 | cpu = raw_smp_processor_id(); | ||
120 | data = tr->data[cpu]; | ||
121 | disabled = atomic_inc_return(&data->disabled); | ||
122 | |||
123 | if (likely(disabled == 1)) | ||
124 | __trace_special(tr, data, arg1, arg2, arg3); | ||
125 | |||
126 | atomic_dec(&data->disabled); | ||
127 | local_irq_restore(flags); | ||
128 | } | ||
129 | |||
106 | static void sched_switch_reset(struct trace_array *tr) | 130 | static void sched_switch_reset(struct trace_array *tr) |
107 | { | 131 | { |
108 | int cpu; | 132 | int cpu; |