Skip to content

Commit 2d601b9

Browse files
liqiongrostedt
authored andcommitted
tracing: Change "char *" string form to "char []"
The "char []" string form declares a single variable. It is better than "char *" which creates two variables in the final assembly. Link: https://lkml.kernel.org/r/20220512143230.28796-1-liqiong@nfschina.com Signed-off-by: liqiong <liqiong@nfschina.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 9c556e5 commit 2d601b9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/trace/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4252,7 +4252,7 @@ static void print_func_help_header_irq(struct array_buffer *buf, struct seq_file
42524252
unsigned int flags)
42534253
{
42544254
bool tgid = flags & TRACE_ITER_RECORD_TGID;
4255-
const char *space = " ";
4255+
static const char space[] = " ";
42564256
int prec = tgid ? 12 : 2;
42574257

42584258
print_event_info(buf, m);

kernel/trace/trace_events_hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4165,7 +4165,7 @@ static int create_val_field(struct hist_trigger_data *hist_data,
41654165
return __create_val_field(hist_data, val_idx, file, NULL, field_str, 0);
41664166
}
41674167

4168-
static const char *no_comm = "(no comm)";
4168+
static const char no_comm[] = "(no comm)";
41694169

41704170
static u64 hist_field_execname(struct hist_field *hist_field,
41714171
struct tracing_map_elt *elt,

0 commit comments

Comments
 (0)