tracing: Remove redundant check on field->field in histograms
authorColin Ian King <colin.i.king@gmail.com>
Thu, 7 Nov 2024 12:05:30 +0000 (12:05 +0000)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 12 Nov 2024 16:36:57 +0000 (11:36 -0500)
The check on field->field being true is handled as the first check
on the cascaded if statement, so the later checks on field->field
are redundant because this clause has already been handled. Since
this later check is redundant, just remove it.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20241107120530.18728-1-colin.i.king@gmail.com
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c

index c288b92..9c058aa 100644 (file)
@@ -1354,10 +1354,7 @@ static const char *hist_field_name(struct hist_field *field,
        } else if (field->flags & HIST_FIELD_FL_TIMESTAMP)
                field_name = "common_timestamp";
        else if (field->flags & HIST_FIELD_FL_STACKTRACE) {
-               if (field->field)
-                       field_name = field->field->name;
-               else
-                       field_name = "common_stacktrace";
+               field_name = "common_stacktrace";
        } else if (field->flags & HIST_FIELD_FL_HITCOUNT)
                field_name = "hitcount";