Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'tip/perf/core-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull minor tracing updates and fixes from Steven Rostedt:
"It seems that one of my old pull requests have slipped through.

The changes are contained to just the files that I maintain, and are
changes from others that I told I would get into this merge window.

They have already been in linux-next for several weeks, and should be
well tested."

* 'tip/perf/core-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Remove unnecessary WARN_ONCE's from tracing_buffers_splice_read
tracing: Remove unneeded checks from the stack tracer
tracing: Add a resize function to make one buffer equivalent to another buffer

+31 -33
+31 -29
kernel/trace/trace.c
··· 3034 3034 tr->data[cpu]->entries = val; 3035 3035 } 3036 3036 3037 + /* resize @tr's buffer to the size of @size_tr's entries */ 3038 + static int resize_buffer_duplicate_size(struct trace_array *tr, 3039 + struct trace_array *size_tr, int cpu_id) 3040 + { 3041 + int cpu, ret = 0; 3042 + 3043 + if (cpu_id == RING_BUFFER_ALL_CPUS) { 3044 + for_each_tracing_cpu(cpu) { 3045 + ret = ring_buffer_resize(tr->buffer, 3046 + size_tr->data[cpu]->entries, cpu); 3047 + if (ret < 0) 3048 + break; 3049 + tr->data[cpu]->entries = size_tr->data[cpu]->entries; 3050 + } 3051 + } else { 3052 + ret = ring_buffer_resize(tr->buffer, 3053 + size_tr->data[cpu_id]->entries, cpu_id); 3054 + if (ret == 0) 3055 + tr->data[cpu_id]->entries = 3056 + size_tr->data[cpu_id]->entries; 3057 + } 3058 + 3059 + return ret; 3060 + } 3061 + 3037 3062 static int __tracing_resize_ring_buffer(unsigned long size, int cpu) 3038 3063 { 3039 3064 int ret; ··· 3083 3058 3084 3059 ret = ring_buffer_resize(max_tr.buffer, size, cpu); 3085 3060 if (ret < 0) { 3086 - int r = 0; 3087 - 3088 - if (cpu == RING_BUFFER_ALL_CPUS) { 3089 - int i; 3090 - for_each_tracing_cpu(i) { 3091 - r = ring_buffer_resize(global_trace.buffer, 3092 - global_trace.data[i]->entries, 3093 - i); 3094 - if (r < 0) 3095 - break; 3096 - } 3097 - } else { 3098 - r = ring_buffer_resize(global_trace.buffer, 3099 - global_trace.data[cpu]->entries, 3100 - cpu); 3101 - } 3102 - 3061 + int r = resize_buffer_duplicate_size(&global_trace, 3062 + &global_trace, cpu); 3103 3063 if (r < 0) { 3104 3064 /* 3105 3065 * AARGH! We are left with different ··· 3222 3212 3223 3213 topts = create_trace_option_files(t); 3224 3214 if (t->use_max_tr) { 3225 - int cpu; 3226 3215 /* we need to make per cpu buffer sizes equivalent */ 3227 - for_each_tracing_cpu(cpu) { 3228 - ret = ring_buffer_resize(max_tr.buffer, 3229 - global_trace.data[cpu]->entries, 3230 - cpu); 3231 - if (ret < 0) 3232 - goto out; 3233 - max_tr.data[cpu]->entries = 3234 - global_trace.data[cpu]->entries; 3235 - } 3216 + ret = resize_buffer_duplicate_size(&max_tr, &global_trace, 3217 + RING_BUFFER_ALL_CPUS); 3218 + if (ret < 0) 3219 + goto out; 3236 3220 } 3237 3221 3238 3222 if (t->init) { ··· 4275 4271 return -ENOMEM; 4276 4272 4277 4273 if (*ppos & (PAGE_SIZE - 1)) { 4278 - WARN_ONCE(1, "Ftrace: previous read must page-align\n"); 4279 4274 ret = -EINVAL; 4280 4275 goto out; 4281 4276 } 4282 4277 4283 4278 if (len & (PAGE_SIZE - 1)) { 4284 - WARN_ONCE(1, "Ftrace: splice_read should page-align\n"); 4285 4279 if (len < PAGE_SIZE) { 4286 4280 ret = -EINVAL; 4287 4281 goto out;
-4
kernel/trace/trace_stack.c
··· 33 33 static arch_spinlock_t max_stack_lock = 34 34 (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; 35 35 36 - static int stack_trace_disabled __read_mostly; 37 36 static DEFINE_PER_CPU(int, trace_active); 38 37 static DEFINE_MUTEX(stack_sysctl_mutex); 39 38 ··· 114 115 struct ftrace_ops *op, struct pt_regs *pt_regs) 115 116 { 116 117 int cpu; 117 - 118 - if (unlikely(!ftrace_enabled || stack_trace_disabled)) 119 - return; 120 118 121 119 preempt_disable_notrace(); 122 120