diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 2230b46f9e1c..fc8c7d66832b 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1632,7 +1632,11 @@ static void test_cpu_buff_start(struct trace_iterator *iter) | |||
1632 | return; | 1632 | return; |
1633 | 1633 | ||
1634 | cpumask_set_cpu(iter->cpu, iter->started); | 1634 | cpumask_set_cpu(iter->cpu, iter->started); |
1635 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); | 1635 | |
1636 | /* Don't print started cpu buffer for the first entry of the trace */ | ||
1637 | if (iter->idx > 1) | ||
1638 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", | ||
1639 | iter->cpu); | ||
1636 | } | 1640 | } |
1637 | 1641 | ||
1638 | static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | 1642 | static enum print_line_t print_trace_fmt(struct trace_iterator *iter) |
@@ -1867,6 +1871,11 @@ __tracing_open(struct inode *inode, struct file *file) | |||
1867 | if (current_trace) | 1871 | if (current_trace) |
1868 | *iter->trace = *current_trace; | 1872 | *iter->trace = *current_trace; |
1869 | 1873 | ||
1874 | if (!alloc_cpumask_var(&iter->started, GFP_KERNEL)) | ||
1875 | goto fail; | ||
1876 | |||
1877 | cpumask_clear(iter->started); | ||
1878 | |||
1870 | if (current_trace && current_trace->print_max) | 1879 | if (current_trace && current_trace->print_max) |
1871 | iter->tr = &max_tr; | 1880 | iter->tr = &max_tr; |
1872 | else | 1881 | else |
@@ -1917,6 +1926,7 @@ __tracing_open(struct inode *inode, struct file *file) | |||
1917 | if (iter->buffer_iter[cpu]) | 1926 | if (iter->buffer_iter[cpu]) |
1918 | ring_buffer_read_finish(iter->buffer_iter[cpu]); | 1927 | ring_buffer_read_finish(iter->buffer_iter[cpu]); |
1919 | } | 1928 | } |
1929 | free_cpumask_var(iter->started); | ||
1920 | fail: | 1930 | fail: |
1921 | mutex_unlock(&trace_types_lock); | 1931 | mutex_unlock(&trace_types_lock); |
1922 | kfree(iter->trace); | 1932 | kfree(iter->trace); |
@@ -1960,6 +1970,7 @@ static int tracing_release(struct inode *inode, struct file *file) | |||
1960 | 1970 | ||
1961 | seq_release(inode, file); | 1971 | seq_release(inode, file); |
1962 | mutex_destroy(&iter->mutex); | 1972 | mutex_destroy(&iter->mutex); |
1973 | free_cpumask_var(iter->started); | ||
1963 | kfree(iter->trace); | 1974 | kfree(iter->trace); |
1964 | kfree(iter); | 1975 | kfree(iter); |
1965 | return 0; | 1976 | return 0; |