diff options
-rw-r--r-- | kernel/trace/trace.c | 19 | ||||
-rw-r--r-- | kernel/trace/trace.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 58435415b366..f147f198b9a6 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1478,6 +1478,17 @@ void trace_seq_print_cont(struct trace_seq *s, struct trace_iterator *iter) | |||
1478 | trace_seq_putc(s, '\n'); | 1478 | trace_seq_putc(s, '\n'); |
1479 | } | 1479 | } |
1480 | 1480 | ||
1481 | static void test_cpu_buff_start(struct trace_iterator *iter) | ||
1482 | { | ||
1483 | struct trace_seq *s = &iter->seq; | ||
1484 | |||
1485 | if (cpu_isset(iter->cpu, iter->started)) | ||
1486 | return; | ||
1487 | |||
1488 | cpu_set(iter->cpu, iter->started); | ||
1489 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); | ||
1490 | } | ||
1491 | |||
1481 | static enum print_line_t | 1492 | static enum print_line_t |
1482 | print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) | 1493 | print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) |
1483 | { | 1494 | { |
@@ -1497,6 +1508,8 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) | |||
1497 | if (entry->type == TRACE_CONT) | 1508 | if (entry->type == TRACE_CONT) |
1498 | return TRACE_TYPE_HANDLED; | 1509 | return TRACE_TYPE_HANDLED; |
1499 | 1510 | ||
1511 | test_cpu_buff_start(iter); | ||
1512 | |||
1500 | next_entry = find_next_entry(iter, NULL, &next_ts); | 1513 | next_entry = find_next_entry(iter, NULL, &next_ts); |
1501 | if (!next_entry) | 1514 | if (!next_entry) |
1502 | next_ts = iter->ts; | 1515 | next_ts = iter->ts; |
@@ -1612,6 +1625,8 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | |||
1612 | if (entry->type == TRACE_CONT) | 1625 | if (entry->type == TRACE_CONT) |
1613 | return TRACE_TYPE_HANDLED; | 1626 | return TRACE_TYPE_HANDLED; |
1614 | 1627 | ||
1628 | test_cpu_buff_start(iter); | ||
1629 | |||
1615 | comm = trace_find_cmdline(iter->ent->pid); | 1630 | comm = trace_find_cmdline(iter->ent->pid); |
1616 | 1631 | ||
1617 | t = ns2usecs(iter->ts); | 1632 | t = ns2usecs(iter->ts); |
@@ -2631,6 +2646,10 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) | |||
2631 | return -ENOMEM; | 2646 | return -ENOMEM; |
2632 | 2647 | ||
2633 | mutex_lock(&trace_types_lock); | 2648 | mutex_lock(&trace_types_lock); |
2649 | |||
2650 | /* trace pipe does not show start of buffer */ | ||
2651 | cpus_setall(iter->started); | ||
2652 | |||
2634 | iter->tr = &global_trace; | 2653 | iter->tr = &global_trace; |
2635 | iter->trace = current_trace; | 2654 | iter->trace = current_trace; |
2636 | filp->private_data = iter; | 2655 | filp->private_data = iter; |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index cfda9d219e66..978145088fb8 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -277,6 +277,8 @@ struct trace_iterator { | |||
277 | unsigned long iter_flags; | 277 | unsigned long iter_flags; |
278 | loff_t pos; | 278 | loff_t pos; |
279 | long idx; | 279 | long idx; |
280 | |||
281 | cpumask_t started; | ||
280 | }; | 282 | }; |
281 | 283 | ||
282 | int tracing_is_enabled(void); | 284 | int tracing_is_enabled(void); |