Skip to contentSkip to conversation

function_graph: Rename BYTE_NUMBER to CHAR_NUMBER in selftests

PATCH In review Steven Rostedt 2 participants 2 messages Jun 6, 2024 – Jun 8, 2024 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 function_graph: Rename BYTE_NUMBER to CHAR_NUMBER in selftests

From: "Steven Rostedt (Google)" <[email protected]>

The function_graph selftests checks various size variables to pass from the entry of the function to the exit. It tests 1, 2, 4 and 8 byte words. The 1 byte macro was called BYTE_NUMBER but that is used in the sh
architecture: arch/sh/include/asm/bitops-op32.h

Just rename the macro to CHAR_NUMBER.

Fixes 47c3c70aa3697 ("function_graph: Add selftest for passing local variables")
---
 kernel/trace/trace_selftest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/trace/trace_selftest.c +3 -3
index 369efc569238..adf0f436d84b 100644
@@ -758,7 +758,7 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)
 
 #ifdef CONFIG_DYNAMIC_FTRACE
 
-#define BYTE_NUMBER 123
+#define CHAR_NUMBER 123
 #define SHORT_NUMBER 12345
 #define WORD_NUMBER 1234567890
 #define LONG_NUMBER 1234567890123456789LL
@@ -789,7 +789,7 @@ static __init int store_entry(struct ftrace_graph_ent *trace,
 
 	switch (size) {
 	case 1:
-		*(char *)p = BYTE_NUMBER;
+		*(char *)p = CHAR_NUMBER;
 		break;
 	case 2:
 		*(short *)p = SHORT_NUMBER;
@@ -830,7 +830,7 @@ static __init void store_return(struct ftrace_graph_ret *trace,
 
 	switch (fixture->store_size) {
 	case 1:
-		expect = BYTE_NUMBER;
+		expect = CHAR_NUMBER;
 		found = *(char *)p;
 		break;
 	case 2:
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Thu, 6 Jun 2024 08:18:46 -0400 Steven Rostedt <[email protected]> wrote:

From: "Steven Rostedt (Google)" <[email protected]>

The function_graph selftests checks various size variables to pass from the entry of the function to the exit. It tests 1, 2, 4 and 8 byte words. The 1 byte macro was called BYTE_NUMBER but that is used in the sh
architecture: arch/sh/include/asm/bitops-op32.h

Just rename the macro to CHAR_NUMBER.

Looks good to me.

Thanks,

Quoted 43 lines
Fixes 47c3c70aa3697 ("function_graph: Add selftest for passing local variables")
---
 kernel/trace/trace_selftest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/trace/trace_selftest.c +3 -3
index 369efc569238..adf0f436d84b 100644
@@ -758,7 +758,7 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr)
 
 #ifdef CONFIG_DYNAMIC_FTRACE
 
-#define BYTE_NUMBER 123
+#define CHAR_NUMBER 123
 #define SHORT_NUMBER 12345
 #define WORD_NUMBER 1234567890
 #define LONG_NUMBER 1234567890123456789LL
@@ -789,7 +789,7 @@ static __init int store_entry(struct ftrace_graph_ent *trace,
 
 	switch (size) {
 	case 1:
-		*(char *)p = BYTE_NUMBER;
+		*(char *)p = CHAR_NUMBER;
 		break;
 	case 2:
 		*(short *)p = SHORT_NUMBER;
@@ -830,7 +830,7 @@ static __init void store_return(struct ftrace_graph_ret *trace,
 
 	switch (fixture->store_size) {
 	case 1:
-		expect = BYTE_NUMBER;
+		expect = CHAR_NUMBER;
 		found = *(char *)p;
 		break;
 	case 2:
Signature · 1 line
2.43.0
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>