diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 5d04e27f3b40..c580233add95 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1811,10 +1811,10 @@ static void test_cpu_buff_start(struct trace_iterator *iter) | |||
1811 | if (!(iter->iter_flags & TRACE_FILE_ANNOTATE)) | 1811 | if (!(iter->iter_flags & TRACE_FILE_ANNOTATE)) |
1812 | return; | 1812 | return; |
1813 | 1813 | ||
1814 | if (cpu_isset(iter->cpu, iter->started)) | 1814 | if (cpumask_test_cpu(iter->cpu, iter->started)) |
1815 | return; | 1815 | return; |
1816 | 1816 | ||
1817 | cpu_set(iter->cpu, iter->started); | 1817 | cpumask_set_cpu(iter->cpu, iter->started); |
1818 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); | 1818 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); |
1819 | } | 1819 | } |
1820 | 1820 | ||
@@ -3114,10 +3114,15 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) | |||
3114 | if (!iter) | 3114 | if (!iter) |
3115 | return -ENOMEM; | 3115 | return -ENOMEM; |
3116 | 3116 | ||
3117 | if (!alloc_cpumask_var(&iter->started, GFP_KERNEL)) { | ||
3118 | kfree(iter); | ||
3119 | return -ENOMEM; | ||
3120 | } | ||
3121 | |||
3117 | mutex_lock(&trace_types_lock); | 3122 | mutex_lock(&trace_types_lock); |
3118 | 3123 | ||
3119 | /* trace pipe does not show start of buffer */ | 3124 | /* trace pipe does not show start of buffer */ |
3120 | cpus_setall(iter->started); | 3125 | cpumask_setall(iter->started); |
3121 | 3126 | ||
3122 | iter->tr = &global_trace; | 3127 | iter->tr = &global_trace; |
3123 | iter->trace = current_trace; | 3128 | iter->trace = current_trace; |
@@ -3134,6 +3139,7 @@ static int tracing_release_pipe(struct inode *inode, struct file *file) | |||
3134 | { | 3139 | { |
3135 | struct trace_iterator *iter = file->private_data; | 3140 | struct trace_iterator *iter = file->private_data; |
3136 | 3141 | ||
3142 | free_cpumask_var(iter->started); | ||
3137 | kfree(iter); | 3143 | kfree(iter); |
3138 | atomic_dec(&tracing_reader); | 3144 | atomic_dec(&tracing_reader); |
3139 | 3145 | ||