diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 3 | ||||
-rw-r--r-- | kernel/trace/trace_functions_graph.c | 66 |
2 files changed, 64 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 7729c4bbc8ba..d377097572f9 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1851,6 +1851,8 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu) | |||
1851 | 1851 | ||
1852 | clock_offset = old_rq->clock - new_rq->clock; | 1852 | clock_offset = old_rq->clock - new_rq->clock; |
1853 | 1853 | ||
1854 | trace_sched_migrate_task(p, task_cpu(p), new_cpu); | ||
1855 | |||
1854 | #ifdef CONFIG_SCHEDSTATS | 1856 | #ifdef CONFIG_SCHEDSTATS |
1855 | if (p->se.wait_start) | 1857 | if (p->se.wait_start) |
1856 | p->se.wait_start -= clock_offset; | 1858 | p->se.wait_start -= clock_offset; |
@@ -2868,7 +2870,6 @@ static void sched_migrate_task(struct task_struct *p, int dest_cpu) | |||
2868 | || unlikely(!cpu_active(dest_cpu))) | 2870 | || unlikely(!cpu_active(dest_cpu))) |
2869 | goto out; | 2871 | goto out; |
2870 | 2872 | ||
2871 | trace_sched_migrate_task(rq, p, dest_cpu); | ||
2872 | /* force the process onto the specified CPU */ | 2873 | /* force the process onto the specified CPU */ |
2873 | if (migrate_task(p, dest_cpu, &req)) { | 2874 | if (migrate_task(p, dest_cpu, &req)) { |
2874 | /* Need to wait for migration thread (might exit: take ref). */ | 2875 | /* Need to wait for migration thread (might exit: take ref). */ |
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index af60eef4cbcc..4bf39fcae97a 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
@@ -231,6 +231,49 @@ trace_branch_is_leaf(struct trace_iterator *iter, | |||
231 | return true; | 231 | return true; |
232 | } | 232 | } |
233 | 233 | ||
234 | static enum print_line_t | ||
235 | print_graph_irq(struct trace_seq *s, unsigned long addr, | ||
236 | enum trace_type type, int cpu, pid_t pid) | ||
237 | { | ||
238 | int ret; | ||
239 | |||
240 | if (addr < (unsigned long)__irqentry_text_start || | ||
241 | addr >= (unsigned long)__irqentry_text_end) | ||
242 | return TRACE_TYPE_UNHANDLED; | ||
243 | |||
244 | if (type == TRACE_GRAPH_ENT) { | ||
245 | ret = trace_seq_printf(s, "==========> | "); | ||
246 | } else { | ||
247 | /* Cpu */ | ||
248 | if (tracer_flags.val & TRACE_GRAPH_PRINT_CPU) { | ||
249 | ret = print_graph_cpu(s, cpu); | ||
250 | if (ret == TRACE_TYPE_PARTIAL_LINE) | ||
251 | return TRACE_TYPE_PARTIAL_LINE; | ||
252 | } | ||
253 | /* Proc */ | ||
254 | if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC) { | ||
255 | ret = print_graph_proc(s, pid); | ||
256 | if (ret == TRACE_TYPE_PARTIAL_LINE) | ||
257 | return TRACE_TYPE_PARTIAL_LINE; | ||
258 | |||
259 | ret = trace_seq_printf(s, " | "); | ||
260 | if (!ret) | ||
261 | return TRACE_TYPE_PARTIAL_LINE; | ||
262 | } | ||
263 | |||
264 | /* No overhead */ | ||
265 | if (tracer_flags.val & TRACE_GRAPH_PRINT_OVERHEAD) { | ||
266 | ret = trace_seq_printf(s, " "); | ||
267 | if (!ret) | ||
268 | return TRACE_TYPE_PARTIAL_LINE; | ||
269 | } | ||
270 | |||
271 | ret = trace_seq_printf(s, "<========== |\n"); | ||
272 | } | ||
273 | if (!ret) | ||
274 | return TRACE_TYPE_PARTIAL_LINE; | ||
275 | return TRACE_TYPE_HANDLED; | ||
276 | } | ||
234 | 277 | ||
235 | static enum print_line_t | 278 | static enum print_line_t |
236 | print_graph_duration(unsigned long long duration, struct trace_seq *s) | 279 | print_graph_duration(unsigned long long duration, struct trace_seq *s) |
@@ -344,7 +387,7 @@ print_graph_entry_leaf(struct trace_iterator *iter, | |||
344 | 387 | ||
345 | static enum print_line_t | 388 | static enum print_line_t |
346 | print_graph_entry_nested(struct ftrace_graph_ent_entry *entry, | 389 | print_graph_entry_nested(struct ftrace_graph_ent_entry *entry, |
347 | struct trace_seq *s) | 390 | struct trace_seq *s, pid_t pid, int cpu) |
348 | { | 391 | { |
349 | int i; | 392 | int i; |
350 | int ret; | 393 | int ret; |
@@ -357,8 +400,18 @@ print_graph_entry_nested(struct ftrace_graph_ent_entry *entry, | |||
357 | return TRACE_TYPE_PARTIAL_LINE; | 400 | return TRACE_TYPE_PARTIAL_LINE; |
358 | } | 401 | } |
359 | 402 | ||
360 | /* No time */ | 403 | /* Interrupt */ |
361 | ret = trace_seq_printf(s, " | "); | 404 | ret = print_graph_irq(s, call->func, TRACE_GRAPH_ENT, cpu, pid); |
405 | if (ret == TRACE_TYPE_UNHANDLED) { | ||
406 | /* No time */ | ||
407 | ret = trace_seq_printf(s, " | "); | ||
408 | if (!ret) | ||
409 | return TRACE_TYPE_PARTIAL_LINE; | ||
410 | } else { | ||
411 | if (ret == TRACE_TYPE_PARTIAL_LINE) | ||
412 | return TRACE_TYPE_PARTIAL_LINE; | ||
413 | } | ||
414 | |||
362 | 415 | ||
363 | /* Function */ | 416 | /* Function */ |
364 | for (i = 0; i < call->depth * TRACE_GRAPH_INDENT; i++) { | 417 | for (i = 0; i < call->depth * TRACE_GRAPH_INDENT; i++) { |
@@ -410,7 +463,7 @@ print_graph_entry(struct ftrace_graph_ent_entry *field, struct trace_seq *s, | |||
410 | if (trace_branch_is_leaf(iter, field)) | 463 | if (trace_branch_is_leaf(iter, field)) |
411 | return print_graph_entry_leaf(iter, field, s); | 464 | return print_graph_entry_leaf(iter, field, s); |
412 | else | 465 | else |
413 | return print_graph_entry_nested(field, s); | 466 | return print_graph_entry_nested(field, s, iter->ent->pid, cpu); |
414 | 467 | ||
415 | } | 468 | } |
416 | 469 | ||
@@ -474,6 +527,11 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s, | |||
474 | if (!ret) | 527 | if (!ret) |
475 | return TRACE_TYPE_PARTIAL_LINE; | 528 | return TRACE_TYPE_PARTIAL_LINE; |
476 | } | 529 | } |
530 | |||
531 | ret = print_graph_irq(s, trace->func, TRACE_GRAPH_RET, cpu, ent->pid); | ||
532 | if (ret == TRACE_TYPE_PARTIAL_LINE) | ||
533 | return TRACE_TYPE_PARTIAL_LINE; | ||
534 | |||
477 | return TRACE_TYPE_HANDLED; | 535 | return TRACE_TYPE_HANDLED; |
478 | } | 536 | } |
479 | 537 | ||