Pull tracing fixes from Steven Rostedt: "Three minor tracing fixes: - Fix missing prototypes in sample module for direct functions - Fix check of valid buffer in get_trace_buf() - Fix annotations of percpu pointers" * tag 'trace-v5.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Tag trace_percpu_buffer as a percpu pointer tracing: Fix check for trace_percpu_buffer validity in get_trace_buf() ftrace/samples: Add missing prototypes direct functions
Unified · Split
| @@ -3207,7 +3207,7 @@ struct trace_buffer_struct { · 3206 unmodified lines | |||
| 3207 | char buffer[4][TRACE_BUF_SIZE]; | 3207 | char buffer[4][TRACE_BUF_SIZE]; |
| 3208 | }; | 3208 | }; |
| 3209 | 3209 | ||
| 3210 | static struct trace_buffer_struct *trace_percpu_buffer; | 3210 | static struct trace_buffer_struct __percpu *trace_percpu_buffer; |
| 3211 | 3211 | ||
| 3212 | /* | 3212 | /* |
| 3213 | * This allows for lockless recording. If we're nested too deeply, then | 3213 | * This allows for lockless recording. If we're nested too deeply, then |
| @@ -3217,7 +3217,7 @@ static char *get_trace_buf(void) · 3 unmodified lines | |||
| 3217 | { | 3217 | { |
| 3218 | struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer); | 3218 | struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer); |
| 3219 | 3219 | ||
| 3220 | if (!buffer || buffer->nesting >= 4) | 3220 | if (!trace_percpu_buffer || buffer->nesting >= 4) |
| 3221 | return NULL; | 3221 | return NULL; |
| 3222 | 3222 | ||
| 3223 | buffer->nesting++; | 3223 | buffer->nesting++; |
| @@ -3236,7 +3236,7 @@ static void put_trace_buf(void) · 12 unmodified lines | |||
| 3236 | 3236 | ||
| 3237 | static int alloc_percpu_trace_buffer(void) | 3237 | static int alloc_percpu_trace_buffer(void) |
| 3238 | { | 3238 | { |
| 3239 | struct trace_buffer_struct *buffers; | 3239 | struct trace_buffer_struct __percpu *buffers; |
| 3240 | 3240 | ||
| 3241 | if (trace_percpu_buffer) | 3241 | if (trace_percpu_buffer) |
| 3242 | return 0; | 3242 | return 0; |
| @@ -4,6 +4,9 @@ · 3 unmodified lines | |||
| 4 | #include <linux/ftrace.h> | 4 | #include <linux/ftrace.h> |
| 5 | #include <asm/asm-offsets.h> | 5 | #include <asm/asm-offsets.h> |
| 6 | 6 | ||
| 7 | extern void my_direct_func1(void); | ||
| 8 | extern void my_direct_func2(void); | ||
| 9 | |||
| 7 | void my_direct_func1(void) | 10 | void my_direct_func1(void) |
| 8 | { | 11 | { |
| 9 | trace_printk("my direct func1\n"); | 12 | trace_printk("my direct func1\n"); |
| @@ -4,6 +4,9 @@ · 3 unmodified lines | |||
| 4 | #include <linux/ftrace.h> | 4 | #include <linux/ftrace.h> |
| 5 | #include <asm/asm-offsets.h> | 5 | #include <asm/asm-offsets.h> |
| 6 | 6 | ||
| 7 | extern void my_direct_func1(unsigned long ip); | ||
| 8 | extern void my_direct_func2(unsigned long ip); | ||
| 9 | |||
| 7 | void my_direct_func1(unsigned long ip) | 10 | void my_direct_func1(unsigned long ip) |
| 8 | { | 11 | { |
| 9 | trace_printk("my direct func1 ip %lx\n", ip); | 12 | trace_printk("my direct func1 ip %lx\n", ip); |
| @@ -5,6 +5,9 @@ · 4 unmodified lines | |||
| 5 | #include <linux/ftrace.h> | 5 | #include <linux/ftrace.h> |
| 6 | #include <asm/asm-offsets.h> | 6 | #include <asm/asm-offsets.h> |
| 7 | 7 | ||
| 8 | extern void my_direct_func(struct vm_area_struct *vma, | ||
| 9 | unsigned long address, unsigned int flags); | ||
| 10 | |||
| 8 | void my_direct_func(struct vm_area_struct *vma, | 11 | void my_direct_func(struct vm_area_struct *vma, |
| 9 | unsigned long address, unsigned int flags) | 12 | unsigned long address, unsigned int flags) |
| 10 | { | 13 | { |
| @@ -5,6 +5,8 @@ · 4 unmodified lines | |||
| 5 | #include <linux/ftrace.h> | 5 | #include <linux/ftrace.h> |
| 6 | #include <asm/asm-offsets.h> | 6 | #include <asm/asm-offsets.h> |
| 7 | 7 | ||
| 8 | extern void my_direct_func(struct task_struct *p); | ||
| 9 | |||
| 8 | void my_direct_func(struct task_struct *p) | 10 | void my_direct_func(struct task_struct *p) |
| 9 | { | 11 | { |
| 10 | trace_printk("waking up %s-%d\n", p->comm, p->pid); | 12 | trace_printk("waking up %s-%d\n", p->comm, p->pid); |