From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 CD22E428822 for ; Fri, 22 May 2026 14:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460503; cv=none; b=U4R3Ih+QQ/cZhoEN3KZisELAT0tckPsqo4ht5blmFcLaQ5PuIrnPZ8z80uv+P1nWvCiFJA+v5KXS5raClSsjwBYmHQWXMtb4AHXQgXCPf3jCIySsOt23caQO+FzquD4tWMtjOv9ySMXM7R64dDJPo9MAH9kk/5wupcS9tL+K72E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460503; c=relaxed/simple; bh=RDoeT/dMm98P3BL5kwGwBTK7uUr+pj8BCO8qU5GyOas=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=PfQQ7K0S3u8Ss/BXEL2t8watLWAzQ6qaXi5VNKDEU5uiR/n/xnkLqS6BhZMrZnCsBP5EjrscZQGK6rMbjVSPdXObo0rjAS3/R+a6hp0reaFUxYPpEotNTXPXaxryP6eb7uA6jXWniupSo82vBG9cBW6cH5PlXFyr35+3e5QdBhU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dS8QlHQO; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dS8QlHQO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A205C1F000E9; Fri, 22 May 2026 14:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460501; bh=WkYjyur7AV3cNG5Dvb9lMi2dJWrLVGIR03kGW2DQYgM=; h=Date:From:To:Cc:Subject:References; b=dS8QlHQO1IUknmL3AqzMPFhyCG1wCMaOcz7kbE0dAZ4lUKgu4TbIRIpR/oqlpzU0I M7LQvC/h7MXN30m+qwjmtIbuMHra15fpZfWi1NRnDYHHzXbVbRCVceJnibYtvVb84Y 3L3Yq1yXyA2R8yflRFVvyy5oULbz4RStNmCj9xZ8ohlLvJbWHOWO2n5St11tqMCPbZ qt+DyqKHsXZBf7KAepK/wDf5NwnhWWb9nGDIZ7TityeG5fo5QsNRb6qa72mZ2PHMwR xn0oAnB9O+SAJ6WiXtH3ruRxLW2HkREPSCNaRqqW4R7BPdzxAr4QWAaHXI7zazDZNa ly+1qUCBFIwSQ== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyD-0000000666B-0kob; Fri, 22 May 2026 10:35:25 -0400 Message-ID: <20260522143525.024053404@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:09 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Yash Suthar Subject: [for-next][PATCH 01/15] tracing: Remove redundant IS_ERR() check in trace_pipe_open() References: <20260522143508.298439732@kernel.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: Yash Suthar in trace_pipe_open() already check the IS_ERR(iter) and return early on error,so iter after will be valid and it is safe to return 0 at end. Link: https://patch.msgid.link/20260420101236.223919-1-yashsuthar983@gmail.= com Signed-off-by: Yash Suthar Signed-off-by: Steven Rostedt --- kernel/trace/trace_remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_remote.c b/kernel/trace/trace_remote.c index d6c3f94d67cd..2a6cc000ec98 100644 --- a/kernel/trace/trace_remote.c +++ b/kernel/trace/trace_remote.c @@ -602,7 +602,7 @@ static int trace_pipe_open(struct inode *inode, struct = file *filp) =20 filp->private_data =3D iter; =20 - return IS_ERR(iter) ? PTR_ERR(iter) : 0; + return 0; } =20 static int trace_pipe_release(struct inode *inode, struct file *filp) --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 1F6B6426693 for ; Fri, 22 May 2026 14:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460503; cv=none; b=XqfqRPScYUoEg2gwm6BXyX5OVDlpW5i21O4lvDWAyzZMVRvJZwxRg5BAH5m/hc0N0PPAF/RlJYdrS9n/0vaedvPfjc8vNsNWgjqlvgm3iODqYkXmvIl6I4nK8nwJ9oHdjudhh/TkcnkqBZ+6LAE0jwc1bJM5PZjtYJfQWLb2coA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460503; c=relaxed/simple; bh=bYj4noasIVcXaU0ZQZFXSCzSO/8QarCBfrVyenbJBcE=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ivG/voED+uA655M3p4k4tTfR7YSo2CAPqjfizXW+a+wa6W5+TdZLoIB/eWgq1mVl4ZyNXGLbla8O1heP6emsblMbRmOwuXy1eODELMP5BlYk9JQ4O5Sr4DlHf/o/rTRR08evjWbjyDO8wmVUKP9W+QePE1nqOMIj4slES0PIUGA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Nb8XKzmN; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Nb8XKzmN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCB1A1F00A3E; Fri, 22 May 2026 14:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460501; bh=eKsVfrH0Dr0g4kgHtR9f4PLod3KiwkMqUeKMY44x6/g=; h=Date:From:To:Cc:Subject:References; b=Nb8XKzmNun9V7yrV7RcjZhDU/FdFreXa0MZb5UbUv3AbeMnQQsbAykmZfrNZ2ZvxO i9f544fgDdLWO+had/5EVaV1+FMtirExvV6zGFbmxf0hd7ryBppwn3tqZ/dRbG3dRy gFwtyZveJHonZScQ04qpcz8NnKY+agVKXFF44wSd24mUnlNb8RfoNmeuSJ4/rfRDmj SZnKaadpFePua5+98t6t9p5Zb4SyWwlyP2u0Ljsbjnc0zWkyMcLTfepzr100WxkbR3 CZnQupBXygn9jEuHDm6Lsccu/k0QO7H94nmNaPpYAz1Llujo20vL1r0KfLVm4UZmvr s0To+zbygFKJA== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyD-0000000666f-1UMV; Fri, 22 May 2026 10:35:25 -0400 Message-ID: <20260522143525.200081787@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:10 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , David Gow , Shuvam Pandey Subject: [for-next][PATCH 02/15] seq_buf: Export seq_buf_putmem_hex() and add KUnit tests References: <20260522143508.298439732@kernel.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: Shuvam Pandey The seq_buf KUnit suite does not exercise seq_buf_putmem_hex(). Add one test for the len > 8 chunking path and one overflow test where a later chunk no longer fits in the buffer. Export seq_buf_putmem_hex() as well so SEQ_BUF_KUNIT_TEST=3Dm links cleanly. Without the export, modpost reports seq_buf_putmem_hex as undefined when seq_buf_kunit is built as a module. Cc: Andrew Morton Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: David Gow Link: https://patch.msgid.link/20260408202351.21829-1-shuvampandey1@gmail.c= om Acked-by: Steven Rostedt (Google) Signed-off-by: Shuvam Pandey Signed-off-by: Steven Rostedt --- lib/seq_buf.c | 1 + lib/tests/seq_buf_kunit.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/lib/seq_buf.c b/lib/seq_buf.c index f3f3436d60a9..b59488fa8135 100644 --- a/lib/seq_buf.c +++ b/lib/seq_buf.c @@ -298,6 +298,7 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *m= em, } return 0; } +EXPORT_SYMBOL_GPL(seq_buf_putmem_hex); =20 /** * seq_buf_path - copy a path into the sequence buffer diff --git a/lib/tests/seq_buf_kunit.c b/lib/tests/seq_buf_kunit.c index 8a01579a978e..eb466386bbef 100644 --- a/lib/tests/seq_buf_kunit.c +++ b/lib/tests/seq_buf_kunit.c @@ -184,6 +184,38 @@ static void seq_buf_get_buf_commit_test(struct kunit *= test) KUNIT_EXPECT_TRUE(test, seq_buf_has_overflowed(&s)); } =20 +static void seq_buf_putmem_hex_test(struct kunit *test) +{ + DECLARE_SEQ_BUF(s, 24); + const u8 data[] =3D { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; +#ifdef __BIG_ENDIAN + const char *expected =3D "0001020304050607 0809 "; +#else + const char *expected =3D "0706050403020100 0908 "; +#endif + + KUNIT_EXPECT_EQ(test, seq_buf_putmem_hex(&s, data, sizeof(data)), 0); + KUNIT_EXPECT_FALSE(test, seq_buf_has_overflowed(&s)); + KUNIT_EXPECT_EQ(test, seq_buf_used(&s), strlen(expected)); + KUNIT_EXPECT_STREQ(test, seq_buf_str(&s), expected); +} + +static void seq_buf_putmem_hex_overflow_test(struct kunit *test) +{ + DECLARE_SEQ_BUF(s, 20); + const u8 data[] =3D { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; +#ifdef __BIG_ENDIAN + const char *expected =3D "0001020304050607 "; +#else + const char *expected =3D "0706050403020100 "; +#endif + + KUNIT_EXPECT_EQ(test, seq_buf_putmem_hex(&s, data, sizeof(data)), -1); + KUNIT_EXPECT_TRUE(test, seq_buf_has_overflowed(&s)); + KUNIT_EXPECT_EQ(test, seq_buf_used(&s), 20); + KUNIT_EXPECT_STREQ(test, seq_buf_str(&s), expected); +} + static struct kunit_case seq_buf_test_cases[] =3D { KUNIT_CASE(seq_buf_init_test), KUNIT_CASE(seq_buf_declare_test), @@ -194,6 +226,8 @@ static struct kunit_case seq_buf_test_cases[] =3D { KUNIT_CASE(seq_buf_printf_test), KUNIT_CASE(seq_buf_printf_overflow_test), KUNIT_CASE(seq_buf_get_buf_commit_test), + KUNIT_CASE(seq_buf_putmem_hex_test), + KUNIT_CASE(seq_buf_putmem_hex_overflow_test), {} }; =20 --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0375443635D for ; Fri, 22 May 2026 14:35:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460504; cv=none; b=sCkiw/mJuLmCzu9t0Dj69pHqwzhmQlZ/YyjLzm6v1IgcIyWUcaPFQHa3/sSjzFmVgL+YD+9sgEL3zThRp5mmvWu5GIh5yXohQ/FANX7GpT/H78mpm56lnfITkurOZ+634uY+6nG+sbu4mvN9U9KeSHY5ioCBvzJGqpLN+wgRnHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460504; c=relaxed/simple; bh=4+QKmBlA1KIDu/ZJroN63SmQpgTG1FwOxiyt9EDWBVw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=eMQndKLJvp5bRg0rOFBqCcCqWvMTomu6gd3E6P59I7YXJ2/HmMPM1UplviY48cUpytZ3Ase82+7MAGa+R2Jdvrgx/dhTfdkMe0ZiUmKVp5toDtdtCW7lj9zyaRiDj8rkak+THviEykbHvLoiVg3dT6r9sv1YrKNB+Lz7KHoRx+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GwnUoxkv; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GwnUoxkv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBE691F00ADF; Fri, 22 May 2026 14:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460501; bh=LM89YYi/g3sQsg8aXAM5rWVMCRdZG1KcqZMcYI39TZU=; h=Date:From:To:Cc:Subject:References; b=GwnUoxkvhnRlezua5dndE/Vtqx1PU9JIsaIzM0OrCrxkDdfG13ebF33t4yt7pclhz PMjCP+R8BQQatrA6Q394gPavvBKFOX5n0QUMP2dCoE+7gbII01iItlpResjAFrTZSk M4bUtTQB4Y0UXldqsoI3qtOYbJMjFDKMBeSZ8TOgt8RaAkf0zCZUAq6G+2e1mPoT80 iwSGFYU9rJzpR11oW2UJSfRFd1laIpfaJiHmjixQj/mNtfvv8YSDeov+EHtmYyGoVH 5lOpK8u/GtrM67MoLHELat61Xclfmy7DhSoinuz+6BP23BkhZdKhQefYIfewIAUnVJ +r5BYtFJraVaQ== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyD-00000006679-2ETJ; Fri, 22 May 2026 10:35:25 -0400 Message-ID: <20260522143525.374444253@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:11 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Tom Zanussi , Tom Zanussi , Pengpeng Hou Subject: [for-next][PATCH 03/15] tracing: Bound synthetic-field strings with seq_buf References: <20260522143508.298439732@kernel.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: Pengpeng Hou The synthetic field helpers build a prefixed synthetic variable name and a generated hist command in fixed MAX_FILTER_STR_VAL buffers. The current code appends those strings with raw strcat(), so long key lists, field names, or saved filters can run past the end of the staging buffers. Build both strings with seq_buf and propagate -E2BIG if either the synthetic variable name or the generated command exceeds MAX_FILTER_STR_VAL. This keeps the existing tracing-side limit while using the helper intended for bounded command construction. Cc: Mathieu Desnoyers Cc: Tom Zanussi Link: https://patch.msgid.link/20260430043350.57928-1-pengpeng@iscas.ac.cn Fixes: 02205a6752f2 ("tracing: Add support for 'field variables'") Acked-by: Masami Hiramatsu (Google) Reviewed-by: Tom Zanussi Signed-off-by: Pengpeng Hou [ sdr: Moved struct seq_buf *s for upside-down x-mas tree formatting ] Signed-off-by: Steven Rostedt --- kernel/trace/trace_events_hist.c | 41 ++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_h= ist.c index eb2c2bc8bc3d..9701650c89b2 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -2967,13 +2968,22 @@ find_synthetic_field_var(struct hist_trigger_data *= target_hist_data, { struct hist_field *event_var; char *synthetic_name; + struct seq_buf s; =20 synthetic_name =3D kzalloc(MAX_FILTER_STR_VAL, GFP_KERNEL); if (!synthetic_name) return ERR_PTR(-ENOMEM); =20 - strcpy(synthetic_name, "synthetic_"); - strcat(synthetic_name, field_name); + seq_buf_init(&s, synthetic_name, MAX_FILTER_STR_VAL); + seq_buf_printf(&s, "synthetic_%s", field_name); + + /* Terminate synthetic_name with a NUL. */ + seq_buf_str(&s); + + if (seq_buf_has_overflowed(&s)) { + kfree(synthetic_name); + return ERR_PTR(-E2BIG); + } =20 event_var =3D find_event_var(target_hist_data, system, event_name, synthe= tic_name); =20 @@ -3019,6 +3029,7 @@ create_field_var_hist(struct hist_trigger_data *targe= t_hist_data, struct hist_field *key_field; struct hist_field *event_var; char *saved_filter; + struct seq_buf s; char *cmd; int ret; =20 @@ -3063,28 +3074,34 @@ create_field_var_hist(struct hist_trigger_data *tar= get_hist_data, return ERR_PTR(-ENOMEM); } =20 + seq_buf_init(&s, cmd, MAX_FILTER_STR_VAL); + /* Use the same keys as the compatible histogram */ - strcat(cmd, "keys=3D"); + seq_buf_puts(&s, "keys=3D"); =20 for_each_hist_key_field(i, hist_data) { key_field =3D hist_data->fields[i]; if (!first) - strcat(cmd, ","); - strcat(cmd, key_field->field->name); + seq_buf_putc(&s, ','); + seq_buf_puts(&s, key_field->field->name); first =3D false; } =20 /* Create the synthetic field variable specification */ - strcat(cmd, ":synthetic_"); - strcat(cmd, field_name); - strcat(cmd, "=3D"); - strcat(cmd, field_name); + seq_buf_printf(&s, ":synthetic_%s=3D%s", field_name, field_name); =20 /* Use the same filter as the compatible histogram */ saved_filter =3D find_trigger_filter(hist_data, file); - if (saved_filter) { - strcat(cmd, " if "); - strcat(cmd, saved_filter); + if (saved_filter) + seq_buf_printf(&s, " if %s", saved_filter); + + /* Terminate cmd with a NUL. */ + seq_buf_str(&s); + + if (seq_buf_has_overflowed(&s)) { + kfree(cmd); + kfree(var_hist); + return ERR_PTR(-E2BIG); } =20 var_hist->cmd =3D kstrdup(cmd, GFP_KERNEL); --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 56414407CDF for ; Fri, 22 May 2026 14:35:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460504; cv=none; b=tu7sLhbHlyEjgYADQnBcJvpAp1abIv8hmDyVQ0XXCp33H6CkK/w+Lii8ML6g/gnFSeBsfX3pu6bOx6tre41yiTHyY2l5py52R7wXaka+gX438+yEmINLSsA3HHyaMd7mtQcpWhVEcJ8l+RZHmgbdmc7a+jJVvcw3TtkRuJdOTJ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460504; c=relaxed/simple; bh=WVJEFkeBNBSTaAFRTLPVpP9nqvhaWceILqcbevNtZ+c=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=VgFDyRgppOcyDYVfWKXjV0Y4cedMy1utFXCJFkgdFy5i+Q/wbSS9kWjIdKJy6G7XZsZ8A9cu/1+KTZ6Lig6oPrM7/jPsXTqV+oCizgjWzN2YRrcH1HHaZ8N6RncEZ4YLpOAe8sW/kkL3pPfq4mUKr7hYoyvbZCXXlqtBlNZUy3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XhDfrXhP; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XhDfrXhP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CE321F00A3F; Fri, 22 May 2026 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460502; bh=Ijc/T8H7IkQi3O5/caNndvOiReMByEl6wUiqdBLZL50=; h=Date:From:To:Cc:Subject:References; b=XhDfrXhPoIpHxB2lj/qHK+RiLUOJS/V8DPqjd0LHg7U7vQiHU5C1VfwNpuMBfjN31 CunsSYBblyH6Cp680923p2w7et/aQDSQc0ZgRYIYqzsj3bG5NCggHUL2SCVaXVZ0CO UJETqrD4Ik79XTgg4MuLrx3vY+I9CTaBbIUuo3voEigO9vyfQdCFp5g5mM4SMjdDhW yXEII2WrISkdFGRsP0iSzmJ1lpXMU5nTBQceKVzR6tY7zujXQ7ssUxCjcRQv26j1wi xG8GRkQNnmJ/1h4W8CCeln1szLE20Z3rqXWP8zoa1HyCCQ8RW7k7HL69l1efbxHCUK 49Oskq8FQ6zng== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyD-0000000667d-30Uf; Fri, 22 May 2026 10:35:25 -0400 Message-ID: <20260522143525.551205135@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:12 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , "Vineeth Pillai (Google)" , Peter Zijlstra , David Carlier Subject: [for-next][PATCH 04/15] tracepoint: Add lockdep rcu_is_watching() check to trace_##name##_enabled() References: <20260522143508.298439732@kernel.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: David Carlier The trace_##name##_enabled() static call branch is used when work needs to be done for a tracepoint. It allows that work to be skipped when the tracepoint is not active and still uses the static_branch() of the tracepoint to keep performance. Tracepoints themselves require being called in "RCU watching" locations otherwise races can occur that corrupts things. In order to make sure lockdep triggers at tracepoint locations, the lockdep checks are added to the tracepoint calling location and trigger even if the tracepoint is not enabled. This is done because a poorly placed tracepoint may never be detected if it is never enabled when lockdep is enabled. As trace_##name##_enabled() also prevents the lockdep checks when the tracepoint is disabled add lockdep checks to that as well so that if one is placed in a location that RCU is not watching, it will trigger a lockdep splat even when the tracepoint is not enabled. Cc: Vineeth Pillai (Google) Cc: Mathieu Desnoyers Cc: Masami Hiramatsu Cc: Peter Zijlstra Link: https://patch.msgid.link/20260430144159.10985-1-devnexen@gmail.com Signed-off-by: David Carlier [ Updated the change log ] Signed-off-by: Steven Rostedt --- include/linux/tracepoint.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 763eea4d80d8..c29fc57392bb 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -293,6 +293,10 @@ static inline struct tracepoint *tracepoint_ptr_deref(= tracepoint_ptr_t *p) static inline bool \ trace_##name##_enabled(void) \ { \ + if (IS_ENABLED(CONFIG_LOCKDEP)) { \ + WARN_ONCE(!rcu_is_watching(), \ + "RCU not watching for tracepoint"); \ + } \ return static_branch_unlikely(&__tracepoint_##name.key);\ } =20 --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6408C421A0A for ; Fri, 22 May 2026 14:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460504; cv=none; b=hmzBBNeWqRarn7ei8J4rZgzWcwYGj2d5SBUdl2PntEM8yQhHSoAYCvEbFHHSAvWFpPiC9lRuRvA6h47O7ZS+hT7+/EFa+k61B9MpEiY2JeVYhzn6gZy2Qg61DSAltl/M8swBEZlGFTb3nbIYbfy0tfEO87Uic/ram6AlSHC3y/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460504; c=relaxed/simple; bh=1ssrb7J/bifTr1tstxSO54qch/dy5aqP71wuKx2S9jI=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=canmYJj3/EWmuL0Q8S2+qmLjTEdLd3OtsI1RzMNikIYqE/WX+rUZVnY5f46jxFrNYwAZLbGm6vMkfZIiU0RGBclmFrztmiHk5snPSgGgHFnVL6oBOgAKr7Boor/W4zGdkx6W3/qi9lWQE6ygswtvAUDDIZTg+S6eIuqQoZrQyAE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UEjec+Jb; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UEjec+Jb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AB251F0155A; Fri, 22 May 2026 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460502; bh=7JPgi0/Koq+xrbSftk7/iF8qG0o+Jq3QebqgcvvRJXk=; h=Date:From:To:Cc:Subject:References; b=UEjec+JbfZqNvb2qXRkQJOwkc/vebPno5lOCvtSiZnk2H7opCpsvz3mc4VBuNvFUS /o2M64/m8CVRldyDbgg5ALHrYSxOd/2mCpeZ+iNizfmflKvxOpv0Vh02ohfCC8oZoY n5+91xKMaEzZ16KlfqirXrSJ641NUkxNMa7npBHTtUpFcwa5Fp7JRVM/njIgLqvRCI ayCJ7K2O5jg06nHZhwMmYn/S/z8cottJ+SG6/0LfBh0wHSv2+yctWnwyYtwl/FdS7R sertPJ5dq4TAkGT1NbiGqmKSsdP3PHUWR9s4OsyDuUZrEXXncfosDptDhr1Awjgo3Y 0NLd7uXHJeW3A== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyD-00000006687-3gK8; Fri, 22 May 2026 10:35:25 -0400 Message-ID: <20260522143525.736370754@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:13 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , David Laight , Qian-Yu Lin Subject: [for-next][PATCH 05/15] tracing: Remove local variable for argument detection from trace_printk() References: <20260522143508.298439732@kernel.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: Qian-Yu Lin The trace_printk() macro uses a local variable _______STR to detect whether variadic arguments are present. This name can shadow outer variables. Replace the local variable with sizeof applied directly to the stringified arguments: if (sizeof __stringify((__VA_ARGS__)) > 3) This eliminates the shadowing risk entirely without introducing any additional includes or local variables. Verified with objdump on samples/trace_printk that all four cases branch correctly: __trace_bputs, __trace_puts, __trace_bprintk, and __trace_printk. Link: https://patch.msgid.link/20260502075535.34997-1-tiffany019230@gmail.c= om Suggested-by: David Laight Signed-off-by: Qian-Yu Lin Signed-off-by: Steven Rostedt --- include/linux/trace_printk.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/trace_printk.h b/include/linux/trace_printk.h index 2670ec7f4262..3d54f440dccf 100644 --- a/include/linux/trace_printk.h +++ b/include/linux/trace_printk.h @@ -86,8 +86,7 @@ do { \ =20 #define trace_printk(fmt, ...) \ do { \ - char _______STR[] =3D __stringify((__VA_ARGS__)); \ - if (sizeof(_______STR) > 3) \ + if (sizeof __stringify((__VA_ARGS__)) > 3) \ do_trace_printk(fmt, ##__VA_ARGS__); \ else \ trace_puts(fmt); \ --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 79A6742314D for ; Fri, 22 May 2026 14:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; cv=none; b=dfx+jO7/ng25UKW7kOhanA+SJZCcqkrIX/1gPVtUarvTXbVUTPpw6WSYLhLg3NLwjxiOtW/SXGemI7BBu8pDZzDvt3cttTl+uyAJsCVpiD21Iqb91dJOZM6CkqygR1IbpTxE1Gas6RmPqCkyBXwz7D8p6+EJR+nrK7oRjtt8yMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; c=relaxed/simple; bh=g8zWk/Auc+O62tHUgG59rP/1B1peQZ6Yc4dTuqzongY=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=KPjxwPHGYKGbNtevtQX+N08ksl9J6ZnMRUTqXtoNl36m4bIyH1iwmafcZjOhhdV9QyMquwVsx81EKdHTo4RyeJTlPk6yJ6us+sH/75VdRpVn8H7zJ1LIzeeoIipcWbap16Pxz4ftUv8ivDoOxXfa3p6Ex/++PkVFfuDCQVyWpBk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SmVYEAP7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SmVYEAP7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76B6A1F0155C; Fri, 22 May 2026 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460502; bh=f35kLwIfuNqRDzKotxTnqiCUvLtAR1AirFdxdYehEGo=; h=Date:From:To:Cc:Subject:References; b=SmVYEAP77kjA9zq1XpQg54Z8qzhzrqMVlzcZPjx2WpUdpFo7sq7lS7oeTO3UANzuD GprOgkA3rVbq+W8MPF5q0l1HTlFqOF0VfVHUatEdpVfij1+tDhj6Cr6HmKR7mkkw01 U2Yzay+TQXTCCpnMJRtA88HZRbUVABii0ytUNrbmAkyQCf3o0qZhUJfwdSnqT8PMQP zfOoXWtngCMTbFnQsWm18mn+zrQSt6IvQy7Xy5AFlU0+kayhsvtIBFLugahGMSxcOZ AX1lRUy3X33BR2cdLq32L7kHOZZoC7+2b82rOMVtp+6LFG3/D++r4BofIcOwAb7vrx iIvHxbYRYsVXQ== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyE-0000000668b-0A07; Fri, 22 May 2026 10:35:26 -0400 Message-ID: <20260522143525.896753113@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:14 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Yash Suthar Subject: [for-next][PATCH 06/15] tracing: Switch trace_recursion_record.c code over to use guard() References: <20260522143508.298439732@kernel.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: Yash Suthar Switch mutex_lock()/mutex_unlock() to guard(). also drop the ret local variable and return directly. Link: https://patch.msgid.link/20260502174741.39636-1-yashsuthar983@gmail.c= om Signed-off-by: Yash Suthar Signed-off-by: Steven Rostedt --- kernel/trace/trace_recursion_record.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/trace/trace_recursion_record.c b/kernel/trace/trace_rec= ursion_record.c index 784fe1fbb866..bac4bc844ccd 100644 --- a/kernel/trace/trace_recursion_record.c +++ b/kernel/trace/trace_recursion_record.c @@ -180,9 +180,8 @@ static const struct seq_operations recursed_function_se= q_ops =3D { =20 static int recursed_function_open(struct inode *inode, struct file *file) { - int ret =3D 0; + guard(mutex)(&recursed_function_lock); =20 - mutex_lock(&recursed_function_lock); /* If this file was opened for write, then erase contents */ if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) { /* disable updating records */ @@ -194,10 +193,9 @@ static int recursed_function_open(struct inode *inode,= struct file *file) atomic_set(&nr_records, 0); } if (file->f_mode & FMODE_READ) - ret =3D seq_open(file, &recursed_function_seq_ops); - mutex_unlock(&recursed_function_lock); + return seq_open(file, &recursed_function_seq_ops); =20 - return ret; + return 0; } =20 static ssize_t recursed_function_write(struct file *file, --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B96F244CAF7 for ; Fri, 22 May 2026 14:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; cv=none; b=XXb+lU1oo2Bs0q+N9YDdovkzbed1GU8+ldzsKcwp9yTF27hIAg6wCDPFl0afNo/vX/GLx7ppG47EoqPKgvsVihu6k5hQRlzTVXT41d92XeR6VR3MQD6okCbJMwY7szkFUClvfHGl7Dr5qcqg+HyK3GbKyHStrz5b0+36xxFVRgY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; c=relaxed/simple; bh=Yg4nViD8eroIDCzeAHJgwvJdFxNRQE21mkTt88GLNGc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=oM0NEYI8KHwHAVw2xupTUd1bsW+Yqq8GK0AZ0syg24jtS7gQXKRUgInXYW0rXRiJBccfr9U6kAoGL6GuVEabBnuM1W3nDwvEgPXSIqH+68TImTir5IPlzUE7tfr8FDgzYnIDqN9S2hFaV24HMcDX4Hn7oRA9M/mVUZX+s0RcI+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ULF5XlkM; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ULF5XlkM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EFCA1F0155D; Fri, 22 May 2026 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460502; bh=ijQqHJtJUgjBmy6QZcRPqPa/Mu76ngBC5kDqpwNjP6Y=; h=Date:From:To:Cc:Subject:References; b=ULF5XlkMjZNxaT2eAojtE6Ed45TstQgHWgLTFTU7K6UhdmIiOVfocGaoaOHkNi3QI d9ffJsLypWp7wYr0G6bNmCa0yV7mrhoesxmWwyWo+L+5sl0H8QKPWXNfI+V7yD2yF5 ybZbSJx5jNil5t1p+m1xqTC4G7iQk/8PjG1P9CYPtjRNfOUSMRZvmBDrzZ/jq65pPb ++Wh0O4zbg29rNARhrYccCoETbWes6wShK25tIYxjOlurORx9uBijsVLVVBO1DM6d9 jdfKKWs8+W8LrvAD++dMHRBhfNQ3i23C7kHqo3uySZValN5rrbiSwcctoqmoaF7QEx 1o9/7dmwO2HKQ== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyE-00000006695-0oWX; Fri, 22 May 2026 10:35:26 -0400 Message-ID: <20260522143526.058827124@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:15 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Martin Kaiser Subject: [for-next][PATCH 07/15] tracefs: Fix typo in a comment of eventfs_callback() kerneldoc References: <20260522143508.298439732@kernel.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: Martin Kaiser Fix a typo "evetnfs files" to "eventfs files" in a comment. Cc: Masami Hiramatsu Link: https://patch.msgid.link/20260507081041.885781-2-martin@kaiser.cx Signed-off-by: Martin Kaiser Signed-off-by: Steven Rostedt --- include/linux/tracefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/tracefs.h b/include/linux/tracefs.h index d03f74658716..bc354d340046 100644 --- a/include/linux/tracefs.h +++ b/include/linux/tracefs.h @@ -30,7 +30,7 @@ struct eventfs_file; * @data: data to pass to the created file ops * @fops: the file operations of the created file * - * The evetnfs files are dynamically created. The struct eventfs_entry arr= ay + * The eventfs files are dynamically created. The struct eventfs_entry arr= ay * is passed to eventfs_create_dir() or eventfs_create_events_dir() that w= ill * be used to create the files within those directories. When a lookup * or access to a file within the directory is made, the struct eventfs_en= try --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B94C144CAE0 for ; Fri, 22 May 2026 14:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460506; cv=none; b=orBCz7D3QW5AeZ5GAOg+Uazcuj4GTVWr0uUEcpGbwiwDyQJYPEjDnjiga89s4UDFU8oxxpw5vJnbotFcDXINH8uiha0LmiFMnV2K7KPM9P7zhZ4CfLO9DKO5V2Xt/PIp2vdGZdPpYJQK4EXv7AuNmyPYlDuZKC9ZRepn4VSrYcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460506; c=relaxed/simple; bh=WqrfXFyOkKW8+X6Q2Ei5AotDeyZFf5v7BmImt3DImBY=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=bq742F7cUkiZoWKTWnz0zzNswfYibv8b0/b5p8LLyuvY9KxuG6AZnOmj/SGLB4b7CHnoIkwDX/2DJcuTa8vDhkXG5g2jWydeGBjSHGA+YOWq3D65uCsYRRs321RcXU+ya5vA+e9O7aZSXLc3G3g9shluSVnc4tz0tCZ2AoDkF7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ez7WY4E4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ez7WY4E4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFAA01F0155E; Fri, 22 May 2026 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460502; bh=IIFnHKA4qq6B5W3fFSCXAFWllXAtq38mkuCLRGyMKQI=; h=Date:From:To:Cc:Subject:References; b=Ez7WY4E4HSZk5eobOGX9p1YDBWPlzshSzAaDWLvUXCOajZ42wHjA9+yipeltFgeW4 ardAKqVxIIKNtpR8acTRhHosrMZsqYXZcYgz9B4SBCUEI4s/mAyffwSw7M2bD7IYXr O2normjnYjBRNNtWVYa448uWcvDtdxHgEcnh7hCjrhxieaGUldDvSrWoqi9nktw4ar 21gLeRXil2IbOvvvjOP8jmeYpxwSwz78sEI9dbbxZMcC/nMKed8tWPauchDRq/h3ua xoiHkv7OqQKWXgETtSE3guo5DQOq2fvZBTB0Olh3+QPi+x768cGruPq0mMy2h8LNxX oBk+e5QC31lYQ== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyE-0000000669c-1SmW; Fri, 22 May 2026 10:35:26 -0400 Message-ID: <20260522143526.212452748@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:16 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Huang Rui , "Rafael J. Wysocki" , Viresh Kumar , Peter Zijlstra , Mario Limonciello , "Vineeth Pillai (Google)" Subject: [for-next][PATCH 08/15] cpufreq: amd-pstate: Use trace_call__##name() at guarded tracepoint call site References: <20260522143508.298439732@kernel.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: Vineeth Pillai Replace trace_foo() with the new trace_call__foo() at sites already guarded by trace_foo_enabled(), avoiding a redundant static_branch_unlikely() re-evaluation inside the tracepoint. trace_call__foo() calls the tracepoint callbacks directly without utilizing the static branch again. Cc: Huang Rui Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Link: https://patch.msgid.link/20260515140121.2239414-1-vineeth@bitbyteword= .org Suggested-by: Steven Rostedt Suggested-by: Peter Zijlstra Assisted-by: Claude:claude-sonnet-4-6 Reviewed-by: Mario Limonciello Signed-off-by: Vineeth Pillai (Google) Signed-off-by: Steven Rostedt --- drivers/cpufreq/amd-pstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 453084c67327..4722de25149b 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -368,7 +368,8 @@ static int amd_pstate_set_floor_perf(struct cpufreq_pol= icy *policy, u8 perf) =20 out_trace: if (trace_amd_pstate_cppc_req2_enabled()) - trace_amd_pstate_cppc_req2(cpudata->cpu, perf, changed, ret); + trace_call__amd_pstate_cppc_req2(cpudata->cpu, perf, changed, + ret); return ret; } =20 --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B939C44CAC6 for ; Fri, 22 May 2026 14:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; cv=none; b=u312xhCDbv7Vovb1zYN9g/bd9obs3nguCLs7sui551+eXlVgVauNVmkJJd3mONg5bmST2OpoltoauuFXWdfMjzZSirHmGSOxN76Z3RvasyvxnG1d7jp3D/c85GJ3Eu0VGOE/WD75b2WoNkJZC7sMLjExTZkKOKeyclX0Ec4bHlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; c=relaxed/simple; bh=rbEzG2QH3FRIeCZgOWnD0XdQHQBha+223d8Pn4OWdCk=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=aXpjf/nyp1VAeVEYJ2JenePmPG++G+1ntE9bVvPDqWYRKudl9/CEVD9XQZqUq3gB+MLcGLm1feoXc5n44429UUEhTuE5291yggV2ahFQL+2ive9CQb0sd+4Rgxn8sgOwHi9c7xNQYpI/u5U4kc88RcjAvYLfaSOb4QFP7GIcvEU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XmmgyYBb; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XmmgyYBb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD0D91F0155F; Fri, 22 May 2026 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460502; bh=yLwzrRHVNC7sOHFhR2t1r6cVUt0IxH3X7J2ZXqbU/e8=; h=Date:From:To:Cc:Subject:References; b=XmmgyYBb47Ve6b6lvIkV3mEecdMAj8vAlhadBXhed4B7LkkdrbSxPH+w4vCVzW5TX oFbFhit166N5apQJaVVo7LAHCsoXU3GoOGXsTde602YrRdtxZixIbD9AOeAXW0xgGN cRLWNQqbiMwJlqRhu6fwY+QZmWwSgJpd1sxRYoRdg+HyxqeAnLs8FP0/a4vZi3RnNI v7fvOdgLrC0rk2cyWpo8fD6qQ69FBCNsr9MxTnDkuh3BuuMunIL/bMXxoD3HoSQ8+Q dyt1eit/iXW9d8sAWR8DbMQtmqTjR2VeYbZWWGiEQcL+ZUwG5ti22zwN+Wvm1hzYZw LcRGzBSn+n58Q== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyE-000000066A7-27Aw; Fri, 22 May 2026 10:35:26 -0400 Message-ID: <20260522143526.368163811@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:17 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires , Peter Zijlstra , "Vineeth Pillai (Google)" Subject: [for-next][PATCH 09/15] HID: Use trace_call__##name() at guarded tracepoint call sites References: <20260522143508.298439732@kernel.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: Vineeth Pillai Replace trace_foo() with the new trace_call__foo() at sites already guarded by trace_foo_enabled(), avoiding a redundant static_branch_unlikely() re-evaluation inside the tracepoint. trace_call__foo() calls the tracepoint callbacks directly without utilizing the static branch again. Original v2 series: https://lore.kernel.org/linux-trace-kernel/20260323160052.17528-1-vineeth@b= itbyteword.org/ Parts of the original v2 series have already been merged in mainline. This patch is being reposted as a follow-up cleanup for the remaining unmerged pieces. Cc: Srinivas Pandruvada Cc: Jiri Kosina Cc: Benjamin Tissoires Link: https://patch.msgid.link/20260515135941.2238861-1-vineeth@bitbyteword= .org Suggested-by: Steven Rostedt Suggested-by: Peter Zijlstra Signed-off-by: Vineeth Pillai (Google) Assisted-by: Claude:claude-sonnet-4-6 Signed-off-by: Steven Rostedt --- drivers/hid/intel-ish-hid/ipc/pci-ish.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-is= h-hid/ipc/pci-ish.c index ed3405c05e73..8d36ae96a3ee 100644 --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c @@ -110,7 +110,7 @@ void ish_event_tracer(struct ishtp_device *dev, const c= har *format, ...) vsnprintf(tmp_buf, sizeof(tmp_buf), format, args); va_end(args); =20 - trace_ishtp_dump(tmp_buf); + trace_call__ishtp_dump(tmp_buf); } } =20 --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 A922044BC8E for ; Fri, 22 May 2026 14:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460507; cv=none; b=rnVmzq4S7WVo8wkWJCa3h3KyCrpFdTm9NAuB5qkL71itWTx4K2AMq+MAruFeL8NFEQ1gxw3uBxOAxKxWFBggK+hP2rDvrKFBfYQr7sDO1dYW+IMvD+doFGJopXcvvNIXykUObzyf18ABqdEs0xWZcfT31pnSSGUiBneI30rNO0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460507; c=relaxed/simple; bh=vYWRFAjVeuVzDzRxjaGpHF17Ws0kCrh9LCXEzjYt6Hc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=C/WGgGKxOg+meXPJvwylm/l1KPv5MaGX5Lu7EWvc+hDS87PqMx3JO4H2DI5CCc9gNHZsglZZz/Y8bHwFZqXMlnluN2E4+7YWZrsuMsDT4ACXeSrVKH7DFyPHv2J1H03+PSXT87OW1uXMfjYza/rxAJHlxYQetfZ3bj0uJctJmNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lSfjyQDh; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lSfjyQDh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E1691F00ADE; Fri, 22 May 2026 14:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460503; bh=KdaYUs9sUq5Agjn/nTlDwu47m8ybbTggHMIUaFT+UFo=; h=Date:From:To:Cc:Subject:References; b=lSfjyQDhJPqWv5HSxHsijXL2NDIhA6suXxZbcXTOnrocNPpMERp4GeQ2b0IJ+Cic9 pTof/OUIYz59lGwwd4WlXFlh/9rRbtEUDXvJ/7uFLe7LXqXLjCURuK5SWHZbswZ20V IxC0M99b00ecCicmh9RM3V6Z8Gy4uAo7mQtlZnZFtYUErdtu6uFm/T5G4GdUr4j8m1 GJwahNYYM1jp+qiES3c7LutlFX2HsGrpDLrH8v5DLxDrJYzDa/YRZDhCyKwLO/QpXn qr1FT7FKDCxLir9uSYLz8CrxXihmvR/r/XcHZsimL6tLksrZWfPc7vDoqwd+aqnnfq oaVENMwe4ezgQ== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyE-000000066Ac-2lb3; Fri, 22 May 2026 10:35:26 -0400 Message-ID: <20260522143526.523134137@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:18 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Arnaldo Carvalho de Melo , Jiri Olsa , Peter Zijlstra , Ian Rogers , Namhyung Kim Subject: [for-next][PATCH 10/15] tracing: Allow perf to read synthetic events References: <20260522143508.298439732@kernel.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 Currently, perf can not enable synthetic events. When it does, it either causes a warning in the kernel or errors with "no such device". Add the necessary code to allow perf to also attach to synthetic events. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://patch.msgid.link/20260513150007.3b280e87@gandalf.local.home Reported-by: Ian Rogers Acked-by: Namhyung Kim Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_synth.c | 121 +++++++++++++++++++++++------- 1 file changed, 94 insertions(+), 27 deletions(-) diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_= synth.c index 39ac4eba0702..e6871230bde9 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -499,28 +499,19 @@ static unsigned int trace_stack(struct synth_trace_ev= ent *entry, return len; } =20 -static void trace_event_raw_event_synth(void *__data, - u64 *var_ref_vals, - unsigned int *var_ref_idx) +static __always_inline int get_field_size(struct synth_event *event, + u64 *var_ref_vals, + unsigned int *var_ref_idx) { - unsigned int i, n_u64, val_idx, len, data_size =3D 0; - struct trace_event_file *trace_file =3D __data; - struct synth_trace_event *entry; - struct trace_event_buffer fbuffer; - struct trace_buffer *buffer; - struct synth_event *event; - int fields_size =3D 0; - - event =3D trace_file->event_call->data; - - if (trace_trigger_soft_disabled(trace_file)) - return; + int fields_size; =20 fields_size =3D event->n_u64 * sizeof(u64); =20 - for (i =3D 0; i < event->n_dynamic_fields; i++) { + for (int i =3D 0; i < event->n_dynamic_fields; i++) { unsigned int field_pos =3D event->dynamic_fields[i]->field_pos; char *str_val; + int val_idx; + int len; =20 val_idx =3D var_ref_idx[field_pos]; str_val =3D (char *)(long)var_ref_vals[val_idx]; @@ -535,18 +526,18 @@ static void trace_event_raw_event_synth(void *__data, =20 fields_size +=3D len; } + return fields_size; +} =20 - /* - * Avoid ring buffer recursion detection, as this event - * is being performed within another event. - */ - buffer =3D trace_file->tr->array_buffer.buffer; - guard(ring_buffer_nest)(buffer); - - entry =3D trace_event_buffer_reserve(&fbuffer, trace_file, - sizeof(*entry) + fields_size); - if (!entry) - return; +static __always_inline void write_synth_entry(struct synth_event *event, + struct synth_trace_event *entry, + u64 *var_ref_vals, + unsigned int *var_ref_idx) +{ + int data_size =3D 0; + int i, n_u64; + int val_idx; + int len; =20 for (i =3D 0, n_u64 =3D 0; i < event->n_fields; i++) { val_idx =3D var_ref_idx[i]; @@ -587,10 +578,83 @@ static void trace_event_raw_event_synth(void *__data, n_u64++; } } +} + +static void trace_event_raw_event_synth(void *__data, + u64 *var_ref_vals, + unsigned int *var_ref_idx) +{ + struct trace_event_file *trace_file =3D __data; + struct synth_trace_event *entry; + struct trace_event_buffer fbuffer; + struct trace_buffer *buffer; + struct synth_event *event; + int fields_size; + + event =3D trace_file->event_call->data; + + if (trace_trigger_soft_disabled(trace_file)) + return; + + fields_size =3D get_field_size(event, var_ref_vals, var_ref_idx); + + /* + * Avoid ring buffer recursion detection, as this event + * is being performed within another event. + */ + buffer =3D trace_file->tr->array_buffer.buffer; + guard(ring_buffer_nest)(buffer); + + entry =3D trace_event_buffer_reserve(&fbuffer, trace_file, + sizeof(*entry) + fields_size); + if (!entry) + return; + + write_synth_entry(event, entry, var_ref_vals, var_ref_idx); =20 trace_event_buffer_commit(&fbuffer); } =20 +#ifdef CONFIG_PERF_EVENTS +static void perf_event_raw_event_synth(void *__data, + u64 *var_ref_vals, + unsigned int *var_ref_idx) +{ + struct trace_event_call *call =3D __data; + struct synth_trace_event *entry; + struct hlist_head *perf_head; + struct synth_event *event; + struct pt_regs *regs; + int fields_size; + size_t size; + int context; + + event =3D call->data; + + perf_head =3D this_cpu_ptr(call->perf_events); + + if (!perf_head || hlist_empty(perf_head)) + return; + + fields_size =3D get_field_size(event, var_ref_vals, var_ref_idx); + + size =3D ALIGN(sizeof(*entry) + fields_size, 8); + + entry =3D perf_trace_buf_alloc(size, ®s, &context); + + if (unlikely(!entry)) + return; + + write_synth_entry(event, entry, var_ref_vals, var_ref_idx); + + perf_fetch_caller_regs(regs); + + perf_trace_buf_submit(entry, size, context, + call->event.type, 1, regs, + perf_head, NULL); +} +#endif + static void free_synth_event_print_fmt(struct trace_event_call *call) { if (call) { @@ -917,6 +981,9 @@ static int register_synth_event(struct synth_event *eve= nt) call->flags =3D TRACE_EVENT_FL_TRACEPOINT; call->class->reg =3D synth_event_reg; call->class->probe =3D trace_event_raw_event_synth; +#ifdef CONFIG_PERF_EVENTS + call->class->perf_probe =3D perf_event_raw_event_synth; +#endif call->data =3D event; call->tp =3D event->tp; =20 --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 3ED061E7660 for ; Fri, 22 May 2026 14:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; cv=none; b=iJxqmk/7S0GdH/31jcHuxa1TtBAzzXQbqJPR1apK+W1KVCojbCiP732mmQk3fu/WJ3Z98B5ZrBpRjaeOO7jlIh+4Nm7o0jhexe02QyvQVgeiWRgwDb1sLl+fmJ1k9/ntfgiXQV5yRv8QFprf2Vm0jS5A5G4iNsaMB6RhbBXaqdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; c=relaxed/simple; bh=BX38CM460Fjq5MMVY32wb9LV5o8bKGCXH3LvScDnZJE=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=F8OkIY3U9YFhohh1Qmv/Z/xnBpNmrMx9mzh6o0DRGl/zTWbzb8e9khZ5gIF59TQAknxNLgsRGUzZx/iHq+pTr5RfJcZsJbjsWFMVjJFxUeBb58jhc6UAFpAyV7TvqgYgW6A3to5pAl0e3S9mm52qzRWC6UUmzA8Ck8y/W5Zof+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HhV+OQt/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HhV+OQt/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3664D1F01560; Fri, 22 May 2026 14:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460503; bh=AqkdezbHY+HJ4XpYSJU7DCiqRYX9RaOgqFVaeXayMl4=; h=Date:From:To:Cc:Subject:References; b=HhV+OQt/bGD8LJ+Cl4yaVjXBugq3N5I43UNrU26uDG75IlXGOshIedaGLOl9Btuwm r41JHlt2AFhw4kPxSwIQIG3WLoPx36zDmeh+4xX5+Qe9bBOWkp3FPL9tOhMUCbKuJD zG3EK12WtCa1no6qFWfBhQowbfl6ms4r1Cn0WLQ4i1V584BFmKXE2WRc4oGpkeUdGK zy3VNlJF/DhdZlKRu3hgwwLlV2dnTpgYIlaZ3DdUVsZVTFrr7I06lc5KFW3gbXV3I5 kmufO+w5xzRNFLruS1eY6ZyorB49w0M8UIZHDCqAzRtELLtR5S+HftdXdw5C1IH1pf XzqZcnikp+XJQ== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyE-000000066B8-3PaC; Fri, 22 May 2026 10:35:26 -0400 Message-ID: <20260522143526.677642818@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:19 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Yu Peng Subject: [for-next][PATCH 11/15] tracing/branch: Use pr_warn() instead of printk(KERN_WARNING) References: <20260522143508.298439732@kernel.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: Yu Peng Use pr_warn() instead of printk(KERN_WARNING ...) for the branch tracer warning messages. Keep the message text unchanged. The change only removes the open-coded log level from these warnings. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260519081620.3874441-1-pengyu@kylinos.cn Signed-off-by: Yu Peng Signed-off-by: Steven Rostedt --- kernel/trace/trace_branch.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index d1564db95a8f..d8e97ad798f0 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c @@ -181,8 +181,7 @@ __init static int init_branch_tracer(void) =20 ret =3D register_trace_event(&trace_branch_event); if (!ret) { - printk(KERN_WARNING "Warning: could not register " - "branch events\n"); + pr_warn("Warning: could not register branch events\n"); return 1; } return register_tracer(&branch_trace); @@ -374,8 +373,7 @@ __init static int init_annotated_branch_stats(void) =20 ret =3D register_stat_tracer(&annotated_branch_stats); if (ret) { - printk(KERN_WARNING "Warning: could not register " - "annotated branches stats\n"); + pr_warn("Warning: could not register annotated branches stats\n"); return ret; } return 0; @@ -439,8 +437,7 @@ __init static int all_annotated_branch_stats(void) =20 ret =3D register_stat_tracer(&all_branch_stats); if (ret) { - printk(KERN_WARNING "Warning: could not register " - "all branches stats\n"); + pr_warn("Warning: could not register all branches stats\n"); return ret; } return 0; --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 223E744DB73 for ; Fri, 22 May 2026 14:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; cv=none; b=DxZ43XNeN1htHaYwx8BkIKmG3rwTICJZ+8Ft/IP/xItVFahb9whruEuJXR/nAuYc6FS1HX1cJMd5uhDth2hKXXFtdTYsAii0H9nzVjgShSYMz9avpJe20p09oFxqqFxXyaL3VaNpgAuAWLb34rcZlUXMcFZmCq4C7KtpxgR9LSw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460505; c=relaxed/simple; bh=jY+x/NHFlh23eJCFlQoaY3OuKIiwHKJ3cNAQRdrOTbc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=WEZDMXfog/BBTSwHsleeJhQRNaHzC6l5zIddRTwYCurNgEsiHHF1fQuP/Qss0k/1pYB4ppcMgC5PkZeUz4SXHpnal4CejIXAskdQOP2cnigG+i+UGQiW4VP9rjHhYuvsOH23terd8e1nO6ps9HZ4GvUKbykkFLTozfcQ9G7BUT4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BAFFlSlB; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BAFFlSlB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C7CB1F01561; Fri, 22 May 2026 14:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460503; bh=3dNjfvyvVVsoRoVMfzr/Nde5yF6F/Nc35akU3BHHVkQ=; h=Date:From:To:Cc:Subject:References; b=BAFFlSlBga9Wzm54uf/NDloULB/dFbsFfDj981FS7t3veg1b8s78FaOw+O6dRhuQE YtrUOGZBzfHilQ5RHAMSwphNP6WpOqvu0Px5UHr00aT6gU5uARtOdHwTtCC0LK1iY0 4C8h5lvELmiWg0n+eIlGz+R+ge3MiStdc6aZWQ2iu1VxWUrsSiHPY+LfI2rpLkhGzZ sgFyYfSv1GfBkAaKwd8fxCURSAVp+J9UYj4dvnw8ShG/gWwWJ5FuvIuULvZnIJMr0w eZN9t1XDZhRKjbbGpIvmcRd7nHqqn9t3I8jCbVmdOKSjsvCm9VY3WC4uDVohz8mOdP FYkXIXtI6WfbA== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyE-000000066Bc-43p4; Fri, 22 May 2026 10:35:26 -0400 Message-ID: <20260522143526.835124644@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:20 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Yu Peng Subject: [for-next][PATCH 12/15] tracing: Use krealloc_array() for trace option array growth References: <20260522143508.298439732@kernel.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: Yu Peng Use krealloc_array() when growing tr->topts instead of open-coding the size calculation in krealloc(). This makes the resize path use the helper intended for array allocations and avoids manual multiplication of the element count and element size. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260519083409.3885032-1-pengyu@kylinos.cn Signed-off-by: Yu Peng Signed-off-by: Steven Rostedt --- kernel/trace/trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 6eb4d3097a4d..aec3f31ed027 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -7928,8 +7928,8 @@ create_trace_option_files(struct trace_array *tr, str= uct tracer *tracer, if (!topts) return 0; =20 - tr_topts =3D krealloc(tr->topts, sizeof(*tr->topts) * (tr->nr_topts + 1), - GFP_KERNEL); + tr_topts =3D krealloc_array(tr->topts, tr->nr_topts + 1, sizeof(*tr->topt= s), + GFP_KERNEL); if (!tr_topts) { kfree(topts); return -ENOMEM; --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C8C89451062 for ; Fri, 22 May 2026 14:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460506; cv=none; b=iOA+n+MSRk6Hvv0cu+aiEUYfETnaTLWu/3HWH+ySHHQIvjAz1MnEvLQuC4AwgPHvTkeUHyYNVobWtL+LJmKN8c/Hpqs57+Wkn6lkTVbMwXxN4r4AMNlngmvDcrEaaQPAOabEs+HxB54E8SDhDJIuze0APULRHAwhXdoZMd1zd6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460506; c=relaxed/simple; bh=i2VATB9/cotPUgXNt9f+I0mRR9a8q9xW9hHHr3Ie/2I=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=dQXEdokgYEmzgZ9Zsn3WjWdXMbXTZncIiHUl1m7VUGT73eEJ4zrwKqFoDe23qtu48qwPWSfVyoUkwEApHd7OKawA7rbSfOoEqPa8NFFTUZp0GgIXgrJDcyFZiCB5KPWHGctdCpMozXotPg0si9/Ei+gmq8tYr7tkfau+st3lJJ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HS02Elxl; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HS02Elxl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7869C1F01562; Fri, 22 May 2026 14:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460503; bh=1wSqJ1Izd8QIdYWu6lg+p68tM8vQpQuwsHkF8XnS0C0=; h=Date:From:To:Cc:Subject:References; b=HS02ElxlX+O6awFg0BtiD3dxYGiHajn7n7Q1+XXs+YvAAcedwtax788pn1WqGAbPy 1HIB1Oyl+4Q5StM8ogXIsu59g8XSsAsLt5EBdDt4HaRo6aRtOuFjXKZvcKfEwIc9N3 dY7/iWNSZz57qwrbLP+xUHg9JgTWSHQ2TEPMMnoTg4PDvcfUdKOIqglSVRgHNSGIrb KrxmZhEHuKY+57ad9ihekidee291E0zw22XUJ+yxN+GzXRBMSEIl9Q2jnFMCmqlhPW LPX19glbw3c4O2I/Y30ERcIhOCZuCYXpb+RnOBgPvssodeD7wvFmxheZoFqyMZjsHE +IMtolqULHnTQ== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyF-000000066C8-0VPn; Fri, 22 May 2026 10:35:27 -0400 Message-ID: <20260522143526.986589078@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:21 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Ao Sun Subject: [for-next][PATCH 13/15] tracing: Fix README path for synthetic_events References: <20260522143508.298439732@kernel.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: Ao Sun The events/ prefix should be removed, since synthetic_events is now directly under the tracing root directory. Cc: Cc: Link: https://patch.msgid.link/20260521015211.111-1-ao.sun@transsion.com Signed-off-by: Ao Sun Signed-off-by: Steven Rostedt --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index aec3f31ed027..4218c174460b 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4474,7 +4474,7 @@ static const char readme_msg[] =3D "\t snapshot() - snapshot the trace buff= er\n\n" #endif #ifdef CONFIG_SYNTH_EVENTS - " events/synthetic_events\t- Create/append/remove/show synthetic events\= n" + " synthetic_events\t- Create/append/remove/show synthetic events\n" "\t Write into this file to define/undefine new synthetic events.\n" "\t example: echo 'myevent u64 lat; char name[]; long[] stack' >> syn= thetic_events\n" #endif --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C8D92451064 for ; Fri, 22 May 2026 14:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460506; cv=none; b=iMi14caqFVCp7fn6ovgCGTrf9yz5pUwnbsbTGrbBuYY84fsJENu+qa7t1oPcil+4Yy71Dk9ZeOVaSU6RBnWT1DdPPcnuhWQxYajdmttA9bkBShAb9Wk5xb+cTx4WHl5cN4Yj13x8DP2w5y38GYzTh/4e0+ZinAHsCzk0KLWdQwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460506; c=relaxed/simple; bh=ML5DPmH8xDlMiMsCh4nnqHrdM6tVPBcebCq7uFh9bRA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=tUV+Twm9IqAL03OEpQD0o3VrvpzRWl5mwcTsqKetaIz53qm9s8NFBEfLo74phLEXx5dN2LecdUW/WYsc340fQK4Cyt7ehhWwZHB4R/qVpiCwpRxyCFpuQvxS9l7LR1vSj0yXVdD7opy2Ge5txxABoyp04auS71KqsS6cKonRhE0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=R6P0CeHQ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="R6P0CeHQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CEB91F000E9; Fri, 22 May 2026 14:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460503; bh=Lek57FEU9LjQRAZbraWhQYi0Mm3HHqNBbES1zu8B+Kw=; h=Date:From:To:Cc:Subject:References; b=R6P0CeHQzlZdkGvdZ1Unmhb30RXhXjJkD3Umh1YiSEFKLmhUoL+mTSzrujqBO1XR0 iljWCf0vwgIkyPS2XJNo+lVYriJcrApMqWZkZ35aQ0r4ZzCuno/zP4wVn4ni2oUikY 9TlkSeKtz+J6I5D0ZtwxRH4++/6uJKIitM5zEjsfr48InvWJHT4Eov/jinh1aBKygC 60fshZBs6k70cPBwE+3eAW5hrUiFi9rWKRYymRb35l8T9WyI8cpfaHNzpKpL0LRKxi d8yABIjZCxAU8Gz6++X0sWPA2x2D7nZzTy6qb5eE4FIB3vjXhhSHZWDCHOH3R/QlON y2G6p33RPk0og== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyF-000000066Cd-19Co; Fri, 22 May 2026 10:35:27 -0400 Message-ID: <20260522143527.139109060@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:22 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Kees Cook , "Gustavo A. R. Silva" , Rosen Penev Subject: [for-next][PATCH 14/15] tracing: Simplify pages allocation for tracing_map logic References: <20260522143508.298439732@kernel.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: Rosen Penev Change to a flexible array member to allocate together with the array struct. Simplifies code slightly by removing no longer correct null checks for pages and removing kfrees. Cc: Mathieu Desnoyers Cc: Kees Cook Cc: "Gustavo A. R. Silva" Link: https://patch.msgid.link/20260520215006.12008-1-rosenp@gmail.com Signed-off-by: Rosen Penev Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt --- kernel/trace/tracing_map.c | 30 +++++++++++------------------- kernel/trace/tracing_map.h | 2 +- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c index 0dd7927df22a..d7922f40dbe2 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -288,9 +288,6 @@ static void tracing_map_array_clear(struct tracing_map_= array *a) { unsigned int i; =20 - if (!a->pages) - return; - for (i =3D 0; i < a->n_pages; i++) memset(a->pages[i], 0, PAGE_SIZE); } @@ -302,9 +299,6 @@ static void tracing_map_array_free(struct tracing_map_a= rray *a) if (!a) return; =20 - if (!a->pages) - goto free; - for (i =3D 0; i < a->n_pages; i++) { if (!a->pages[i]) break; @@ -312,9 +306,6 @@ static void tracing_map_array_free(struct tracing_map_a= rray *a) free_page((unsigned long)a->pages[i]); } =20 - kfree(a->pages); - - free: kfree(a); } =20 @@ -322,24 +313,25 @@ static struct tracing_map_array *tracing_map_array_al= loc(unsigned int n_elts, unsigned int entry_size) { struct tracing_map_array *a; + unsigned int entry_size_shift; + unsigned int entries_per_page; + unsigned int n_pages; unsigned int i; =20 - a =3D kzalloc_obj(*a); + entry_size_shift =3D fls(roundup_pow_of_two(entry_size) - 1); + entries_per_page =3D PAGE_SIZE / (1 << entry_size_shift); + n_pages =3D max(1, n_elts / entries_per_page); + + a =3D kzalloc_flex(*a, pages, n_pages); if (!a) return NULL; =20 - a->entry_size_shift =3D fls(roundup_pow_of_two(entry_size) - 1); - a->entries_per_page =3D PAGE_SIZE / (1 << a->entry_size_shift); - a->n_pages =3D n_elts / a->entries_per_page; - if (!a->n_pages) - a->n_pages =3D 1; + a->entry_size_shift =3D entry_size_shift; + a->entries_per_page =3D entries_per_page; + a->n_pages =3D n_pages; a->entry_shift =3D fls(a->entries_per_page) - 1; a->entry_mask =3D (1 << a->entry_shift) - 1; =20 - a->pages =3D kcalloc(a->n_pages, sizeof(void *), GFP_KERNEL); - if (!a->pages) - goto free; - for (i =3D 0; i < a->n_pages; i++) { a->pages[i] =3D (void *)get_zeroed_page(GFP_KERNEL); if (!a->pages[i]) diff --git a/kernel/trace/tracing_map.h b/kernel/trace/tracing_map.h index 99c37eeebc16..18a02959d77b 100644 --- a/kernel/trace/tracing_map.h +++ b/kernel/trace/tracing_map.h @@ -167,7 +167,7 @@ struct tracing_map_array { unsigned int entry_shift; unsigned int entry_mask; unsigned int n_pages; - void **pages; + void *pages[] __counted_by(n_pages); }; =20 #define TRACING_MAP_ARRAY_ELT(array, idx) \ --=20 2.53.0 From nobody Sun May 24 20:33:09 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0BC1245106F for ; Fri, 22 May 2026 14:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460506; cv=none; b=ito1pWKEEgKezb1gQEzFSmZNiA5a0WHtos8ukfTV60aZIzIL0Bq+kLFoyiRH9or2dGOVYd9VRzc3vP0ZyAxI0DZx6j6GaQuF9fr+Pon2MlYuTtnMi3uBD+ICUrR7lYKhyfkVndX5mqOwbjgBWNpf6qG/WH/DCOzEepwlS+f/iJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779460506; c=relaxed/simple; bh=gwvlT/lbA79VyFOYkidlTTqu6RBkMgG7kbw9GDUEKD8=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=b2oePVXfShARo+xe5f+9rphJ55cpbbYrVpIC9QDn1tdkRbGKHrhSvhY4O5Y2In9QDwO2CkJWA40JICPvr3LJ3uP/wgO5CEdqbSIzWKbHhAP+C3FH9sjTvcuy7FD1KppffRm6ZXJh2qHchrrVVj5muLj2c14XCiKS+LeFjR+aVLg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H81glnre; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H81glnre" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA3E11F00A3D; Fri, 22 May 2026 14:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779460503; bh=bhb0AJjPF1bypb3xLG8icThue8VlQwGjbSGE6pWziVE=; h=Date:From:To:Cc:Subject:References; b=H81glnrebRGk16EiHBMWWn7diHvZ9rhFyHrrKKIj0xvGJhaQPjEicg62E0YAevyIN Mw6tINoMugggDR8fn6An6GZ22J5jxdN1VS6r3OvRl8EC6F2OyVpNgfj1m0CJgNWEMM ynePZKHGAugm1+JYEmk/ETvLFe9a6tANk1Mwo3R47d8zVG99Z29qY8/BaQhxzczjrZ zGaKhB3fqqEcElN5Db5mn5D9aRAF8SwRolFFn8DXFYMlougf7+fu1noZPYwr++kRXl cq8ehfVgVjfFDNaRqx1mTJAudjYVMsoMpeAaevJNyvLFWg5MUCCeSoXD9qJaSZ1DZ8 Qz+snkPEFh6yw== Received: from rostedt by gandalf with local (Exim 4.99.2) (envelope-from ) id 1wQQyF-000000066D8-1qsO; Fri, 22 May 2026 10:35:27 -0400 Message-ID: <20260522143527.293032377@kernel.org> User-Agent: quilt/0.69 Date: Fri, 22 May 2026 10:35:23 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-next][PATCH 15/15] tracing: Move trace_iterator_increment() into trace_find_next_entry_inc() References: <20260522143508.298439732@kernel.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 trace_iterator_increment() is only called from trace_find_next_entry_inc(). It's a small enough function that really doesn't need to be separated. Move the code from trace_iterator_increment() into trace_find_next_entry_inc() and remove trace_iterator_increment(). Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260521095026.20c9799d@gandalf.local.home Signed-off-by: Steven Rostedt --- kernel/trace/trace.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 4218c174460b..ae527c419508 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2338,15 +2338,6 @@ void trace_last_func_repeats(struct trace_array *tr, __buffer_unlock_commit(buffer, event); } =20 -static void trace_iterator_increment(struct trace_iterator *iter) -{ - struct ring_buffer_iter *buf_iter =3D trace_buffer_iter(iter, iter->cpu); - - iter->idx++; - if (buf_iter) - ring_buffer_iter_advance(buf_iter); -} - static struct trace_entry * peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts, unsigned long *lost_events) @@ -2676,11 +2667,17 @@ struct trace_entry *trace_find_next_entry(struct tr= ace_iterator *iter, /* Find the next real entry, and increment the iterator to the next entry = */ void *trace_find_next_entry_inc(struct trace_iterator *iter) { + struct ring_buffer_iter *buf_iter; + iter->ent =3D __find_next_entry(iter, &iter->cpu, &iter->lost_events, &iter->ts); =20 - if (iter->ent) - trace_iterator_increment(iter); + if (iter->ent) { + iter->idx++; + buf_iter =3D trace_buffer_iter(iter, iter->cpu); + if (buf_iter) + ring_buffer_iter_advance(buf_iter); + } =20 return iter->ent ? iter : NULL; } --=20 2.53.0