From nobody Sat Feb 7 14:52:51 2026 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 EBEAB3112C9 for ; Tue, 27 Jan 2026 15:06:05 +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=1769526366; cv=none; b=PxYRpmRVttSrDpupNO127XmWuwgPXuOb9/6bOkjYKynH7RubRiVM2OgotXjsq11oHZMN7Bwy0zeFRmryMyOWxmvMrCu92kkoGvRuehlg8aaf3MYoYMlCXguEfHSKE6M+OhcgTBNhTkdvcJEBhb90lebJIRxgMfnxUwLC8DRnKTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526366; c=relaxed/simple; bh=1F2GeyFoZht5dtnWbw33ntwDY2+SMhAOmStyZRAl73U=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=PvoUB/kOl+FWFB1SzEzrBN63jgyJzz/ku5lrrYePr2DromSYSP3uez9ee7FQf4SjV/i9EE65B66mszoj06OVdcq2N5z5wRkuo4PtLpddr4OlZpuqUvpTHrGcJRwk1dYRpME5U0OpMFkyniOMebFBicUOZIPibtgLRL6qE8G9zbc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q9rkY/gB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q9rkY/gB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B389CC116C6; Tue, 27 Jan 2026 15:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526365; bh=1F2GeyFoZht5dtnWbw33ntwDY2+SMhAOmStyZRAl73U=; h=Date:From:To:Cc:Subject:References:From; b=q9rkY/gBOih02mv2Pjeg+LxV2UUZ6g5d0ZAm1sgGD7YypjgabvpsLNWDq9qfuyegB NXlSmAoJ0FmVmEcMpTNBE1qbA/8A3zAYLTZeOzl39ODk7Av1YOMZzug6KcT5zMawpr ZNamrQLIH+EbvOilYgbJ2O/4UhjQ4YVTPkVMwCY+yR4N0ecmrG58oAAa3qQYxmaohg n1tvMH3ViRXm4YOn91r5zQI/0+VmAVUKVNpT7+w0ayd55m0LuU3LrbPQyfknNg9XlI Tkx2NbD9ODJhwADEDClLA4rSIomhpbI3Vzq+3I/wkJ/WOETUbjiWWZH0vy5J/gpMdN H0sbWdyULp7hw== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdv-00000000Lac-2aE5; Tue, 27 Jan 2026 10:06:11 -0500 Message-ID: <20260127150611.473025749@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:05:56 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Tom Zanussi , Miaoqian Lin Subject: [for-next][PATCH 01/15] tracing: Properly process error handling in event_hist_trigger_parse() References: <20260127150555.840066272@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: Miaoqian Lin Memory allocated with trigger_data_alloc() requires trigger_data_free() for proper cleanup. Replace kfree() with trigger_data_free() to fix this. Found via static analysis and code review. This isn't a real bug due to the current code basically being an open coded version of trigger_data_free() without the synchronization. The synchronization isn't needed as this is the error path of creation and there's nothing to synchronize against yet. Replace the kfree() to be consistent with the allocation. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Tom Zanussi Link: https://patch.msgid.link/20251211100058.2381268-1-linmq006@gmail.com Fixes: e1f187d09e11 ("tracing: Have existing event_command.parse() implemen= tations use helpers") Signed-off-by: Miaoqian Lin Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_h= ist.c index c97bb2fda5c0..7e50df8b800b 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -6911,7 +6911,7 @@ static int event_hist_trigger_parse(struct event_comm= and *cmd_ops, =20 remove_hist_vars(hist_data); =20 - kfree(trigger_data); + trigger_data_free(trigger_data); =20 destroy_hist_data(hist_data); goto out; --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 4418735D61C for ; Tue, 27 Jan 2026 15:06:07 +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=1769526367; cv=none; b=cIG6B0B0fw3xGeI0rQkRShzwl7L6NjkeMX7Au1Ey5f+FcimFHOAa4MMqozCIIFVOSvtvzzzsq+9hdi5gCHZAlXhvxpAoKon9KYUxVSmU44YSxV1UKqmmr6fNfOLCIuLcDcv+uxPMiBHKlVS6THyPQdnsUZrcIpcfCC7wXLVeFkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=aMCu6kBL9STMHZl9XjwmgPN0vK0fhh0I7sBbjkZlD6w=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=Xlbtt1DcPoB95tE9n9pUxXiVXfSG4TDWtvghwv/blwKBCNXht9Cj6OyqUr8nHn3abTDFvPC0hyjdUDGX66wQYcV//1N82yrzvxjsKBR30s2RQG5cybwRw1XEskTvkjNoBgW2chX+VgRDnb8z6akih67l8a+pozq1u8+ZaNPJcjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y4qJDBOT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y4qJDBOT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BB55C2BCAF; Tue, 27 Jan 2026 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526367; bh=aMCu6kBL9STMHZl9XjwmgPN0vK0fhh0I7sBbjkZlD6w=; h=Date:From:To:Cc:Subject:References:From; b=Y4qJDBOTr3E43g+1VO3GlmiMoKVU3u0VfL4U9u4J1yXegFyr46M/o+IoC7oJBTKAc Ndp8bj6rzQOlg6xOYcQe2evIvOxLKNkOfDMQdENfUbfDMzFlFYrQpAc0R21j0yyWVj z8622b5teShK20F2GqpT48nrQUW0LwAzpPM6WXX6evy9nJOyEyJ+kYqHMCzoLcV2j0 NH2eX1zWSpupQzqKE2+VZexlya8EFNEaLkF1XnTpagF6cyVVukCycz+uI0jazxQyDE jZJdx6s0gPraVAg1uxV5NrkI0HrVl48EnEvZ61XF3qg807VJC0kyXt7eQ+9bThMc5j zupnOQHarEDTA== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdv-00000000Lb6-3Gr0; Tue, 27 Jan 2026 10:06:11 -0500 Message-ID: <20260127150611.635050688@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:05:57 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Miaoqian Lin Subject: [for-next][PATCH 02/15] tracing: Remove redundant call to event_trigger_reset_filter() in event_hist_trigger_parse() References: <20260127150555.840066272@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 With the change to replace kfree() with trigger_data_free(), which starts out doing the exact same thing as event_trigger_reset_filter(), there's no reason to call event_trigger_reset_filter() before calling trigger_data_free(). Remove the call to it. Link: https://lore.kernel.org/linux-trace-kernel/20251211204520.0f3ba6d1@fe= dora/ Cc: Mathieu Desnoyers Cc: Miaoqian Lin Link: https://patch.msgid.link/20260108174429.2d9ca51f@gandalf.local.home Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_hist.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_h= ist.c index 7e50df8b800b..0908a9f7e289 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -6907,8 +6907,6 @@ static int event_hist_trigger_parse(struct event_comm= and *cmd_ops, out_unreg: event_trigger_unregister(cmd_ops, file, glob+1, trigger_data); out_free: - event_trigger_reset_filter(cmd_ops, trigger_data); - remove_hist_vars(hist_data); =20 trigger_data_free(trigger_data); --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 45C9735CBB8 for ; Tue, 27 Jan 2026 15:06:06 +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=1769526366; cv=none; b=JKXCQk1fFzS0gsfV1wrUiZ+1ofgUIBV+8ePD3SIxW6Bm9rcGzL2bYEdtO5ruOA06Qw+28qY4dM/3L+dYJfccuvu1MjK6ZQpKiIE8kndnVwMbe0Sl8Za+Vzp57V86D1tNWWvVDKLRULTn8RKPc/2faVwS5oyfpfr99m0ZSlZkjvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526366; c=relaxed/simple; bh=iRB282rLOp1iucZRzSCO9Qk4UkpqTL8zji5puOv19YA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ASeu+nNMTYL8InXXLONpfG1NSeD7yUhxEWucurX3+EDqbBnPHjVOXZYWP6eF8ws5wF5O9GNfGLKJtHC5wQLmhvLl9ElieuJRmA7JhnF5zKW0gfPOOjygzcBTXLLwe3gBlfiaZE1xXfc5Mlm3CBZz8kFLMVGHoU22Nrm861e1oHg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MomuIm2t; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MomuIm2t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A9BAC116D0; Tue, 27 Jan 2026 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526366; bh=iRB282rLOp1iucZRzSCO9Qk4UkpqTL8zji5puOv19YA=; h=Date:From:To:Cc:Subject:References:From; b=MomuIm2tpZVvkmjZBJUx8D1hcQLPTOcLj0oBcIgCk6HBjSW1oljT4O3FITsoAFmdb 5vQEak4/VKb0NyEj4AxUbd8VRgMcAilxK5a3wQPN0mQ8nMNTkmnUsqFkS/Oj/6ZMag mzuv98Sazyuc/zHKqsvD8TGv24uZJ+jHOhGcNmQkAKhIIWQ/1lVYBqXcM16CtYuXGo vi+7G4SH/X5wRc5BjkK2a/2JOl+mwxIg6TYST1pSPfeLxkY/M2RD6EwAM+7B+EvJEL Mz8teEadvUae/KBV/QCLJw9voWBtXwv9McocQihBWq4UgIDh5THmeYklK+fVVQjoVO pgrJCidwaOwHA== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdv-00000000Lba-3xrR; Tue, 27 Jan 2026 10:06:11 -0500 Message-ID: <20260127150611.800127903@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:05:58 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Aaron Tomlin Subject: [for-next][PATCH 03/15] tracing: Add bitmask-list option for human-readable bitmask display References: <20260127150555.840066272@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: Aaron Tomlin Add support for displaying bitmasks in human-readable list format (e.g., 0,2-5,7) in addition to the default hexadecimal bitmap representation. This is particularly useful when tracing CPU masks and other large bitmasks where individual bit positions are more meaningful than their hexadecimal encoding. When the "bitmask-list" option is enabled, the printk "%*pbl" format specifier is used to render bitmasks as comma-separated ranges, making trace output easier to interpret for complex CPU configurations and large bitmask values. Link: https://patch.msgid.link/20251226160724.2246493-2-atomlin@atomlin.com Signed-off-by: Aaron Tomlin Signed-off-by: Steven Rostedt (Google) --- Documentation/trace/ftrace.rst | 9 +++++++ include/linux/trace_events.h | 8 +++--- include/linux/trace_seq.h | 12 ++++++++- include/trace/stages/stage3_trace_output.h | 4 +-- kernel/trace/trace.h | 1 + kernel/trace/trace_output.c | 30 +++++++++++++++++++--- kernel/trace/trace_seq.c | 29 ++++++++++++++++++++- 7 files changed, 82 insertions(+), 11 deletions(-) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index d1f313a5f4ad..639f4d95732f 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst @@ -1290,6 +1290,15 @@ Here are the available options: This will be useful if you want to find out which hashed value is corresponding to the real value in trace log. =20 + bitmask-list + When enabled, bitmasks are displayed as a human-readable list of + ranges (e.g., 0,2-5,7) using the printk "%*pbl" format specifier. + When disabled (the default), bitmasks are displayed in the + traditional hexadecimal bitmap representation. The list format is + particularly useful for tracing CPU masks and other large bitmasks + where individual bit positions are more meaningful than their + hexadecimal encoding. + record-cmd When any event or tracer is enabled, a hook is enabled in the sched_switch trace point to fill comm cache diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index 3690221ba3d8..0a2b8229b999 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -38,7 +38,10 @@ const char *trace_print_symbols_seq_u64(struct trace_seq= *p, *symbol_array); #endif =20 -const char *trace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr, +struct trace_iterator; +struct trace_event; + +const char *trace_print_bitmask_seq(struct trace_iterator *iter, void *bit= mask_ptr, unsigned int bitmask_size); =20 const char *trace_print_hex_seq(struct trace_seq *p, @@ -54,9 +57,6 @@ trace_print_hex_dump_seq(struct trace_seq *p, const char = *prefix_str, int prefix_type, int rowsize, int groupsize, const void *buf, size_t len, bool ascii); =20 -struct trace_iterator; -struct trace_event; - int trace_raw_output_prep(struct trace_iterator *iter, struct trace_event *event); extern __printf(2, 3) diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index 4a0b8c172d27..697d619aafdc 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h @@ -114,7 +114,11 @@ extern void trace_seq_putmem_hex(struct trace_seq *s, = const void *mem, extern int trace_seq_path(struct trace_seq *s, const struct path *path); =20 extern void trace_seq_bitmask(struct trace_seq *s, const unsigned long *ma= skp, - int nmaskbits); + int nmaskbits); + +extern void trace_seq_bitmask_list(struct trace_seq *s, + const unsigned long *maskp, + int nmaskbits); =20 extern int trace_seq_hex_dump(struct trace_seq *s, const char *prefix_str, int prefix_type, int rowsize, int groupsize, @@ -137,6 +141,12 @@ trace_seq_bitmask(struct trace_seq *s, const unsigned = long *maskp, { } =20 +static inline void +trace_seq_bitmask_list(struct trace_seq *s, const unsigned long *maskp, + int nmaskbits) +{ +} + static inline int trace_print_seq(struct seq_file *m, struct trace_seq *s) { return 0; diff --git a/include/trace/stages/stage3_trace_output.h b/include/trace/sta= ges/stage3_trace_output.h index 1e7b0bef95f5..fce85ea2df1c 100644 --- a/include/trace/stages/stage3_trace_output.h +++ b/include/trace/stages/stage3_trace_output.h @@ -39,7 +39,7 @@ void *__bitmask =3D __get_dynamic_array(field); \ unsigned int __bitmask_size; \ __bitmask_size =3D __get_dynamic_array_len(field); \ - trace_print_bitmask_seq(p, __bitmask, __bitmask_size); \ + trace_print_bitmask_seq(iter, __bitmask, __bitmask_size); \ }) =20 #undef __get_cpumask @@ -51,7 +51,7 @@ void *__bitmask =3D __get_rel_dynamic_array(field); \ unsigned int __bitmask_size; \ __bitmask_size =3D __get_rel_dynamic_array_len(field); \ - trace_print_bitmask_seq(p, __bitmask, __bitmask_size); \ + trace_print_bitmask_seq(iter, __bitmask, __bitmask_size); \ }) =20 #undef __get_rel_cpumask diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index b6d42fe06115..8888fc9335b6 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -1411,6 +1411,7 @@ extern int trace_get_user(struct trace_parser *parser= , const char __user *ubuf, C(COPY_MARKER, "copy_trace_marker"), \ C(PAUSE_ON_TRACE, "pause-on-trace"), \ C(HASH_PTR, "hash-ptr"), /* Print hashed pointer */ \ + C(BITMASK_LIST, "bitmask-list"), \ FUNCTION_FLAGS \ FGRAPH_FLAGS \ STACK_FLAGS \ diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index cc2d3306bb60..1996d7aba038 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -194,13 +194,37 @@ trace_print_symbols_seq_u64(struct trace_seq *p, unsi= gned long long val, EXPORT_SYMBOL(trace_print_symbols_seq_u64); #endif =20 +/** + * trace_print_bitmask_seq - print a bitmask to a sequence buffer + * @iter: The trace iterator for the current event instance + * @bitmask_ptr: The pointer to the bitmask data + * @bitmask_size: The size of the bitmask in bytes + * + * Prints a bitmask into a sequence buffer as either a hex string or a + * human-readable range list, depending on the instance's "bitmask-list" + * trace option. The bitmask is formatted into the iterator's temporary + * scratchpad rather than the primary sequence buffer. This avoids + * duplication and pointer-collision issues when the returned string is + * processed by a "%s" specifier in a TP_printk() macro. + * + * Returns a pointer to the formatted string within the temporary buffer. + */ const char * -trace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr, +trace_print_bitmask_seq(struct trace_iterator *iter, void *bitmask_ptr, unsigned int bitmask_size) { - const char *ret =3D trace_seq_buffer_ptr(p); + struct trace_seq *p =3D &iter->tmp_seq; + const struct trace_array *tr =3D iter->tr; + const char *ret; + + trace_seq_init(p); + ret =3D trace_seq_buffer_ptr(p); + + if (tr->trace_flags & TRACE_ITER(BITMASK_LIST)) + trace_seq_bitmask_list(p, bitmask_ptr, bitmask_size * 8); + else + trace_seq_bitmask(p, bitmask_ptr, bitmask_size * 8); =20 - trace_seq_bitmask(p, bitmask_ptr, bitmask_size * 8); trace_seq_putc(p, 0); =20 return ret; diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c index 32684ef4fb9d..85f6f10d107f 100644 --- a/kernel/trace/trace_seq.c +++ b/kernel/trace/trace_seq.c @@ -106,7 +106,7 @@ EXPORT_SYMBOL_GPL(trace_seq_printf); * Writes a ASCII representation of a bitmask string into @s. */ void trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, - int nmaskbits) + int nmaskbits) { unsigned int save_len =3D s->seq.len; =20 @@ -124,6 +124,33 @@ void trace_seq_bitmask(struct trace_seq *s, const unsi= gned long *maskp, } EXPORT_SYMBOL_GPL(trace_seq_bitmask); =20 +/** + * trace_seq_bitmask_list - write a bitmask array in its list representati= on + * @s: trace sequence descriptor + * @maskp: points to an array of unsigned longs that represent a bitmask + * @nmaskbits: The number of bits that are valid in @maskp + * + * Writes a list representation (e.g., 0-3,5-7) of a bitmask string into @= s. + */ +void trace_seq_bitmask_list(struct trace_seq *s, const unsigned long *mask= p, + int nmaskbits) +{ + unsigned int save_len =3D s->seq.len; + + if (s->full) + return; + + __trace_seq_init(s); + + seq_buf_printf(&s->seq, "%*pbl", nmaskbits, maskp); + + if (unlikely(seq_buf_has_overflowed(&s->seq))) { + s->seq.len =3D save_len; + s->full =3D 1; + } +} +EXPORT_SYMBOL_GPL(trace_seq_bitmask_list); + /** * trace_seq_vprintf - sequence printing of trace information * @s: trace sequence descriptor --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 7D6D9311596 for ; Tue, 27 Jan 2026 15:06:07 +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=1769526367; cv=none; b=oe9Baie4387HjsXrssOpkl6PVDs5lSSW/AE3ZWzZBk7IB/wqQV97r/NtoXv7RSPd9etO+RlbkooZKAJe7zB+uoQIEVDdp9P0AkE8QlMhmARVVdUE0qgDpb+QZ1375kIbJmax1Oe9sOv2C5HK1B6JmlPs3mAM8s2rG3OxoYXOlFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=WvHPZVX/rhYbJEeH9s1HZdUW1pS9qWxVKfHANSpGSD8=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=LE72ann3lAfZ48xWEJ1iGgu48yOc9FOZiUauZWhcUu/SIAegL4/YZuJFDpWf60nunlW3x3TFK5p7jD0xJ8XCVY3DXsbaG6xvqh31GG4qtd/Pd50fKg+joQlsIDEUaQsJ2w8amubZvQV6dlBUvSC8SZgFDrJ8tuVUqbNa4JTOUr0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q74PEPpt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q74PEPpt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F5BBC19422; Tue, 27 Jan 2026 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526367; bh=WvHPZVX/rhYbJEeH9s1HZdUW1pS9qWxVKfHANSpGSD8=; h=Date:From:To:Cc:Subject:References:From; b=q74PEPptpJce51Xs3kBqMcvNv4pjUoZcbxkhoYkqpQqsSU7qounJR59wfrkGP6CED UxUQpCNUClwkxk7Ga8sYtfzMkw8le25enjCc1qJAlnOHLx57PlUYn6WMUog3lYvZsf e6vNnDJyVUUEpfQG4UiO3kuV/F3M6S2r4FumhZbnksNMajtXve8CvyeeYEeXV/PFYz CZtXZZftjFnTDwyxof3LeZ9g0XBbPMtMHq5p7tZ7mhUeLuaPnQP7r6uiCc6vP/YryG TenJt8Q3qjKPIqxvIgqW4mnRMr6NrPKXuqJfuskyCQ5sjEPUv3oVwqJgxsawWpnEAw uD8Ei2iqNCztw== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdw-00000000Lc4-0TwR; Tue, 27 Jan 2026 10:06:12 -0500 Message-ID: <20260127150611.962217175@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:05:59 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Michal Hocko , Tejun Heo , Marco Crivellari Subject: [for-next][PATCH 04/15] tracing: Replace use of system_wq with system_dfl_wq References: <20260127150555.840066272@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: Marco Crivellari This patch continues the effort to refactor workqueue APIs, which has begun with the changes introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The point of the refactoring is to eventually alter the default behavior of workqueues to become unbound by default so that their workload placement is optimized by the scheduler. Before that to happen after a careful review and conversion of each individ= ual case, workqueue users must be converted to the better named new workqueues = with no intended behaviour changes: system_wq -> system_percpu_wq system_unbound_wq -> system_dfl_wq This specific workflow has no benefits being per-cpu, so instead of system_percpu_wq the new unbound workqueue has been used (system_dfl_wq). This way the old obsolete workqueues (system_wq, system_unbound_wq) can be removed in the future. Cc: Lai Jiangshan Cc: Frederic Weisbecker Cc: Sebastian Andrzej Siewior Cc: Michal Hocko Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20251230142820.173712-1-marco.crivellari@sus= e.com Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events= _filter.c index 385af8405392..7001e34476ee 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -1375,7 +1375,7 @@ static void free_filter_list_tasks(struct rcu_head *r= hp) struct filter_head *filter_list =3D container_of(rhp, struct filter_head,= rcu); =20 INIT_RCU_WORK(&filter_list->rwork, free_filter_list_work); - queue_rcu_work(system_wq, &filter_list->rwork); + queue_rcu_work(system_dfl_wq, &filter_list->rwork); } =20 /* --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 D17EF35CBDC for ; Tue, 27 Jan 2026 15:06:06 +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=1769526366; cv=none; b=cmvc3vE65Kx5Nl1eNvudmgBqxrquMaAeMUm3sDWVs1+JUfyi5f7nI1Sd+A/YkLjlne0lGkIdaGQszTGgZuTtdeNEL4edqHLK91/zNgxwobsOVA2MBL90gRzEdEKzn8zk6vsNWuKiVL0QZUuck5TtIUrJY9dU9bX8sO+DTExj4DM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526366; c=relaxed/simple; bh=b5MKQFmS68tKRRE+nXDVK5jRE7M7qsfMIZZ3cnMYRYc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=UaHJx/p0cFO68rycSN5M5jwbz4NZBFPn9nJyHugl7AxFXC061CsYot8gl5GqEk4j3OM37b+o0F4VvZo/tshmC4gF0lWtfOgYj6fWocOmiiOtWy93QOBbKjYQH8Yz/46a98ofynm35Z/WyNlhmXJaQUdEEBiw29lvzZI1a9T1AfU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nEmwTmCU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nEmwTmCU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80443C116D0; Tue, 27 Jan 2026 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526366; bh=b5MKQFmS68tKRRE+nXDVK5jRE7M7qsfMIZZ3cnMYRYc=; h=Date:From:To:Cc:Subject:References:From; b=nEmwTmCUpl0MWpkINb9g4sMTwML/Ub5TP+3zYaV75nXnH/2uHQg9e1/1svQQII992 LghGb66d7PPmGmQuqXYKzEbLskbB2S3Jhem+So0ub45yLtGIr8Br7DHmVOcBXEmrKT 2RjR5ao1rejXjNP9LuYR6CUUMhB6EMh/Y8VF4ZA62ms9RknsQ7+LdkpIJG4cPxfPWT DipngYfrVOttkZWPJjI2jR6pCiKSVuhLGhWtFgvYPtPyVJUgubfr7YzfbM1GReSfAD a5hX6WXfugRmBQNZyPu8PEJG8yCZtxCAze9uQXAC5hg7iOR57AKng6sihscQyXzFu0 7sL9NXIbaC31Q== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdw-00000000LcY-1Apn; Tue, 27 Jan 2026 10:06:12 -0500 Message-ID: <20260127150612.133372665@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:00 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Aaron Tomlin Subject: [for-next][PATCH 05/15] tracing: Add show_event_filters to expose active event filters References: <20260127150555.840066272@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: Aaron Tomlin Currently, to audit active Ftrace event filters, userspace must recursively traverse the events/ directory and read each individual filter file. This is inefficient for monitoring tools and debugging. Introduce "show_event_filters" at the trace root directory. This file displays all events that currently have a filter applied, alongside the actual filter string, in a consolidated system:event [tab] filter format. The implementation reuses the existing trace_event_file iterators to ensure atomic traversal of the event list and utilises guard(rcu)() for automatic, scope-based protection when accessing volatile filter strings. Link: https://patch.msgid.link/20260105142939.2655342-2-atomlin@atomlin.com Signed-off-by: Aaron Tomlin Signed-off-by: Steven Rostedt (Google) --- Documentation/trace/ftrace.rst | 8 +++++ kernel/trace/trace_events.c | 58 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index 639f4d95732f..4ce01e726b09 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst @@ -684,6 +684,14 @@ of ftrace. Here is a list of some of the key files: =20 See events.rst for more information. =20 + show_event_filters: + + A list of events that have filters. This shows the + system/event pair along with the filter that is attached to + the event. + + See events.rst for more information. + available_events: =20 A list of events that can be enabled in tracing. diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 137b4d9bb116..6cbd36508368 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -1662,6 +1662,32 @@ static void t_stop(struct seq_file *m, void *p) mutex_unlock(&event_mutex); } =20 +/** + * t_show_filters - seq_file callback to display active event filters + * @m: The seq_file interface for formatted output + * @v: The current trace_event_file being iterated + * + * Identifies and prints active filters for the current event file in the + * iteration. If a filter is applied to the current event and, if so, + * prints the system name, event name, and the filter string. + */ +static int t_show_filters(struct seq_file *m, void *v) +{ + struct trace_event_file *file =3D v; + struct trace_event_call *call =3D file->event_call; + struct event_filter *filter; + + guard(rcu)(); + filter =3D rcu_dereference(file->filter); + if (!filter || !filter->filter_string) + return 0; + + seq_printf(m, "%s:%s\t%s\n", call->class->system, + trace_event_name(call), filter->filter_string); + + return 0; +} + #ifdef CONFIG_MODULES static int s_show(struct seq_file *m, void *v) { @@ -2489,6 +2515,7 @@ ftrace_event_npid_write(struct file *filp, const char= __user *ubuf, =20 static int ftrace_event_avail_open(struct inode *inode, struct file *file); static int ftrace_event_set_open(struct inode *inode, struct file *file); +static int ftrace_event_show_filters_open(struct inode *inode, struct file= *file); static int ftrace_event_set_pid_open(struct inode *inode, struct file *fil= e); static int ftrace_event_set_npid_open(struct inode *inode, struct file *fi= le); static int ftrace_event_release(struct inode *inode, struct file *file); @@ -2507,6 +2534,13 @@ static const struct seq_operations show_set_event_se= q_ops =3D { .stop =3D s_stop, }; =20 +static const struct seq_operations show_show_event_filters_seq_ops =3D { + .start =3D t_start, + .next =3D t_next, + .show =3D t_show_filters, + .stop =3D t_stop, +}; + static const struct seq_operations show_set_pid_seq_ops =3D { .start =3D p_start, .next =3D p_next, @@ -2536,6 +2570,13 @@ static const struct file_operations ftrace_set_event= _fops =3D { .release =3D ftrace_event_release, }; =20 +static const struct file_operations ftrace_show_event_filters_fops =3D { + .open =3D ftrace_event_show_filters_open, + .read =3D seq_read, + .llseek =3D seq_lseek, + .release =3D seq_release, +}; + static const struct file_operations ftrace_set_event_pid_fops =3D { .open =3D ftrace_event_set_pid_open, .read =3D seq_read, @@ -2680,6 +2721,20 @@ ftrace_event_set_open(struct inode *inode, struct fi= le *file) return ret; } =20 +/** + * ftrace_event_show_filters_open - open interface for set_event_filters + * @inode: The inode of the file + * @file: The file being opened + * + * Connects the set_event_filters file to the sequence operations + * required to iterate over and display active event filters. + */ +static int +ftrace_event_show_filters_open(struct inode *inode, struct file *file) +{ + return ftrace_event_open(inode, file, &show_show_event_filters_seq_ops); +} + static int ftrace_event_set_pid_open(struct inode *inode, struct file *file) { @@ -4400,6 +4455,9 @@ create_event_toplevel_files(struct dentry *parent, st= ruct trace_array *tr) if (!entry) return -ENOMEM; =20 + trace_create_file("show_event_filters", TRACE_MODE_READ, parent, tr, + &ftrace_show_event_filters_fops); + nr_entries =3D ARRAY_SIZE(events_entries); =20 e_events =3D eventfs_create_events_dir("events", parent, events_entries, --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 1EDB235D5E8 for ; Tue, 27 Jan 2026 15:06:06 +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=1769526367; cv=none; b=nLeyKIDZQcfdiXp982RoOc91NsdfunH6cEpxXFKmNr4bL/q+1Y4F4gDUZ5O6KiDLu9MbbMMiRju1gu0IH81+rNtdWqcbHTCHiSREEqPDIevhP513iV+hn2IJrSmMiOjtut3AeS0XgIs1urBBiRwGXl2J+Td7xRClLiNyvz4wSSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=nywsedjg+r1aPax6Erd7Q/470qmMSyOdyB+yMNJ4UVM=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=cnMlKMsvB+15VC/KpqFGq4XHP8+SyWl9+7uZrgh28CK1z0oW0ZoTDQvrN1j+xpBb3vp/ZPc0YMciilqWNyfMi1qr7nBm+4C8T8W6zTVUxNW5F4GfTFc/+G3nNht1+qTjw58rtjGTpwidfRfPiiMqxeG5aDJXJ2SkF1KWuQ4iHa4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sRaSmP37; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sRaSmP37" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92F11C116C6; Tue, 27 Jan 2026 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526366; bh=nywsedjg+r1aPax6Erd7Q/470qmMSyOdyB+yMNJ4UVM=; h=Date:From:To:Cc:Subject:References:From; b=sRaSmP37RkOPfgBazu6UpoDAq2KxJjElWDmZ5xSl8F1HVvBUZooMLn3TsKs9T4s4I kMoTYj+fc/fVWB9hejfbQDafzfVFG8MOuzo5jHgUOZnBwMjKDDtYeednk2gZZQtQP5 eCqr8Du2RabtTmdHRJ6MQ7X9duanrnd2A4DLrGYh0VoAv93O0cDvTHdE3m+b0HBoIe y4yOc6q6mjiTvX/YR7nBCDTBybl+HWOSWvMLrIbPdazZb1RolZmex/NCdtD29+iyVd pF4EuvFiHFJFHTt0RfTIgOkhS4LO/8jC/v054z7sErgaW+dUqeTqRpjjD4BT3j6aYz /rqEoMH+9K2dA== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdw-00000000Ld2-1qh7; Tue, 27 Jan 2026 10:06:12 -0500 Message-ID: <20260127150612.296956158@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:01 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Aaron Tomlin Subject: [for-next][PATCH 06/15] tracing: Add show_event_triggers to expose active event triggers References: <20260127150555.840066272@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: Aaron Tomlin To audit active event triggers, userspace currently must traverse the events/ directory and read each individual trigger file. This is cumbersome for system-wide auditing or debugging. Introduce "show_event_triggers" at the trace root directory. This file displays all events that currently have one or more triggers applied, alongside the trigger configuration, in a consolidated system:event [tab] trigger format. The implementation leverages the existing trace_event_file iterators and uses the trigger's own print() operation to ensure output consistency with the per-event trigger files. Link: https://patch.msgid.link/20260105142939.2655342-3-atomlin@atomlin.com Signed-off-by: Aaron Tomlin Signed-off-by: Steven Rostedt (Google) --- Documentation/trace/ftrace.rst | 8 +++++ kernel/trace/trace_events.c | 64 ++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index 4ce01e726b09..b9efb148a5c2 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst @@ -692,6 +692,14 @@ of ftrace. Here is a list of some of the key files: =20 See events.rst for more information. =20 + show_event_triggers: + + A list of events that have triggers. This shows the + system/event pair along with the trigger that is attached to + the event. + + See events.rst for more information. + available_events: =20 A list of events that can be enabled in tracing. diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 6cbd36508368..36936697fa2a 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -1688,6 +1688,38 @@ static int t_show_filters(struct seq_file *m, void *= v) return 0; } =20 +/** + * t_show_triggers - seq_file callback to display active event triggers + * @m: The seq_file interface for formatted output + * @v: The current trace_event_file being iterated + * + * Iterates through the trigger list of the current event file and prints + * each active trigger's configuration using its associated print + * operation. + */ +static int t_show_triggers(struct seq_file *m, void *v) +{ + struct trace_event_file *file =3D v; + struct trace_event_call *call =3D file->event_call; + struct event_trigger_data *data; + + /* + * The event_mutex is held by t_start(), protecting the + * file->triggers list traversal. + */ + if (list_empty(&file->triggers)) + return 0; + + list_for_each_entry_rcu(data, &file->triggers, list) { + seq_printf(m, "%s:%s\t", call->class->system, + trace_event_name(call)); + + data->cmd_ops->print(m, data); + } + + return 0; +} + #ifdef CONFIG_MODULES static int s_show(struct seq_file *m, void *v) { @@ -2516,6 +2548,7 @@ ftrace_event_npid_write(struct file *filp, const char= __user *ubuf, static int ftrace_event_avail_open(struct inode *inode, struct file *file); static int ftrace_event_set_open(struct inode *inode, struct file *file); static int ftrace_event_show_filters_open(struct inode *inode, struct file= *file); +static int ftrace_event_show_triggers_open(struct inode *inode, struct fil= e *file); static int ftrace_event_set_pid_open(struct inode *inode, struct file *fil= e); static int ftrace_event_set_npid_open(struct inode *inode, struct file *fi= le); static int ftrace_event_release(struct inode *inode, struct file *file); @@ -2541,6 +2574,13 @@ static const struct seq_operations show_show_event_f= ilters_seq_ops =3D { .stop =3D t_stop, }; =20 +static const struct seq_operations show_show_event_triggers_seq_ops =3D { + .start =3D t_start, + .next =3D t_next, + .show =3D t_show_triggers, + .stop =3D t_stop, +}; + static const struct seq_operations show_set_pid_seq_ops =3D { .start =3D p_start, .next =3D p_next, @@ -2577,6 +2617,13 @@ static const struct file_operations ftrace_show_even= t_filters_fops =3D { .release =3D seq_release, }; =20 +static const struct file_operations ftrace_show_event_triggers_fops =3D { + .open =3D ftrace_event_show_triggers_open, + .read =3D seq_read, + .llseek =3D seq_lseek, + .release =3D seq_release, +}; + static const struct file_operations ftrace_set_event_pid_fops =3D { .open =3D ftrace_event_set_pid_open, .read =3D seq_read, @@ -2735,6 +2782,20 @@ ftrace_event_show_filters_open(struct inode *inode, = struct file *file) return ftrace_event_open(inode, file, &show_show_event_filters_seq_ops); } =20 +/** + * ftrace_event_show_triggers_open - open interface for show_event_triggers + * @inode: The inode of the file + * @file: The file being opened + * + * Connects the show_event_triggers file to the sequence operations + * required to iterate over and display active event triggers. + */ +static int +ftrace_event_show_triggers_open(struct inode *inode, struct file *file) +{ + return ftrace_event_open(inode, file, &show_show_event_triggers_seq_ops); +} + static int ftrace_event_set_pid_open(struct inode *inode, struct file *file) { @@ -4458,6 +4519,9 @@ create_event_toplevel_files(struct dentry *parent, st= ruct trace_array *tr) trace_create_file("show_event_filters", TRACE_MODE_READ, parent, tr, &ftrace_show_event_filters_fops); =20 + trace_create_file("show_event_triggers", TRACE_MODE_READ, parent, tr, + &ftrace_show_event_triggers_fops); + nr_entries =3D ARRAY_SIZE(events_entries); =20 e_events =3D eventfs_create_events_dir("events", parent, events_entries, --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 1AE7035D5E4 for ; Tue, 27 Jan 2026 15:06:06 +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=1769526367; cv=none; b=lybzc84t16B6ucmuKKur7WWQ36Fymkq3rNo1U0BSv4CxmM+zBGc3/fTfYMVIvTPBNmdu4lAzs84Gk1LPYv+0AflOyJBQPQccoimaxxEWpkV/BLvJ0c2ZyMhSAitSHRofe94aZIKWxY3Hto3zxCOmYjqWJHdc5+1nE5m/KEkPNqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=Iwb0nTZK5hr6PHrU1eorsbeS3LH2liTvzUPgBOadV/w=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=gpC8QJKiINL8ags9FaG3mi+3NGjRe6TQHQgjRiJiG4BaJ3P/vdwcK65/Ug1LaAn6xIrx0vuejQf8UEdTu8ChkKrl1fcFJ3IiA+cjK1RvbkPf6Y5ckv/Dqfyzs0CdrV+CagmLGjtaT/UvhJHzeDIPQxGw22y4xRAI+eo6/Fmjzuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gM1VUBvG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gM1VUBvG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC794C19422; Tue, 27 Jan 2026 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526366; bh=Iwb0nTZK5hr6PHrU1eorsbeS3LH2liTvzUPgBOadV/w=; h=Date:From:To:Cc:Subject:References:From; b=gM1VUBvGgrWo0qFX3pu19xXIprM11ZVr7ZdXFiuHnschT2l5zHXUM4mF16sRwlAQY j7wuBoRi1WAX4QSaNmL26lykh1J5ROp3CUTlUoStZ0Wb8rf/Y5CtZGlawKcD8kMMjU gprkvglypMhfnPaeMZxORsQR7Z73eRdzTfiGZ9rouKLA3ReOX758UVHtQiCjmvlbcY VEpXYh69mE6orixtSFNSzDXUL1vJWA+2ggeV8dMdvdk8mOYMlDYLM0Xvj6T/2NgV09 A3XFO/FtYxqvakG8IltwCdL506YSZ/x6K74EgLLpyu6UPvQ0gXmPwzZvv/HbZ5VhyS lavVKrjbJrw4Q== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdw-00000000LdX-2XLW; Tue, 27 Jan 2026 10:06:12 -0500 Message-ID: <20260127150612.459344562@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:02 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Li Zhong Subject: [for-next][PATCH 07/15] tracing: Check the return value of tracing_update_buffers() References: <20260127150555.840066272@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 In the very unlikely event that tracing_update_buffers() fails in trace_printk_init_buffers(), report the failure so that it is known. Link: https://lore.kernel.org/all/20220917020353.3836285-1-floridsleeves@gm= ail.com/ Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260107161510.4dc98b15@gandalf.local.home Suggested-by: Li Zhong Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 8bd4ec08fb36..870205cba31e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -3309,9 +3309,10 @@ void trace_printk_init_buffers(void) pr_warn("**********************************************************\n"); =20 /* Expand the buffers to set size */ - tracing_update_buffers(&global_trace); - - buffers_allocated =3D 1; + if (tracing_update_buffers(&global_trace) < 0) + pr_err("Failed to expand tracing buffers for trace_printk() calls\n"); + else + buffers_allocated =3D 1; =20 /* * trace_printk_init_buffers() can be called by modules. --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 1EF1C35CBCD for ; Tue, 27 Jan 2026 15:06:07 +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=1769526367; cv=none; b=rM/v9wRFSByT+WepBmi7lYwWbaladfLEQLpvaNvf2H9T8LWqY00/fxv/Rqr7Oo5fLpLqHLSuHv1XJTQ1mgnEEokcsi1OHRdIb31TZYArEVSSBZoUp27jXFODg+jckGlqMJ6ZGUlOkLAVN0Aho4KQxb36Z5HeDu53LZmtsDW9bxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=afAM7ZOA5SuRSLbL65crNSVL4m8qdt+XGZdZANRgrJw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=lzpx8GbTUN7EVLjaE5GD90rDMyC5wBl3ZxzMCxQs5+7951AczSR1J7n4YzPsmRXvtGF3gzcXLf/7ndleyTmu8o/sJHdVAuMFEB0YotI/k3s+470TV4shZRYs0Kk8h10beN0XS2tZkDnk43XotpgFMynjQiHJYmLpp4BxkdbwABY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VZYh7pYW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VZYh7pYW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D610EC16AAE; Tue, 27 Jan 2026 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526366; bh=afAM7ZOA5SuRSLbL65crNSVL4m8qdt+XGZdZANRgrJw=; h=Date:From:To:Cc:Subject:References:From; b=VZYh7pYWP4n0vNhxVKffcKkIUuU2DlumWn8pcajKg7Ljh3JQYCQzyZaFoVexWYLlK 1T/504ZeTXtkV2YIeet8RHFUkpEIcMw9KWs21czZxgOb3wX/8JTeJPqkLuF0weOgfj rQdp/mIUgX2B91mx7Ex5u++ngGH15np9qfhr3/DCCWDM31DBsHNdnMMU1oEfqd8bDf cvWpdmCn2PTh4bh3Vzd2uXwruYjQZZiNBHIj08VTWQQBeTKoLgx4PqnTg5BTEz7s2N e0BczQ8L47HloKAVDTZwdQ/Z3la4ufHCeqTdL+VVGyq4d6i0rYtVkVs9DFWx5DzwVt vQv3Z02r4OsJQ== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdw-00000000Le1-3Eiy; Tue, 27 Jan 2026 10:06:12 -0500 Message-ID: <20260127150612.623913531@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:03 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Sebastian Andrzej Siewior , Clark Williams , Frederic Weisbecker , Petr Tesarik Subject: [for-next][PATCH 08/15] ring-buffer: Use a housekeeping CPU to wake up waiters References: <20260127150555.840066272@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: Petr Tesarik Avoid running the wakeup irq_work on an isolated CPU. Since the wakeup can run on any CPU, let's pick a housekeeping CPU to do the job. This change reduces additional noise when tracing isolated CPUs. For example, the following ipi_send_cpu stack trace was captured with nohz_full=3D2 on the isolated CPU: -0 [002] d.h4. 1255.379293: ipi_send_cpu: cpu=3D2 ca= llsite=3Dirq_work_queue+0x2d/0x50 callback=3Drb_wake_up_waiters+0x0/0x80 -0 [002] d.h4. 1255.379329: =3D> trace_event_raw_event_ipi_send_cpu =3D> __irq_work_queue_local =3D> irq_work_queue =3D> ring_buffer_unlock_commit =3D> trace_buffer_unlock_commit_regs =3D> trace_event_buffer_commit =3D> trace_event_raw_event_x86_irq_vector =3D> __sysvec_apic_timer_interrupt =3D> sysvec_apic_timer_interrupt =3D> asm_sysvec_apic_timer_interrupt =3D> pv_native_safe_halt =3D> default_idle =3D> default_idle_call =3D> do_idle =3D> cpu_startup_entry =3D> start_secondary =3D> common_startup_64 The IRQ work interrupt alone adds considerable noise, but the impact can get even worse with PREEMPT_RT, because the IRQ work interrupt is then handled by a separate kernel thread. This requires a task switch and makes tracing useless for analyzing latency on an isolated CPU. After applying the patch, the trace is similar, but ipi_send_cpu always targets a non-isolated CPU. Unfortunately, irq_work_queue_on() is not NMI-safe. When running in NMI context, fall back to queuing the irq work on the local CPU. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Sebastian Andrzej Siewior Cc: Clark Williams Cc: Frederic Weisbecker Link: https://patch.msgid.link/20260108132132.2473515-1-ptesarik@suse.com Signed-off-by: Petr Tesarik Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ring_buffer.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 630221b00838..d33103408955 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -4,6 +4,7 @@ * * Copyright (C) 2008 Steven Rostedt */ +#include #include #include #include @@ -4013,19 +4014,36 @@ static void rb_commit(struct ring_buffer_per_cpu *c= pu_buffer) rb_end_commit(cpu_buffer); } =20 +static bool +rb_irq_work_queue(struct rb_irq_work *irq_work) +{ + int cpu; + + /* irq_work_queue_on() is not NMI-safe */ + if (unlikely(in_nmi())) + return irq_work_queue(&irq_work->work); + + /* + * If CPU isolation is not active, cpu is always the current + * CPU, and the following is equivallent to irq_work_queue(). + */ + cpu =3D housekeeping_any_cpu(HK_TYPE_KERNEL_NOISE); + return irq_work_queue_on(&irq_work->work, cpu); +} + static __always_inline void rb_wakeups(struct trace_buffer *buffer, struct ring_buffer_per_cpu *cpu_bu= ffer) { if (buffer->irq_work.waiters_pending) { buffer->irq_work.waiters_pending =3D false; /* irq_work_queue() supplies it's own memory barriers */ - irq_work_queue(&buffer->irq_work.work); + rb_irq_work_queue(&buffer->irq_work); } =20 if (cpu_buffer->irq_work.waiters_pending) { cpu_buffer->irq_work.waiters_pending =3D false; /* irq_work_queue() supplies it's own memory barriers */ - irq_work_queue(&cpu_buffer->irq_work.work); + rb_irq_work_queue(&cpu_buffer->irq_work); } =20 if (cpu_buffer->last_pages_touch =3D=3D local_read(&cpu_buffer->pages_tou= ched)) @@ -4045,7 +4063,7 @@ rb_wakeups(struct trace_buffer *buffer, struct ring_b= uffer_per_cpu *cpu_buffer) cpu_buffer->irq_work.wakeup_full =3D true; cpu_buffer->irq_work.full_waiters_pending =3D false; /* irq_work_queue() supplies it's own memory barriers */ - irq_work_queue(&cpu_buffer->irq_work.work); + rb_irq_work_queue(&cpu_buffer->irq_work); } =20 #ifdef CONFIG_RING_BUFFER_RECORD_RECURSION --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 2269A35D5E9 for ; Tue, 27 Jan 2026 15:06:07 +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=1769526367; cv=none; b=iyILnbdTbqEKPBc+s1E1AOVzwCeXdb/hPtFMspDEL5U544BuQiMtiht7UYzLACJzwPlaq0cq06RTc1FuTSbgX8pn7XARecNYO7wKldDI0/b5P52tUrDRZimfQBBEWC39uqi9M5gVXckaA4qpJNMJufXRlTJZnI3w3xClauDtgv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=6J2EqFQjEjfkzaTJ9AVzw+wpoKpJxoJkfmb4zJVrgTc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=HtpQMowgy7OftoXL+iSHHhbkjjmhoNnJA2R3vESu6Hoc7tQds7yAhX64iBbhNa26bgRMESHPwDG7GaSKquQj/D68/W5JXB6XOaK4rTrkObCc8CWJ4DKyt5rO2bpbOHnSyH5aUh4lhgyRyv+LzCwa2PYoSqjql3PmhAzRem2sSK0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FIZ/Z7HF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FIZ/Z7HF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03BE4C116D0; Tue, 27 Jan 2026 15:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526367; bh=6J2EqFQjEjfkzaTJ9AVzw+wpoKpJxoJkfmb4zJVrgTc=; h=Date:From:To:Cc:Subject:References:From; b=FIZ/Z7HFb1pB7JoI8YTV8DgXbFH2trg4g2sbKfqFXWqYZRqqz1Ym0EWzfEdvMdTJN D1ZiCcriMWrmDRSRyjA6PwlIjHtkIjELTwhRzvrMg0QnmczqHr6yupO42ofBwU/Vsr zalpAmyOvC+sYjrglHQ+EZEmYDUElc3kdF8k+h3/QiNEOgc5VUYzao5yHWz1Sg64Ft XMw2eTx8epAJ8565cWdzsFiyYTxph1QED6sUcvBvVNeDkuh19Klmz4gR9zHq+sWriZ 1tJP5vdU0obtiVeeLWFN1kxJchupxr57PHWToZ2zdwNbwrp9wF64ncSG7Rvv2PPgMr YBl7JpEpwwfmg== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdw-00000000LeV-3vRS; Tue, 27 Jan 2026 10:06:12 -0500 Message-ID: <20260127150612.790179493@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:04 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Aaron Tomlin Subject: [for-next][PATCH 09/15] tracing: Have show_event_trigger/filter format a bit more in columns References: <20260127150555.840066272@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 By doing: # trace-cmd sqlhist -e -n futex_wait select TIMESTAMP_DELTA_USECS as lat f= rom sys_enter_futex as start join sys_exit_futex as end on start.common_pid= =3D end.common_pid and # trace-cmd start -e futex_wait -f 'lat > 100' -e page_pool_state_release = -f 'pfn =3D=3D 1' The output of the show_event_trigger and show_event_filter files are well aligned because of the inconsistent 'tab' spacing: ~# cat /sys/kernel/tracing/show_event_triggers syscalls:sys_exit_futex hist:keys=3Dcommon_pid:vals=3Dhitcount:__lat_12046_= 2=3Dcommon_timestamp.usecs-$__arg_12046_1:sort=3Dhitcount:size=3D2048:clock= =3Dglobal:onmatch(syscalls.sys_enter_futex).trace(futex_wait,$__lat_12046_2= ) [active] syscalls:sys_enter_futex hist:keys=3Dcommon_pid:vals=3Dhitcount:__arg_12046= _1=3Dcommon_timestamp.usecs:sort=3Dhitcount:size=3D2048:clock=3Dglobal [act= ive] ~# cat /sys/kernel/tracing/show_event_filters synthetic:futex_wait (lat > 100) page_pool:page_pool_state_release (pfn =3D=3D 1) This makes it not so easy to read. Instead, force the spacing to be at least 32 bytes from the beginning (one space if the system:event is longer than 30 bytes): ~# cat /sys/kernel/tracing/show_event_triggers syscalls:sys_exit_futex hist:keys=3Dcommon_pid:vals=3Dhitcount:__l= at_8125_2=3Dcommon_timestamp.usecs-$__arg_8125_1:sort=3Dhitcount:size=3D204= 8:clock=3Dglobal:onmatch(syscalls.sys_enter_futex).trace(futex_wait,$__lat_= 8125_2) [active] syscalls:sys_enter_futex hist:keys=3Dcommon_pid:vals=3Dhitcount:__a= rg_8125_1=3Dcommon_timestamp.usecs:sort=3Dhitcount:size=3D2048:clock=3Dglob= al [active] ~# cat /sys/kernel/tracing/show_event_filters synthetic:futex_wait (lat > 100) page_pool:page_pool_state_release (pfn =3D=3D 1) Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260112153408.18373e73@gandalf.local.home Reviewed-by: Aaron Tomlin Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 36936697fa2a..f372a6374164 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -1662,6 +1662,18 @@ static void t_stop(struct seq_file *m, void *p) mutex_unlock(&event_mutex); } =20 +static int get_call_len(struct trace_event_call *call) +{ + int len; + + /* Get the length of ":" */ + len =3D strlen(call->class->system) + 1; + len +=3D strlen(trace_event_name(call)); + + /* Set the index to 32 bytes to separate event from data */ + return len >=3D 32 ? 1 : 32 - len; +} + /** * t_show_filters - seq_file callback to display active event filters * @m: The seq_file interface for formatted output @@ -1676,14 +1688,17 @@ static int t_show_filters(struct seq_file *m, void = *v) struct trace_event_file *file =3D v; struct trace_event_call *call =3D file->event_call; struct event_filter *filter; + int len; =20 guard(rcu)(); filter =3D rcu_dereference(file->filter); if (!filter || !filter->filter_string) return 0; =20 - seq_printf(m, "%s:%s\t%s\n", call->class->system, - trace_event_name(call), filter->filter_string); + len =3D get_call_len(call); + + seq_printf(m, "%s:%s%*.s%s\n", call->class->system, + trace_event_name(call), len, "", filter->filter_string); =20 return 0; } @@ -1702,6 +1717,7 @@ static int t_show_triggers(struct seq_file *m, void *= v) struct trace_event_file *file =3D v; struct trace_event_call *call =3D file->event_call; struct event_trigger_data *data; + int len; =20 /* * The event_mutex is held by t_start(), protecting the @@ -1710,9 +1726,11 @@ static int t_show_triggers(struct seq_file *m, void = *v) if (list_empty(&file->triggers)) return 0; =20 + len =3D get_call_len(call); + list_for_each_entry_rcu(data, &file->triggers, list) { - seq_printf(m, "%s:%s\t", call->class->system, - trace_event_name(call)); + seq_printf(m, "%s:%s%*.s", call->class->system, + trace_event_name(call), len, ""); =20 data->cmd_ops->print(m, data); } --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 610CA35DCE0 for ; Tue, 27 Jan 2026 15:06:07 +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=1769526367; cv=none; b=iW2cAZDkQ/LLprkzmwZRqSgwGa6ta9vAruJYyV+m8j2NOLrKnWT5iriCE6D39FbPhwB+CJwC+tQLIXe5myCChiFQc9ZDUcekF1Es2JVS0OdV9579f+6PSmJsCEgnCF0Lo00hopk1ueN+X1tbwtOQjVzQhF26zBq7XqzQMrT+l2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=UZebaUi5DgLc7MzMKMKI79nDnKbOblVAjX2OuUQ8Lp8=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=QzSpAOb0zrAou5jZcFJ8sBb+9I+IdLeNtiBAu2T/kFJYP23ZnDgQFUMpw93xTItXbBdjKp4GuNWWxf0l1h+aUjHUL/iv35f6mTLcsf0CMFPdyg3x9cJlOhmaMRgpJst/oQhcppiVIsVYG0/Jg9RRiNI5QlScxt18NAKncjBRatY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M/DIpySl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M/DIpySl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44CF9C116C6; Tue, 27 Jan 2026 15:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526367; bh=UZebaUi5DgLc7MzMKMKI79nDnKbOblVAjX2OuUQ8Lp8=; h=Date:From:To:Cc:Subject:References:From; b=M/DIpySlxzKqTF+x3COODTcf47BTVX7nC3oQyCjxbsWzDi/AC1sXOmoGV2Mtxfl9R 9xIkKD/5V+dEz6RHVEH0SdND8EYNDNbl6PTKqAx+iBWIFHLIjT53RVB094DNIpi1/x LB3DNZNA03PMImjdo5hhN0s0xoeQ0UiZDO9cifGZ2auly2V0JBU9WiaN7UpEKVOQ1L vyHb/JGQxCNEE0n6wlAMTUyj57U2QpTg7UPr5qYhbJ6oNA/H3YatDvHs1UcQRCOkwR v572oZ2be7rDneMU2kQpfr5vrzQ2fvDNnSwNSduKpklt9q3YAyyJrvOKm2qt4GRPfs Hv+EE9dEnlAQg== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdx-00000000Lf0-0PTS; Tue, 27 Jan 2026 10:06:13 -0500 Message-ID: <20260127150612.953117141@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:05 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Guenter Roeck Subject: [for-next][PATCH 10/15] ftrace: Introduce and use ENTRIES_PER_PAGE_GROUP macro References: <20260127150555.840066272@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: Guenter Roeck ENTRIES_PER_PAGE_GROUP() returns the number of dyn_ftrace entries in a page group, identified by its order. No functional change. Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260113152243.3557219-2-linux@roeck-us.net Signed-off-by: Guenter Roeck Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index aa758efc3731..df4ce244202e 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1148,6 +1148,7 @@ struct ftrace_page { }; =20 #define ENTRY_SIZE sizeof(struct dyn_ftrace) +#define ENTRIES_PER_PAGE_GROUP(order) ((PAGE_SIZE << (order)) / ENTRY_SIZE) =20 static struct ftrace_page *ftrace_pages_start; static struct ftrace_page *ftrace_pages; @@ -3862,7 +3863,7 @@ static int ftrace_allocate_records(struct ftrace_page= *pg, int count, *num_pages +=3D 1 << order; ftrace_number_of_groups++; =20 - cnt =3D (PAGE_SIZE << order) / ENTRY_SIZE; + cnt =3D ENTRIES_PER_PAGE_GROUP(order); pg->order =3D order; =20 if (cnt > count) @@ -7309,7 +7310,7 @@ static int ftrace_process_locs(struct module *mod, long skip; =20 /* Count the number of entries unused and compare it to skipped. */ - pg_remaining =3D (PAGE_SIZE << pg->order) / ENTRY_SIZE - pg->index; + pg_remaining =3D ENTRIES_PER_PAGE_GROUP(pg->order) - pg->index; =20 if (!WARN(skipped < pg_remaining, "Extra allocated pages for ftrace")) { =20 @@ -7317,7 +7318,7 @@ static int ftrace_process_locs(struct module *mod, =20 for (pg =3D pg_unuse; pg && skip > 0; pg =3D pg->next) { remaining +=3D 1 << pg->order; - skip -=3D (PAGE_SIZE << pg->order) / ENTRY_SIZE; + skip -=3D ENTRIES_PER_PAGE_GROUP(pg->order); } =20 pages -=3D remaining; --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 8282535DCEA for ; Tue, 27 Jan 2026 15:06:07 +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=1769526367; cv=none; b=mGKfZ73vYE+jxVv6L3GLfzSeVji9t3Zrdl+pk0UnVEC+XWKGhgtTkYICVnDvGpcs90hxVZMVViB9l1XD7JErgGCHgWkgP9k0Qw74Th/a6lyQEhtuF3ftD7yfrbSb7eioeg0RyPE7Xgi3d2LMaCZ1p4iJdd1h/5K/jBZ5qX0Ucdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=ofdWWKG2mHqrOT4Kc9hAyRRZxkIc65bzAv8uBbcH4hk=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=GhwWVynXJln0eDzn03LwPf+tFU2Xo40aralL43yPxEHRMHrQ07azkPGZ5gTs/YQH6Engadih/jLq5ITZKzLncr65n+xodrf0WLw6QHtO6iMik3sLwZM82euJqAJ3uW/KZsgxJdDdlFT1cSdYSwhDwBoYXEQWARQiGG/Jy3rthqE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mW6Cx5/b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mW6Cx5/b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 678FBC2BCAF; Tue, 27 Jan 2026 15:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526367; bh=ofdWWKG2mHqrOT4Kc9hAyRRZxkIc65bzAv8uBbcH4hk=; h=Date:From:To:Cc:Subject:References:From; b=mW6Cx5/bQucnWM1VWm//s55jrf++KIMvoCJwAqD0hQGwVXdix6PSTdPZ7XJfnkAnp uxZ2VVsW29dLIVV6CgsgQg0yLbO94ATj16grDgRdokyWvOUwlIEo94TsJwejlflc4g 6u+wSw5URxDw4sacaMLHsNMkAwStdWVj4XmbNxmKstHnJZGDGYp5ML7SwiUUWIJVVj KWh46/PaQZb0zSF3Q+7znXIvS1HOAzmWmpBPSVyGDiurbciJVB0XkxM4PNsTpdGI8l xQj7/TCqX9KhrbQF64w6XFvTrLZzogemzSw61p38vh/omdfUWFF7MTdsFsz86vpFL5 Wi6979Kp84Ngw== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdx-00000000LfU-161V; Tue, 27 Jan 2026 10:06:13 -0500 Message-ID: <20260127150613.117137449@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:06 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-next][PATCH 11/15] tracing: Disable trace_printk buffer on warning too References: <20260127150555.840066272@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 When /proc/sys/kernel/traceoff_on_warning is set to 1, the top level tracing buffer is disabled when a warning happens. This is very useful when debugging and want the tracing buffer to stop taking new data when a warning triggers keeping the events that lead up to the warning from being overwritten. Now that there is also a persistent ring buffer and an option to have trace_printk go to that buffer, the same holds true for that buffer. A warning could happen just before a crash but still write enough events to lose the events that lead up to the first warning that was the reason for the crash. When /proc/sys/kernel/traceoff_on_warning is set to 1 and a warning is triggered, not only disable the top level tracing buffer, but also disable the buffer that trace_printk()s are written to. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Mark Rutland Link: https://patch.msgid.link/20260121093858.5c5d7e7b@gandalf.local.home Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 870205cba31e..396d59202438 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1666,9 +1666,18 @@ EXPORT_SYMBOL_GPL(tracing_off); void disable_trace_on_warning(void) { if (__disable_trace_on_warning) { + struct trace_array *tr =3D READ_ONCE(printk_trace); + trace_array_printk_buf(global_trace.array_buffer.buffer, _THIS_IP_, "Disabling tracing due to warning\n"); tracing_off(); + + /* Disable trace_printk() buffer too */ + if (tr !=3D &global_trace) { + trace_array_printk_buf(tr->array_buffer.buffer, _THIS_IP_, + "Disabling tracing due to warning\n"); + tracer_tracing_off(tr); + } } } =20 --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 9D5E435DCF9 for ; Tue, 27 Jan 2026 15:06:07 +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=1769526367; cv=none; b=HuiFoBlOy0wYo58b1H52C4AC7AfEiFQUkCMsRycEDON7B2d5Nr5FVRdzrgPL66S6i+QcvkT/xIHhFs1ZCvNlxPDSYxbVmCe7wExCLAYuGFYoj1Q+mob3awZujfxdz7Dx1EUdka+DqpLAuXF30pKD45Do//OdhdK40w3p/E240H0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=BLCgiTcnx2AWGK+Jpqug6hrV02OqahpMa9S4QJ5xxZw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=PmI2X92rVDvPoPJSHYg5mJQNj+/R61DEEpDR+84acsVkl7ojHi7+Zn6ocjuqXF3X881yY4AQ7Ciue4T3zuhE7I2zyg1EFsmE90CjNrOrQOhxFjgN51ALmBVrbLIgKegkKdWu8Jrg3vIIH0LvKdHrPpND6Fd+t2zc8S2MErhknPQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qalfIeqC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qalfIeqC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 804F7C116C6; Tue, 27 Jan 2026 15:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526367; bh=BLCgiTcnx2AWGK+Jpqug6hrV02OqahpMa9S4QJ5xxZw=; h=Date:From:To:Cc:Subject:References:From; b=qalfIeqCxhfTUsd3xDvXE9rdhHk+FPQ+rb7ZtqRIcCO+cbGDoQpn5RgfXOuI6yhfa pv/wLNO6q3+mjAYXuG2LmEqZM/NeNBqkuq8SU+8S3JLImJkjHS4HQQ/uJ3PPcx6lpJ +l6UkXuY4b9uslFv3qbCJDeh4tc8Sy3fln2wBWRUz+LxhbH/mM/fGwHwK6ywZ/XtNd r8Qx4+V/0LsLBNZYhaJbujNGZAt30cAfXd5SBKeZd/8uAXAxhwJV3T0eoMwS03oowi d9bwEGluPmdBoXF9AQdDpp78XWcE+1Fq+J0FJtyS61E0IiRvndy2kcOB94YfPW2mIf BdQKpKmclgNUw== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdx-00000000Lfz-1mUt; Tue, 27 Jan 2026 10:06:13 -0500 Message-ID: <20260127150613.281228909@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:07 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Tom Zanussi Subject: [for-next][PATCH 12/15] tracing: Have hist_debug show what function a field uses References: <20260127150555.840066272@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 When CONFIG_HIST_TRIGGERS_DEBUG is enabled, each trace event has a "hist_debug" file that explains the histogram internal data. This is very useful for debugging histograms. One bit of data that was missing from this file was what function a histogram field uses to process its data. The hist_field structure now has a fn_num that is used by a switch statement in hist_fn_call() to call a function directly (to avoid spectre mitigations). Instead of displaying that number, create a string array that maps to the histogram function enums so that the function for a field may be displayed: ~# cat /sys/kernel/tracing/events/sched/sched_switch/hist_debug [..] hist_data: 0000000043d62762 n_vals: 2 n_keys: 1 n_fields: 3 val fields: hist_data->fields[0]: flags: VAL: HIST_FIELD_FL_HITCOUNT type: u64 size: 8 is_signed: 0 function: hist_field_counter() hist_data->fields[1]: flags: HIST_FIELD_FL_VAR var.name: __arg_3921_2 var.idx (into tracing_map_elt.vars[]): 0 type: unsigned long[] size: 128 is_signed: 0 function: hist_field_nop() key fields: hist_data->fields[2]: flags: HIST_FIELD_FL_KEY ftrace_event_field name: prev_pid type: pid_t size: 8 is_signed: 1 function: hist_field_s32() The "function:" field above is added. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260122203822.58df4d80@gandalf.local.home Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_hist.c | 75 +++++++++++++++++++------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_h= ist.c index 0908a9f7e289..e245446a8cf7 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -105,38 +105,44 @@ enum field_op_id { FIELD_OP_MULT, }; =20 +#define FIELD_FUNCS \ + C(NOP, "nop"), \ + C(VAR_REF, "var_ref"), \ + C(COUNTER, "counter"), \ + C(CONST, "const"), \ + C(LOG2, "log2"), \ + C(BUCKET, "bucket"), \ + C(TIMESTAMP, "timestamp"), \ + C(CPU, "cpu"), \ + C(COMM, "comm"), \ + C(STRING, "string"), \ + C(DYNSTRING, "dynstring"), \ + C(RELDYNSTRING, "reldynstring"), \ + C(PSTRING, "pstring"), \ + C(S64, "s64"), \ + C(U64, "u64"), \ + C(S32, "s32"), \ + C(U32, "u32"), \ + C(S16, "s16"), \ + C(U16, "u16"), \ + C(S8, "s8"), \ + C(U8, "u8"), \ + C(UMINUS, "uminus"), \ + C(MINUS, "minus"), \ + C(PLUS, "plus"), \ + C(DIV, "div"), \ + C(MULT, "mult"), \ + C(DIV_POWER2, "div_power2"), \ + C(DIV_NOT_POWER2, "div_not_power2"), \ + C(DIV_MULT_SHIFT, "div_mult_shift"), \ + C(EXECNAME, "execname"), \ + C(STACK, "stack"), + +#undef C +#define C(a, b) HIST_FIELD_FN_##a + enum hist_field_fn { - HIST_FIELD_FN_NOP, - HIST_FIELD_FN_VAR_REF, - HIST_FIELD_FN_COUNTER, - HIST_FIELD_FN_CONST, - HIST_FIELD_FN_LOG2, - HIST_FIELD_FN_BUCKET, - HIST_FIELD_FN_TIMESTAMP, - HIST_FIELD_FN_CPU, - HIST_FIELD_FN_COMM, - HIST_FIELD_FN_STRING, - HIST_FIELD_FN_DYNSTRING, - HIST_FIELD_FN_RELDYNSTRING, - HIST_FIELD_FN_PSTRING, - HIST_FIELD_FN_S64, - HIST_FIELD_FN_U64, - HIST_FIELD_FN_S32, - HIST_FIELD_FN_U32, - HIST_FIELD_FN_S16, - HIST_FIELD_FN_U16, - HIST_FIELD_FN_S8, - HIST_FIELD_FN_U8, - HIST_FIELD_FN_UMINUS, - HIST_FIELD_FN_MINUS, - HIST_FIELD_FN_PLUS, - HIST_FIELD_FN_DIV, - HIST_FIELD_FN_MULT, - HIST_FIELD_FN_DIV_POWER2, - HIST_FIELD_FN_DIV_NOT_POWER2, - HIST_FIELD_FN_DIV_MULT_SHIFT, - HIST_FIELD_FN_EXECNAME, - HIST_FIELD_FN_STACK, + FIELD_FUNCS }; =20 /* @@ -5854,6 +5860,12 @@ const struct file_operations event_hist_fops =3D { }; =20 #ifdef CONFIG_HIST_TRIGGERS_DEBUG + +#undef C +#define C(a, b) b + +static const char * const field_funcs[] =3D { FIELD_FUNCS }; + static void hist_field_debug_show_flags(struct seq_file *m, unsigned long flags) { @@ -5918,6 +5930,7 @@ static int hist_field_debug_show(struct seq_file *m, seq_printf(m, " type: %s\n", field->type); seq_printf(m, " size: %u\n", field->size); seq_printf(m, " is_signed: %u\n", field->is_signed); + seq_printf(m, " function: hist_field_%s()\n", field_funcs[field->fn_= num]); =20 return 0; } --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 BDD6B35DD06 for ; Tue, 27 Jan 2026 15:06:07 +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=1769526367; cv=none; b=DNGXkjWTVymhJ113ZXkFRPOfWu0r5SOM+qywTXTG0rx2FuT9mPhYv+sd/Ji4RJCAZ701qzXWLQcenagbgd4YJq6KMI6+4/IKuGhNTWDraJ0J3zfnE1kgKnGN0V7ooD5Ps+zRimoacB0Jt5/JrzspbSGl8DyB839WOoXy43t8u88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526367; c=relaxed/simple; bh=Z/P3xQ3Fh9vK1TBE5Ubs+VBUebnpk3HuIqef/YiwItg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=huYSBnHYtbmQjjgzLqaQ4EKTr6LMcQz9x9Dc8GFtn/6EF6tOQXdaIFioeVFltNK47U+hdLRAuR6nfLYY+779S5fs4ujYwRz7+fbXimp0cW4Ri2EtshikIvAqTGD1gugtPM2UGPHfHL2CzvEw0FDBqiAG/oLuGFGyX41PxMqX5QQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KuWXG4nt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KuWXG4nt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4F78C19422; Tue, 27 Jan 2026 15:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526367; bh=Z/P3xQ3Fh9vK1TBE5Ubs+VBUebnpk3HuIqef/YiwItg=; h=Date:From:To:Cc:Subject:References:From; b=KuWXG4ntB1dYRvdS/W9kvhZ0xX1sFki9vVSLUX25cXFh3bUeNxVk5ABgtLuGmkt3O 3TP3iOJoKvd/CGrgDEzVkIRl2ca9Na0ZnR7U9d5PM3Ytt5+NFHFFsjR/gOYQ+FOlSV ul5kzDbuNZyZLn+S0UCozV3zYnNkFVj6V1IJW59iwJiLMa2b/0vywcz8c579ErSsed iylVCt0ZmGtYxLuAaxLXSgA54mrluf4fi87ZuWWlE4J7oTctsYStkSEzgK4i+S+lRS 0gvYCqimYfn971dbnzR7XMeuA+uIaIa2CKCrzlW2RdCvz4PRvT/ayQXNpT1HnEU6yY kGNGF4J2lEViw== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdx-00000000LgU-2Tnp; Tue, 27 Jan 2026 10:06:13 -0500 Message-ID: <20260127150613.443907430@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:08 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Tom Zanussi Subject: [for-next][PATCH 13/15] tracing: Remove notrace from trace_event_raw_event_synth() References: <20260127150555.840066272@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 When debugging the synthetic events, being able to function trace its functions is very useful (now that CONFIG_FUNCTION_SELF_TRACING is available). For some reason trace_event_raw_event_synth() was marked as "notrace", which was totally unnecessary as all of the tracing directory had function tracing disabled until the recent FUNCTION_SELF_TRACING was added. Remove the notrace annotation from trace_event_raw_event_synth() as there's no reason to not trace it when tracing synthetic event functions. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260122204526.068a98c9@gandalf.local.home Acked-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_synth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_= synth.c index 45c187e77e21..ce42fbf16f4a 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -499,9 +499,9 @@ static unsigned int trace_stack(struct synth_trace_even= t *entry, return len; } =20 -static notrace void trace_event_raw_event_synth(void *__data, - u64 *var_ref_vals, - unsigned int *var_ref_idx) +static void trace_event_raw_event_synth(void *__data, + 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; --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 EF8B035DD14 for ; Tue, 27 Jan 2026 15:06:07 +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=1769526368; cv=none; b=e4R7g9xOlnBA2hKL+4Gl5E2ISdRwlaZPh9av7E2nsKxk+/E8Z+RI2UsH/wE99G8KSGR96lbA0BfIDdAbeYzakTSRF4IHT9L1fMq1il46X+Lnb/v4nFW++JCqbpWW5sMmaCU27cfJ/cNwT+48EoaBympkFV7/vgP3syRk/Rj9rJ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526368; c=relaxed/simple; bh=bicGd8d3hH1wHh88x65zy3nXf1AGVk/iW2GEnB43qAw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=I2IKLbxvufgDmexfGxPzEvuqbshonX3LVq/pOG/wgBBaeRzycqqOc2eL+ZR2O6iGPpGy7nuGrPOyVAv5sOZbIX4QmU8MNQMG4mihI+xqzMp7Q/CTgJKc4lAPW8Amf2TucilyaGz9P3ghyixe6GeRk33IIRwkc3woYhgWHa/gaZ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fWlhPFAY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fWlhPFAY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2239C116C6; Tue, 27 Jan 2026 15:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526367; bh=bicGd8d3hH1wHh88x65zy3nXf1AGVk/iW2GEnB43qAw=; h=Date:From:To:Cc:Subject:References:From; b=fWlhPFAYf4mRdbiQtCh0AsNtCG757aqfrDi1d7BnTVVlutLS0dpalRrP2qgyxOBms jOWpwrCxUJQ06UqMQJgB/e7QXuVcUaAAYMUc0EwSg16w05QWwl0/8mnJgY5QnFLpWj 3SQO2via/kGVBsap5fmWIHnBHhk8tvBVvZPWalvcZnHWaL8y4LKa06wib5KFzRnbSc vKedaDBfZzvjJXOI6tABfK70nBgzQG24UYi14cU3ei/2JmebFMoc3c5H37ZwgGXsSk AWmVC1r72enIXpZGPh1qqw7HNKOLLMZoDkmH4iwAtNopz1bmRaBwuQPU2q6D3Vw3RA d+1O9xTyDUQ7Q== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdx-00000000Lh1-3CNp; Tue, 27 Jan 2026 10:06:13 -0500 Message-ID: <20260127150613.609056092@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:09 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Tom Zanussi Subject: [for-next][PATCH 14/15] tracing: Up the hist stacktrace size from 16 to 31 References: <20260127150555.840066272@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 Recording stacktraces is very useful, but the size of 16 deep is very restrictive. For example, in seeing where tasks schedule out in a non running state, the following can be used: ~# cd /sys/kernel/tracing ~# echo 'hist:keys=3Dcommon_stacktrace:vals=3Dhitcount if prev_state & 3' = > events/sched/sched_switch/trigger ~# cat events/sched/sched_switch/hist [..] { common_stacktrace: __schedule+0xdc0/0x1860 schedule+0x27/0xd0 schedule_timeout+0xb5/0x100 wait_for_completion+0x8a/0x140 xfs_buf_iowait+0x20/0xd0 [xfs] xfs_buf_read_map+0x103/0x250 [xfs] xfs_trans_read_buf_map+0x161/0x310 [xfs] xfs_btree_read_buf_block+0xa0/0x120 [xfs] xfs_btree_lookup_get_block+0xa3/0x1e0 [xfs] xfs_btree_lookup+0xea/0x530 [xfs] xfs_alloc_fixup_trees+0x72/0x570 [xfs] xfs_alloc_ag_vextent_size+0x67f/0x800 [xfs] xfs_alloc_vextent_iterate_ags.constprop.0+0x52/0x230 [xfs] xfs_alloc_vextent_start_ag+0x9d/0x1b0 [xfs] xfs_bmap_btalloc+0x2af/0x680 [xfs] xfs_bmapi_allocate+0xdb/0x2c0 [xfs] } hitcount: 1 [..] The above stops at 16 functions where knowing more would be useful. As the allocated storage for stacks is the same for strings, and that size is 256 bytes, there is a lot of space not being used for stacktraces. 16 * 8 =3D 128 Up the size to 31 (it requires the last slot to be zero, so it can't be 32). Also change the BUILD_BUG_ON() to allow the size of the stacktrace storage to be equal to the max size. One slot is used to hold the number of elements in the stack. BUILD_BUG_ON((HIST_STACKTRACE_DEPTH + 1) * sizeof(long) >=3D STR_VAR_LEN_= MAX); Change that from ">=3D" to just ">", as now they are equal. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://patch.msgid.link/20260123105415.2be26bf4@gandalf.local.home Reviewed-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.h | 2 +- kernel/trace/trace_events_hist.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 8888fc9335b6..69e7defba6c6 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -128,7 +128,7 @@ enum trace_type { =20 #define FAULT_STRING "(fault)" =20 -#define HIST_STACKTRACE_DEPTH 16 +#define HIST_STACKTRACE_DEPTH 31 #define HIST_STACKTRACE_SIZE (HIST_STACKTRACE_DEPTH * sizeof(unsigned long= )) #define HIST_STACKTRACE_SKIP 5 =20 diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_h= ist.c index e245446a8cf7..0fc641461be5 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -3163,7 +3163,7 @@ static inline void __update_field_vars(struct tracing= _map_elt *elt, u64 var_val; =20 /* Make sure stacktrace can fit in the string variable length */ - BUILD_BUG_ON((HIST_STACKTRACE_DEPTH + 1) * sizeof(long) >=3D STR_VAR_LEN_= MAX); + BUILD_BUG_ON((HIST_STACKTRACE_DEPTH + 1) * sizeof(long) > STR_VAR_LEN_MAX= ); =20 for (i =3D 0, j =3D field_var_str_start; i < n_field_vars; i++) { struct field_var *field_var =3D field_vars[i]; --=20 2.51.0 From nobody Sat Feb 7 14:52:51 2026 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 368F435E533 for ; Tue, 27 Jan 2026 15:06:08 +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=1769526368; cv=none; b=eyrd5XdwmLTpIO45aRWiOGv7vmnt5pim58y9kJLu53UHVYOJ8pcUtt4JAQHxAnHor925Tz9BQP2tytX4slDYblYuhFBDARbaCn6Kpsl0GvO4TC1voriYq1b4aq+bj3XPOgC6mIlPzcfahwQzkk7ONLfVaUA3iY0HoIdS6vAQp64= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769526368; c=relaxed/simple; bh=mfb7yxAPFt8DDPvfPmxwZDLUZvdFaVADsybCJ7EccOQ=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=Aii+eyQVJClDMgrY0xEVQRYXhkaVy3bMja5J47VOZ2q1BUjxxtWJtw+G/WZ2WLo07mQIsM0EMreKDGGnD1fiML8ILi7ADdFdYz873I/aynkxWoTudrlnRr4mWNf7LBlYo+SjlQiFN4v5oySBZikBKtqVZYmDfRsvctIXwDrEdqg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gznk0b8A; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gznk0b8A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07024C19422; Tue, 27 Jan 2026 15:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769526368; bh=mfb7yxAPFt8DDPvfPmxwZDLUZvdFaVADsybCJ7EccOQ=; h=Date:From:To:Cc:Subject:References:From; b=Gznk0b8AdUEZO8d/hMRirh02JpBk7RJCm0BUm92WA5qmJbzJNrTA+eY5dTmzw19oX RuLpyoNkbO2l0BdUBRngAXxIoMYZxHTi2IzhqD88EFioySS3ApQjZvExywZ7HLuB2U +LL7bFcKisJ5KYsfFIBEGh0LcsHhxWw8GlNzYWQKKmNDNSDNDqvetQT7heVTlUbDQZ xTFiiW5gxWgQ9dJfmP5ZiBvgPYFIbPbsD6QBOqUmYjghn+23xoiBHUi647xY+kKsLp nm1o7U//cN/oXXiAMxtBO+J9SNI9q0JocEtyXna7JBKm5y8SrcHgGQkI0j3xqVTpnF TL56NyqTdLtLQ== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vkkdx-00000000LhX-3sf1; Tue, 27 Jan 2026 10:06:13 -0500 Message-ID: <20260127150613.780962226@kernel.org> User-Agent: quilt/0.68 Date: Tue, 27 Jan 2026 10:06:10 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Tom Zanussi Subject: [for-next][PATCH 15/15] tracing: Remove duplicate ENABLE_EVENT_STR and DISABLE_EVENT_STR macros References: <20260127150555.840066272@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 The macros ENABLE_EVENT_STR and DISABLE_EVENT_STR were added to trace.h so that more than one file can have access to them, but was never removed from their original location. Remove the duplicates. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Tom Zanussi Link: https://patch.msgid.link/20260126130037.4ba201f9@gandalf.local.home Fixes: d0bad49bb0a09 ("tracing: Add enable_hist/disable_hist triggers") Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index f372a6374164..4972e1a2b5f3 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -4097,11 +4097,6 @@ void trace_put_event_file(struct trace_event_file *f= ile) EXPORT_SYMBOL_GPL(trace_put_event_file); =20 #ifdef CONFIG_DYNAMIC_FTRACE - -/* Avoid typos */ -#define ENABLE_EVENT_STR "enable_event" -#define DISABLE_EVENT_STR "disable_event" - struct event_probe_data { struct trace_event_file *file; unsigned long count; --=20 2.51.0