From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 6FF3E3016E3 for ; Thu, 14 May 2026 15:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778772088; cv=none; b=G6xYpCqivSyurFRpxYbjv6I5m7TCEhahwZVDBipX6Q3Nr1jTLZUkcGZ3r9CQtSLrVawn4OoDT1Ll721mxUdu8dx5PESFN0hXDzAmmg6/yIcx5PsScs11+Gc4huJQP4LcBVzgij30DBNoMoNXL1ns5+eN3ZVro3qdRakAl8xDWIg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778772088; c=relaxed/simple; bh=E+DSAUBgHEQsfyxM6Knh3+4qtmmADUuWkGc6CuPvfUI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=soYepQ/vvoabzUlmsEKDzTuwlYvUFx8wrBdc43PNWK5hZlPKsWVhRabkxIPoINddRl43T1U+5swZKEuk8a7tD92bbG0Zb5ESJP03kR99Ef97lg+KC0IuyKTN6C8Pv4/Wmj/OvAqykSW9RkbkHUu80X93uVb/10trHrFyBodPQZk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OPSnLKe+; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OPSnLKe+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778772086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vd1fF6aAyPNOBNzcj+Y3eMBsL+QM4FlzHARfaZk0mQE=; b=OPSnLKe+owvAcLBhDMuL5FLUcL5efczNmZFPfgMQGDJ8Ci4+ey+59hfuJZ0Kg98zqzw5nX 451dnUDeZA3AaQNumGR2TBBQ1aYWWGoSc5fWWo2P7ghdl7Io7/qu+LMS3++XKOmDU89kp6 FrQW29Y9sXeD2tLzksbDTnLXr2LIlFs= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-670-RIula7KAOriklGyC7KJDAQ-1; Thu, 14 May 2026 11:21:23 -0400 X-MC-Unique: RIula7KAOriklGyC7KJDAQ-1 X-Mimecast-MFC-AGG-ID: RIula7KAOriklGyC7KJDAQ_1778772081 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 895A61956089; Thu, 14 May 2026 15:21:21 +0000 (UTC) Received: from gmonaco-thinkpadt14gen3.rmtit.csb (unknown [10.44.48.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 51D7C30001A2; Thu, 14 May 2026 15:21:18 +0000 (UTC) From: Gabriele Monaco To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Steven Rostedt , Gabriele Monaco Cc: Nam Cao , Thomas Weissschuh , Tomas Glozar , John Kacur , Wen Yang Subject: [PATCH v2 02/14] tools/rv: Fix substring match when listing container monitors Date: Thu, 14 May 2026 17:20:43 +0200 Message-ID: <20260514152055.229162-3-gmonaco@redhat.com> In-Reply-To: <20260514152055.229162-1-gmonaco@redhat.com> References: <20260514152055.229162-1-gmonaco@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 When listing monitors within a specific container (rv list ), the tool incorrectly matched monitors if the requested container name was only a prefix of the actual container (e.g., 'rv list sche' would incorrectly list monitors from 'sched:'). Fix this by ensuring the container name is an exact match and is immediately followed by the ':' separator. Signed-off-by: Gabriele Monaco --- tools/verification/rv/src/in_kernel.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/verification/rv/src/in_kernel.c b/tools/verification/rv/src/in_kernel.c index a200b63f4509..95adae321c11 100644 --- a/tools/verification/rv/src/in_kernel.c +++ b/tools/verification/rv/src/in_kernel.c @@ -193,8 +193,12 @@ static int ikm_fill_monitor_definition(char *name, struct monitor *ikm, char *co nested_name = strstr(name, ":"); if (nested_name) { /* it belongs in container if it starts with "container:" */ - if (container && strstr(name, container) != name) - return 1; + if (container) { + int len = strlen(container); + + if (strncmp(name, container, len) || name[len] != ':') + return 1; + } *nested_name = '/'; ++nested_name; ikm->nested = 1; -- 2.54.0