From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29C7CC433F5 for ; Sun, 19 Sep 2021 16:01:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04EA661074 for ; Sun, 19 Sep 2021 16:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233783AbhISQCx convert rfc822-to-8bit (ORCPT ); Sun, 19 Sep 2021 12:02:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:34050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhISQCv (ORCPT ); Sun, 19 Sep 2021 12:02:51 -0400 Received: from rorschach.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4A6FE6101B; Sun, 19 Sep 2021 16:01:26 +0000 (UTC) Date: Sun, 19 Sep 2021 12:01:24 -0400 From: Steven Rostedt To: Jackie Liu Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, bristot@redhat.com Subject: Re: [PATCH] tracing: fix missing osnoise tracer on max_latency Message-ID: <20210919120124.3e2b1b7b@rorschach.local.home> In-Reply-To: <20210918051118.1096575-1-liu.yun@linux.dev> References: <20210918051118.1096575-1-liu.yun@linux.dev> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 18 Sep 2021 13:11:18 +0800 Jackie Liu wrote: > From: Jackie Liu > > The compiler warns when the data are actually unused: > > kernel/trace/trace.c:1712:13: error: ‘trace_create_maxlat_file’ defined but not used [-Werror=unused-function] > 1712 | static void trace_create_maxlat_file(struct trace_array *tr, > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > [Why] > CONFIG_HWLAT_TRACER=n, CONFIG_TRACER_MAX_TRACE=n, CONFIG_OSNOISE_TRACER=y > gcc report warns. > > [How] > Now trace_create_maxlat_file will only take effect when > CONFIG_HWLAT_TRACER=y or CONFIG_TRACER_MAX_TRACE=y. In fact, after > adding osnoise trace, it also needs to take effect. > > BTW, Fixed the conflicting defined comment information. Thanks for the report. > > Fixes: bce29ac9ce0b ("trace: Add osnoise tracer") > Cc: Daniel Bristot de Oliveira > Signed-off-by: Jackie Liu > --- > kernel/trace/trace.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index 7896d30d90f7..d7e3ed82fafd 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -1744,11 +1744,7 @@ void latency_fsnotify(struct trace_array *tr) > irq_work_queue(&tr->fsnotify_irqwork); > } > > -/* > - * (defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)) && \ > - * defined(CONFIG_FSNOTIFY) > - */ > -#else > +#else /* LATENCY_FS_NOTIFY */ > > #define trace_create_maxlat_file(tr, d_tracer) \ > trace_create_file("tracing_max_latency", 0644, d_tracer, \ To clean this up even better, we should add here: #elif defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) \ || defined(CONFIG_OSNOISE_TRACER) # define trace_create_maxlat_file(tr, d_tracer) \ trace_create_file("tracing_max_latency", 0644, d_tracer, \ &tr->max_latency, &tracing_max_lat_fops) #else # define trace_create_maxlat_file(tr, d_tracer) do { } while (0) #endif > @@ -9473,7 +9469,8 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer) > > create_trace_options_dir(tr); > > -#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) > +#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) \ > + || defined(CONFIG_OSNOISE_TRACER) And remove the #if statement complete from inside the function. -- Steve > trace_create_maxlat_file(tr, d_tracer); > #endif >