From nobody Tue Apr 7 12:55:14 2026 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 742093A3E96 for ; Fri, 13 Mar 2026 13:23:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408241; cv=none; b=PKn1CoovhLHSztkQEzMeJHG9B3QqAOEXlZ1jZvvh70jskDM0Jv+jNJCUnw4UptiWlTlBXbisbvGsM/fjrPXs5FEHeYYb4juTMuEElxNJn/JcI3UWC6INwVqC9t/m09W0gBvs0GfZjOwAcnHOFheGGa+vTqaq4Dx8P4919xtRZcs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408241; c=relaxed/simple; bh=gePKOP5tnt0R8TPIErv3cmLoJ02zcFPQDivFAVxPdOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NiOCQo7pUsh39uHwHOQqJaDTxyV2NVpao6WUnWNaB+02MGh6TM2TZ45AbmovXuKD9IF9Y08D4Ar7ot4a5qs5Q3SJ+SblB5iCN6zinGBdIG2A05NJxoW2L5XS5w4tErjQiDb06Q4ZSoTc7rCkrexCRT9KzOn91LowO6ru0QerHXo= 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=lLOAFyE+; arc=none smtp.client-ip=209.85.167.177 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="lLOAFyE+" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-4671cbce32bso548427b6e.3 for ; Fri, 13 Mar 2026 06:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408238; x=1774013038; 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; bh=hpMXv4qahUc2uiZbMeFCgErFRwXSuQXuET6sVgGMTXM=; b=lLOAFyE+/nGkPiUqjMqbbVwfMgf+T6WTq9aH3Q2ZHtb3jPY+9Z/oEAsa+g48KYeVLu b6paICTOrf0Ek0jnjpyO1gAd+MDznuuYWc3ia8X7zDbwnt/qX7PkRlOgKw1ciswq/+ic N665v96eC94iZB9u1Hay3wR/o+LF9P8jaxKRWRqzj96JILEYN0sx5oTSzTfi7W3KlBrW JNA721HSPPeNKfRt4l5m8CqdnqehcAlt0LW1RdTaHpOHahdHquxKynKn07lPNWQfREsV A5khXCqFh7CIaD1Bbl2PLTlyrwgPrP3Grslgbf7N69JAJ8OY6uATsD42eJ4raTvrUycP efmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408238; x=1774013038; 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; bh=hpMXv4qahUc2uiZbMeFCgErFRwXSuQXuET6sVgGMTXM=; b=ZxxyXIbKPBPj0ZN7Wl8I1WGe4AqFLxVF0ytjQAvKAtNgpIEp+/14ZVlNqg4oHlsH23 4VBQvYZ6/PYT96TfWoZLffoMQQ2lfOYzDiYNT3pXSPVTTKQcRJi8vqgYQEiuKHZCSsS2 5GZ3qY3HH/0ABX5HONRTL+wpATQTfpC5VIgcTGd5RtfHj4eWNwcGZdpsf/fBGKisJtv6 i1VkWJO0MculMYLYNCZQf8bh9yJ2N+GyGTeEPrwdugCnyDP6aHhFkOi/NFHXdrwKs/vU ZhEelEkUCE1AL2hbfKBLJlRcOJOGNsL3mMgca+lWyczWNnXZdpmaug28UrFRzJkx/MkB 3Ctw== X-Forwarded-Encrypted: i=1; AJvYcCUMO3sp9P4vnQHKsSm5g9yfoCMQ5/r9gxNh1C00iVDI/ZDoxVO5DM49a4SDEVZa5wB72dLDnMKXDTF4JiM=@vger.kernel.org X-Gm-Message-State: AOJu0YwzW7PDequMrhorbJ89JlpHIFkpdKiL546K/bs+dIBjBqg96uZ3 MA00+DlBkRn9JrVWryuYu6gKx7BAcJvBEIA3bN2qrqKsvPDJaIHMab472XeqBnle X-Gm-Gg: ATEYQzzvuLpJduxN5UyWfZ4UjI5a5hbdirhY8UNyb+bBxMI+anXv5/3NibOuyJb9dui s51f3/INqV/Sr/YJuVKUVaMGOQ7f0hpFBoaCENEkuyemwlAItBux3y5zXbKVPdEwJKqmUOynee4 JHEXZm4U+EjRMQ9CRfrYHru8LVzlJJw6w0XRkJ1oVmnOse9DWMO499whUtMMAeRmK9ipa1D7u7h yOLZzJHlZxd/SHmRAgEiGoMK7yqVUUY0wfNrJ+GLCIwu/r66DV6LYMxKpD2OlFK/F5B77JiFxyl WXlDnm8lONwuxxurR4piHbg05VXsiIL8WA5ua7biEq+q3eZsMszkxAxvlrwkDMgh53XihlOTHgU PFOVAVJ0CKCR1O8rtarbBXPiOA5Zc2W64/uvbbGxNvgwj4f/0/mxiNAd4I6JbnTkacNrleh2qQW XMAWTaUO9famL+H344r7FY5I9yqgjl0w/XuncalRhh4xXwOjZacsgptgYJof8= X-Received: by 2002:a05:6808:1b0b:b0:467:a44:dde2 with SMTP id 5614622812f47-46757583573mr1661703b6e.56.1773408238278; Fri, 13 Mar 2026 06:23:58 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:57 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jonathan Corbet , Shuah Khan , Andrew Morton , Jim Cromie , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 28/65] dyndbg: split multi-query strings with % Date: Fri, 13 Mar 2026 07:19:53 -0600 Message-ID: <20260313132103.2529746-29-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-1-jim.cromie@gmail.com> 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" Since commit 85f7f6c0edb8 ("dynamic_debug: process multiple debug-queries on a line") Multi-query commands have been allowed: modprobe drm dyndbg=3D"class DRM_UT_CORE +p; class DRM_UT_KMS +p" modprobe drm dyndbg=3D< [ 203.902703] dyndbg: query parse failed [ 203.902871] dyndbg: processed 2 queries, with 0 matches, 2 errs bash: echo: write error: Invalid argument The '%' splits the input into 2 queries, and both fail. Given the limited utility of matching against the working parts of a format string "foo: %d bar %s", nothing is actually lost here. selftests-dyndbg: test_percent_splitting This does basic testing of classmaps using '%' separated multi-queries. It modprobes test_dynamic_debug with several classes enabled, and counts to verify that the expected sites show the enablement in the control file. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 8 ++++--- lib/dynamic_debug.c | 2 +- .../dynamic_debug/dyndbg_selftest.sh | 24 +++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index dbf901150587..0a42b9de55ac 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -85,10 +85,12 @@ by spaces, tabs, or commas. So these are all equivalen= t:: :#> ddcmd ' file svcsock.c line 1603 +p ' :#> ddcmd file,svcsock.c,line,1603,+p =20 -Command submissions are bounded by a write() system call. -Multiple commands can be written together, separated by ``;`` or ``\n``:: +Command submissions are bounded by a write() system call. Multiple +commands can be written together, separated by ``%``, ``;`` or ``\n``:: =20 - :#> ddcmd "func pnpacpi_get_resources +p; func pnp_assign_mem +p" + :#> ddcmd func foo +p % func bar +p + :#> ddcmd func foo +p \; func bar +p + :#> ddcmd "func foo +p ; func bar +p" :#> ddcmd <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a77c6e9ff90c..a1c3141372d1 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -626,7 +626,7 @@ static int ddebug_exec_queries(char *query, const char = *modname) int i, errs =3D 0, exitcode =3D 0, rc, nfound =3D 0; =20 for (i =3D 0; query; query =3D split) { - split =3D strpbrk(query, ";\n"); + split =3D strpbrk(query, "%;\n"); if (split) *split++ =3D '\0'; =20 diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index c7bf521f36ee..513f6cb1db1d 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -256,9 +256,33 @@ function comma_terminator_tests { ddcmd =3D_ } =20 +function test_percent_splitting { + echo -e "${GREEN}# TEST_PERCENT_SPLITTING - multi-command splitting on= % ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP - test requires test-dynamic-debug.ko" + return + fi + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =3D_ + modprobe test_dynamic_debug dyndbg=3Dclass,D2_CORE,+pf%class,D2_KMS,+p= t%class,D2_ATOMIC,+pm + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + check_match_ct test_dynamic_debug 23 -r + # add flags to those callsites + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml + check_match_ct =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 + check_match_ct test_dynamic_debug 23 -r + ifrmmod test_dynamic_debug +} + tests_list=3D( basic_tests comma_terminator_tests + test_percent_splitting ) =20 # Run tests --=20 2.53.0