From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC1272E7635 for ; Fri, 24 Jul 2026 02:33:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784860406; cv=none; b=R1knSWWgQwFfwpOnvjKK/d45Y1UhqUMHluWb6h6UDmwx25plIu9LsoD4eOHtJsrdqfucEAerSeXDvWVjTrIpOhCgg5tKwrMXB7HXlexFOA5GtAK6PPT1ac90Jz4K5N0gNCbsbXVNWAUAxdoambps297qw4Ty3KmweVVs3ZB9W6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784860406; c=relaxed/simple; bh=nuRw+6p67qaHazyhijHeIaFQfYRohH4J45oaItgPOiw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M1r7QlfFC5wfqE4ez3NWc8u+rk2bsphAUXf0btyz9f/sBwijMJT8hzQKDt3nPEXl4bFYcV0+z6unnphvEzYc6vepCpYJFEfz7QmwN2XEJq5rT3pZuDdLPrNtzheKLikOjpGvYxZ2jRcMn0HwCEPzXwZpkvSOrEpFxpF0iRdohdA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a8n8J0HM; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a8n8J0HM" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2caed617615so15193015ad.3 for ; Thu, 23 Jul 2026 19:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784860404; x=1785465204; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uRpZaMx5e+nGKMC8zc7uMAUN5qp/LA2gF83ppDblymU=; b=a8n8J0HM9Zy6oat7WvZ60201RtAjbz9f5A3n/9iz/qgVXZysY5xOiE8I1GaCYSqqHo LebkMdsUYP9/+dzDoLwCvE2LsjVpWsSqmpVzFXkfyW5/4voOoD6VgTmlNGJYnHZgwtox WC256pCSexpYAp9AdCGWxxijmSEZJ6M+n2mEPjptkUE/yOWeioSBul6Xgxhcj8PQqN2I l3RqHYKWcQwR1KOwbTIqBfT0BEhAfc5NCbp4albLBQaqKmDprXFFmf7DY9aEWHUPfaYJ LM0K/4O+2c5WYF+MP5YtAgQRNoD90ZFzRKsKIKeARfsl6njp+CXYf0OEf90qtQ+czcD3 sDHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784860404; x=1785465204; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=uRpZaMx5e+nGKMC8zc7uMAUN5qp/LA2gF83ppDblymU=; b=MSyPTS6uU0lc8/UhPzvpKrO8Q3vOEe6+VSGHPyT5qm/JMhYjmv0i7mJuzbxJxwmYqW bpFpNQeDMKVB0nOePHIWOsk+eN4/rvEJuVensU0xKZig9whE3I80iVtBcAbtljdimQqB 5bMrERCBmCzpEhcyX1z82TEW5CJJa6rU3eZIM/oWHPxF8ZQ6q8iVxgOFRdM7Q/HkTFK5 gt9j3q/0amikILVXAWyeLJWYVrfRKwNg10EklacZD4aYnUFNR+1PFpHdKC2jIHpg1ayc I9ZR1QBXlE+8I903INdVgnQfeYMnPeVSgPYIcmyuAP0eaKa4ifeF7UpD7XHObioRWCpA gDdg== X-Forwarded-Encrypted: i=1; AHgh+RoW1s2fVw4so0mldMtRxGzql2EoJkD1jdymt+wNA/WdZQKTguG5U/FuBAFNoWtghoRgLlbF4G0Sul3xBw8=@vger.kernel.org X-Gm-Message-State: AOJu0YxnDBhnSyp2fyjL/IIXSW0FMltiLqET5K01UCo14aWFyzifXdiB UfPCzco1sF4eGWonRMGE/k/+EG+lNyIJGdxwwIK1RVq3SJLJyNtg9IR6TvBQzQ== X-Gm-Gg: AR+sD11FSL+72cnQBNqocg1ViNHFRM6jHXTL2CMFnEGgdh7rde+mJw+hZzagTJAdzu7 ZFjaujN1ypz7JtQmQ0kz7DSCDu7u0JYJjjD2mXKJWJ3kKXUAi0i8/DCXWpQvon8q0TPRt+HgkUc QzHNBTSg1TKyWgTP9crflf38pY5FJN94e2+30xJ1HrxSaGLCj4/KfbfxeMUeq4F25bKPmQawwZ0 Hg3O1ujPY6EIaGVx/28SQXsYOiRWuBBy6g48KluyriecZrylZczuGqPQHZa6kz9UNZIDLklNSKB k4DJ1BoXTX20+DDZ8l4NleETf77r9IHwWPGanTWUUsTZuu7yskQ+n+IDdw1Ua9ysOKR2IW1nRNp 14p2KExmHx8+Wlemzc8jQ1qZ9VKj+Kd3Txcod8Xa4KibxjDK6voZwEicvzaAEye51xALsP4crgj wj3Y7mxQy4LqJTbA== X-Received: by 2002:a17:903:2341:b0:2ca:d975:5bbd with SMTP id d9443c01a7336-2cfa6b995b6mr65133375ad.20.1784860403839; Thu, 23 Jul 2026 19:33:23 -0700 (PDT) Received: from osman.mioffice.cn ([43.224.245.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf8f350560sm43044905ad.68.2026.07.23.19.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 19:33:23 -0700 (PDT) From: Zhan Xusheng X-Google-Original-From: Zhan Xusheng To: Masami Hiramatsu , Steven Rostedt , Shuah Khan Cc: Mathieu Desnoyers , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v3 4/5] tracing/probes: Extend max length of argument string Date: Fri, 24 Jul 2026 10:33:17 +0800 Message-ID: <20260724023317.624074-1-zhanxusheng@xiaomi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <178399140457.27810.11387684872148824707.stgit@devnote2> References: <178399140457.27810.11387684872148824707.stgit@devnote2> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Tue, Jul 14, 2026 at 10:10:04AM +0900, Masami Hiramatsu (Google) wrote: > - char buf[MAX_ARGSTR_LEN + 1]; > + char buf[MAX_COMMON_HEAD_LEN + 1]; > ... > +#define MAX_ARGSTR_LEN 255 > +#define MAX_COMMON_HEAD_LEN 63 Keeping the head buffer at 63 avoids growing it to 256, but it also preserves a pre-existing truncation of the kprobe/fprobe head: both trace_kprobe_match_command_head() and trace_fprobe_match_command_head() snprintf() the symbol / function name into this buffer ("%s" or "%s+%u"). Kernel symbols can be far longer than 63 -- Rust-mangled names are routinely 150-200+ chars (KSYM_NAME_LEN is 512); I see 199-char symbols in /proc/kallsyms here. This is the same delete-/match-by-command path you just fixed for the args matcher in commit 15f197856d68 ("tracing/probes: Avoid temporary buffer truncation in trace_probe_match_command_args()"): dyn_event_release() passes the symbol as argv[0] to *_match_command_head(), which then calls trace_probe_match_command_args(). The head runs first, so for a probe on a long symbol the head strcmp() already fails and the probe cannot be matched/deleted by full command -- before the args fix is even reached. Would it make sense to give the head matchers the same direct-comparison treatment instead of a fixed buffer -- compare the symbol (and optional "+offset") against argv[0] directly? uprobe already compares its filename directly, so mainly kprobe and fprobe would need it, and MAX_COMMON_HEAD_LEN could then be dropped. Thanks, Xusheng