Skip to content

Commit b2b436e

Browse files
committed
Merge tag 'trace-v5.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
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
2 parents 75acfdb + f28439d commit b2b436e

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

kernel/trace/trace.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3207,7 +3207,7 @@ struct trace_buffer_struct {
32073207
char buffer[4][TRACE_BUF_SIZE];
32083208
};
32093209

3210-
static struct trace_buffer_struct *trace_percpu_buffer;
3210+
static struct trace_buffer_struct __percpu *trace_percpu_buffer;
32113211

32123212
/*
32133213
* This allows for lockless recording. If we're nested too deeply, then
@@ -3217,7 +3217,7 @@ static char *get_trace_buf(void)
32173217
{
32183218
struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer);
32193219

3220-
if (!buffer || buffer->nesting >= 4)
3220+
if (!trace_percpu_buffer || buffer->nesting >= 4)
32213221
return NULL;
32223222

32233223
buffer->nesting++;
@@ -3236,7 +3236,7 @@ static void put_trace_buf(void)
32363236

32373237
static int alloc_percpu_trace_buffer(void)
32383238
{
3239-
struct trace_buffer_struct *buffers;
3239+
struct trace_buffer_struct __percpu *buffers;
32403240

32413241
if (trace_percpu_buffer)
32423242
return 0;

samples/ftrace/ftrace-direct-modify.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include <linux/ftrace.h>
55
#include <asm/asm-offsets.h>
66

7+
extern void my_direct_func1(void);
8+
extern void my_direct_func2(void);
9+
710
void my_direct_func1(void)
811
{
912
trace_printk("my direct func1\n");

samples/ftrace/ftrace-direct-multi-modify.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#include <linux/ftrace.h>
55
#include <asm/asm-offsets.h>
66

7+
extern void my_direct_func1(unsigned long ip);
8+
extern void my_direct_func2(unsigned long ip);
9+
710
void my_direct_func1(unsigned long ip)
811
{
912
trace_printk("my direct func1 ip %lx\n", ip);

samples/ftrace/ftrace-direct-too.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include <linux/ftrace.h>
66
#include <asm/asm-offsets.h>
77

8+
extern void my_direct_func(struct vm_area_struct *vma,
9+
unsigned long address, unsigned int flags);
10+
811
void my_direct_func(struct vm_area_struct *vma,
912
unsigned long address, unsigned int flags)
1013
{

samples/ftrace/ftrace-direct.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <linux/ftrace.h>
66
#include <asm/asm-offsets.h>
77

8+
extern void my_direct_func(struct task_struct *p);
9+
810
void my_direct_func(struct task_struct *p)
911
{
1012
trace_printk("waking up %s-%d\n", p->comm, p->pid);

0 commit comments

Comments
 (0)