@@ -1023,21 +1023,16 @@ __buffer_unlock_commit(struct trace_buffer *buffer, struct ring_buffer_event *ev
1023
1023
ring_buffer_unlock_commit (buffer );
1024
1024
}
1025
1025
1026
- /**
1027
- * __trace_puts - write a constant string into the trace buffer.
1028
- * @ip: The address of the caller
1029
- * @str: The constant string to write
1030
- * @size: The size of the string.
1031
- */
1032
- int __trace_puts (unsigned long ip , const char * str , int size )
1026
+ int __trace_array_puts (struct trace_array * tr , unsigned long ip ,
1027
+ const char * str , int size )
1033
1028
{
1034
1029
struct ring_buffer_event * event ;
1035
1030
struct trace_buffer * buffer ;
1036
1031
struct print_entry * entry ;
1037
1032
unsigned int trace_ctx ;
1038
1033
int alloc ;
1039
1034
1040
- if (!(global_trace . trace_flags & TRACE_ITER_PRINTK ))
1035
+ if (!(tr -> trace_flags & TRACE_ITER_PRINTK ))
1041
1036
return 0 ;
1042
1037
1043
1038
if (unlikely (tracing_selftest_running || tracing_disabled ))
@@ -1046,7 +1041,7 @@ int __trace_puts(unsigned long ip, const char *str, int size)
1046
1041
alloc = sizeof (* entry ) + size + 2 ; /* possible \n added */
1047
1042
1048
1043
trace_ctx = tracing_gen_ctx ();
1049
- buffer = global_trace . array_buffer .buffer ;
1044
+ buffer = tr -> array_buffer .buffer ;
1050
1045
ring_buffer_nest_start (buffer );
1051
1046
event = __trace_buffer_lock_reserve (buffer , TRACE_PRINT , alloc ,
1052
1047
trace_ctx );
@@ -1068,11 +1063,23 @@ int __trace_puts(unsigned long ip, const char *str, int size)
1068
1063
entry -> buf [size ] = '\0' ;
1069
1064
1070
1065
__buffer_unlock_commit (buffer , event );
1071
- ftrace_trace_stack (& global_trace , buffer , trace_ctx , 4 , NULL );
1066
+ ftrace_trace_stack (tr , buffer , trace_ctx , 4 , NULL );
1072
1067
out :
1073
1068
ring_buffer_nest_end (buffer );
1074
1069
return size ;
1075
1070
}
1071
+ EXPORT_SYMBOL_GPL (__trace_array_puts );
1072
+
1073
+ /**
1074
+ * __trace_puts - write a constant string into the trace buffer.
1075
+ * @ip: The address of the caller
1076
+ * @str: The constant string to write
1077
+ * @size: The size of the string.
1078
+ */
1079
+ int __trace_puts (unsigned long ip , const char * str , int size )
1080
+ {
1081
+ return __trace_array_puts (& global_trace , ip , str , size );
1082
+ }
1076
1083
EXPORT_SYMBOL_GPL (__trace_puts );
1077
1084
1078
1085
/**
0 commit comments