From nobody Tue Jun 16 18:31:25 2026 Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) (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 44EE6391E55 for ; Wed, 29 Apr 2026 20:23:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777494188; cv=none; b=DG2TEfXXyF8emILYMUb5aRORhJhtUFbrfyB5jQL8zWnnl76Oh5zXJMzSprLdRmExeUMjYOok1OcROe5ma5MTUR4q7MhZtdpUf3iVL/PyVjPLhPm7ST5bFfTxzYpERCN55RZvUOke3iWZBbJG7j2exUccVFLJy8+WI7lRFu10hJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777494188; c=relaxed/simple; bh=lhQ6MsghRCE3/2WYq+2Cnh4T9ZTtSPcWmaHAeQV8PBk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=SHlfv37Dz91C3vvGTTOuz6QwUAAIf6cwMIhE16H2jDCyuu9yr6i8dcYcRL5BxHFS3fisrz5wAHFkcFwUH/bVF0I2vqjE8xJrNQYnoR2O4JMHgRn9PCSyvgyyLOK9d9A9MXHbEsh6BXWvEt0MiGUGGjXbL4xUv93gd37f0XcMJU8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf16.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A57511A011A; Wed, 29 Apr 2026 20:22:58 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf16.hostedemail.com (Postfix) with ESMTPA id D7D6C2000F; Wed, 29 Apr 2026 20:22:56 +0000 (UTC) Date: Wed, 29 Apr 2026 16:23:14 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mathieu Desnoyers , Breno Leitao , Sheng Che Peng Subject: [GIT PULL] tracing: Fixes for v7.1 Message-ID: <20260429162314.2285a252@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D7D6C2000F X-Rspamd-Server: rspamout06 X-Stat-Signature: zecb3st93ckz8y31wsafibkna8mahh6r X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX18Qox5Rsu2l3IuU0rE9AaqIvkghUDwcw28= X-HE-Tag: 1777494176-103119 X-HE-Meta: U2FsdGVkX19JCXBfsGwBaGBT1Sn5ZuiLUfII9cUO98ASICu6jYXuGjoq1A7JexY7baykcoRUN7kGMSm9bAPOXBb9fPw0MM9+Eeh98kVrduJfYWdGuHp0I2lz9jLINzz673OB3MNR0J3wFsRgLbbeMxTpIINKncP/Bre1Ij6baDaxCKqJ8I1JgPztaxaI0m+788SorLIR3Fnr4O3p/WpOQyNjKpNYkIy/6xaZkRrfN4IS5zAvw7cRAk/f/QS6UIlzgGM9g5thhHXG+z6jG+tOMYTP09r9+Mj/20tVTEgXfxkundz9IlCZ+QxdkKHQRooSnVeF3YwzW6Jip6uqXiJcjMGspXb0FJov Content-Type: text/plain; charset="utf-8" Linus, tracing fixes for v7.1: - Fix inverted check of registering the stats for branch tracing When calling register_stat_tracer() which returns zero on success and negative on error, the callers were checking the return of zero as an error and printing a warning message. Because this was just a normal printk() message and not a WARN(), it wasn't caught in any testing. Fix the check to print the warning message when an error actually happens. - Fix a typo in a comment in tracepoint.h - Limit the size of event probes to 3K in size It is possible to create a dynamic event probe via the tracefs system that is greater than the max size of an event that the ring buffer can hold. This basically causes the event to become useless. Limit the size of an event probe to be 3K as that should be large enough to handle any dynamic events being created, and fits within the PAGE_SIZE sub-buffers of the ring buffer. Please pull the latest trace-v7.1-rc1 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v7.1-rc1 Tag SHA1: 817a02442bc5525f75145d7088542440e739a51c Head SHA1: b2aa3b4d64e460ac606f386c24e7d8a873ce6f1a Breno Leitao (1): tracing: branch: Fix inverted check on stat tracer registration Sheng Che Peng (1): tracepoint: Fix typo in tracepoint.h comment Steven Rostedt (1): tracing/probes: Limit size of event probe to 3K ---- include/linux/tracepoint.h | 2 +- kernel/trace/trace_branch.c | 8 ++++---- kernel/trace/trace_probe.c | 6 ++++++ kernel/trace/trace_probe.h | 4 +++- 4 files changed, 14 insertions(+), 6 deletions(-) --------------------------- diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 578e520b6ee6..763eea4d80d8 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -202,7 +202,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(t= racepoint_ptr_t *p) #define TP_CONDITION(args...) args =20 /* - * Individual subsystem my have a separate configuration to + * Individual subsystem may have a separate configuration to * enable their tracepoints. By default, this file will create * the tracepoints if CONFIG_TRACEPOINTS is defined. If a subsystem * wants to be able to disable its tracepoints from being created diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index 6809b370e991..d1564db95a8f 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c @@ -373,10 +373,10 @@ __init static int init_annotated_branch_stats(void) int ret; =20 ret =3D register_stat_tracer(&annotated_branch_stats); - if (!ret) { + if (ret) { printk(KERN_WARNING "Warning: could not register " "annotated branches stats\n"); - return 1; + return ret; } return 0; } @@ -438,10 +438,10 @@ __init static int all_annotated_branch_stats(void) int ret; =20 ret =3D register_stat_tracer(&all_branch_stats); - if (!ret) { + if (ret) { printk(KERN_WARNING "Warning: could not register " "all branches stats\n"); - return 1; + return ret; } return 0; } diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index e1c73065dae5..e0d3a0da26af 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -1523,6 +1523,12 @@ static int traceprobe_parse_probe_arg_body(const cha= r *argv, ssize_t *size, parg->offset =3D *size; *size +=3D parg->type->size * (parg->count ?: 1); =20 + if (*size > MAX_PROBE_EVENT_SIZE) { + ret =3D -E2BIG; + trace_probe_log_err(ctx->offset, EVENT_TOO_BIG); + goto fail; + } + if (parg->count) { len =3D strlen(parg->type->fmttype) + 6; parg->fmt =3D kmalloc(len, GFP_KERNEL); diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h index 9fc56c937130..262d8707a3df 100644 --- a/kernel/trace/trace_probe.h +++ b/kernel/trace/trace_probe.h @@ -38,6 +38,7 @@ #define MAX_BTF_ARGS_LEN 128 #define MAX_DENTRY_ARGS_LEN 256 #define MAX_STRING_SIZE PATH_MAX +#define MAX_PROBE_EVENT_SIZE 3072 =20 /* Reserved field names */ #define FIELD_STRING_IP "__probe_ip" @@ -561,7 +562,8 @@ extern int traceprobe_define_arg_fields(struct trace_ev= ent_call *event_call, C(BAD_TYPE4STR, "This type does not fit for string."),\ C(NEED_STRING_TYPE, "$comm and immediate-string only accepts string type"= ),\ C(TOO_MANY_ARGS, "Too many arguments are specified"), \ - C(TOO_MANY_EARGS, "Too many entry arguments specified"), + C(TOO_MANY_EARGS, "Too many entry arguments specified"), \ + C(EVENT_TOO_BIG, "Event too big (too many fields?)"), =20 #undef C #define C(a, b) TP_ERR_##a