From nobody Sat Nov 30 16:38:57 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 987B21836D9 for ; Mon, 9 Sep 2024 20:08:28 +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=1725912508; cv=none; b=c2sqvmgWjkx9jxfa1BRuzvHBV5SMMdyWtnPzTBcdaDaqdTLHNsvTq47MkbxgDqlj9/4+8U5u77l+7XdWkrmfeZiB3SJ0u+Qqsxh+cJTa8AgBE1kiaio3xc21CNN8KTfe8KSCe9R6JCYyz1IbVqZZcDABI6cv9jCMQr1Nf/zi3DY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725912508; c=relaxed/simple; bh=KmW7WRSo/iGFkcAX6rCPFFaUDhnWuHwnS5jAbrq79mc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=Wn9tj4cPBPJ+ulJeqfJxcKqPqGXnorinjDA+JcvOyRz8R6nn+ibmcgzdo/9WJ2NPHXnf6Xy1P1cNW0ZA1darLH6mvdixMQnJ/8xl5kgU5MgLvcMldhgfP2IO6bjxARqoxcdX18lHZvu5mgtQXfyv2A4GZ3B0g4kgOJAA3k4pFSA= 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 41B60C4CEC5; Mon, 9 Sep 2024 20:08:28 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1snkgW-000000009qX-0AYQ; Mon, 09 Sep 2024 16:08:28 -0400 Message-ID: <20240909200827.908619234@goodmis.org> User-Agent: quilt/0.68 Date: Mon, 09 Sep 2024 16:07:48 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , "Helena Anna" , "Luis Claudio R. Goncalves" , Tomas Glozar , "Bityutskiy, Artem" Subject: [for-linus][PATCH 1/2] tracing/osnoise: Fix build when timerlat is not enabled References: <20240909200747.898018585@goodmis.org> 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. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: "Helena Anna" Cc: "Luis Claudio R. Goncalves" Cc: Tomas Glozar Link: https://lore.kernel.org/20240909103231.23a289e2@gandalf.local.home Fixes: e6a53481da29 ("tracing/timerlat: Only clear timer if a kthread exist= s") Reported-by: "Bityutskiy, Artem" Signed-off-by: Steven Rostedt (Google) --- 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