On 2025/8/21 23:05, Steven Rostedt wrote:
> On Thu, 21 Aug 2025 02:11:20 +0000
> Tengda Wu <wuten...@huaweicloud.com> wrote:
> 
>  tested this and was writing the change log for the pull request when I
> realized an issue.
> 
>> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
>> index 4283ed4e8f59..b4cec22753ea 100644
>> --- a/kernel/trace/trace.c
>> +++ b/kernel/trace/trace.c
>> @@ -10617,6 +10617,7 @@ static void ftrace_dump_one(struct trace_array *tr, 
>> enum ftrace_dump_mode dump_m
>>       */
>>  
>>      while (!trace_empty(&iter)) {
>> +            void *ent;
>>  
>>              if (!cnt)
>>                      printk(KERN_TRACE 
>> "---------------------------------\n");
>> @@ -10625,17 +10626,18 @@ static void ftrace_dump_one(struct trace_array 
>> *tr, enum ftrace_dump_mode dump_m
>>  
>>              trace_iterator_reset(&iter);
>>              iter.iter_flags |= TRACE_FILE_LAT_FMT;
>> +            ent = trace_find_next_entry_inc(&iter);
>>  
>> -            if (trace_find_next_entry_inc(&iter) != NULL) {
>> +            if (ent) {
> 
> Why do we need "ent"?
> 
> 
>>                      int ret;
>>  
>>                      ret = print_trace_line(&iter);
>>                      if (ret != TRACE_TYPE_NO_CONSUME)
>>                              trace_consume(&iter);
>> +
>> +                    trace_printk_seq(&iter.seq);
> 
> Isn't just moving trace_printk_seq() enough?
> 
> The code is no different with or without the "ent" as "ent" is not used in
> the if block.
> 
> -- Steve

I apologize, as this is a trace left over from the initial patch modification
process. While working with the original code, I added an `if (ent)` branch
directly to trace_printk_seq and later realized it could be merged with the
previous `if (ent)` branch. However, I forgot to remove the now-redundant ent
after the merge. 

I will correct this immediately and resend a new version.

-- Tengda



> 
> 
>>              }
>>              touch_nmi_watchdog();
>> -
>> -            trace_printk_seq(&iter.seq);
>>      }
>>  
>>      if (!cnt)


Reply via email to