Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp159337iob; Thu, 12 May 2022 21:43:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIEO0a+biWDE9rIZa4YkwGoTDTtlRVBJ+vT5QzyzGkxyLu0oNZMP2aid+0jUwywzg9gGlL X-Received: by 2002:a17:907:72c2:b0:6f4:ef00:4588 with SMTP id du2-20020a17090772c200b006f4ef004588mr2636568ejc.515.1652417018045; Thu, 12 May 2022 21:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652417018; cv=none; d=google.com; s=arc-20160816; b=v/MBaQLOchE43xW93YVA7ydwoEVXEBTUZeR+jwSkJwT/ILWx0XqmY0G0wVglXPij6C V19ky8ftjM618WqKOZd6QUHkZAe7JTE1WWf6UzLTd5IsVu4/MqnTLa39rnWku+93381P GRKTKzQFXQh/PgfepXh10EqJZMVqcIPzR7omLRry8/cEHylVs//enS6ztYcR3BNKt045 +7dKxoBvahlZ6LQVGABhzB9ZCNtT+Dd7uyfP59vXo6c3bzZRGnUanPwiIm4Ph26YLe6W tT6U8Jq3g1hbzxL/o7SreHJsoC3jagJV+rAJgJld+ewYLOGvYX9ZZEyGDQ5pJ9uCNdVq Pjvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=KNu/rfiWa3yx40xbFtKWh85zy/RJQCTyAS1BfqTfzDM=; b=AatDi5odHVpXLzACuHnI6ftFVAGjSR0f0CkeVL6xSInwod9UEEOMKpB7SJ+EUEfP3P 4rra8ycvtMi7aPyv05L+BqBkX/wRIlM8kwC7ctZJyWXzmPQoPstEs/E+eQvzyIkkMe6a XMuAKX5ktwmdTtgNkCCANtTo32hUD/Pxe5x7j6RThGDfEC1niTRRQjCTUVyFaQQsgD4r EwbmnySNHAhXpslKvLaFvF2wQndbTvrWqrAJynQfLYDhMKuheIzm5yjAV5l9+2RRdz1Z TwkykthjpYc+ejW0axoPc82HezZ3xWlsOZOPiMldP7P0uv7xZROKtf9DaZSH7YF2kAB7 wirQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a1709065d0f00b006e7f21f913dsi1313594ejt.233.2022.05.12.21.43.12; Thu, 12 May 2022 21:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355390AbiELOeC (ORCPT + 99 others); Thu, 12 May 2022 10:34:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355339AbiELOdx (ORCPT ); Thu, 12 May 2022 10:33:53 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CC3D625F79E for ; Thu, 12 May 2022 07:33:36 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 4F9681E80D6B; Thu, 12 May 2022 22:28:00 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00T1VVAvSilP; Thu, 12 May 2022 22:27:57 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 0C7141E80D22; Thu, 12 May 2022 22:27:57 +0800 (CST) From: liqiong To: Steven Rostedt , Ingo Molnar Cc: linux-kernel@vger.kernel.org, hukun@nfschina.com, qixu@nfschina.com, yuzhe@nfschina.com, renyu@nfschina.com, liqiong Subject: [PATCH 2/2] kernel/trace: change "char *" string form to "char []" Date: Thu, 12 May 2022 22:32:30 +0800 Message-Id: <20220512143230.28796-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The "char []" string form declares a single variable. It is better than "char *" which creates two variables in the final assembly. Signed-off-by: liqiong --- kernel/trace/trace.c | 2 +- kernel/trace/trace_events_hist.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index f4de111fa18f..62a3451be0e0 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4249,7 +4249,7 @@ static void print_func_help_header_irq(struct array_buffer *buf, struct seq_file unsigned int flags) { bool tgid = flags & TRACE_ITER_RECORD_TGID; - const char *space = " "; + static const char space[] = " "; int prec = tgid ? 12 : 2; print_event_info(buf, m); diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 44db5ba9cabb..6925ea1b08e7 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -4161,7 +4161,7 @@ static int create_val_field(struct hist_trigger_data *hist_data, return __create_val_field(hist_data, val_idx, file, NULL, field_str, 0); } -static const char *no_comm = "(no comm)"; +static const char no_comm[] = "(no comm)"; static u64 hist_field_execname(struct hist_field *hist_field, struct tracing_map_elt *elt, -- 2.25.1