From nobody Sat Nov 30 12:44:59 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C70F04C6D; Mon, 9 Sep 2024 14:32:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725892354; cv=none; b=Md/b/L9zO2rpCLZXqLKG/1kCwd4EOkt8TdAi/1cKiy07tda7y1ojrZuR3NOyB3cqBXTGH+yyVrJ65Mo8CfYrlHeHbqE+LGsyOaano+hdW6PsIjaQSEEEtRasTX8MYjk8F979aCJ/7UH3Rhl0OXUpovKcU3n0Zu1f5I2F1hlVUL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725892354; c=relaxed/simple; bh=gP0cJNdRSrHsCAa7SNcTD0I1GYBvw01uZ2k6szFGuJE=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=NUP9qqmAjyudf/2/lCuul+4JB5+xdsb/yVsKLoR70UpdWyK1fuOVpGbl4lAw5Sr83QxD7pPdmAHWursLRO8YmBGuDvQqNnqieLW3HX6SU6iuasdJpqwKVPf8a1uvKAiN5GfMPIB9Gab5zT95H5CGlmBZG+FiW16BDz6wmMwai4o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 764C0C4CEC5; Mon, 9 Sep 2024 14:32:33 +0000 (UTC) Date: Mon, 9 Sep 2024 10:32:31 -0400 From: Steven Rostedt To: LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mathieu Desnoyers , "Bityutskiy, Artem" , "Dubel, Helena Anna" , "Luis Claudio R. Goncalves" , Tomas Glozar Subject: [PATCH] tracing/osnoise: Fix build when timerlat is not enabled Message-ID: <20240909103231.23a289e2@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt To fix some critical section races, the interface_lock was added to a few locations. One of those locations was above where the interface_lock was declared, so the declaration was moved up before that usage. Unfortunately, where it was placed was inside a CONFIG_TIMERLAT_TRACER ifdef block. As the interface_lock is used outside that config, this broke the build when CONFIG_OSNOISE_TRACER was enabled but CONFIG_TIMERLAT_TRACER was not. Fixes: e6a53481da29 ("tracing/timerlat: Only clear timer if a kthread exist= s") Reported-by: "Bityutskiy, Artem" Signed-off-by: Steven Rostedt (Google) --- Note to self: Add test to build the kernel with osnoise but not timer lat to my test-suite. kernel/trace/trace_osnoise.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index bbe47781617e..7e75c1214b36 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -228,6 +228,11 @@ static inline struct osnoise_variables *this_cpu_osn_v= ar(void) return this_cpu_ptr(&per_cpu_osnoise_var); } =20 +/* + * Protect the interface. + */ +static struct mutex interface_lock; + #ifdef CONFIG_TIMERLAT_TRACER /* * Runtime information for the timer mode. @@ -252,11 +257,6 @@ static inline struct timerlat_variables *this_cpu_tmr_= var(void) return this_cpu_ptr(&per_cpu_timerlat_var); } =20 -/* - * Protect the interface. - */ -static struct mutex interface_lock; - /* * tlat_var_reset - Reset the values of the given timerlat_variables */ --=20 2.45.2