From nobody Sat Nov 30 12:40:02 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 From nobody Sat Nov 30 12:40:02 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 E5B94189F39 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=jYCkg0EDaT4hF/45CLcxk6yJTa1GkzemGuxPElFp3p4j+DNm34OipBoW9Ixm+5zoR5aAjjpWsT2EBwzebuOz/uucQdomIIfL3lx4Ln0apT+d1yi7fuJgJqGmvVjw+Gf982abOhFd1MK0k5M6ElpS3c6D1vTs5+yuS/nP44oQayo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725912508; c=relaxed/simple; bh=OFjgyyRprw/ih+C+zV6y2ZtnnjCrHiQhxZyG+W+mYNw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=rd6Rb349N26uP2lCAPmjND5pCywtQcly+A4pgB5uBGAf4rNFtVryChl7h+eKA5GIZmktrCu3ldDOOZ5mueWMF6RBEoHqmSRcVpsR5P/1g97zcOohm7+FB9SVjLFzyaqHTibo2qVP1fgHIjWSbfvxfmBkayLm7I1N4HQqWCCZc/g= 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 80337C4CEC8; Mon, 9 Sep 2024 20:08:28 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1snkgW-000000009r2-0qgX; Mon, 09 Sep 2024 16:08:28 -0400 Message-ID: <20240909200828.062668680@goodmis.org> User-Agent: quilt/0.68 Date: Mon, 09 Sep 2024 16:07:49 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andy Shevchenko Subject: [for-linus][PATCH 2/2] tracing: Drop unused helper function to fix the build 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: Andy Shevchenko A helper function defined but not used. This, in particular, prevents kernel builds with clang, `make W=3D1` and CONFIG_WERROR=3Dy: kernel/trace/trace.c:2229:19: error: unused function 'run_tracer_selftest' = [-Werror,-Wunused-function] 2229 | static inline int run_tracer_selftest(struct tracer *type) | ^~~~~~~~~~~~~~~~~~~ Fix this by dropping unused functions. See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=3D1 build"). Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Bill Wendling Cc: Justin Stitt Link: https://lore.kernel.org/20240909105314.928302-1-andriy.shevchenko@lin= ux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index edf6bc817aa1..c3b2c7dfadef 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2226,10 +2226,6 @@ static __init int init_trace_selftests(void) } core_initcall(init_trace_selftests); #else -static inline int run_tracer_selftest(struct tracer *type) -{ - return 0; -} static inline int do_run_tracer_selftest(struct tracer *type) { return 0; --=20 2.45.2