aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c187
1 files changed, 127 insertions, 60 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 44f916a04065..8a76339a9e65 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -117,9 +117,12 @@ static cpumask_var_t __read_mostly tracing_buffer_mask;
117 * 117 *
118 * It is default off, but you can enable it with either specifying 118 * It is default off, but you can enable it with either specifying
119 * "ftrace_dump_on_oops" in the kernel command line, or setting 119 * "ftrace_dump_on_oops" in the kernel command line, or setting
120 * /proc/sys/kernel/ftrace_dump_on_oops to true. 120 * /proc/sys/kernel/ftrace_dump_on_oops
121 * Set 1 if you want to dump buffers of all CPUs
122 * Set 2 if you want to dump the buffer of the CPU that triggered oops
121 */ 123 */
122int ftrace_dump_on_oops; 124
125enum ftrace_dump_mode ftrace_dump_on_oops;
123 126
124static int tracing_set_tracer(const char *buf); 127static int tracing_set_tracer(const char *buf);
125 128
@@ -139,8 +142,17 @@ __setup("ftrace=", set_cmdline_ftrace);
139 142
140static int __init set_ftrace_dump_on_oops(char *str) 143static int __init set_ftrace_dump_on_oops(char *str)
141{ 144{
142 ftrace_dump_on_oops = 1; 145 if (*str++ != '=' || !*str) {
143 return 1; 146 ftrace_dump_on_oops = DUMP_ALL;
147 return 1;
148 }
149
150 if (!strcmp("orig_cpu", str)) {
151 ftrace_dump_on_oops = DUMP_ORIG;
152 return 1;
153 }
154
155 return 0;
144} 156}
145__setup("ftrace_dump_on_oops", set_ftrace_dump_on_oops); 157__setup("ftrace_dump_on_oops", set_ftrace_dump_on_oops);
146 158
@@ -1545,7 +1557,8 @@ static void trace_iterator_increment(struct trace_iterator *iter)
1545} 1557}
1546 1558
1547static struct trace_entry * 1559static struct trace_entry *
1548peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts) 1560peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts,
1561 unsigned long *lost_events)
1549{ 1562{
1550 struct ring_buffer_event *event; 1563 struct ring_buffer_event *event;
1551 struct ring_buffer_iter *buf_iter = iter->buffer_iter[cpu]; 1564 struct ring_buffer_iter *buf_iter = iter->buffer_iter[cpu];
@@ -1556,7 +1569,8 @@ peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts)
1556 if (buf_iter) 1569 if (buf_iter)
1557 event = ring_buffer_iter_peek(buf_iter, ts); 1570 event = ring_buffer_iter_peek(buf_iter, ts);
1558 else 1571 else
1559 event = ring_buffer_peek(iter->tr->buffer, cpu, ts); 1572 event = ring_buffer_peek(iter->tr->buffer, cpu, ts,
1573 lost_events);
1560 1574
1561 ftrace_enable_cpu(); 1575 ftrace_enable_cpu();
1562 1576
@@ -1564,10 +1578,12 @@ peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts)
1564} 1578}
1565 1579
1566static struct trace_entry * 1580static struct trace_entry *
1567__find_next_entry(struct trace_iterator *iter, int *ent_cpu, u64 *ent_ts) 1581__find_next_entry(struct trace_iterator *iter, int *ent_cpu,
1582 unsigned long *missing_events, u64 *ent_ts)
1568{ 1583{
1569 struct ring_buffer *buffer = iter->tr->buffer; 1584 struct ring_buffer *buffer = iter->tr->buffer;
1570 struct trace_entry *ent, *next = NULL; 1585 struct trace_entry *ent, *next = NULL;
1586 unsigned long lost_events = 0, next_lost = 0;
1571 int cpu_file = iter->cpu_file; 1587 int cpu_file = iter->cpu_file;
1572 u64 next_ts = 0, ts; 1588 u64 next_ts = 0, ts;
1573 int next_cpu = -1; 1589 int next_cpu = -1;
@@ -1580,7 +1596,7 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu, u64 *ent_ts)
1580 if (cpu_file > TRACE_PIPE_ALL_CPU) { 1596 if (cpu_file > TRACE_PIPE_ALL_CPU) {
1581 if (ring_buffer_empty_cpu(buffer, cpu_file)) 1597 if (ring_buffer_empty_cpu(buffer, cpu_file))
1582 return NULL; 1598 return NULL;
1583 ent = peek_next_entry(iter, cpu_file, ent_ts); 1599 ent = peek_next_entry(iter, cpu_file, ent_ts, missing_events);
1584 if (ent_cpu) 1600 if (ent_cpu)
1585 *ent_cpu = cpu_file; 1601 *ent_cpu = cpu_file;
1586 1602
@@ -1592,7 +1608,7 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu, u64 *ent_ts)
1592 if (ring_buffer_empty_cpu(buffer, cpu)) 1608 if (ring_buffer_empty_cpu(buffer, cpu))
1593 continue; 1609 continue;
1594 1610
1595 ent = peek_next_entry(iter, cpu, &ts); 1611 ent = peek_next_entry(iter, cpu, &ts, &lost_events);
1596 1612
1597 /* 1613 /*
1598 * Pick the entry with the smallest timestamp: 1614 * Pick the entry with the smallest timestamp:
@@ -1601,6 +1617,7 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu, u64 *ent_ts)
1601 next = ent; 1617 next = ent;
1602 next_cpu = cpu; 1618 next_cpu = cpu;
1603 next_ts = ts; 1619 next_ts = ts;
1620 next_lost = lost_events;
1604 } 1621 }
1605 } 1622 }
1606 1623
@@ -1610,6 +1627,9 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu, u64 *ent_ts)
1610 if (ent_ts) 1627 if (ent_ts)
1611 *ent_ts = next_ts; 1628 *ent_ts = next_ts;
1612 1629
1630 if (missing_events)
1631 *missing_events = next_lost;
1632
1613 return next; 1633 return next;
1614} 1634}
1615 1635
@@ -1617,13 +1637,14 @@ __find_next_entry(struct trace_iterator *iter, int *ent_cpu, u64 *ent_ts)
1617struct trace_entry *trace_find_next_entry(struct trace_iterator *iter, 1637struct trace_entry *trace_find_next_entry(struct trace_iterator *iter,
1618 int *ent_cpu, u64 *ent_ts) 1638 int *ent_cpu, u64 *ent_ts)
1619{ 1639{
1620 return __find_next_entry(iter, ent_cpu, ent_ts); 1640 return __find_next_entry(iter, ent_cpu, NULL, ent_ts);
1621} 1641}
1622 1642
1623/* Find the next real entry, and increment the iterator to the next entry */ 1643/* Find the next real entry, and increment the iterator to the next entry */
1624static void *find_next_entry_inc(struct trace_iterator *iter) 1644static void *find_next_entry_inc(struct trace_iterator *iter)
1625{ 1645{
1626 iter->ent = __find_next_entry(iter, &iter->cpu, &iter->ts); 1646 iter->ent = __find_next_entry(iter, &iter->cpu,
1647 &iter->lost_events, &iter->ts);
1627 1648
1628 if (iter->ent) 1649 if (iter->ent)
1629 trace_iterator_increment(iter); 1650 trace_iterator_increment(iter);
@@ -1635,7 +1656,8 @@ static void trace_consume(struct trace_iterator *iter)
1635{ 1656{
1636 /* Don't allow ftrace to trace into the ring buffers */ 1657 /* Don't allow ftrace to trace into the ring buffers */
1637 ftrace_disable_cpu(); 1658 ftrace_disable_cpu();
1638 ring_buffer_consume(iter->tr->buffer, iter->cpu, &iter->ts); 1659 ring_buffer_consume(iter->tr->buffer, iter->cpu, &iter->ts,
1660 &iter->lost_events);
1639 ftrace_enable_cpu(); 1661 ftrace_enable_cpu();
1640} 1662}
1641 1663
@@ -1786,7 +1808,7 @@ static void print_func_help_header(struct seq_file *m)
1786} 1808}
1787 1809
1788 1810
1789static void 1811void
1790print_trace_header(struct seq_file *m, struct trace_iterator *iter) 1812print_trace_header(struct seq_file *m, struct trace_iterator *iter)
1791{ 1813{
1792 unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK); 1814 unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK);
@@ -1995,7 +2017,7 @@ static enum print_line_t print_bin_fmt(struct trace_iterator *iter)
1995 return event ? event->binary(iter, 0) : TRACE_TYPE_HANDLED; 2017 return event ? event->binary(iter, 0) : TRACE_TYPE_HANDLED;
1996} 2018}
1997 2019
1998static int trace_empty(struct trace_iterator *iter) 2020int trace_empty(struct trace_iterator *iter)
1999{ 2021{
2000 int cpu; 2022 int cpu;
2001 2023
@@ -2030,6 +2052,10 @@ static enum print_line_t print_trace_line(struct trace_iterator *iter)
2030{ 2052{
2031 enum print_line_t ret; 2053 enum print_line_t ret;
2032 2054
2055 if (iter->lost_events)
2056 trace_seq_printf(&iter->seq, "CPU:%d [LOST %lu EVENTS]\n",
2057 iter->cpu, iter->lost_events);
2058
2033 if (iter->trace && iter->trace->print_line) { 2059 if (iter->trace && iter->trace->print_line) {
2034 ret = iter->trace->print_line(iter); 2060 ret = iter->trace->print_line(iter);
2035 if (ret != TRACE_TYPE_UNHANDLED) 2061 if (ret != TRACE_TYPE_UNHANDLED)
@@ -2058,6 +2084,23 @@ static enum print_line_t print_trace_line(struct trace_iterator *iter)
2058 return print_trace_fmt(iter); 2084 return print_trace_fmt(iter);
2059} 2085}
2060 2086
2087void trace_default_header(struct seq_file *m)
2088{
2089 struct trace_iterator *iter = m->private;
2090
2091 if (iter->iter_flags & TRACE_FILE_LAT_FMT) {
2092 /* print nothing if the buffers are empty */
2093 if (trace_empty(iter))
2094 return;
2095 print_trace_header(m, iter);
2096 if (!(trace_flags & TRACE_ITER_VERBOSE))
2097 print_lat_help_header(m);
2098 } else {
2099 if (!(trace_flags & TRACE_ITER_VERBOSE))
2100 print_func_help_header(m);
2101 }
2102}
2103
2061static int s_show(struct seq_file *m, void *v) 2104static int s_show(struct seq_file *m, void *v)
2062{ 2105{
2063 struct trace_iterator *iter = v; 2106 struct trace_iterator *iter = v;
@@ -2070,17 +2113,9 @@ static int s_show(struct seq_file *m, void *v)
2070 } 2113 }
2071 if (iter->trace && iter->trace->print_header) 2114 if (iter->trace && iter->trace->print_header)
2072 iter->trace->print_header(m); 2115 iter->trace->print_header(m);
2073 else if (iter->iter_flags & TRACE_FILE_LAT_FMT) { 2116 else
2074 /* print nothing if the buffers are empty */ 2117 trace_default_header(m);
2075 if (trace_empty(iter)) 2118
2076 return 0;
2077 print_trace_header(m, iter);
2078 if (!(trace_flags & TRACE_ITER_VERBOSE))
2079 print_lat_help_header(m);
2080 } else {
2081 if (!(trace_flags & TRACE_ITER_VERBOSE))
2082 print_func_help_header(m);
2083 }
2084 } else if (iter->leftover) { 2119 } else if (iter->leftover) {
2085 /* 2120 /*
2086 * If we filled the seq_file buffer earlier, we 2121 * If we filled the seq_file buffer earlier, we
@@ -2166,15 +2201,20 @@ __tracing_open(struct inode *inode, struct file *file)
2166 2201
2167 if (iter->cpu_file == TRACE_PIPE_ALL_CPU) { 2202 if (iter->cpu_file == TRACE_PIPE_ALL_CPU) {
2168 for_each_tracing_cpu(cpu) { 2203 for_each_tracing_cpu(cpu) {
2169
2170 iter->buffer_iter[cpu] = 2204 iter->buffer_iter[cpu] =
2171 ring_buffer_read_start(iter->tr->buffer, cpu); 2205 ring_buffer_read_prepare(iter->tr->buffer, cpu);
2206 }
2207 ring_buffer_read_prepare_sync();
2208 for_each_tracing_cpu(cpu) {
2209 ring_buffer_read_start(iter->buffer_iter[cpu]);
2172 tracing_iter_reset(iter, cpu); 2210 tracing_iter_reset(iter, cpu);
2173 } 2211 }
2174 } else { 2212 } else {
2175 cpu = iter->cpu_file; 2213 cpu = iter->cpu_file;
2176 iter->buffer_iter[cpu] = 2214 iter->buffer_iter[cpu] =
2177 ring_buffer_read_start(iter->tr->buffer, cpu); 2215 ring_buffer_read_prepare(iter->tr->buffer, cpu);
2216 ring_buffer_read_prepare_sync();
2217 ring_buffer_read_start(iter->buffer_iter[cpu]);
2178 tracing_iter_reset(iter, cpu); 2218 tracing_iter_reset(iter, cpu);
2179 } 2219 }
2180 2220
@@ -3269,12 +3309,12 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
3269 size_t len, 3309 size_t len,
3270 unsigned int flags) 3310 unsigned int flags)
3271{ 3311{
3272 struct page *pages[PIPE_BUFFERS]; 3312 struct page *pages_def[PIPE_DEF_BUFFERS];
3273 struct partial_page partial[PIPE_BUFFERS]; 3313 struct partial_page partial_def[PIPE_DEF_BUFFERS];
3274 struct trace_iterator *iter = filp->private_data; 3314 struct trace_iterator *iter = filp->private_data;
3275 struct splice_pipe_desc spd = { 3315 struct splice_pipe_desc spd = {
3276 .pages = pages, 3316 .pages = pages_def,
3277 .partial = partial, 3317 .partial = partial_def,
3278 .nr_pages = 0, /* This gets updated below. */ 3318 .nr_pages = 0, /* This gets updated below. */
3279 .flags = flags, 3319 .flags = flags,
3280 .ops = &tracing_pipe_buf_ops, 3320 .ops = &tracing_pipe_buf_ops,
@@ -3285,6 +3325,9 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
3285 size_t rem; 3325 size_t rem;
3286 unsigned int i; 3326 unsigned int i;
3287 3327
3328 if (splice_grow_spd(pipe, &spd))
3329 return -ENOMEM;
3330
3288 /* copy the tracer to avoid using a global lock all around */ 3331 /* copy the tracer to avoid using a global lock all around */
3289 mutex_lock(&trace_types_lock); 3332 mutex_lock(&trace_types_lock);
3290 if (unlikely(old_tracer != current_trace && current_trace)) { 3333 if (unlikely(old_tracer != current_trace && current_trace)) {
@@ -3315,23 +3358,23 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
3315 trace_access_lock(iter->cpu_file); 3358 trace_access_lock(iter->cpu_file);
3316 3359
3317 /* Fill as many pages as possible. */ 3360 /* Fill as many pages as possible. */
3318 for (i = 0, rem = len; i < PIPE_BUFFERS && rem; i++) { 3361 for (i = 0, rem = len; i < pipe->buffers && rem; i++) {
3319 pages[i] = alloc_page(GFP_KERNEL); 3362 spd.pages[i] = alloc_page(GFP_KERNEL);
3320 if (!pages[i]) 3363 if (!spd.pages[i])
3321 break; 3364 break;
3322 3365
3323 rem = tracing_fill_pipe_page(rem, iter); 3366 rem = tracing_fill_pipe_page(rem, iter);
3324 3367
3325 /* Copy the data into the page, so we can start over. */ 3368 /* Copy the data into the page, so we can start over. */
3326 ret = trace_seq_to_buffer(&iter->seq, 3369 ret = trace_seq_to_buffer(&iter->seq,
3327 page_address(pages[i]), 3370 page_address(spd.pages[i]),
3328 iter->seq.len); 3371 iter->seq.len);
3329 if (ret < 0) { 3372 if (ret < 0) {
3330 __free_page(pages[i]); 3373 __free_page(spd.pages[i]);
3331 break; 3374 break;
3332 } 3375 }
3333 partial[i].offset = 0; 3376 spd.partial[i].offset = 0;
3334 partial[i].len = iter->seq.len; 3377 spd.partial[i].len = iter->seq.len;
3335 3378
3336 trace_seq_init(&iter->seq); 3379 trace_seq_init(&iter->seq);
3337 } 3380 }
@@ -3342,12 +3385,14 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
3342 3385
3343 spd.nr_pages = i; 3386 spd.nr_pages = i;
3344 3387
3345 return splice_to_pipe(pipe, &spd); 3388 ret = splice_to_pipe(pipe, &spd);
3389out:
3390 splice_shrink_spd(pipe, &spd);
3391 return ret;
3346 3392
3347out_err: 3393out_err:
3348 mutex_unlock(&iter->mutex); 3394 mutex_unlock(&iter->mutex);
3349 3395 goto out;
3350 return ret;
3351} 3396}
3352 3397
3353static ssize_t 3398static ssize_t
@@ -3746,11 +3791,11 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
3746 unsigned int flags) 3791 unsigned int flags)
3747{ 3792{
3748 struct ftrace_buffer_info *info = file->private_data; 3793 struct ftrace_buffer_info *info = file->private_data;
3749 struct partial_page partial[PIPE_BUFFERS]; 3794 struct partial_page partial_def[PIPE_DEF_BUFFERS];
3750 struct page *pages[PIPE_BUFFERS]; 3795 struct page *pages_def[PIPE_DEF_BUFFERS];
3751 struct splice_pipe_desc spd = { 3796 struct splice_pipe_desc spd = {
3752 .pages = pages, 3797 .pages = pages_def,
3753 .partial = partial, 3798 .partial = partial_def,
3754 .flags = flags, 3799 .flags = flags,
3755 .ops = &buffer_pipe_buf_ops, 3800 .ops = &buffer_pipe_buf_ops,
3756 .spd_release = buffer_spd_release, 3801 .spd_release = buffer_spd_release,
@@ -3759,22 +3804,28 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
3759 int entries, size, i; 3804 int entries, size, i;
3760 size_t ret; 3805 size_t ret;
3761 3806
3807 if (splice_grow_spd(pipe, &spd))
3808 return -ENOMEM;
3809
3762 if (*ppos & (PAGE_SIZE - 1)) { 3810 if (*ppos & (PAGE_SIZE - 1)) {
3763 WARN_ONCE(1, "Ftrace: previous read must page-align\n"); 3811 WARN_ONCE(1, "Ftrace: previous read must page-align\n");
3764 return -EINVAL; 3812 ret = -EINVAL;
3813 goto out;
3765 } 3814 }
3766 3815
3767 if (len & (PAGE_SIZE - 1)) { 3816 if (len & (PAGE_SIZE - 1)) {
3768 WARN_ONCE(1, "Ftrace: splice_read should page-align\n"); 3817 WARN_ONCE(1, "Ftrace: splice_read should page-align\n");
3769 if (len < PAGE_SIZE) 3818 if (len < PAGE_SIZE) {
3770 return -EINVAL; 3819 ret = -EINVAL;
3820 goto out;
3821 }
3771 len &= PAGE_MASK; 3822 len &= PAGE_MASK;
3772 } 3823 }
3773 3824
3774 trace_access_lock(info->cpu); 3825 trace_access_lock(info->cpu);
3775 entries = ring_buffer_entries_cpu(info->tr->buffer, info->cpu); 3826 entries = ring_buffer_entries_cpu(info->tr->buffer, info->cpu);
3776 3827
3777 for (i = 0; i < PIPE_BUFFERS && len && entries; i++, len -= PAGE_SIZE) { 3828 for (i = 0; i < pipe->buffers && len && entries; i++, len -= PAGE_SIZE) {
3778 struct page *page; 3829 struct page *page;
3779 int r; 3830 int r;
3780 3831
@@ -3829,11 +3880,12 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
3829 else 3880 else
3830 ret = 0; 3881 ret = 0;
3831 /* TODO: block */ 3882 /* TODO: block */
3832 return ret; 3883 goto out;
3833 } 3884 }
3834 3885
3835 ret = splice_to_pipe(pipe, &spd); 3886 ret = splice_to_pipe(pipe, &spd);
3836 3887 splice_shrink_spd(pipe, &spd);
3888out:
3837 return ret; 3889 return ret;
3838} 3890}
3839 3891
@@ -4324,7 +4376,7 @@ static int trace_panic_handler(struct notifier_block *this,
4324 unsigned long event, void *unused) 4376 unsigned long event, void *unused)
4325{ 4377{
4326 if (ftrace_dump_on_oops) 4378 if (ftrace_dump_on_oops)
4327 ftrace_dump(); 4379 ftrace_dump(ftrace_dump_on_oops);
4328 return NOTIFY_OK; 4380 return NOTIFY_OK;
4329} 4381}
4330 4382
@@ -4341,7 +4393,7 @@ static int trace_die_handler(struct notifier_block *self,
4341 switch (val) { 4393 switch (val) {
4342 case DIE_OOPS: 4394 case DIE_OOPS:
4343 if (ftrace_dump_on_oops) 4395 if (ftrace_dump_on_oops)
4344 ftrace_dump(); 4396 ftrace_dump(ftrace_dump_on_oops);
4345 break; 4397 break;
4346 default: 4398 default:
4347 break; 4399 break;
@@ -4382,7 +4434,8 @@ trace_printk_seq(struct trace_seq *s)
4382 trace_seq_init(s); 4434 trace_seq_init(s);
4383} 4435}
4384 4436
4385static void __ftrace_dump(bool disable_tracing) 4437static void
4438__ftrace_dump(bool disable_tracing, enum ftrace_dump_mode oops_dump_mode)
4386{ 4439{
4387 static arch_spinlock_t ftrace_dump_lock = 4440 static arch_spinlock_t ftrace_dump_lock =
4388 (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; 4441 (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED;
@@ -4415,12 +4468,25 @@ static void __ftrace_dump(bool disable_tracing)
4415 /* don't look at user memory in panic mode */ 4468 /* don't look at user memory in panic mode */
4416 trace_flags &= ~TRACE_ITER_SYM_USEROBJ; 4469 trace_flags &= ~TRACE_ITER_SYM_USEROBJ;
4417 4470
4418 printk(KERN_TRACE "Dumping ftrace buffer:\n");
4419
4420 /* Simulate the iterator */ 4471 /* Simulate the iterator */
4421 iter.tr = &global_trace; 4472 iter.tr = &global_trace;
4422 iter.trace = current_trace; 4473 iter.trace = current_trace;
4423 iter.cpu_file = TRACE_PIPE_ALL_CPU; 4474
4475 switch (oops_dump_mode) {
4476 case DUMP_ALL:
4477 iter.cpu_file = TRACE_PIPE_ALL_CPU;
4478 break;
4479 case DUMP_ORIG:
4480 iter.cpu_file = raw_smp_processor_id();
4481 break;
4482 case DUMP_NONE:
4483 goto out_enable;
4484 default:
4485 printk(KERN_TRACE "Bad dumping mode, switching to all CPUs dump\n");
4486 iter.cpu_file = TRACE_PIPE_ALL_CPU;
4487 }
4488
4489 printk(KERN_TRACE "Dumping ftrace buffer:\n");
4424 4490
4425 /* 4491 /*
4426 * We need to stop all tracing on all CPUS to read the 4492 * We need to stop all tracing on all CPUS to read the
@@ -4459,6 +4525,7 @@ static void __ftrace_dump(bool disable_tracing)
4459 else 4525 else
4460 printk(KERN_TRACE "---------------------------------\n"); 4526 printk(KERN_TRACE "---------------------------------\n");
4461 4527
4528 out_enable:
4462 /* Re-enable tracing if requested */ 4529 /* Re-enable tracing if requested */
4463 if (!disable_tracing) { 4530 if (!disable_tracing) {
4464 trace_flags |= old_userobj; 4531 trace_flags |= old_userobj;
@@ -4475,9 +4542,9 @@ static void __ftrace_dump(bool disable_tracing)
4475} 4542}
4476 4543
4477/* By default: disable tracing after the dump */ 4544/* By default: disable tracing after the dump */
4478void ftrace_dump(void) 4545void ftrace_dump(enum ftrace_dump_mode oops_dump_mode)
4479{ 4546{
4480 __ftrace_dump(true); 4547 __ftrace_dump(true, oops_dump_mode);
4481} 4548}
4482 4549
4483__init static int tracer_alloc_buffers(void) 4550__init static int tracer_alloc_buffers(void)