@@ -6040,6 +6040,12 @@ static void update_last_data(struct trace_array *tr)
6040
6040
if (!(tr -> flags & TRACE_ARRAY_FL_BOOT ))
6041
6041
return ;
6042
6042
6043
+ if (!(tr -> flags & TRACE_ARRAY_FL_LAST_BOOT ))
6044
+ return ;
6045
+
6046
+ /* Only if the buffer has previous boot data clear and update it. */
6047
+ tr -> flags &= ~TRACE_ARRAY_FL_LAST_BOOT ;
6048
+
6043
6049
/* Reset the module list and reload them */
6044
6050
if (tr -> scratch ) {
6045
6051
struct trace_scratch * tscratch = tr -> scratch ;
@@ -6052,9 +6058,6 @@ static void update_last_data(struct trace_array *tr)
6052
6058
module_for_each_mod (save_mod , tr );
6053
6059
}
6054
6060
6055
- if (!(tr -> flags & TRACE_ARRAY_FL_LAST_BOOT ))
6056
- return ;
6057
-
6058
6061
/*
6059
6062
* Need to clear all CPU buffers as there cannot be events
6060
6063
* from the previous boot mixed with events with this boot
@@ -6077,7 +6080,6 @@ static void update_last_data(struct trace_array *tr)
6077
6080
#else
6078
6081
tscratch -> kaslr_addr = 0 ;
6079
6082
#endif
6080
- tr -> flags &= ~TRACE_ARRAY_FL_LAST_BOOT ;
6081
6083
}
6082
6084
6083
6085
/**
@@ -10103,15 +10105,6 @@ static void trace_module_remove_evals(struct module *mod)
10103
10105
static inline void trace_module_remove_evals (struct module * mod ) { }
10104
10106
#endif /* CONFIG_TRACE_EVAL_MAP_FILE */
10105
10107
10106
- static bool trace_array_active (struct trace_array * tr )
10107
- {
10108
- if (tr -> current_trace != & nop_trace )
10109
- return true;
10110
-
10111
- /* 0 is no events, 1 is all disabled */
10112
- return trace_events_enabled (tr , NULL ) > 1 ;
10113
- }
10114
-
10115
10108
static void trace_module_record (struct module * mod )
10116
10109
{
10117
10110
struct trace_array * tr ;
@@ -10120,11 +10113,8 @@ static void trace_module_record(struct module *mod)
10120
10113
/* Update any persistent trace array that has already been started */
10121
10114
if ((tr -> flags & (TRACE_ARRAY_FL_BOOT | TRACE_ARRAY_FL_LAST_BOOT )) ==
10122
10115
TRACE_ARRAY_FL_BOOT ) {
10123
- /* Only update if the trace array is active */
10124
- if (trace_array_active (tr )) {
10125
- guard (mutex )(& scratch_mutex );
10126
- save_mod (mod , tr );
10127
- }
10116
+ guard (mutex )(& scratch_mutex );
10117
+ save_mod (mod , tr );
10128
10118
}
10129
10119
}
10130
10120
}
0 commit comments