Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3030703pxb; Mon, 18 Oct 2021 06:58:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7tto5d/n5GQYv38ajoDS8WzRyznw9hnPvrz79UUfLKgCbuQZi4Ik+Gtnz46H5InA9fS0o X-Received: by 2002:a17:90a:a389:: with SMTP id x9mr46983254pjp.167.1634565484324; Mon, 18 Oct 2021 06:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565484; cv=none; d=google.com; s=arc-20160816; b=GKyj3PLM1QZBF9nZ9yw86V3hjSbLuCKmlA/2zELkUemBCNgZNwdfPirR1wEF+NgKEr eB47e6BYivqMmFIkJf68HPLwnj1dK/sJrDeTt9V/cMjZalyrudrhwtQNhCT/c3+E4gm1 Y8ws+9RYhcZRmoQMkC/lSKAX98ECkYpBDib8QA4kVA0Kg1fTXOCph7tWoGyv40XmYVYh Ldqm14iVfUnykF1iIF4NCvtIpcJosHGQd07Dzayh/1GmZMMFFjGgIi/8sRaGOefzWmRM g8tJJ5IteRrNwCcFA3jl0ZQ6bK5Q9+biF/8ZZOqiaemrm2urL2N2pqkHEGXYhDxThXcp yj9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PDcFwKCGPa1B6UNJUVYN4ektDjhagrnwYYNheII48B4=; b=rwN8XEVzh7gyi100o7r7lt7qAK/fjmBG6f3AEKpCLxmfYuYaM8B0G6gOED2VyKUxf0 7zpkJXEV5ddMbSuRggcL9THtxbZV2yhtKjw9fV6pvt82W9IDWWvkPNzZceyF90EcWTMg NxfMP/6GogOGWB0FGn4z1w/0H9y/FzOVuVLD3bc2usHxo7SjAnMe8mdvW1SYXEDOQNrq 0fa7ExQbzEaMDL7oqi2h/tR0NMUCPLdD+smocaE8birR/qIgTvldZu3pYOD4PtnMSW7n 0MXoe1gyMp22FFBORmaihU0Kbf/nN6kii8ONjsbClRmOhscgsBb5AnOxwu2os1ekXGi0 cRcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="iWPPhFe/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e70si8288218pgc.35.2021.10.18.06.57.51; Mon, 18 Oct 2021 06:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="iWPPhFe/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233271AbhJRN66 (ORCPT + 99 others); Mon, 18 Oct 2021 09:58:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:59334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232330AbhJRN42 (ORCPT ); Mon, 18 Oct 2021 09:56:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 96A26613A6; Mon, 18 Oct 2021 13:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564433; bh=Pk0vjCTxsyUVkxJShviw2ozJNFJ2klvJbRjQupwHRNE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iWPPhFe/6lNsui2cVEagC6x9PGZ/tRlehwh6bC/eZUIkx+gOOOdaZai5gb8qmFPNB SKkPoMC60qQ2WWL6k+o5tO7IGDqFgjj05q3s/uut6pccIKLOBkHetn+HTQfw7NPVrY H9fQtVVn+YqhYrGA4OLklpjnkcqFe+6bmxwQdTKY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Bristot de Oliveira , Steven Rostedt , Daniel Bristot de Oliveira , Jackie Liu , Randy Dunlap Subject: [PATCH 5.14 087/151] tracing: Fix missing osnoise tracer on max_latency Date: Mon, 18 Oct 2021 15:24:26 +0200 Message-Id: <20211018132343.517300612@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Jackie Liu commit 424b650f35c77defbb3cbd6e5221d3697af42250 upstream. 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. Link: https://lore.kernel.org/all/c1d9e328-ad7c-920b-6c24-9e1598a6421c@infradead.org/ Link: https://lkml.kernel.org/r/20210922025122.3268022-1-liu.yun@linux.dev Fixes: bce29ac9ce0b ("trace: Add osnoise tracer") Cc: Daniel Bristot de Oliveira Suggested-by: Steven Rostedt Reviewed-by: Daniel Bristot de Oliveira Tested-by: Randy Dunlap # build-tested Signed-off-by: Jackie Liu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1744,16 +1744,15 @@ void latency_fsnotify(struct trace_array irq_work_queue(&tr->fsnotify_irqwork); } -/* - * (defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)) && \ - * defined(CONFIG_FSNOTIFY) - */ -#else +#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 #ifdef CONFIG_TRACER_MAX_TRACE @@ -9457,9 +9456,7 @@ init_tracer_tracefs(struct trace_array * create_trace_options_dir(tr); -#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) trace_create_maxlat_file(tr, d_tracer); -#endif if (ftrace_create_function_files(tr, d_tracer)) MEM_FAIL(1, "Could not allocate function filter files");