From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 B6EF8242D8D; Sun, 3 Aug 2025 03:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193514; cv=none; b=CL6RPRNG/cxKY2jMiyUe8v6PuUl1+qnYV+LT4UgQ4lQZt3dHUTLxFbB64/zU4RKb1TSlXvlIXI7k+Ac0k60bFlfheZv/7FV4DbDvSnhUS8ahS8AMVrK26z/FSwM7CEHNdK/NkgCVv55CKK4yU/i1x226RVBSh0JO8KXFK42RJmM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193514; c=relaxed/simple; bh=vCudJxKMdzkoU/DyEok0Rill822aXelf5qxnBmbRnRw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pZFz9ixFc7F1u6XqpNBSa+CKFmjkDIwytipKXs3x+jnsUscahaDdMa5zIfYm0zzV0DviJCbMaV4j10OT2coKfCQ7RkPCOKJPf9EfiiM52QIlUOqcdhkjZ8oxj4mb/f1ZEnXpLTqGPDrKCmkEM/u8X2n45yZNu2IyTIG7Wz36YaY= 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=KGHJ1LNM; arc=none smtp.client-ip=209.85.166.181 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="KGHJ1LNM" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3e40050551bso23417345ab.2; Sat, 02 Aug 2025 20:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193512; x=1754798312; 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=beSu7CSL3w07WglnJy1Z2nCCA3tI3eTc18tKf1Tqulg=; b=KGHJ1LNMQvk6zqXX4HCV3ryt85x0okiJkO5oSs52OyZ8s/H5i4gdXmcBMeCsNCssi+ t6OgXpHgN1u5/Rk2LhKYMKFHBHn8vrHLt76K+bjtaDzyHFpZdVKRzPfCiYdw6mdrIUyw PMaszO9lXHYAFnpExlEAySXl7uTL1ltmmRlhWJ0B2HtzSUGJH3qlrdlfKrSSQX2SbP5y 1eFJGBIpuJvJ+bnv+IyfVrFWJ3Y8BlmrJEocjjyGRf2PO6YoN//m20GgZ9U6bTRsY3ib 1tFbyR6cIJQd91SrDQIxjmEEHVqXPJhY3Ps8jE8MPfXG5IYqUa9dK0+iWpu+zh4a1tI4 U/Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193512; x=1754798312; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=beSu7CSL3w07WglnJy1Z2nCCA3tI3eTc18tKf1Tqulg=; b=RwqEgePhkPXHuskNxHGQVgJX7ggVW4RosVQ4m/ajaxBES3/hmKfhIhPH7dtk44UbQR +ra1bVpF7TaIEGgDVm0TnLRJiaZdKDO7BOHEgPby4jSKo7txBMgjSN+MVoXB7OiRqfCz mxbFVgGGtngGn3lPgPIZx3Xf+TeRFxXlz68XoUTj+Lm/zWxwBCnEvuDRoCpObWHO/bh6 e6ktMbXkAFRLA2Ie7lBd34PMYPxMIEQgtGGtBl+JJNGO5RX+gRPOttp4TM5+C1iUhGpA mvyuZ2drPpqDYTgrrIPyrttNXvldN5ZJQZE11kZJWdAiYxpJfEmu0Gv8zLWr5shF1gYV 9lzA== X-Forwarded-Encrypted: i=1; AJvYcCX3WsBGKLxCopjURhA3YkDvTwO3NdqYRJYZvK0C2spPYdAEy78FsoV/rJiD61tyv+tdpHx8n0drPuHoOMoJ@vger.kernel.org X-Gm-Message-State: AOJu0YwcRYQoSi3lPYKKZTGKWB/AkdlN/Rl/9LsDeojMhXDP/5C2soFa 98QK3RFaIs+Dts5G+VI04Sy4MXQ/p09ef0dkw6F3xLgDrPmwPAb0Y+HE2AS+CWx9PN0= X-Gm-Gg: ASbGncsewpnwPIYQYvN8PeH/gXO++Z5hRlKDeEzWXASdSSlztVPXEOl4fodr1tnzLfZ 5OnA+mPn7tWEl6kOUrll7eHjELWdUm2U+zqF/nHkCWou7iDdhWHsD3XUhipPlcg9xGLMjHR9P3B s8xKF+Xh9ZbY5FuISeE8cNIusd6G2BIwsn79dsiytYopBmbqrLgcBUzPK1p+xI/15l31EYJ0D2W oIbZKXkT9YbKNLjPCPzqAxynIEWr+ZjHiRXxGhMLns+9x6JarZIGe8OVDWiikb3VAX9QX4Z9wSU sgTXqKEyJavfoMxCrARAUTO6wGzL2W+q3F7vdRQ6iHMfXUhFsxoL0zvTd02zJnuKo5O0Qw9FJn6 3sBHTw+tpuUKfF9NoUfhSAVH/lrbAaCSpBGutrY9lB1yPwfmROhCOc4yh4dcMkE/FZvqeafFGgg AAPg== X-Google-Smtp-Source: AGHT+IGPxms8wwqy9B3Lg0t/TQmY+5ADcF8m62tHbLa+p0mv2IAzywY5OepZnyyKE5NE6pgPzLJclg== X-Received: by 2002:a05:6e02:2608:b0:3e2:c345:17f2 with SMTP id e9e14a558f8ab-3e41610a08amr92075105ab.3.1754193511817; Sat, 02 Aug 2025 20:58:31 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:31 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 01/58] docs/dyndbg: update examples \012 to \n Date: Sat, 2 Aug 2025 21:57:19 -0600 Message-ID: <20250803035816.603405-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" commit 47ea6f99d06e ("dyndbg: use ESCAPE_SPACE for cat control") changed the control-file to display format strings with "\n" rather than "\012". Update the docs to match the new reality. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- -v2 fix missed \012's --- .../admin-guide/dynamic-debug-howto.rst | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 7c036590cd07c..4ac18c0a1d953 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -38,12 +38,12 @@ You can view the currently configured behaviour in the = *prdbg* catalog:: =20 :#> head -n7 /proc/dynamic_debug/control # filename:lineno [module]function flags format - init/main.c:1179 [main]initcall_blacklist =3D_ "blacklisting initcall %s= \012 - init/main.c:1218 [main]initcall_blacklisted =3D_ "initcall %s blackliste= d\012" - init/main.c:1424 [main]run_init_process =3D_ " with arguments:\012" - init/main.c:1426 [main]run_init_process =3D_ " %s\012" - init/main.c:1427 [main]run_init_process =3D_ " with environment:\012" - init/main.c:1429 [main]run_init_process =3D_ " %s\012" + init/main.c:1179 [main]initcall_blacklist =3D_ "blacklisting initcall %s= \n" + init/main.c:1218 [main]initcall_blacklisted =3D_ "initcall %s blackliste= d\n" + init/main.c:1424 [main]run_init_process =3D_ " with arguments:\n" + init/main.c:1426 [main]run_init_process =3D_ " %s\n" + init/main.c:1427 [main]run_init_process =3D_ " with environment:\n" + init/main.c:1429 [main]run_init_process =3D_ " %s\n" =20 The 3rd space-delimited column shows the current flags, preceded by a ``=3D`` for easy use with grep/cut. ``=3Dp`` shows enabled callsites. @@ -59,10 +59,10 @@ query/commands to the control file. Example:: =20 :#> ddcmd '-p; module main func run* +p' :#> grep =3Dp /proc/dynamic_debug/control - init/main.c:1424 [main]run_init_process =3Dp " with arguments:\012" - init/main.c:1426 [main]run_init_process =3Dp " %s\012" - init/main.c:1427 [main]run_init_process =3Dp " with environment:\012" - init/main.c:1429 [main]run_init_process =3Dp " %s\012" + init/main.c:1424 [main]run_init_process =3Dp " with arguments:\n" + init/main.c:1426 [main]run_init_process =3Dp " %s\n" + init/main.c:1427 [main]run_init_process =3Dp " with environment:\n" + init/main.c:1429 [main]run_init_process =3Dp " %s\n" =20 Error messages go to console/syslog:: =20 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 243CF23FC49; Sun, 3 Aug 2025 03:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193518; cv=none; b=ODMLw6n4gNfsPNu7bWlp2Wc7JQZ8nfyXCXO1hbZgOnEAZ6YDUe4FquS/nxStvLjcBbEd8bWRSQX2g0dPZ+XHKXANsRB0cHuzHhbBh1ry/eGyE9YXKctFvYW5DkFfimvKbfGeISW+OrEJla0ITrZk02ssAocELnoOg4fCRGXzWsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193518; c=relaxed/simple; bh=qwSDFAjQHW/7wU1Icp8alV4PMk1kI3X0i/CQrdqYV4Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MUAsUs+cYqADjudr3oUlJ8z/OUpV91VT9sndSgTDIK3SBO8y8MkbsuryttdNJ3GFU3fRFcxrevgticvFpaEleVooxrxMno6h2YeIsQ1UZf51DNXecXoJivmZsfxdRBcbVk9+XjyhjMOTC/CAQ/0rbzS7QyV1802oAsTMeuX6mcY= 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=VMHGORvS; arc=none smtp.client-ip=209.85.166.169 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="VMHGORvS" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3e3f01612daso11598985ab.2; Sat, 02 Aug 2025 20:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193516; x=1754798316; 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=VfwMXVBLo5LDCQiepRGuFL3bGQZQgq3Btw/uQ5I/5wQ=; b=VMHGORvSNZO7shDF6RI4zye+Wcn/uy9DzqjDODycM+fJjtQv0uA64OPjLvJFVsADJe kkStFSs5+ZIP2p+ebXgLjMk49PNsMBsPdQ9r8DzI6WMt0Hy2wGTk8lIRg2SxaHNFrE4L lesS98gikjmM5AZprWbtFwVQUJYKbYuNQQKNT6QIbUUK4ceX13LdFqKm8MYw5F3mYmcW d9VKfr4IzM4uw+CKyos3bNhTVsFySu0Tkp3Ly9+qdK7TU+ZX88IoAy1WiDT7Qmh2xvvJ z4pqfp+2nApFjh5Br4R61Nvj0u6CdQ8DplVluixHXx4XadG2KsR4xYFRNmTsmqBUlv+T 16Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193516; x=1754798316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VfwMXVBLo5LDCQiepRGuFL3bGQZQgq3Btw/uQ5I/5wQ=; b=TfqHIT48jTOYX/NN51WCiJgba+NVXzgDdsxUmBn4OYIrvLNflq4GIR121GnozgUTJT 5kn6EXoF9is8mR0kRAomG0i5E02V82olkEHywApiN8+6csRRijxX/o2ah5JtYsvNFP3b cT/m6qxYDEyB4aE3rpH3Ep3el+j8ZV2Dj/PtrFcaC4RdKp8W4aOM4UvlR41a5vaPy255 /FgDhtXYYkdywvxpkbBtmtno3HU1kmMYtsbXrt/sPMTUcWgYect6RNPmiZwam84crfzW F4EfEmdsZalwl2s+IdVeyrD01u7aFaEzHnQctebTVK+idsx78Qtq/DRDL9TboiHtddm5 /fWg== X-Forwarded-Encrypted: i=1; AJvYcCUCxdDmGwvWpWZ3hNrePgDGgQC4dXwKNqPGimXClq2tDkv9kjiLqxYBvTte8lhcGbCGaPPqM0Wkgh/ux5pt@vger.kernel.org, AJvYcCWFlOCiGQrh+1qUsnzdVTtipdFhpaJOQDYxsbTGfPT3/w7bWGEt26xhtvyRc9h34sbRzL1PA2197c5V@vger.kernel.org X-Gm-Message-State: AOJu0YwKINBs3S6Ejgq5zQiBCHrImXQcmnjGfrmkz6XEOA8zglhrOtQ6 Rfyv26bonkAFv4SUrvLze6PYr41bGkxNLxdJMfkCmuEROb5h9QhpDelnLo/jpBgcI+8= X-Gm-Gg: ASbGncusnCkBBW/BfZgp5fcfnYlTx2XX+n5OOMQ5x2Q5ZQkeY2SJKNjJwDyTRKKfeJW dQGNJWHf+Xko2avQtaesa9wO6LUqHxYUyais8BniZunmpAjoOtCAOX+GzG1W6lummxj+GJS/iKP 2aLe7GD3vvOJaCnWaFUN5r4GryhJbbvLPwhIAudePe7hUOLHaDy08v52uuv3K8OTT18Qi2eHhpd Zg7+Ske3YhNm6wmmDEcOAOt9N+H0XUjoEB8ERukKB4kzMdc08K37lTmKjPFEeKL+wYgAxp9ywUU av7bFfylKTeeKBatPnZI1BKGP1MT1nGY1We0t2AV9iKWW2jLv1/lIkjeXfYrZrvHL9hDnyGJjHf h9yWQf9KtytIAJY8jzhN9651EuqTjtXEa+cBz/9UEuyIDtUSSPVs6aGorUBThaO+3ppWqOVKcqF vMgw== X-Google-Smtp-Source: AGHT+IEFfqhK3Yu96GZwkzn3H2xfn17hF1ni9VF+BRmo2ZqR7bTqyB9jhLRitAgzMOgRv2m2JMXKjg== X-Received: by 2002:a05:6e02:2612:b0:3e3:d8af:3847 with SMTP id e9e14a558f8ab-3e416181770mr93924425ab.16.1754193515916; Sat, 02 Aug 2025 20:58:35 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:35 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com, linux-doc@vger.kernel.org Subject: [PATCH v4 02/58] docs/dyndbg: explain flags parse 1st Date: Sat, 2 Aug 2025 21:57:20 -0600 Message-ID: <20250803035816.603405-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" When writing queries to >control, flags are parsed 1st, since they are the only required field, and they require specific compositions. So if the flags draw an error (on those specifics), then keyword errors aren't reported. This can be mildly confusing/annoying, so explain it instead. cc: linux-doc@vger.kernel.org Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- Documentation/admin-guide/dynamic-debug-howto.rst | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 4ac18c0a1d953..63a511f2337bc 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -109,9 +109,18 @@ The match-spec's select *prdbgs* from the catalog, upo= n which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". =20 - -A match specification is a keyword, which selects the attribute of -the callsite to be compared, and a value to compare against. Possible +Note: because the match-spec can be empty, the flags are checked 1st, +then the pairs of keyword values. Flag errs will hide keyword errs: + + bash-5.2# ddcmd mod bar +foo + dyndbg: read 13 bytes from userspace + dyndbg: query 0: "mod bar +foo" mod:* + dyndbg: unknown flag 'o' + dyndbg: flags parse failed + dyndbg: processed 1 queries, with 0 matches, 1 errs + +So a match-spec is a keyword, which selects the attribute of the +callsite to be compared, and a value to compare against. Possible keywords are::: =20 match-spec ::=3D 'func' string | --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 72650246BCF; Sun, 3 Aug 2025 03:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193520; cv=none; b=qxfpMWo+qrmfYRWPGpngW+6VOfnk/NFrlVmGFfbJ2rUwA3EK8sG17GAPBknALBckOE0SCWRthqKJ745Vywe2FrHIAJucSW8Q0jfZEgrkFE3TBvsMtiL6kY1QNd/smnRGx2kHKoAzS72VYhpqyN/amlmHm6ZZ/5giCHCAVjcX2Z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193520; c=relaxed/simple; bh=GsPb/rJcZBRAXb3H2gwmFCkQCsNJexKts4bSgjflKS8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b57/d8mpdhBoVEG1Z0sp5+N4SPOEjgCybWohNas7yeR6FzpysdXDSgGv/xNdbRfuBpOAHtSNEAd8E0PM3vgY98K5spm7JMGLEwvS8jtz+j0Yg/ralK20BhwWI+Zxv4Tr6+dLZXSC2lMDcMIK4eiXix26Bd7xc/uO+/ILa0AvwX8= 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=DfNjxtqh; arc=none smtp.client-ip=209.85.166.173 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="DfNjxtqh" Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3e3faafe30fso25237925ab.0; Sat, 02 Aug 2025 20:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193517; x=1754798317; 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=cT8/zmXv/UqMduSo2scBRCmGp63Q5/YeQDv4ZhdIR2c=; b=DfNjxtqhUza6XfML7uONhAmdcf+YagM04kwgl9ppoI3MN0HRgs3qu+ylsKIbWneI6C 0CYcYDJYohL/J+GiPuXxUFgd3msYreOcUIAfj9qyXiM/6F6zUSU4OU9D91KioAjbao56 4AAI7fEiEWQUDLSKZ1/oUVQNVFMnk1QFXjOtDnFN9UoXsfsqnCmxN69bB/wQhjkRE4fn PLF4Z+I3W82b2MH+fEUWMvlkqbm7LqZt7pZieGofpmXO/BHz7Y1S7dK8bYsW0eLvni3O w25KO4377FAEawZE39UNhzYlkAxudrXlLvMhAbrkbKUwQh6nUcShXYrk12NXKgMBZ2dP AztA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193517; x=1754798317; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cT8/zmXv/UqMduSo2scBRCmGp63Q5/YeQDv4ZhdIR2c=; b=PaA5fJ3+GdR9h+YDeHAwt2BtGjNh/xFMdlKr14EQ9tQIhd2Z2s1xEuG/9XAVTK1Kpd xm7pzsVS1r65hH0u6x76hxvf5wcZoROEbS7jvEXwj10BBYe/IqYxyfAhW8qJCOoHHsQm bcSz9M0AmYIocYfgCgXE3dS5XmPVufxSypWuprviGxz8fPIPvKmARHIsQLFdmo/uBNyn cXr5oe5YTB2bUlWKZBLVG0ZuamIWdyJvTH4/2/eozSRsaBUzCXvZJR69qvkAnQQAB/PE vqlKO91pUz0bQmwVCS8uLZgkBhwdCTRpA7piqeni8IxQTM5oNz+fENVPNxxqBGHaixdN S68g== X-Forwarded-Encrypted: i=1; AJvYcCW2Av420g/oIfn3PuAMYixvT7oGkF3Cu/wgpF/riRaw/SatcPpc+02ZHmy6ngrvUBCiN5ZMMuskEw6Yb9Va@vger.kernel.org X-Gm-Message-State: AOJu0YzkWozFW/2fWFw1heO/wPLedVCUele0TL8UPtmMYLDGeIb6dyab GrGzHRU8C3RwaxKsJy7PY7A7tCCvV+8lMFjFhh9fGc4xcsQlNstcoGhTU3KNpe1J4cQ= X-Gm-Gg: ASbGncvxu8qzRghbuQL4QFohWWWnH46dJTsm7PdXKML+PKZY/u/N8FQ6Gh8Kort/yEW COJCl+oBWFVKDOw5rTNLfdvETwUxsQKDiKmSUGVsDWlcvSeQ9hdGt8lVaDYh2uzAe8k3OcD1Wuf xakPJq7UrqJ8tNsNCatno14vYnOaFqok+E2/hM1rm2226gBZPxEtieijEeshKCmxd04wpEoOzV3 TpaOjEiMFULwcAmu4V9Apg0Ytel8iieXLlOMj6pWJ9NrZQ9ranPxIZFQRloCPK48uiOOPXpXgvc RHmtLz+2WDjoX8jRZB8DbHP1jLa9rObjovlneYIpl4E58UUG1E6ZWb1xjub7M17NddNnA9f+sZ7 lUI0guiWj9kOC2zTqkHjnU41SC7T1BhmH8Jfbhh4JU1UAzKurYC2pLxYWsgBqKnX59FrNRNxFC+ kPmw== X-Google-Smtp-Source: AGHT+IFfI6dv+/Dwk5MRfIQvsp2r14i0lroXxft+olSfZnx9fC58ENAn+6zSkYG0IWesgfHHIjV0TA== X-Received: by 2002:a05:6e02:17ca:b0:3e3:ccfe:d597 with SMTP id e9e14a558f8ab-3e41610a07fmr100943495ab.1.1754193517393; Sat, 02 Aug 2025 20:58:37 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:36 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 03/58] test-dyndbg: fixup CLASSMAP usage error Date: Sat, 2 Aug 2025 21:57:21 -0600 Message-ID: <20250803035816.603405-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" commit 6ea3bf466ac6 ("dyndbg: test DECLARE_DYNDBG_CLASSMAP, sysfs nodes") A closer look at test_dynamic_debug.ko logging output reveals a macro usage error: lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =3Dp "LOW msg\n" c= lass:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =3Dp "MID msg\n" c= lass:HI lib/test_dynamic_debug.c:107 [test_dynamic_debug]do_cats =3D_ "HI msg\n" cl= ass unknown, _id:13 107 says: HI is unknown, and 105,106 have a LOW/MID and MID/HI skew. DECLARE_DYNDBG_CLASSMAP() _base arg must equal the enum's 1st value, in this case it was _base + 1. This leaves HI class un-selectable. NB: the macro could better validate its arguments. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet --- lib/test_dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 77c2a669b6afd..396144cf351be 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -75,7 +75,7 @@ DD_SYS_WRAP(disjoint_bits, p); DD_SYS_WRAP(disjoint_bits, T); =20 /* symbolic input, independent bits */ -enum cat_disjoint_names { LOW =3D 11, MID, HI }; +enum cat_disjoint_names { LOW =3D 10, MID, HI }; DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, = 10, "LOW", "MID", "HI"); DD_SYS_WRAP(disjoint_names, p); --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (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 2621A2472B1; Sun, 3 Aug 2025 03:58:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193521; cv=none; b=UzI6+Kg8+V56DZC1XNGNIsAUH5/U//ylqgSczJD1UXlZ7osz5dHLvLqrhyp8xFJ7+6W94Ul8ikKmgr98WHeGlX2vwArZ3czX6ElIOU0u6lKDXxFwik1Ly/bg7i0ZmMtmYHVW5QbHorGimIH4uF7nGf91cQ1YfW0v3yYSC/1r4WE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193521; c=relaxed/simple; bh=jYtoXAOQQmtyhcvhuuejHTH4FcXNzk41Sf4BVUNPxyc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WgVNM4A/b19cYizo26chcaQ0oxdsgld/LRgzVR7reWJQHwrcr9eYniSPnJL7UpHKjzqiK1hlw+BAPoKoNcXMgH34UpmnCxa/xqqE0FdbL2nv7NSY7A7vILxMjdmGGaV4+sft9GZcRD398H6XStUhDMrwXsqbOJXw7mIschXi/ew= 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=b/ZzZjvZ; arc=none smtp.client-ip=209.85.166.52 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="b/ZzZjvZ" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-88120243d9cso156596639f.2; Sat, 02 Aug 2025 20:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193519; x=1754798319; 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=HHGyuGgnpKZsaheli1wyL5zDNg4zEDBviVdaC5XZBoc=; b=b/ZzZjvZiMQZOkNw2OFMxs3n4/X6lJe8yPzUd4WwcFpqNOJ20ER2cpPF1WzRVUpcnQ QhVDd6ymALbt7JpIbVBq+7Gk/a7kGjvz/qipMlIIJ1v6WtugidHMZ2Eayza359mlACNO 0quUUtUgcBFRGpIxOVTjWz+kLRRYozJ0hQh9glBWm3vil/jaHImRrl7NyPl2Qvnu2Aaj W6YE6UC09LNTRP3dh//zZgTQIca7wNb4Gi7CbwaLBvAxLQm0BDGAuXkQlDeLtbqLPjvo CLUdH5Ww422CAvQ+ulKx9nYOP2B6zJgsNgsM/Na+Rn6F0boIu7CXnA2HPP0gOhUyRxW5 Wz+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193519; x=1754798319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HHGyuGgnpKZsaheli1wyL5zDNg4zEDBviVdaC5XZBoc=; b=JmscjuzdZqq7lmhUy2z81hIsunKHPtdAFqq2gB+ee1U2/P16jpunH0W5xLs1JQNPod ZaCG8jBw4QpgAogfr1CbijNIZv8WSsStUylozlBUPHoWPvWRSWkUpYYYmuAW4yfKE7KH NnmsagNULEAmaRc+ddkC1pFyBrLg46+QxeXWdlEpLvHsv7io9KMLSvOsBPX+Qb84Ui75 lysGmmIdrcsLdGXdWMvcZwYEZzhJSh/NrGlbMMhW4yVaW1nIGPjxvCSjAftoHoX/INlJ N+c6y8yhu6/zfN9N5G8nJMtUOf0LWtbNhVOfu95/E5fCM2jQoXV6qQLDbTo76uBH8cL/ eb9g== X-Forwarded-Encrypted: i=1; AJvYcCWOU8UGQF2rJML8RPMahn2sAG0F+pvY70BqAKXaz04iUyJGrG3lGDyCiNiU1SlOvOwiIkD2gI2XyRrzmgs9@vger.kernel.org X-Gm-Message-State: AOJu0YzDkAME2I1g51TbAaaaYGZMe2/j0LCbqsD+7AsVU07JaFiZRuZr IQM2I1ywzla+NnfZtAfn+Pf9TUMmLaYc0Cg+SnqaSJYLAMcvYs537hOrbnfr66plIKs= X-Gm-Gg: ASbGncuQZB0a+hlfd3YS7wCD2f1PKuLBselehkb98h4pvvBQmkptfjQNR3wVAdz1I7H dfqI1BIeH0EXhZ8xDRpreEFnRNxCkcYF+SANu4d6buSls6x81nmHg44qArvP1JXQw2voTqIC2J0 vFDn7KvNGBvl4qkIk1eIkxQezJ8/cERLAh1pCy1/UfGpOF5iQRSgiySgT0/9scqiQpHFdzERys+ 1v09A4YCzdJutjcb8+sQhYtxHHXxctj8EzNkDIjairXLdqOUZXPK8VnRdBTC9oNcjqEkH+awAiz icumhy7lAnXol5ccKlxvgANpxf7VFuQEGxLuXwsbODVkYGjPb00U+mJ5gwr6HeGC7AWgFz4VVNq WNn7mXx3C9zmENZnIUhDuStbXyGsQVfszca2cYDKCvsRkV2cNrJKNmF82HwJhAJqzCAg1vXykmU 6M8g== X-Google-Smtp-Source: AGHT+IEGWj5ry9FocCclfChHk3bFL/qs2Ye9qIuJae5+Nv+8XnL0ndSBGTCV5nBBUROVehINujYa4Q== X-Received: by 2002:a05:6e02:148b:b0:3e3:a1eb:4462 with SMTP id e9e14a558f8ab-3e416116bfcmr104124655ab.6.1754193518936; Sat, 02 Aug 2025 20:58:38 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:38 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 04/58] dyndbg: reword "class unknown," to "class:_UNKNOWN_" Date: Sat, 2 Aug 2025 21:57:22 -0600 Message-ID: <20250803035816.603405-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" When a dyndbg classname is unknown to a kernel module (as before previous patch), the callsite is un-addressable via >control queries. The control-file displays this condition as "class unknown," currently. That spelling is sub-optimal/too-generic, so change it to "class:_UNKNOWN_" to loudly announce the erroneous situation, and to make it uniquely greppable. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 5a007952f7f24..147540c57154b 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1154,7 +1154,7 @@ static int ddebug_proc_show(struct seq_file *m, void = *p) if (class) seq_printf(m, " class:%s", class); else - seq_printf(m, " class unknown, _id:%d", dp->class_id); + seq_printf(m, " class:_UNKNOWN_ _id:%d", dp->class_id); } seq_putc(m, '\n'); =20 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (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 8C88A27EFF1; Sun, 3 Aug 2025 03:58:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193523; cv=none; b=iHfCQbCdeLsKt8+rF1eJfqFaJexQCiMv/38n1ZzLKJ60quxton9YRzxV+P7uR5FYxe551T1txX9ULaIZdyBu/dgmCUjcgaiezFCC2sQnsY9Cwtkf4NOtu/WZVLTQOd9eAUYPUF7+/6bl4d5NCjr79cXnCBjmZr1MJjlGbbkp0Oc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193523; c=relaxed/simple; bh=d/hOXpE0Mgs1kPAgSx7IHtqQI95jk1oTu9WL6Byrbg4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LRrdT/2YwLnDFtoyXcbbXdfHeZsQA1jTp+EaMLeaPGKO0PY/+wQdl7oYOO0yVo1aSP6AJOXQpfL+9ypLm3ht+CWgR8/CSZWEH427bh8hyuab0nc2/CxJRzNKaDcFvWgQF/GJGUJeynjIF/YsRgAAXzB9kgcU6rROswRj4yzXHc8= 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=QmXSK6DM; arc=none smtp.client-ip=209.85.166.170 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="QmXSK6DM" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3e3ea9e8154so15985445ab.2; Sat, 02 Aug 2025 20:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193520; x=1754798320; 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=kfqa6P75QZanGMFi9p8HAZ4Dyz8oIWbnQ0m74z0/sC8=; b=QmXSK6DMWVIoWPsYoFSLHdD9RybPuvYGuC4/nSD/+ts4gZJeID3f/UdyqGGwRbEffK n9LCJHQiTx/2+P9HB1T32qKqrGRtRfxHOPznry60A5sGx5Q8pA4082iCBDMVlFMhdd0u CdiVbJ7Fd5oUl8NBeaM5CyK6+XREHfalpt27tSj8pMuPlmHjeVYBosl1d+td6dSLl8sp JjHE7cFpHSwdNIopLQ39Ydv/QpxuyDmmEk4353fWgGOVkdjjVMdnedOKdxA00VPa33jk dfjIcdQh37dyqod792zq1dXzq7FUcnK10wijok2e5DqIQl/xyxZ+rxS0VaCyQZ9oxXGE UvDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193520; x=1754798320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kfqa6P75QZanGMFi9p8HAZ4Dyz8oIWbnQ0m74z0/sC8=; b=QQuCBgcgnZn7J+hgnwQOqO1DQdtwTKKyWtGsZTaTKJ7I6SQZrGw+aDNAyux4Padhmk MyeVlnZU0jgiiql7QZFt3uFsMilNg5Wizkyt59hZeTx4n+hWlWcTTmOi+HIrxrxzAABp vwUyt7NiazonLAS7HFfyNeGXbODCMPDXvzg8rUjo+fULlxT+2SR6qU6d5i0FS2DWijeT 54AjjNJKmNixJGW1k/XwwB6wLUmGbjUSkXfCtt7vG388u5UiAH4l/KWtVycL5EEezMbT 5oNVuXvf/JMdqYxFWalsJFZ/hLslsUvjIuKPYPFkxtxZk3gea9fYWytZb05mvKndtsCu VVdg== X-Forwarded-Encrypted: i=1; AJvYcCUrVNlXuzbEvdlUwjF93W0RSM/SYft1snY/zZz6zJg2C7WEgcDexpiyPqqeLYCHXpVQ3Zl6+2YhInisplDO@vger.kernel.org X-Gm-Message-State: AOJu0Yy8dN7GjhYOVlrhfIKDOSzAa0f7RsWGABY8jCSXApLHP+odqvQD wO6vR06yWbK78E08Od12VQOMGmqHFsTh72CT2wGeYOX4BhNKUUZUk8kpkV0UF9njhKc= X-Gm-Gg: ASbGncurg3PfaYtgqdT7blIYnrqR1MRjXqmhwPSdYXFyLgfi2YE2Ti7Fo8D4IVFJtBm JvoAy4MZ/vVoJw9tmuHzvKY+2G+zYvLIWwJGw/jFpTAOlFuuq/40BHD+mNrAv0SUCkQef9teeuD /O06SuMQ89EJ+G3/ysQz+eIk3RHY1fxU81zY0zytEKnJRlTHzEew3FmckrF+kJoDfhJmvdUoA11 lhmeTD24JGtozSieV5YM6aoILHf6E8qqXvnG+eLPlHr+G1JgyhHxZSnRh9aIOQauhbmpupk1T5J 0bXEJ31MPf7j3nqRtpzb9m1GoQVa7DbW5uzE21m/Ct69wuhmkaSf/XcvC4jqSsyi2+9SqHsMVu4 TbB/4WyyQL+QWmQkJch3SiN8Cm6m4YShWZs3J9lBi2O1Qh4313DaA6+tLTzUhd+Rh6tB7bEZXDt VYtw== X-Google-Smtp-Source: AGHT+IHF9fqXIQ9Dy28IS+EYItwaYkEB1EPsxWBXZaRJEXylDi+/C1dLpmjsAMSA//MVYJtcdRokew== X-Received: by 2002:a05:6e02:360b:b0:3e2:c62c:5531 with SMTP id e9e14a558f8ab-3e41618bf16mr95994745ab.20.1754193520351; Sat, 02 Aug 2025 20:58:40 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:40 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 05/58] dyndbg: make ddebug_class_param union members same size Date: Sat, 2 Aug 2025 21:57:23 -0600 Message-ID: <20250803035816.603405-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" struct ddebug_class_param keeps a ref to the state-storage of the param; make both class-types use the same unsigned long storage type. ISTM this is simpler and safer; it avoids an irrelevant difference, and if 2 users somehow get class-type mixed up (or refer to the wrong union member), at least they will both see the same value. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- include/linux/dynamic_debug.h | 2 +- lib/dynamic_debug.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index ff44ec346162a..b9afc7731b7ca 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -124,7 +124,7 @@ struct _ddebug_info { struct ddebug_class_param { union { unsigned long *bits; - unsigned int *lvl; + unsigned long *lvl; }; char flags[8]; const struct ddebug_class_map *map; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 147540c57154b..55df35df093b0 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -799,7 +799,7 @@ int param_get_dyndbg_classes(char *buffer, const struct= kernel_param *kp) =20 case DD_CLASS_TYPE_LEVEL_NAMES: case DD_CLASS_TYPE_LEVEL_NUM: - return scnprintf(buffer, PAGE_SIZE, "%d\n", *dcp->lvl); + return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); default: return -1; } --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 DBB7227F183; Sun, 3 Aug 2025 03:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193524; cv=none; b=UBUHL2uaKtpRubbjESpWakqO7381GhgpikyK8tMNz8wOa9nv/6R8l5G27aSldz2Qot1uzXYLDj0SfmDrUJRHpY60yjyVA7JL5OMyr4y5aIao3qK7KCKa9ies3VfyfA12CU2RHdfmGAIN+mq17jB4NVswaGpBG4hKlsc4zP6w08g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193524; c=relaxed/simple; bh=cjIzNBDsuwE2q6F/gVm+brc7k7AexJB0PkNGHr98X0M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QtOKGmG/dmlnJfbvt9rsAplLR6MOAnKwPt+wRdkwwH4A4iJuiATZz9dfaPXY41oQ3mVFj7naLkeOBXsoyy4PK/Fkbxq4qu4sSrki1ZWxgmPwRqnPN2jkny9qaRsWLd62rirHB8TjCmdYlSXEApKjLpj95/sWou0Af7c323Sh6bc= 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=kkBVkO02; arc=none smtp.client-ip=209.85.166.174 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="kkBVkO02" Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-3e40212e6ceso14461785ab.0; Sat, 02 Aug 2025 20:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193522; x=1754798322; 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=NbagXP4UXG28aliKh3hTngHCxH5FuTw+jOpgL0x5ekY=; b=kkBVkO02GZ93RfSwJt/OV3017ZyOBxuMLz1foqSr0C4OdZihxx2YpZdk0vc6sN9eH4 hHxCT7VoeLei1nYe+AJGNjC742VAf58c/I/KwRkQXwaUXmX3G9nSjvCosuY4BfsE0qjp DXs6bP85/rAoEKOzJU1lwOoW2k2MYGlCljWUfBLH9TNyIh3kyRJgTPSVlgR7Lf12V/MW maVtC7L2Z0wPu5UMu67wVFGGHijAPmvrOibcB8xqXR5aDtcSOhZXGYNEpbRi4g64rxMY snPdsios7rjwNz7flYHqIyL5TGHMLU4uOih6YpxjuRi+cps8YBM10RNVi9XqwHwuQ9K3 TTEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193522; x=1754798322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NbagXP4UXG28aliKh3hTngHCxH5FuTw+jOpgL0x5ekY=; b=j0zNBZOWguaX8nmHC9io3vVqxA3gZiMO5VFK/iFafih2+L+1M5O0ePumdlpAAj36mk p5EimqT5txeTbhIvsUe5nqijPZj2ypGROsxyFXRPEOE01wi6o9HTeblAoBEYAjvvcs/B 7/f9u1ukVSdZrvO/2ZuYkcP2gXWRiftgKI5Q7PdinRbxnPXVCiWHJodBKy/SbODym15F eKgkdtq3mXQJdlc3pzbMtw/pu1i9KA5SQD38qoU8dGyQALHg/5ydXFyLJZrfvfnRbNPY s5XmkGsSE/G3owH+/O07kMKgp/PqWIHMJaBiZZV+f+XykuB1DKOUcSFXXMUxyNH5cgjP JPTg== X-Forwarded-Encrypted: i=1; AJvYcCVO5CLdwTUOtAPCz9yPkpoYvXNlY1LaxuD0cvFJ7h/a8qdSaNdYFwSxdHZJ5Z7qPOPehEBY6gzXxpL9/+xx@vger.kernel.org X-Gm-Message-State: AOJu0YyFmFPjhw2zEK6fIztJdxP4aVcYdIhS7C0nznZ+RXMjWu0im5i7 xXGqtFk4fUb9oBu5ERrNKHz530XK5E4HDAzfS0jDXfIUAa73Mqg955b1KXzWKOuZCWI= X-Gm-Gg: ASbGnct7g7dBo23HgZ2M06UiBSNUKoip0qk6szJlSEvrS+JWG/FfrYbTgXmxEvBpWSA Q2PW1TvlLncOck3+YOpN1ckaFvYOOgQjkQYil1/3azSBJsbKjYWMfDPknSxPQJ3cijmg0cy982D GmG8U2HxJN6pSPn56HGIZBnvjPx76qFjE/BQeaXU0oCoQVK/irLjMm+3s1LcezbbZwZoVMwLa6i 5u/D+ctpsFGz4jiXeFXxWkYpWfA0ZDKx3yyQ7QmYGbV+r/UwOozFWpPwS6NPXdWc0v4tfqEqgf+ V3G+VylkbiXLDTaFCm/3kgl4xGZmtkOi4seBHUA8lpxRC/rboFNufGuJSr6vI0H5OOXBxsFi57P zdvuZvTSUbztwNRz0zHI6IVx/o4iDWmAgPfQQcf/WuOB2wV585FVCpR6SHIZ9m9sswhIks9wPYW WcCA== X-Google-Smtp-Source: AGHT+IEBPg9osrUDJ2eMDLZJ8n8wcDzvlf2PJNGm/kwan5N45OjUBgHKkKoWTIKMjcalGwUYti/UbA== X-Received: by 2002:a05:6e02:348c:b0:3e3:d674:6754 with SMTP id e9e14a558f8ab-3e4160fb6fcmr87580415ab.3.1754193521740; Sat, 02 Aug 2025 20:58:41 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:41 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 06/58] dyndbg: drop NUM_TYPE_ARRAY Date: Sat, 2 Aug 2025 21:57:24 -0600 Message-ID: <20250803035816.603405-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b9afc7731b7ca..ac199293d2032 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -107,11 +107,9 @@ struct ddebug_class_map { .mod_name =3D KBUILD_MODNAME, \ .base =3D _base, \ .map_type =3D _maptype, \ - .length =3D NUM_TYPE_ARGS(char*, __VA_ARGS__), \ + .length =3D ARRAY_SIZE(_var##_classnames), \ .class_names =3D _var##_classnames, \ } -#define NUM_TYPE_ARGS(eltype, ...) \ - (sizeof((eltype[]){__VA_ARGS__}) / sizeof(eltype)) =20 /* encapsulate linker provided built-in (or module) dyndbg data */ struct _ddebug_info { --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 3B00C27FD43; Sun, 3 Aug 2025 03:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193526; cv=none; b=l6GR5Ym6yyUyq7rZaYgIVkn8hQQoaz7Gbo41KnB/UcUOLJfrgcKsqca4FhtXocy80dmu3wwcailXvoZt0dkUg6HECrgPdy2pSwUPLlVbfKVACJOpQTBcgfN/jT36MrMZ57uqBEfcecZzEATDM1GmyQeHqAG4PDgbS+7+cASRoAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193526; c=relaxed/simple; bh=ghEoe6tUJcsqU6v8X4tUjcFEDweMtm0M/jrunEyWQwM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ynmh+geH8whkoyQAygdH5tDmgrzdi2dUHmHMxU77K2LZFSwOxf/CcXrDmhQH3Abp1ypQw6v6F9Z8Njo/Zewyp7m33VqNZe07FSuv587hoKQrQC/Gt7mGJf+/ydMNrqKKNH1mW04uaiQPQ6TzLYeWaIyctVy6ufFnxSspV++MLl0= 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=Lw3u0LMF; arc=none smtp.client-ip=209.85.166.180 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="Lw3u0LMF" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3e3d7b135c2so40558345ab.1; Sat, 02 Aug 2025 20:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193523; x=1754798323; 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=5LKFK2FQkGbRBipMPdzUP2qSKsnxzgWO8ffhfoPvu04=; b=Lw3u0LMF7wBW86onffm7gAHph4p34tsf646nv9Mp4UWAE2caQ7z1bTnWJYkVDfOOEY FmavgbHyt80W8TUbedu5zeN8lj8OsYZT/b7X6/xxFPIS1GD+qRz5pMg80Wd3vd91nBdj DtZLedLR3IpcGzOsPGIc6GxU5nHfbIPRY4vHD2wzOEmEvgP2mBWnUAoCpMrGOecFvqBv vmxPgCEWmBC1JwrQfirdtibbG8wmr1gJLaHyn02RVVYgO5BfF8ah+SN7UFNsXmswEvsB BFPpxeYCpc+cu/hui65YNtL7uKxGVTQzgFmCO80FYS9woRtu/AFZ3fK/boRU7WIVhjvO LqYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193523; x=1754798323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5LKFK2FQkGbRBipMPdzUP2qSKsnxzgWO8ffhfoPvu04=; b=Jpm5dm/u8Fa5ch34B3cHLGdAxsismIMyT2Knq7+edF3qwk5IShmgGy6GFC8ArpVa/r Z2+jxsOOMSGUfbCxmTW+60vbmrNtYAhFhKpIBBd8Se8VDo9WdlH2ZUOmYQNbQ96ktUOH ebehcm9fkIFDsskuEgTul9sviJfhBhy9ms6ls6n41d+q9o937Qy6eBx5Ak4QmYTNKof7 8+clwkZ7gadP5CPcl20DNdsQ8OMai6otN1GOFIUUlGxVZTFKv7llCMC9Psd19Me1cRN+ Uwjv6jgpiMrnSBl1a76D3wDnaPP6GiNO7kwsnF4cL7hBzJT02uRiMTCD0Z+e3KRKauS/ +TVA== X-Forwarded-Encrypted: i=1; AJvYcCWdvuCCxMwkfjrbwXvZ+K3wJ/FpRAlLRnTv+g7daQo8C2fV4KhXCu4N6ahP/dRdL2jr/E2FsiIZfU2pHnK3@vger.kernel.org X-Gm-Message-State: AOJu0YwLFqa3+Q/0TtyAb/MNAbHz/edwUSd2/MLouNfGLRpgCeNxG83T yHrvnvaapTEKvt1+/TamLEIMsSIG6F1OC0ZHlirQniIQuo/jPOSGGsVvADauETqLYug= X-Gm-Gg: ASbGncsENAM7/Ef8YD19BzlNOp1LcnW6Vva5SG5s9HT0t1dDt2pwxOOg+ficlyqFu4q zuMkb5FL06D2C3FyeFJb2wZ8I3rln+TmjWPqgDVHjdCvgz2Wdel8quAMD1xabj4PT2B3OVgxS/T +4wcIK9Q+LEC1ctZV6jwK/HGVTOMFWcN5m3joVhoMqfAUghMjE9kHoIgbJsP2s0vF0JDiMtNWmY yP6jOYGy+R/0Sr4r+7KM2IMOU18MZmceD+WIhpDFww0SiIPDEf/F9LwCpxWCPKYzG3IAxwIoqfJ LtNca0DcJzR+8uO2QhvYSXcpgN+Tpi/5Sk7YAVCMCvPUrzI2AIdVPna5uRlg5QF4UQmER3ZrCAL YfoIvQt5Mg0O3h8ISv/NfJkAcUJr+ng00RvDM7KsfalYZZTmrBdN4cHqnAs74mdrKzvH6nyQcLK FmhHfRTfiuM3UrpxzbHNFJ2Bc= X-Google-Smtp-Source: AGHT+IEK8/vwYm1R/fsAxFG9PU2vcozrYZR6RghCEJBk18PG9+D3j285L0ye3PQbY3Q2FqB5Lv0cRw== X-Received: by 2002:a05:6e02:2220:b0:3e4:1162:6761 with SMTP id e9e14a558f8ab-3e416128e06mr102803815ab.9.1754193523038; Sat, 02 Aug 2025 20:58:43 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:42 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 07/58] dyndbg: tweak pr_fmt to avoid expansion conflicts Date: Sat, 2 Aug 2025 21:57:25 -0600 Message-ID: <20250803035816.603405-8-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Disambiguate pr_fmt(fmt) arg, by changing it to _FMT_, to avoid naming confusion with many later macros also using that argname. no functional change Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 55df35df093b0..2751056a5240d 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -11,7 +11,7 @@ * Copyright (C) 2013 Du, Changbin */ =20 -#define pr_fmt(fmt) "dyndbg: " fmt +#define pr_fmt(_FMT_) "dyndbg: " _FMT_ =20 #include #include --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (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 B16D527FD4A; Sun, 3 Aug 2025 03:58:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193527; cv=none; b=KRHz3Yzy+aounLvYeOOmJHAmUUSZ4GWYCpKt6Y3BOQhoSMcmRB5ua+XecmMC2WmKAVQwe/g4IlkbqSnRprk6Kd4F7MiPKCYBoYEyKqoTKXWHsAoww++bXUqKsScQ/6Spk022tlRrRwNuZR6hmEV4iUDT/CuA7WpmNQ7I3FWkwIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193527; c=relaxed/simple; bh=GrU2Nwi/8rfpPNVMPMtCaqjljNF1MwD9H/5YTmIIFhI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UdjC5s5G3SDDKRsR3MxlB/pxrYZD3RQPIc+xcG6/xxcxm64VmlAnsRzsRZA82tXa9T/FHm+PVGDp9W5lLjVsRlNtUX3EddhuMCuHigc7Qt75vztK4L14pCgEhL0oCO/wY3EdWhGQ4KBwYXx9pynseZBCHGZD1T3PEjBX78+rkUM= 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=f0XO7CtT; arc=none smtp.client-ip=209.85.166.170 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="f0XO7CtT" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3e3f0f29d09so9436865ab.2; Sat, 02 Aug 2025 20:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193524; x=1754798324; 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=w11iTWBqUyUmFQ/xlqpJdlubct7P9lvcZ8FTN2uj0dc=; b=f0XO7CtTDJ2MB4o0ilnbBHxxB9/wy2eWn1eaGaEzIgmLniQstWF7XOzaFm2Uz8B6Bd k8fTey9Eji4tJj2ogPvN2XASPfrlSEpouqm5XKj2psgu8BQtR6T9GrRNqgqUscnjXkc1 PnTn7vdQIj7piFhgWaRsulFpQHC1/MSx/gpROforS+WpzaAHG9WZC0Q9z34DsomfPe3/ MQ4KUf1z+VhnJ5Grjpc0xz31roUs7Mtj+j6ywf82nXwQdkpRe9aD8m+B3UvrCVKIMTwl HmEObPHordjs3whI6nOwtA9zumCSbUhzcHCrGNK+5rON0TYTNe7EWgyL9+qRUadvxMc0 XcLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193524; x=1754798324; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w11iTWBqUyUmFQ/xlqpJdlubct7P9lvcZ8FTN2uj0dc=; b=dN6mWIV3g4eXggjutckR0xyhx3JUGIGjVxkgssNAi1VP4DPwYmBLiLa2psCQfyFwr2 36XQoP6jBVt4sW4euQ6V9VqcBIIa7D2JOtlJA+wrlQfUAPxnPYii1Hox8IhlxYZtZs6y tWVHOypEQfLaq+jvV1blvB74OwHGtjepsNf1Uoa/ENEH70leEUbAW38kfbp7XvTHFVPV vfCygvYvPUsc+LWA4+zcx07988V0pGmjUOwXn4D/hHylEOXk+zFegjViocCJOwhsS7Fi krjSHY24DXsnLTYGgVYubtatvRWGR2JAGeCJND2esjfUYBmOZsatavN7SFEr9vmLkOvv zajw== X-Forwarded-Encrypted: i=1; AJvYcCVfXAFI1TVzU9vR1//oDfrysPNbdKv471bSXVxcvQ6iiXDaWXX5mXJHZudAItXzBKIHu34DELwo9d3B6ZL0@vger.kernel.org X-Gm-Message-State: AOJu0Yx6ZwYhdExk0/GuiCDGvgGhAngKUENvhktqjQlx3xYLZOh/0Ees RO6nfxl11YHIiDmW3z47hkTkVD3yBcBaDOB3kXsbVpqe2KMZQS/5nVH0Ogc0eUCDSLY= X-Gm-Gg: ASbGnctIKbkBuQDcCZrT354JnbgnuZ6RVz5OeRVgJ7jo0apoQd3KrVxb4XKR3hDzPXq a+C60gG3VjI8vBv+cWdwDlkOtd8w83C3y/UUrrweJJyFfoGcP+CtZ3IrGnYhj7SIioynFEQUmlG /YABGZwLrUNDYjLPR3P2+QSkhtby+fSXZrGIGISGBhK14rMYPkXlXURNxWeGDBkDSvrt/5xBo8w Px/C1XzQkLMu7TQrXGwGNrVCYTQ4QRQ8Hxfn6h5G7ZynygtYiMMRwWj95cnZOcR2erI4DNbVPtg sYsH6vMGQmRbst24Cw78u02WkfnisAG/wVVl1osAXDMezfgHwc61+heUrHZjbtK45CdH327UGVq fvvPhw7UczAklrFerp8Z1vZWFk4C+pH2r7utodzM0jmZ4tnGoqps6gaAOz4OviLI3BEd1mQoCS1 eqFcEAIab1CbIq X-Google-Smtp-Source: AGHT+IGMOals5COhIioa7WIuP+hDvHPdqL2k/g/lRnDo5cgFfZ32l9pYAvRqMJUqo71V4g8mlLwHfg== X-Received: by 2002:a05:6e02:370d:b0:3e4:17c1:3fdb with SMTP id e9e14a558f8ab-3e417c142cfmr83851035ab.0.1754193524519; Sat, 02 Aug 2025 20:58:44 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:44 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 08/58] dyndbg: reduce verbose/debug clutter Date: Sat, 2 Aug 2025 21:57:26 -0600 Message-ID: <20250803035816.603405-9-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" currently, for verbose=3D3, these are logged (blank lines for clarity): dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op=3D'+' dyndbg: flags=3D0x1 dyndbg: *flagsp=3D0x1 *maskp=3D0xffffffff dyndbg: parsed: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0 c= lass=3D... dyndbg: no matches for query dyndbg: no-match: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0= class=3D... dyndbg: processed 1 queries, with 0 matches, 0 errs That is excessive, so this patch: - shrinks 3 lines of 2nd stanza to single line - drops 1st 2 lines of 3rd stanza 3rd line is like 1st, with result, not procedure. 2nd line is just status, retold in 4th, with more info. New output: dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op=3D'+' flags=3D0x1 *flagsp=3D0x1 *maskp=3D0xffffffff dyndbg: no-match: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0= class=3D... dyndbg: processed 1 queries, with 0 matches, 0 errs Also reduce verbose=3D3 messages in ddebug_add_module When modprobing a module, dyndbg currently logs/says "add-module", and then "skipping" if the module has no prdbgs. Instead just check 1st and return quietly. no functional change Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- -v2 squash several verbose cleanups together --- lib/dynamic_debug.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 2751056a5240d..d9268d051a106 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -264,9 +264,6 @@ static int ddebug_change(const struct ddebug_query *que= ry, } mutex_unlock(&ddebug_lock); =20 - if (!nfound && verbose) - pr_info("no matches for query\n"); - return nfound; } =20 @@ -499,7 +496,6 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) pr_err("bad flag-op %c, at start of %s\n", *str, str); return -EINVAL; } - v3pr_info("op=3D'%c'\n", op); =20 for (; *str ; ++str) { for (i =3D ARRAY_SIZE(opt_array) - 1; i >=3D 0; i--) { @@ -513,7 +509,6 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) return -EINVAL; } } - v3pr_info("flags=3D0x%x\n", modifiers->flags); =20 /* calculate final flags, mask based upon op */ switch (op) { @@ -529,7 +524,7 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) modifiers->flags =3D 0; break; } - v3pr_info("*flagsp=3D0x%x *maskp=3D0x%x\n", modifiers->flags, modifiers->= mask); + v3pr_info("op=3D'%c' flags=3D0x%x maskp=3D0x%x\n", op, modifiers->flags, = modifiers->mask); =20 return 0; } @@ -539,7 +534,7 @@ static int ddebug_exec_query(char *query_string, const = char *modname) struct flag_settings modifiers =3D {}; struct ddebug_query query =3D {}; #define MAXWORDS 9 - int nwords, nfound; + int nwords; char *words[MAXWORDS]; =20 nwords =3D ddebug_tokenize(query_string, words, MAXWORDS); @@ -557,10 +552,7 @@ static int ddebug_exec_query(char *query_string, const= char *modname) return -EINVAL; } /* actually go and implement the change */ - nfound =3D ddebug_change(&query, &modifiers); - vpr_info_dq(&query, nfound ? "applied" : "no-match"); - - return nfound; + return ddebug_change(&query, &modifiers); } =20 /* handle multiple queries in query string, continue on error, return @@ -1234,11 +1226,10 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) { struct ddebug_table *dt; =20 - v3pr_info("add-module: %s.%d sites\n", modname, di->num_descs); - if (!di->num_descs) { - v3pr_info(" skip %s\n", modname); + if (!di->num_descs) return 0; - } + + v3pr_info("add-module: %s %d sites\n", modname, di->num_descs); =20 dt =3D kzalloc(sizeof(*dt), GFP_KERNEL); if (dt =3D=3D NULL) { --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 5201228000B; Sun, 3 Aug 2025 03:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193529; cv=none; b=tu8cv6MRpcGV3An+HC5Zl4mZ1i+px1MDRJ5osOsOYlyXVwS5duauQuh6wbTcnB1wLmu6BBMPsjjloe7d+Qk5XR/4QXN4ormogjcgHZkwTvyH8TqUxCCy4jKT8P/eT0/xW2MkazzGqI3reYzdALGOMUFD7hkJWlmR7aEMuJjoxcs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193529; c=relaxed/simple; bh=bFptKY//Y7AeurprMAUL2pttbCSoLwQDJIXPiXNp2Bs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oyi6l4d0KwODAtNe6CVOjT4DOnFcebQLnJD1YB71+DC5n5bRSrNX9U6lJK3qqoCCF3RbQyHz9Ws5nnrPKZxTQ9TcYuQkMtMggPhz8JyN41WaMtFk1a5LppGunfAxWb2+bk+p9nw4qt5P/1AoZVCBQD4i8dkNKOCUkPI7HNLlQVw= 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=fY0/R1Tw; arc=none smtp.client-ip=209.85.166.54 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="fY0/R1Tw" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-87c6dfca35bso98238339f.1; Sat, 02 Aug 2025 20:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193526; x=1754798326; 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=5v9qJvElB9xnBCx4c3TzoDVgCXyi+Hp+akyZh9KZwV0=; b=fY0/R1TwPoRp07l1YllROy9i0DlS/J54az9svRtfr+qZpsvbXP8gvjTDUMDncfBUG2 BtvxOPkuMjtoU3nPnWTvWsHGAPFDWIOV0lkiM/si5q62E1CJOCVQ6slJbfuikdOZsVht LjhqQtwrg4Ci6LInweO5u3nSyC13f6mCSjujjcNoKJNbtL09IPEN1eo7HcDyu6/vKmeO t0NbGcqtAAvr2G0JOiaDGMIwCJAS9OrrXhwoqHrz8N0xKzQRzZlCTMc+ZIZbWWGdW/lT 4JxFCmsCw/DfC0s2Mpb4lxXWZjy5J0dzM9aL2KMTUwuMhnmBxmsxcJpSKrSNgx/dj5Iy XVtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193526; x=1754798326; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5v9qJvElB9xnBCx4c3TzoDVgCXyi+Hp+akyZh9KZwV0=; b=KWs+CNGv9pEvyOhg/wTJO2poZYGQZbNS1Dot+hhkDKxoM3GUzTPTKNv+JcgkNL5oWU oy4YJt/RZAN8+cWjZRNmm0EYZx0DIRJdIc2mct2UlVBBhx9r6BBdm7i4KpxYlB2iCCdG d9epW883OohQBMTXFG1V+rO6/NCnS2jxm6SiIrQuaMC9+fqs4Dgc1Uts0TUXxYO1Qj7O +DLsI8xVcbaOvSAa9rVMsx08ZpJDkS2cTYRBq3vQC9v1dvhaU+ihXMLXD7LCZHxR0Mgp fQQ3znVRbP1DbXh89fzBWed+sN4C5/yLr3D9jimQmzxQjFaZR+hDlHF8U2INjxcD7hPZ 4lAw== X-Forwarded-Encrypted: i=1; AJvYcCUgDW29jiZX0b8bX+fHoyAsSHwIXbr3wsymxJO/wMCpMbfsqMTIAd1D4IhhuFJxN3P8aIFySSM6K7PKier+@vger.kernel.org X-Gm-Message-State: AOJu0YxTD2nawIaJLxf7CoNi147mO92avS+22ypCaA12Cg54Jaq6qOMm mwzZ2o3cpjAx96yYNAT1GQ9WrttYFp8UfqzG3wNPSWjAooKF1mpykSbA1I1J5mUKM4U= X-Gm-Gg: ASbGnctst1cMirvQnoDwsCo3oEiZ3znaI4f/fvMAYUq0WizbAZ/fqgvl6C3UF2ViBVm xFcTxmqyrJn5wnU94UY+ahx1X6Zmqeyup8REloA/iHnwlnMcZ4+TXOWvOkOlCW4btC4US2KJDBv DQkt72xiwtmXQTMkld86IYyutL1NHgxXdOixmpIl9M2FRhzd0PhITCfFi022t7fxL8MY25gp8e3 7JebzRheGNPoZDgkXereAvZG+Gwr72I8ePDcUJXHnkGoMPfDzrmQ+ori/jIdvX7M6pF9AozTTH5 G/0chBjvs4eShVCCAcLGsYyItRm4Th+E+xIRopZp8ZXodmyw8wvZznU/0c16lgF171aTQPzQ2w6 TA4VFNDl/hST8e3c/0uo0YfQ09Ir1W+yrCX8u2x57pRp7+SGYIuz2oYgdSV6dtlNhSlX3kerIJ4 2bdg== X-Google-Smtp-Source: AGHT+IEfkx+mWG/5C96EB2sKffZquP2JNAMc+2Hxnxpx6JWp1mejb70acLW+yvRvYAwNDC6Jp/PAZg== X-Received: by 2002:a6b:ea09:0:b0:881:7c2d:20e9 with SMTP id ca18e2360f4ac-8817c2d23a7mr42429039f.2.1754193526185; Sat, 02 Aug 2025 20:58:46 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:45 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 09/58] dyndbg: refactor param_set_dyndbg_classes and below Date: Sat, 2 Aug 2025 21:57:27 -0600 Message-ID: <20250803035816.603405-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Refactor callchain below param_set_dyndbg_classes(1) to allow mod-name specific settings. Split (1) into upper/lower fns, adding modname param to lower, and passing NULL in from upper. Below that, add the same param to ddebug_apply_class_bitmap(), and pass it thru to _ddebug_queries(), replacing NULL with the param. This allows the callchain to update the classmap in just one module, vs just all as currently done. While the sysfs param is unlikely to ever update just one module, the callchain will be used for modprobe handling, which should update only that just-probed module. In ddebug_apply_class_bitmap(), also check for actual changes to the bits before announcing them, to declutter logs. No functional change. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- v3 s/modnm/mod_name/g --- lib/dynamic_debug.c | 65 ++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d9268d051a106..96cd31c457e2e 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -593,9 +593,10 @@ static int ddebug_exec_queries(char *query, const char= *modname) return nfound; } =20 -/* apply a new bitmap to the sys-knob's current bit-state */ +/* apply a new class-param setting */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits) + unsigned long *new_bits, unsigned long *old_bits, + const char *query_modname) { #define QUERY_SIZE 128 char query[QUERY_SIZE]; @@ -603,7 +604,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, int matches =3D 0; int bi, ct; =20 - v2pr_info("apply: 0x%lx to: 0x%lx\n", *new_bits, *old_bits); + if (*new_bits !=3D *old_bits) + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); =20 for (bi =3D 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) @@ -612,12 +615,16 @@ static int ddebug_apply_class_bitmap(const struct dde= bug_class_param *dcp, snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], test_bit(bi, new_bits) ? '+' : '-', dcp->flags); =20 - ct =3D ddebug_exec_queries(query, NULL); + ct =3D ddebug_exec_queries(query, query_modname); matches +=3D ct; =20 v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } + if (*new_bits !=3D *old_bits) + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); + return matches; } =20 @@ -672,7 +679,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa continue; } curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); *dcp->bits =3D curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -682,7 +689,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); =20 - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -696,18 +703,9 @@ static int param_set_dyndbg_classnames(const char *ins= tr, const struct kernel_pa return 0; } =20 -/** - * param_set_dyndbg_classes - class FOO >control - * @instr: string echo>d to sysfs, input depends on map_type - * @kp: kp->arg has state: bits/lvl, map, map_type - * - * Enable/disable prdbgs by their class, as given in the arguments to - * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative - * levels by bitpos. - * - * Returns: 0 or <0 if error. - */ -int param_set_dyndbg_classes(const char *instr, const struct kernel_param = *kp) +static int param_set_dyndbg_module_classes(const char *instr, + const struct kernel_param *kp, + const char *mod_name) { const struct ddebug_class_param *dcp =3D kp->arg; const struct ddebug_class_map *map =3D dcp->map; @@ -744,8 +742,8 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); inrep &=3D CLASSMAP_BITMASK(map->length); } - v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits); + v2pr_info("bits:0x%lx > %s.%s\n", inrep, mod_name ?: "*", KP_NAME(kp)); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, mod_name); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -758,7 +756,7 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, mod_name= ); *dcp->lvl =3D inrep; break; default: @@ -767,16 +765,33 @@ int param_set_dyndbg_classes(const char *instr, const= struct kernel_param *kp) vpr_info("%s: total matches: %d\n", KP_NAME(kp), totct); return 0; } + +/** + * param_set_dyndbg_classes - classmap kparam setter + * @instr: string echo>d to sysfs, input depends on map_type + * @kp: kp->arg has state: bits/lvl, map, map_type + * + * enable/disable all class'd pr_debugs in the classmap. For LEVEL + * map-types, enforce * relative levels by bitpos. + * + * Returns: 0 or <0 if error. + */ +int param_set_dyndbg_classes(const char *instr, const struct kernel_param = *kp) +{ + return param_set_dyndbg_module_classes(instr, kp, NULL); +} EXPORT_SYMBOL(param_set_dyndbg_classes); =20 /** - * param_get_dyndbg_classes - classes reader + * param_get_dyndbg_classes - classmap kparam getter * @buffer: string description of controlled bits -> classes * @kp: kp->arg has state: bits, map * - * Reads last written state, underlying prdbg state may have been - * altered by direct >control. Displays 0x for DISJOINT, 0-N for - * LEVEL Returns: #chars written or <0 on error + * Reads last written state, underlying pr_debug states may have been + * altered by direct >control. Displays 0x for DISJOINT classmap + * types, 0-N for LEVEL types. + * + * Returns: ct of chars written or <0 on error */ int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp) { --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 ADEBF28032D; Sun, 3 Aug 2025 03:58:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193530; cv=none; b=DewV66ZMoGsxFO7noBax5s9Oubvl0ytX4HHdvr5H55GaYmW+MsNzD5Hkp92KKQEPh3946j0WuFwy7SLRDmDTPuN6G1h3hf8+PEapvUyDdhEyshQPAOJKdDP3EXiDgs+3ncy1ZWVozSWcd8n7Is7gT491Q6HYoKPgxNL3/2HE+5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193530; c=relaxed/simple; bh=hhfT9gZ7X/jSpM5Z3jfMG2zspglVJhn33CuvRKJ8vqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XlqVOJFiaf4FUwQgc2aauxu8VXW938880TywWG4h2Fnd0dNxl/thaqlydGncnV0Xz/M5sRtqK9wJDwjUokDGyWzrWfprnzPKaFvOfoIQ25VDKnDUw39StK/dldaznwQzZlD8NDM8YoUU/VxWsMM+E0XRMG9yiVGrBOepENZAJKc= 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=JzsvfZSC; arc=none smtp.client-ip=209.85.166.180 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="JzsvfZSC" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3e40050551bso23418215ab.2; Sat, 02 Aug 2025 20:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193528; x=1754798328; 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=OuNmIbrdZwfa0pVSTeAraA+TCM/HhXLg2Msu1oHrhfo=; b=JzsvfZSCRBQM9aPfSQrUgepf7vTczNe7QZhx8w2uCuUcbsLCkJR4pIux/GOgr6JaPo mx72nPJnQxM2qlfW7n1UYDCKvwzrJ48piujMx5ksd8WfV2BEOcEV1qC6tvGFmptci1MU OoxwdgJQ/WocRPz/2NkkBVNKN3b7Lfi0W/MWFzfUGn3JkOwaBjQMihiQ3kviRBIlRvRW NhqnnUQqydjX5ueHFNn1tBdHW2siyvCzM2Hz6mNJkRsZ9w33P2lkYiJeZVjCORpZR82B 4DE7e0MlokoxFPuZPGBhrXIEDfmdkj1bRCFArqXbAheu8MZCiPSCAqXZ0l+RnUoWGBjC +l/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193528; x=1754798328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OuNmIbrdZwfa0pVSTeAraA+TCM/HhXLg2Msu1oHrhfo=; b=Qot1mpr1UPMikOmjupvd0DUMRC4UU6mfjW0QmYc6JqyE09KfgHp/3STVYGlwznhsYt UZkEGhKlZcqpAJPWeZ+iE0DJTt019vFx/DjCbcZlBDs1/p1hwgcWFgulCyngcDwiIhKU YlI9NBo22y+vKSBER3nPfiOlOCnVy9w2YagCdooVpt7svRJpaBfj4iMG+BN+mIaLuoJh N+bUzPIqXQMvcbh0lQCvxJm+tWSkMAtt86GroUnBmtMI4NQ+cShnK0Eav2+R/1p95Jn0 FbFgvWxXYucvj0bA3CCfcUKWhTRwaTKqctSORTcUiWYoonE6M0G4GSUAqcMFB5wuYTrg M2QQ== X-Forwarded-Encrypted: i=1; AJvYcCWRukTp108FD/6xVnST8aS5K06iAwoP8MS3Buu1NjDh6YMuSN9i+6nCN/uBUC9kbnzjChAqEmyvLZZAmZCs@vger.kernel.org X-Gm-Message-State: AOJu0Yz8e4CJuzmmD82EmGVXQXs52znWAmmXjHRkgpAQ2DINc5/Hfz/h B0aJvbPxsoYiwC9f0EwlSVw1H8CUwb30KMebNNAtRl3M0z7jll2gROKK/jaHODRqOos= X-Gm-Gg: ASbGncsWQYjh1btqq8e3017JDvg4lg+NxD30tCNZ2ugsmj2tZU5GSQjuKEyX29vfuon t0Bx+1AD4WSaVEGlLyHZql3tEoLFGJRPoVLBL1oN3uDFyZkmkFALAM27iGdX0ghBiYsfc9L66kC pMjD5b4Vtv0BNEhnlMkxBmj0V2RvfG0l5KDw7G5uiwDkpFUTCns8Jlp+x5Geuwv06OMPNDXf1FN vhjmJGTRUfRIv5VDTHpXJ1c+za5JNs2hFeZ1gdLNtI0ZZ+7HkIhw1dA9gFAs8szVNzzJytM6Gk2 O5Fjvxc3hM0Nzu/UHEOblTMwogKEnWMGWSmUnrFsEGnKLY96pv3vzAtXSfe5vqxUF5+xv1VTC5v VZTwN7xn1RRfBtvxzYpNBHyjjUtOIlPv8wARp5rJ3WGK5rY0IF8T4P80BfSQ1JpQy9amIltldfY SSFg== X-Google-Smtp-Source: AGHT+IGcflxY2xQddxU8v/rmDKw+QE+rWz5yIjaVEFD/GSKgriVLCHdPf305K8rfqYkhIJesD2M8sg== X-Received: by 2002:a05:6e02:17ca:b0:3e3:ccfe:d597 with SMTP id e9e14a558f8ab-3e41610a07fmr100947485ab.1.1754193527658; Sat, 02 Aug 2025 20:58:47 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:47 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 10/58] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap Date: Sat, 2 Aug 2025 21:57:28 -0600 Message-ID: <20250803035816.603405-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- lib/dynamic_debug.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 96cd31c457e2e..08d095dd19ef4 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -595,7 +595,8 @@ static int ddebug_exec_queries(char *query, const char = *modname) =20 /* apply a new class-param setting */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits, + const unsigned long *new_bits, + const unsigned long old_bits, const char *query_modname) { #define QUERY_SIZE 128 @@ -604,12 +605,12 @@ static int ddebug_apply_class_bitmap(const struct dde= bug_class_param *dcp, int matches =3D 0; int bi, ct; =20 - if (*new_bits !=3D *old_bits) + if (*new_bits !=3D old_bits) v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); =20 for (bi =3D 0; bi < map->length; bi++) { - if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) + if (test_bit(bi, new_bits) =3D=3D test_bit(bi, &old_bits)) continue; =20 snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], @@ -621,9 +622,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } - if (*new_bits !=3D *old_bits) + if (*new_bits !=3D old_bits) v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); =20 return matches; } @@ -679,7 +680,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa continue; } curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); *dcp->bits =3D curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -689,7 +690,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); =20 - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -743,7 +744,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, inrep &=3D CLASSMAP_BITMASK(map->length); } v2pr_info("bits:0x%lx > %s.%s\n", inrep, mod_name ?: "*", KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, mod_name); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, mod_name); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -756,7 +757,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, mod_name= ); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, old_bits, mod_name); *dcp->lvl =3D inrep; break; default: --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 43260280CC8; Sun, 3 Aug 2025 03:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193532; cv=none; b=GAaxwhddujzxHGrK6hhZapb7E/9NZF0I3oztM4z5rpren+0BbXX/aCPVZ5thHj2yA7GRrTVT5PL2s7tTn8WqTpqmQepbi2sEJNzeqVjpN07paKDn7Fn5ipvv5Fz8tsXN/iqZemKB7/uSLqmqqkzeip1XMgfr70MJzMPkiU0ifVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193532; c=relaxed/simple; bh=WTb1c1aO86V04FFdGKr8wh3r9rPdQzoyUUxDa7EEch8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ioPSwdyHSOTivtuy9v4j4GJrbIhlFNN/iKBtYvWD1fYC/8uZuB617gxs0XW0Y4E/RdsBRlfaz4C33IRv+eAptX1hVod2i6//q7qbQq/VPaW5AN5ULGpW7INZ92BWFiRg95TbY0sqbhS28r2+MiTzl1BuqAH9hj2YDLy968adYm8= 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=IacL8ANA; arc=none smtp.client-ip=209.85.166.176 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="IacL8ANA" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3e3d7b135c2so40558895ab.1; Sat, 02 Aug 2025 20:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193529; x=1754798329; 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=j+IM0NsWJ5A9C8Bm0HIX5NiHGnXi4xS02uXX3BN3rSA=; b=IacL8ANA3g27d38adu5nxzlIaG0LFO/jp1toVpG+9RpmvpWf9DL5yirk9im9d3uZLD X3L6C1zHJQUua1vCCYw3jzvQnZ2d17L7Q8Hx7tqhN0rBGL9xZutthlhIA95SuivsEtLX V2sfUfPJ6aUe/KZMbxExETkhNzecdUjf05BrRbza+0BdFuWqyRavT4hosVIkRzsJpL+b N/qxpYJsXe7nU3SSy0PkR1wDnad+ZY4dQYnR8zr+MULPYO8ZfcwsiZmbWJ8nPJqURYYp hFvwLhMXWJbXk3czH3Jsex6wG7eRvwt0ZjfUAdCatCKBEwD6TekJ5MsbbBJDsElArn1m kyjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193529; x=1754798329; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j+IM0NsWJ5A9C8Bm0HIX5NiHGnXi4xS02uXX3BN3rSA=; b=p5MYnKqvl9eXChBbUgbI8RtYt471HF8iSMmmXkuYLElkrLafgb0PBEmaTnXAkMctI1 4ixyJHTRkP8+E6LLM2U6f2AzgjqtOpbdstD1s80TOzCO1ltDWGq7HFrwnqjRPfeKNr/g dXZ01I/IB8w/CCGv7lq1tnl0W5edlNpIR9kjUOQH2+Y9kXWl7996d8ekfFGQwZLW5yny do9x4zCxM7vAzViqPh+chnM5hsGdPwfUPu2rMZu0475exvYUu+cu8fWa/hAj+jcJyz+9 fojgfI3o9kvYM5YqxabvqgZNKCMfWvbblzFaMOtKmTeKvqFXtB7LFECnZ0gWxBNvnfgd ABpA== X-Forwarded-Encrypted: i=1; AJvYcCUgcDn9AZJmFVJJOlWEiRff+eRhsmvbiFSs3WkbotpMSGLuUWXkKG+6CtDC45tm5Nul3wiAztWCUC9EVeop@vger.kernel.org X-Gm-Message-State: AOJu0Yzg0JzCbrByCnOgDfG4FCHgpACDCyjvfNAOs54msm8Ba7PFrjSW 5OqXKEfi9+Ucu9f36FeMaeQ5fDCSp0ImeETDmK/RaRTLbYI6IV0aH27u13nwDr2mf9s= X-Gm-Gg: ASbGnct+kKGns+R0Fh092rliClDnKMgu+3uXGQ/rhLmXI/0XUyh5CycvJY6+Zoa7/EX dwbsLlfkPokYKd7aevr1lpf9tRet9GFK4JbGkQh/Bb2cgsN2U9aukLBlHG+j4AuhDEi+G1oEwkk eSQZnNJyBSItPnQWxCJZ4QYMor6pK+fK3iv+X5ypyaCZbihNcsW0x/WCYfSGiuMfD0547HxF4uW dXnlHxf0P436T7F5kEs5+I691lJoxGV+cRnzYNYqo/b8vTauElRoYlMigXnrcXbBWWdxN4DvU5a mLkDk6Xd4wPgvpRCEAG82IkN+5DPgUUpfSr6Ch4klp1FYsjC70AiXmhW2/39NmmOLu19Wuv8HAr /sqQ6Lf3VgWIUO9CxWfCxVEZcipw++ZstvbmJ1RdaDAaAYi+8ZLBM/IhRME/5TucvD7LjXP9x6Y FzMQs2xq4uXXhN X-Google-Smtp-Source: AGHT+IGM7OSUipX6+Z/C4hvdpT/EoYheE+z0u0a3sHNA7VxTBFGUiEplXS+T9MpT5CIry67A8qS+LA== X-Received: by 2002:a05:6e02:3191:b0:3dd:e7d6:18bb with SMTP id e9e14a558f8ab-3e4161cca21mr84220835ab.17.1754193529107; Sat, 02 Aug 2025 20:58:49 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:48 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 11/58] dyndbg: replace classmap list with a vector Date: Sat, 2 Aug 2025 21:57:29 -0600 Message-ID: <20250803035816.603405-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Classmaps are stored in an elf section/array, but currently are individually list-linked onto dyndbg's per-module ddebug_table for operation. This is unnecessary. Just like dyndbg's descriptors, classes are packed in compile order; so even with many builtin modules employing multiple classmaps, each modules' maps are packed contiguously, and can be treated as a array-start-address & array-length. So this drops the whole list building operation done in ddebug_attach_module_classes(), and removes the list-head members. The "select-by-modname" condition is reused to find the start,end of the subrange. NOTE: This "filter-by-modname" on classmaps should really be done in ddebug_add_module(1); ie at least one step closer to ddebug_init(2), which already splits up pr-debug descriptors into subranges by modname, then calls (1) on each. (2) knows nothing of classmaps currently, and doesn't need to. For now, just add comment. Signed-off-by: Jim Cromie --- v3- drop __outvar as promising magic it doesnt have --- include/linux/dynamic_debug.h | 1 - lib/dynamic_debug.c | 62 ++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index ac199293d2032..e458d4b838ac3 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -83,7 +83,6 @@ enum class_map_type { }; =20 struct ddebug_class_map { - struct list_head link; struct module *mod; const char *mod_name; /* needed for builtins */ const char **class_names; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 08d095dd19ef4..283926530a43b 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -45,10 +45,11 @@ extern struct ddebug_class_map __start___dyndbg_classes= []; extern struct ddebug_class_map __stop___dyndbg_classes[]; =20 struct ddebug_table { - struct list_head link, maps; + struct list_head link; const char *mod_name; - unsigned int num_ddebugs; struct _ddebug *ddebugs; + struct ddebug_class_map *classes; + unsigned int num_ddebugs, num_classes; }; =20 struct ddebug_query { @@ -148,12 +149,13 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) } =20 static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_tabl= e const *dt, - const char *class_string, int *class_id) + const char *class_string, + int *class_id) { struct ddebug_class_map *map; - int idx; + int i, idx; =20 - list_for_each_entry(map, &dt->maps, link) { + for (map =3D dt->classes, i =3D 0; i < dt->num_classes; i++, map++) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; @@ -164,7 +166,6 @@ static struct ddebug_class_map *ddebug_find_valid_class= (struct ddebug_table cons return NULL; } =20 -#define __outvar /* filled by callee */ /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -180,7 +181,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, unsigned int nfound =3D 0; struct flagsbuf fbuf, nbuf; struct ddebug_class_map *map =3D NULL; - int __outvar valid_class; + int valid_class; =20 /* search for matching ddebugs */ mutex_lock(&ddebug_lock); @@ -1122,9 +1123,10 @@ static void *ddebug_proc_next(struct seq_file *m, vo= id *p, loff_t *pos) =20 static const char *ddebug_class_name(struct ddebug_iter *iter, struct _dde= bug *dp) { - struct ddebug_class_map *map; + struct ddebug_class_map *map =3D iter->table->classes; + int i, nc =3D iter->table->num_classes; =20 - list_for_each_entry(map, &iter->table->maps, link) + for (i =3D 0; i < nc; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1208,30 +1210,31 @@ static const struct proc_ops proc_fops =3D { .proc_write =3D ddebug_proc_write }; =20 -static void ddebug_attach_module_classes(struct ddebug_table *dt, - struct ddebug_class_map *classes, - int num_classes) +static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) { struct ddebug_class_map *cm; - int i, j, ct =3D 0; + int i, nc =3D 0; =20 - for (cm =3D classes, i =3D 0; i < num_classes; i++, cm++) { + /* + * Find this module's classmaps in a subrange/wholerange of + * the builtin/modular classmap vector/section. Save the start + * and length of the subrange at its edges. + */ + for (cm =3D di->classes, i =3D 0; i < di->num_classes; i++, cm++) { =20 if (!strcmp(cm->mod_name, dt->mod_name)) { - - v2pr_info("class[%d]: module:%s base:%d len:%d ty:%d\n", i, - cm->mod_name, cm->base, cm->length, cm->map_type); - - for (j =3D 0; j < cm->length; j++) - v3pr_info(" %d: %d %s\n", j + cm->base, j, - cm->class_names[j]); - - list_add(&cm->link, &dt->maps); - ct++; + if (!nc) { + v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n= ", + i, cm->mod_name, cm->base, cm->length, cm->map_type); + dt->classes =3D cm; + } + nc++; } } - if (ct) - vpr_info("module:%s attached %d classes\n", dt->mod_name, ct); + if (nc) { + dt->num_classes =3D nc; + vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + } } =20 /* @@ -1263,10 +1266,9 @@ static int ddebug_add_module(struct _ddebug_info *di= , const char *modname) dt->num_ddebugs =3D di->num_descs; =20 INIT_LIST_HEAD(&dt->link); - INIT_LIST_HEAD(&dt->maps); =20 if (di->classes && di->num_classes) - ddebug_attach_module_classes(dt, di->classes, di->num_classes); + ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); @@ -1379,8 +1381,8 @@ static void ddebug_remove_all_tables(void) mutex_lock(&ddebug_lock); while (!list_empty(&ddebug_tables)) { struct ddebug_table *dt =3D list_entry(ddebug_tables.next, - struct ddebug_table, - link); + struct ddebug_table, + link); ddebug_table_free(dt); } mutex_unlock(&ddebug_lock); --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 0A92928136B; Sun, 3 Aug 2025 03:58:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193533; cv=none; b=YECyWSIMiwojICHTQqmm3g2ste96Opa267YOqsU7tmypelsSczrnohBQTg1q/f+d8aniWuZrCr1VRGdhXjg4c4FD2F9Ti5uR9Hdpw8FIWS/aDyugC01EKZMgx6DbGHbJo8lAl4Q5XhdOjt1dQq1bs1Z+EOeBcd+LKvs8LT/vHgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193533; c=relaxed/simple; bh=b+FioSz/8EWacVXu7Sm+hMOcAgEfnPdX9uYqDnCHyck=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AEenKZLc6+SPciHL35DDW0jEolwGs6n40+QKJPPKoLhNCMrPwh3PBOY/0Iy4JVMtkI9YJ/5Ynlf6LITkv8gUY9fpxWCW/Q0ApbzsMnyvZjw7c8yp6hC+jlD1PWMVf9R7/NID9uYhllfV7FZobOpb6MaFTKr0XNCUDd+2mQhXuus= 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=kyHRtd75; arc=none smtp.client-ip=209.85.166.180 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="kyHRtd75" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3e3e926fdeaso12248235ab.1; Sat, 02 Aug 2025 20:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193531; x=1754798331; 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=1JCLCVuCy1Iq9Gw35PtEgUXRGWUdACaICRLzJa5akkQ=; b=kyHRtd75Rszj6XN+q6zUkLhHZZNWxGXZncYPTrpdX0X0DXRzCK0ytGvh+k1jO2dhvj IQKxz8UBV2H841SIIdB6u352gU3IsJ7tuJ6UbWMW8c6F/cIwBvEyJdbchIyTUdmVW2tk BmojrbMOStGbhjv4e9FLhthwZZeOTv2UwzppY4dPOaGYG6lh+ZqW7JOAAff+no47MA7j voqCol9Q8el/EOYvyNSlp82/OuDir1Wej7G5WdGvFqQlmaAQDRNZwGgZHYPT8dAhFFy4 uTPYVwBHb/VSr5mXokMUsFLyKzUXmemkYOlvtIkfL/qFiuxTx1CRQNULjUpTlW9F+eiL HOcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193531; x=1754798331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1JCLCVuCy1Iq9Gw35PtEgUXRGWUdACaICRLzJa5akkQ=; b=qtp/UCCe8qeDWnAcTbLrDAle8k/bouPbXTRKYpQTo2IBbZDzmO1EUl1NxNznq4d4WH QdJYTU+vlRExM/+AMhUIiX+liu/LlexcDX3Qwr0TE5Nz0PXk/Mzq1VNyiXsztHVI7rl3 jnStbIwVFZwo02IkdQwKurAzlH+VD/KAY7oRyBZSIKvAPVWvYBiNeoFlHS1ndDedBmfX 9sVJodzrpHgt49c0ufYowa+n2Q4mK6pAZlmvu+c6zRScUOc/+78H5V1GWYvo+pu5kdS1 e4WX5hANBGdqDXUM/ca1kWWi2mvYaNu90M23o6KBlGj+7TQLnmj7Tdyem5W6heL952lE l0cg== X-Forwarded-Encrypted: i=1; AJvYcCXnIK+VzDnsiU37wdxt6KhHBMS2Souv4gSd+xla4TC5h1LDucLB+xOrDU6A2y0EDYy/1zSC3tJ3I9SAvtV8@vger.kernel.org X-Gm-Message-State: AOJu0YwrOiWBSiCtehdjtEwWtrimRiVJw5ZjE7Ed0aPLqTnGo1ILpKPw dod0XP6dQvEnpPkssYgOZvXItkuS2XHDORQWcMoFuNXi53cZ154i0BpGdrHOp9IY69M= X-Gm-Gg: ASbGnctGwlrmiaZd2SrA/UMdM5jvHhIQRYsVo8ZwVhWWmyGUqGlSn0owdEBwBpQxSs6 iPcX53phi2vxOVsdiOGL7sNVyBpnwuCbYJqsAl4My84RsY7aR6c/z7r86FUPGxc8hZu4w8TztjS eyZCVOPJj3vAFAwqoHt0h/mwb75V/DgOwy9RojTjXsfWklHHcnzwhbx7vWCUPqgVsCwPEnyAS4p rIQcTfwNlF7IqfP+JH+3QHgsQgmn7bmul7YGqf2GBDqnkBuEC3+eBkKbZD3DF+xLGEZrzCwUPn3 2Ky8lCpZ7dDjV/xr1yOyX3bi7aZT1b+gc4uPS5Qb6qN3Yuat5EwPLUidZ7B6xcceppHsOi03EnK exgXgIFmohK0T4GxZoN3EtUHZwHN8i8aXhMiGMazlE+mfY4jAEwwD6VVqUYv14NoBJ5nMDy+IL1 xN5A== X-Google-Smtp-Source: AGHT+IELdpv7uUZAZBrGCo6vRMKsduTbeRMcIYAoxynvAlTrmV87SOcUm0eDA5nlXTZa0W/xhKLP5A== X-Received: by 2002:a92:cda6:0:b0:3e2:a8d7:cbc0 with SMTP id e9e14a558f8ab-3e41610d612mr96883205ab.2.1754193530845; Sat, 02 Aug 2025 20:58:50 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:50 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 12/58] dyndbg: macrofy a 2-index for-loop pattern Date: Sat, 2 Aug 2025 21:57:30 -0600 Message-ID: <20250803035816.603405-13-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" dynamic-debug has several __sections, each with , num_, and it iterates over these with a 2-index for-loop. These loops are fiddly with the 2 names. We have only 2 such loops now, but are getting more soon; lets embed/abstract the fiddlyness in the for_subvec() macro, and avoid repeating it going forward. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- lib/dynamic_debug.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 283926530a43b..7c5a1ae2c0a65 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -128,6 +128,21 @@ do { \ #define v3pr_info(fmt, ...) vnpr_info(3, fmt, ##__VA_ARGS__) #define v4pr_info(fmt, ...) vnpr_info(4, fmt, ##__VA_ARGS__) =20 + +/* + * simplify a repeated for-loop pattern walking N steps in a T _vec + * member inside a struct _box. It expects int i and T *_sp to be + * declared in the caller. + * @_i: caller provided counter. + * @_sp: cursor into _vec, to examine each item. + * @_box: ptr to a struct containing @_vec member + * @_vec: name of a sub-struct member in _box, with array-ref and length + */ +#define for_subvec(_i, _sp, _box, _vec) \ + for ((_i) =3D 0, (_sp) =3D (_box)->_vec; \ + (_i) < (_box)->num_##_vec; \ + (_i)++, (_sp)++) + static void vpr_info_dq(const struct ddebug_query *query, const char *msg) { /* trim any trailing newlines */ @@ -155,7 +170,7 @@ static struct ddebug_class_map *ddebug_find_valid_class= (struct ddebug_table cons struct ddebug_class_map *map; int i, idx; =20 - for (map =3D dt->classes, i =3D 0; i < dt->num_classes; i++, map++) { + for_subvec(i, map, dt, classes) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; @@ -1220,8 +1235,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug * the builtin/modular classmap vector/section. Save the start * and length of the subrange at its edges. */ - for (cm =3D di->classes, i =3D 0; i < di->num_classes; i++, cm++) { - + for_subvec(i, cm, di, classes) { if (!strcmp(cm->mod_name, dt->mod_name)) { if (!nc) { v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n= ", --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 CD5DD23BCFF; Sun, 3 Aug 2025 03:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193536; cv=none; b=OgjASX54ds/p+kWveipLlbw8yRiAXRQZ7pYCyYLdaMFJUr+5968GV7v7nuffjUnZ9DfokB9WMdIgXZDLu4hVAx3NJSp1jByNDCStnLmgEUNzrH04N8PrKMmajGSNpeRmgTN2qk/gZyrnOPeQJkkaUnTYfWBakh+aDT/dOUpPRrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193536; c=relaxed/simple; bh=19rCl/67IFPuwImL6uB3E5CdVnk1Uoou4bARziU6g1E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=koy8BPX2VBDXZM0/dXWZpkK8429iXDim/smu1kt8A+DabpElxyQvZho+AwPHZWvUE/VR42/oOgS4wUQ1xpWt986eupTndAco6qPSr9JiUkkW3tK32WoF+XtD7Zl/8s7PhD4ViGIHU8PxZk/8bXBvlYqigzSiwolRBBMe7kGNlsk= 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=HHjkV90C; arc=none smtp.client-ip=209.85.166.169 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="HHjkV90C" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3e40d006105so14218265ab.3; Sat, 02 Aug 2025 20:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193533; x=1754798333; 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=dZapcZOYbsRXRLzueF01PKADy1U1mu9RPzgpP5J8FF4=; b=HHjkV90CyUfRM5VQAn6Gkp0C1LBeinC7kyHXylVOBj9ennCToEed5nPqPjqWUiL61i iAcPc8DfakL3ICrk90b6CXCwLLWDPjwXS2zg4j8jEeFBCMB31F1Ymo/EoiDe4lC0e2+a NMU8dtADRrh5DOT0J+jPr3aewkDFmVPoGP51IWjA7vZSR4mz5tE1FM/LsyziERsPCSfp gwvt3hqpuUXOetj5lgT52F4WoFAZG2apZFxSYFFx72h+QbuHBhOoCrQzBix+QvQCpPFK Hr+2QGU+LjloaxY/oERdVAwf7hMXHWTn3ekJDmVMssNuQNlhYWKX6+C/wLBJ2z7sb0IT QXmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193533; x=1754798333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dZapcZOYbsRXRLzueF01PKADy1U1mu9RPzgpP5J8FF4=; b=bhzT0RKJuop1D0k9dHke+x5Qh+cOScYQaDCPD9MuBKfucLLRCqzD8kcG42gVNJh2L7 9ak8sNrTAZSolIBInxSgPXhlHoV/7j78pHiOi9dm8GmJadCRXUwLR2Qm+95ha+YQto0j eGn41fx7uk/k08DlMxZCGOrVLEus+hufAkQoyg69l4wpq6xCTODsEHpGGc+7c1OLNK1Q 4rRB6i0/FPXo+oH06tHzKCdl4k7gIMtRugxVxTKmMNXmAcCS8Kd8s2TitwXe+yztMA/7 QdKk0/mGLVKDLQ5WydTZ4J8i1d9hnn77Ryb/iq5SvvriP/KuFbit17aVB3TieoMHiI0P Zz7A== X-Forwarded-Encrypted: i=1; AJvYcCUeNmX62M5cK7/hxPO9qEq+hIXHoY3PidIybczvx5kazWhf3Dy8aha2r8RK4lbm4A7pwLKB7mp96XIaKRQK@vger.kernel.org X-Gm-Message-State: AOJu0Yy0ugZ5bJDFycb1FLehc+AnscbeylZpPHjzY1/z18y/yWaaCBV7 4zkskoIJywQ5MV8JiTg0eaQ1L8VQ+PoDQddFnarrsVW7DdDLA9K8eyOsLXKcTyk3A4k= X-Gm-Gg: ASbGncupsySqGIkkHeTA17ftyv6TjYX1zwqRCOVfZs2AfSIvnmeEhknD43lagcYzRBL Hwc8r/sWhhSRCqkgFChHLHI9mypmnZhwjkd6g7NUmWm70qvmtFGDiUkjCv3A6hvOuBp/5yQOW18 DNrK62ey+1zwyrvwwyWeBjVEWUCb5779B5eD3h75wF3CHlPMLPhWToarSf6L/udIShANZhSUliI 6ZjUHH0VmOWFRi1+feMX1vqfM4nI8cPyVgy8/6Zt3k5QLA0Vm6J5UIqM3TvzKMwq5ZTcOT8AHed mO7LfFmVUZ1BbnVUZpJXrG34uWcnxcTIcEnvMfWmBAFjPcRcqrGdn9l+ZSep6JBKODvzx0yUajo QqJncCzl++arggfqZaUvbBftMjJydIhM/sn4hzrAOQAqDJ/80W9xzU0XU91P88sDCGnE736jMqA LGpg== X-Google-Smtp-Source: AGHT+IHqePFp53oMCYMNijD3iMKpdYzaHPS18na9qxSpVx8K9OUWUT0UP9MDSZXkIdTTfzJxGeMc3Q== X-Received: by 2002:a05:6e02:17cd:b0:3e3:d197:b567 with SMTP id e9e14a558f8ab-3e416117005mr96452805ab.9.1754193532690; Sat, 02 Aug 2025 20:58:52 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:51 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 13/58] dyndbg,module: make proper substructs in _ddebug_info Date: Sat, 2 Aug 2025 21:57:31 -0600 Message-ID: <20250803035816.603405-14-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" recompose struct _ddebug_info, inserting proper sub-structs. The struct currently has 2 pairs of fields: descs, num_descs and classes, num_classes. Several for-loops operate on these field pairs, soon many more will be added. Looping over these blocks by respective field-pairs is repetitive and fiddly, differing only by the field-names. Before adding a 3rd section and compounding the fiddly details problem, make proper substructs of each section, with the same named fields. So this patch does: Adds 3 "vector" structs, each with { *start, int len; } components, for _ddebug_descriptors, _ddebug_class_maps, and _ddebug_class_users respectively. Invariant: These vectors ref a contiguous subrange of __section memory in builtin/DATA or in loadable modules via mod->dyndbg_info; with guaranteed life-time for us. Bundles these 3 vectors (subrange-refs) struct (reformed) _ddebug_info, where they're __packed to close the paholes introduced otherwise. The common fields allow improving the for_subvec() macro by dropping the ugly num_## paste-up. Also recompose struct ddebug_table to contain a _ddebug_info. This reinforces its use as a cursor into relevant data for a builtin module, and access to the full _ddebug state for modules. NOTES: Fixup names: section names improved, struct names normalized to _ddebug_* struct module contains a _ddebug_info field and module/main.c sets it up, so that gets adjusted. The __packed attribute on _ddebug_info and the 3 contained structs closes the holes otherwise created by the structification (which was my excuse for not doing it originally). Signed-off-by: Jim Cromie --- -v2 rework towards front of series --- include/asm-generic/vmlinux.lds.h | 4 +- include/linux/dynamic_debug.h | 42 +++++++----- kernel/module/main.c | 12 ++-- lib/dynamic_debug.c | 108 ++++++++++++++---------------- lib/test_dynamic_debug.c | 2 +- 5 files changed, 88 insertions(+), 80 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index fa5f19b8d53a0..6fbdee1978210 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -365,8 +365,8 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELL= ER_CLANG) *(__tracepoints) \ /* implement dynamic printk debug */ \ . =3D ALIGN(8); \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ - BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + BOUNDED_SECTION_BY(__dyndbg_class_maps, ___dyndbg_class_maps) \ + BOUNDED_SECTION_BY(__dyndbg_descriptors, ___dyndbg_descs) \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index e458d4b838ac3..9d282e2444e18 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -82,7 +82,7 @@ enum class_map_type { */ }; =20 -struct ddebug_class_map { +struct _ddebug_class_map { struct module *mod; const char *mod_name; /* needed for builtins */ const char **class_names; @@ -93,15 +93,15 @@ struct ddebug_class_map { =20 /** * DECLARE_DYNDBG_CLASSMAP - declare classnames known by a module - * @_var: a struct ddebug_class_map, passed to module_param_cb + * @_var: a struct _ddebug_class_map, passed to module_param_cb * @_type: enum class_map_type, chooses bits/verbose, numeric/symbolic * @_base: offset of 1st class-name. splits .class_id space * @classes: class-names used to control class'd prdbgs */ #define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ - static struct ddebug_class_map __aligned(8) __used \ - __section("__dyndbg_classes") _var =3D { \ + static struct _ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_class_maps") _var =3D { \ .mod =3D THIS_MODULE, \ .mod_name =3D KBUILD_MODNAME, \ .base =3D _base, \ @@ -110,21 +110,33 @@ struct ddebug_class_map { .class_names =3D _var##_classnames, \ } =20 -/* encapsulate linker provided built-in (or module) dyndbg data */ +/* + * @_ddebug_info: gathers module/builtin dyndbg_* __sections together. + * For builtins, it is used as a cursor, with the inner structs + * marking sub-vectors of the builtin __sections in DATA. + */ +struct _ddebug_descs { + struct _ddebug *start; + int len; +} __packed; + +struct _ddebug_class_maps { + struct _ddebug_class_map *start; + int len; +} __packed; + struct _ddebug_info { - struct _ddebug *descs; - struct ddebug_class_map *classes; - unsigned int num_descs; - unsigned int num_classes; -}; + struct _ddebug_descs descs; + struct _ddebug_class_maps maps; +} __packed; =20 -struct ddebug_class_param { +struct _ddebug_class_param { union { unsigned long *bits; unsigned long *lvl; }; char flags[8]; - const struct ddebug_class_map *map; + const struct _ddebug_class_map *map; }; =20 /* @@ -159,7 +171,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, =20 #define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt) \ static struct _ddebug __aligned(8) \ - __section("__dyndbg") name =3D { \ + __section("__dyndbg_descriptors") name =3D { \ .modname =3D KBUILD_MODNAME, \ .function =3D __func__, \ .filename =3D __FILE__, \ @@ -242,7 +254,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * macro. */ #define _dynamic_func_call_cls(cls, fmt, func, ...) \ - __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS_= _) + __dynamic_func_call_cls(__UNIQUE_ID(_ddebug), cls, fmt, func, ##__VA_ARGS= __) #define _dynamic_func_call(fmt, func, ...) \ _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__) =20 @@ -252,7 +264,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * with precisely the macro's varargs. */ #define _dynamic_func_call_cls_no_desc(cls, fmt, func, ...) \ - __dynamic_func_call_cls_no_desc(__UNIQUE_ID(ddebug), cls, fmt, \ + __dynamic_func_call_cls_no_desc(__UNIQUE_ID(_ddebug), cls, fmt, \ func, ##__VA_ARGS__) #define _dynamic_func_call_no_desc(fmt, func, ...) \ _dynamic_func_call_cls_no_desc(_DPRINTK_CLASS_DFLT, fmt, \ diff --git a/kernel/module/main.c b/kernel/module/main.c index c2c08007029d1..8515a6184be09 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2689,12 +2689,12 @@ static int find_module_sections(struct module *mod,= struct load_info *info) pr_warn("%s: Ignoring obsolete parameters\n", mod->name); =20 #ifdef CONFIG_DYNAMIC_DEBUG_CORE - mod->dyndbg_info.descs =3D section_objs(info, "__dyndbg", - sizeof(*mod->dyndbg_info.descs), - &mod->dyndbg_info.num_descs); - mod->dyndbg_info.classes =3D section_objs(info, "__dyndbg_classes", - sizeof(*mod->dyndbg_info.classes), - &mod->dyndbg_info.num_classes); + mod->dyndbg_info.descs.start =3D section_objs(info, "__dyndbg_descriptors= ", + sizeof(*mod->dyndbg_info.descs.start), + &mod->dyndbg_info.descs.len); + mod->dyndbg_info.maps.start =3D section_objs(info, "__dyndbg_class_maps", + sizeof(*mod->dyndbg_info.maps.start), + &mod->dyndbg_info.maps.len); #endif =20 return 0; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 7c5a1ae2c0a65..53ce282554266 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -39,17 +39,15 @@ =20 #include =20 -extern struct _ddebug __start___dyndbg[]; -extern struct _ddebug __stop___dyndbg[]; -extern struct ddebug_class_map __start___dyndbg_classes[]; -extern struct ddebug_class_map __stop___dyndbg_classes[]; +extern struct _ddebug __start___dyndbg_descs[]; +extern struct _ddebug __stop___dyndbg_descs[]; +extern struct _ddebug_class_map __start___dyndbg_class_maps[]; +extern struct _ddebug_class_map __stop___dyndbg_class_maps[]; =20 struct ddebug_table { struct list_head link; const char *mod_name; - struct _ddebug *ddebugs; - struct ddebug_class_map *classes; - unsigned int num_ddebugs, num_classes; + struct _ddebug_info info; }; =20 struct ddebug_query { @@ -128,7 +126,6 @@ do { \ #define v3pr_info(fmt, ...) vnpr_info(3, fmt, ##__VA_ARGS__) #define v4pr_info(fmt, ...) vnpr_info(4, fmt, ##__VA_ARGS__) =20 - /* * simplify a repeated for-loop pattern walking N steps in a T _vec * member inside a struct _box. It expects int i and T *_sp to be @@ -139,8 +136,8 @@ do { \ * @_vec: name of a sub-struct member in _box, with array-ref and length */ #define for_subvec(_i, _sp, _box, _vec) \ - for ((_i) =3D 0, (_sp) =3D (_box)->_vec; \ - (_i) < (_box)->num_##_vec; \ + for ((_i) =3D 0, (_sp) =3D (_box)->_vec.start; \ + (_i) < (_box)->_vec.len; \ (_i)++, (_sp)++) =20 static void vpr_info_dq(const struct ddebug_query *query, const char *msg) @@ -163,14 +160,14 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } =20 -static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_tabl= e const *dt, +static struct _ddebug_class_map *ddebug_find_valid_class(struct ddebug_tab= le const *dt, const char *class_string, int *class_id) { - struct ddebug_class_map *map; + struct _ddebug_class_map *map; int i, idx; =20 - for_subvec(i, map, dt, classes) { + for_subvec(i, map, &dt->info, maps) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; @@ -195,7 +192,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, unsigned int newflags; unsigned int nfound =3D 0; struct flagsbuf fbuf, nbuf; - struct ddebug_class_map *map =3D NULL; + struct _ddebug_class_map *map =3D NULL; int valid_class; =20 /* search for matching ddebugs */ @@ -216,8 +213,8 @@ static int ddebug_change(const struct ddebug_query *que= ry, valid_class =3D _DPRINTK_CLASS_DFLT; } =20 - for (i =3D 0; i < dt->num_ddebugs; i++) { - struct _ddebug *dp =3D &dt->ddebugs[i]; + for (i =3D 0; i < dt->info.descs.len; i++) { + struct _ddebug *dp =3D &dt->info.descs.start[i]; =20 /* match site against query-class */ if (dp->class_id !=3D valid_class) @@ -610,14 +607,14 @@ static int ddebug_exec_queries(char *query, const cha= r *modname) } =20 /* apply a new class-param setting */ -static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, +static int ddebug_apply_class_bitmap(const struct _ddebug_class_param *dcp, const unsigned long *new_bits, const unsigned long old_bits, const char *query_modname) { #define QUERY_SIZE 128 char query[QUERY_SIZE]; - const struct ddebug_class_map *map =3D dcp->map; + const struct _ddebug_class_map *map =3D dcp->map; int matches =3D 0; int bi, ct; =20 @@ -653,8 +650,8 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, /* accept comma-separated-list of [+-] classnames */ static int param_set_dyndbg_classnames(const char *instr, const struct ker= nel_param *kp) { - const struct ddebug_class_param *dcp =3D kp->arg; - const struct ddebug_class_map *map =3D dcp->map; + const struct _ddebug_class_param *dcp =3D kp->arg; + const struct _ddebug_class_map *map =3D dcp->map; unsigned long curr_bits, old_bits; char *cl_str, *p, *tmp; int cls_id, totct =3D 0; @@ -724,8 +721,8 @@ static int param_set_dyndbg_module_classes(const char *= instr, const struct kernel_param *kp, const char *mod_name) { - const struct ddebug_class_param *dcp =3D kp->arg; - const struct ddebug_class_map *map =3D dcp->map; + const struct _ddebug_class_param *dcp =3D kp->arg; + const struct _ddebug_class_map *map =3D dcp->map; unsigned long inrep, new_bits, old_bits; int rc, totct =3D 0; =20 @@ -812,8 +809,8 @@ EXPORT_SYMBOL(param_set_dyndbg_classes); */ int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp) { - const struct ddebug_class_param *dcp =3D kp->arg; - const struct ddebug_class_map *map =3D dcp->map; + const struct _ddebug_class_param *dcp =3D kp->arg; + const struct _ddebug_class_map *map =3D dcp->map; =20 switch (map->map_type) { =20 @@ -1064,8 +1061,8 @@ static struct _ddebug *ddebug_iter_first(struct ddebu= g_iter *iter) } iter->table =3D list_entry(ddebug_tables.next, struct ddebug_table, link); - iter->idx =3D iter->table->num_ddebugs; - return &iter->table->ddebugs[--iter->idx]; + iter->idx =3D iter->table->info.descs.len; + return &iter->table->info.descs.start[--iter->idx]; } =20 /* @@ -1086,10 +1083,10 @@ static struct _ddebug *ddebug_iter_next(struct ddeb= ug_iter *iter) } iter->table =3D list_entry(iter->table->link.next, struct ddebug_table, link); - iter->idx =3D iter->table->num_ddebugs; + iter->idx =3D iter->table->info.descs.len; --iter->idx; } - return &iter->table->ddebugs[iter->idx]; + return &iter->table->info.descs.start[iter->idx]; } =20 /* @@ -1136,12 +1133,12 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) #define class_in_range(class_id, map) \ (class_id >=3D map->base && class_id < map->base + map->length) =20 -static const char *ddebug_class_name(struct ddebug_iter *iter, struct _dde= bug *dp) +static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) { - struct ddebug_class_map *map =3D iter->table->classes; - int i, nc =3D iter->table->num_classes; + struct _ddebug_class_map *map; + int i; =20 - for (i =3D 0; i < nc; i++, map++) + for_subvec(i, map, &dt->info, maps) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1175,7 +1172,7 @@ static int ddebug_proc_show(struct seq_file *m, void = *p) seq_putc(m, '"'); =20 if (dp->class_id !=3D _DPRINTK_CLASS_DFLT) { - class =3D ddebug_class_name(iter, dp); + class =3D ddebug_class_name(iter->table, dp); if (class) seq_printf(m, " class:%s", class); else @@ -1227,7 +1224,7 @@ static const struct proc_ops proc_fops =3D { =20 static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) { - struct ddebug_class_map *cm; + struct _ddebug_class_map *cm; int i, nc =3D 0; =20 /* @@ -1235,18 +1232,18 @@ static void ddebug_attach_module_classes(struct dde= bug_table *dt, struct _ddebug * the builtin/modular classmap vector/section. Save the start * and length of the subrange at its edges. */ - for_subvec(i, cm, di, classes) { + for_subvec(i, cm, di, maps) { if (!strcmp(cm->mod_name, dt->mod_name)) { if (!nc) { v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n= ", i, cm->mod_name, cm->base, cm->length, cm->map_type); - dt->classes =3D cm; + dt->info.maps.start =3D cm; } nc++; } } if (nc) { - dt->num_classes =3D nc; + dt->info.maps.len =3D nc; vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); } } @@ -1259,10 +1256,10 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) { struct ddebug_table *dt; =20 - if (!di->num_descs) + if (!di->descs.len) return 0; =20 - v3pr_info("add-module: %s %d sites\n", modname, di->num_descs); + v3pr_info("add-module: %s %d sites\n", modname, di->descs.len); =20 dt =3D kzalloc(sizeof(*dt), GFP_KERNEL); if (dt =3D=3D NULL) { @@ -1276,19 +1273,18 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) * this struct ddebug_table. */ dt->mod_name =3D modname; - dt->ddebugs =3D di->descs; - dt->num_ddebugs =3D di->num_descs; + dt->info =3D *di; =20 INIT_LIST_HEAD(&dt->link); =20 - if (di->classes && di->num_classes) + if (di->maps.len) ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - vpr_info("%3u debug prints in module %s\n", di->num_descs, modname); + vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); return 0; } =20 @@ -1435,10 +1431,10 @@ static int __init dynamic_debug_init(void) char *cmdline; =20 struct _ddebug_info di =3D { - .descs =3D __start___dyndbg, - .classes =3D __start___dyndbg_classes, - .num_descs =3D __stop___dyndbg - __start___dyndbg, - .num_classes =3D __stop___dyndbg_classes - __start___dyndbg_classes, + .descs.start =3D __start___dyndbg_descs, + .maps.start =3D __start___dyndbg_class_maps, + .descs.len =3D __stop___dyndbg_descs - __start___dyndbg_descs, + .maps.len =3D __stop___dyndbg_class_maps - __start___dyndbg_class_maps, }; =20 #ifdef CONFIG_MODULES @@ -1449,7 +1445,7 @@ static int __init dynamic_debug_init(void) } #endif /* CONFIG_MODULES */ =20 - if (&__start___dyndbg =3D=3D &__stop___dyndbg) { + if (&__start___dyndbg_descs =3D=3D &__stop___dyndbg_descs) { if (IS_ENABLED(CONFIG_DYNAMIC_DEBUG)) { pr_warn("_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build\n"); return 1; @@ -1459,16 +1455,16 @@ static int __init dynamic_debug_init(void) return 0; } =20 - iter =3D iter_mod_start =3D __start___dyndbg; + iter =3D iter_mod_start =3D __start___dyndbg_descs; modname =3D iter->modname; i =3D mod_sites =3D mod_ct =3D 0; =20 - for (; iter < __stop___dyndbg; iter++, i++, mod_sites++) { + for (; iter < __stop___dyndbg_descs; iter++, i++, mod_sites++) { =20 if (strcmp(modname, iter->modname)) { mod_ct++; - di.num_descs =3D mod_sites; - di.descs =3D iter_mod_start; + di.descs.len =3D mod_sites; + di.descs.start =3D iter_mod_start; ret =3D ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1478,8 +1474,8 @@ static int __init dynamic_debug_init(void) iter_mod_start =3D iter; } } - di.num_descs =3D mod_sites; - di.descs =3D iter_mod_start; + di.descs.len =3D mod_sites; + di.descs.start =3D iter_mod_start; ret =3D ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1489,8 +1485,8 @@ static int __init dynamic_debug_init(void) i, mod_ct, (int)((mod_ct * sizeof(struct ddebug_table)) >> 10), (int)((i * sizeof(struct _ddebug)) >> 10)); =20 - if (di.num_classes) - v2pr_info(" %d builtin ddebug class-maps\n", di.num_classes); + if (di.maps.len) + v2pr_info(" %d builtin ddebug class-maps\n", di.maps.len); =20 /* now that ddebug tables are loaded, process all boot args * again to find and activate queries given in dyndbg params. diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 396144cf351be..8434f70b51bb3 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -41,7 +41,7 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 06= 00); */ #define DD_SYS_WRAP(_model, _flags) \ static unsigned long bits_##_model; \ - static struct ddebug_class_param _flags##_model =3D { \ + static struct _ddebug_class_param _flags##_model =3D { \ .bits =3D &bits_##_model, \ .flags =3D #_flags, \ .map =3D &map_##_model, \ --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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 EFFE22820DC; Sun, 3 Aug 2025 03:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193536; cv=none; b=VOg9HzgJ/sHDNgFEF6WMu9relIJ15T4a7QCXwwHLayDrxtWm3ZoGkqqUM83O5tfxWTq20JdgjnFuqzxVVOUUl0pK621eEm/VAkspAFYINIgVlsYYdmhgSfq0SzJtxpR2BjLEWzqEplUmpVtE7nFT3ymqqk0C+EUOf9se4V+Xdqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193536; c=relaxed/simple; bh=zN3cF721erymKVUNLmpuAfeG+E/WuLJrQ664eUCiPfs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k6Y5upu+LMRyEEQx5eLHVODVZcVKsVefXRq7J7foDjzzdGl1L2F8aOHITE5giqx8sZkQLukqhqjl8wpxc9KUaFbyyQ2yyETqbUVRc+VzUhdv2nkGmwl63HJbOFzSxvY6FuKaTsIsyg2KnY72V+flcwm5vg/swsuCpFQR+iiSZ0Y= 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=FcngqZa7; arc=none smtp.client-ip=209.85.166.172 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="FcngqZa7" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-3e3f449fa6fso30579365ab.3; Sat, 02 Aug 2025 20:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193534; x=1754798334; 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=On0sP/gRX6jcjl/izeb41d+iaYm4WT2VrxWSOrwNZ0U=; b=FcngqZa7qk177IHXH0UMpJai96U57W1/gTksFdBjoFyvtKD8pAMYoSsSn+bwBVCXfT iweNvX8xg6Bn81d09a/1QzCsnpQkzMxgoTE1co/RdJT536KOSbcCXAea8No/knGMnM/G edDjQoQFeo7/SmvCfeSHlr/ETBeKjm5F6z7HzCV3e8fOZIvDkoBVatJz0cinfumTaaSP MnpppyYnopf2doE7P0mveZ+DKNwR318K8acSQ+wIxIRlfdrifHwCIDTV9dmhq5CjNTSz DQJUsu0FwGE0GYM31NcumdKASoKFu4JLofDnrG7cIqdFHkig8cb51BcQyyOtFfmLH8pC E8hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193534; x=1754798334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=On0sP/gRX6jcjl/izeb41d+iaYm4WT2VrxWSOrwNZ0U=; b=bUYeXWntLiuobY23oVcw3QH0WE7iwKSqPrMDovkbR3bl/iDI/XN+KWujCVylsaAawe g4hcYEJX97GqqxuQYEL1O2BhJsCf/KnzdV6uim30wd4dVbX+4TXGJgbTmxGjoC2atpQX 7EEIezHmPgwtinfoNjaJbUuY2fVnooSzj8de+f50ve1Ci4FPxbky5J/1+rY954L8ZOcA QS0BXwSPwPiVN8kuVVvzCBpJKqXjEi+nsNZGiB/aqYYKR8EhPEZ0rMkJ/x3GWrRjOqQO I1i6JgaVw/417lCFin/x4zaaD0w+ihKChhthZAXkHueXwKp0bubN0EXqxs6g9L7Qj7a3 Efrw== X-Forwarded-Encrypted: i=1; AJvYcCUt6lIO1lvdacrkEvHmrvnodsWzdMI5O1uQN7rg5SDyJ2g6di78APRaMNIDCvogiD0G2ORlI6MdHCyav2jI@vger.kernel.org X-Gm-Message-State: AOJu0YyQvw4UpeemWbRjni5Mtw/nVIk9hNDks4fZYGdd9CZq1y8qHOFo DcorQM2rcqVIJ+R0o2fAYS6pIJDM6nBVDD7wSwlAfmvcwzleIbixN088wwO3XxQrslY= X-Gm-Gg: ASbGncu3NPTd0XBRIoAFmQIIUlo7jhdZBRGCHZLav7khdGHGNbPHB4torzyTdz6WhSl WxfPk0LnWUMlPvKQ/6EbjTMcgI7iKwb3inth+c7skQVq5/scfk2o0lXBIDDigXkzTUe1CkHt05/ 7uYCNFirPU1m9F9Ye7P656oEzUZfza2WvhHvb/y+ulF9gOo/CxUdqKmd6UdinrszRiC5J5QHm6t I63XfHKzaqJVKqELPAlRcT3gnjeMiuDb3ewEop6OZlP+PNVAFLYw74y3TdZtCJ7gKEroQ3zvO1O unPLtd1gxxM6g6E1Ab5MskW/RanwGzyVrquEOtXaOCh6FD+ZBPxtACHu3VwC2gOOLWKL8gD59EL 2ieKfbk6oLSUj8xU4EW7UuFgkCiTd54a1naolzPEadQxzv2CSWraZXwBNYS4mxa9pS2izT4o4Fr 0HNw== X-Google-Smtp-Source: AGHT+IFH+mtyxnkEPDbV4MUz0swiDqyakmO8hLW0D4nl3KXQPrEDdogoDGroqUg609kTHFJlSLTDsA== X-Received: by 2002:a05:6e02:e:b0:3e3:fd25:f6a with SMTP id e9e14a558f8ab-3e41618bf21mr94866305ab.11.1754193533929; Sat, 02 Aug 2025 20:58:53 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:53 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 14/58] dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module Date: Sat, 2 Aug 2025 21:57:32 -0600 Message-ID: <20250803035816.603405-15-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The body of ddebug_attach_module_classes() is dominated by a code-block that finds the contiguous subrange of classmaps matching on modname, and saves it into the ddebug_table's info record. Implement this block in a macro to accommodate different component vectors in the "box" (as named in the for_subvec macro). And hoist its invocation out of ddebug_attach_module_classes() up into ddebug_add_module(). This moves the filtering step up closer to dynamic_debug_init(), which effectively does the same for builtin pr_debug descriptors; segmenting them into subranges by modname. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 56 ++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 53ce282554266..bbbdb8aba0716 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -161,8 +161,8 @@ static void vpr_info_dq(const struct ddebug_query *quer= y, const char *msg) } =20 static struct _ddebug_class_map *ddebug_find_valid_class(struct ddebug_tab= le const *dt, - const char *class_string, - int *class_id) + const char *class_string, + int *class_id) { struct _ddebug_class_map *map; int i, idx; @@ -1224,30 +1224,34 @@ static const struct proc_ops proc_fops =3D { =20 static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) { - struct _ddebug_class_map *cm; - int i, nc =3D 0; - - /* - * Find this module's classmaps in a subrange/wholerange of - * the builtin/modular classmap vector/section. Save the start - * and length of the subrange at its edges. - */ - for_subvec(i, cm, di, maps) { - if (!strcmp(cm->mod_name, dt->mod_name)) { - if (!nc) { - v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n= ", - i, cm->mod_name, cm->base, cm->length, cm->map_type); - dt->info.maps.start =3D cm; - } - nc++; - } - } - if (nc) { - dt->info.maps.len =3D nc; - vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); - } + vpr_info("module:%s attached %d classes\n", dt->mod_name, dt->info.maps.l= en); } =20 +/* + * Walk the @_box->@_vec member, over @_vec.start[0..len], and find + * the contiguous subrange of elements matching on ->mod_name. Copy + * the subrange into @_dst. This depends on vars defd by caller. + * + * @_i: caller provided counter var, init'd by macro + * @_sp: cursor into @_vec. + * @_box: contains member named @_vec + * @_vec: an array-ref, with: .start .len fields. + * @_dst: an array-ref: to remember the module's subrange + */ +#define dd_mark_vector_subrange(_i, _dst, _sp, _box, _vec) ({ \ + int nc =3D 0; \ + for_subvec(_i, _sp, _box, _vec) { \ + if (!strcmp((_sp)->mod_name, (_dst)->mod_name)) { \ + if (!nc++) \ + (_dst)->info._vec.start =3D (_sp); \ + } else { \ + if (nc) \ + break; /* end of consecutive matches */ \ + } \ + } \ + (_dst)->info._vec.len =3D nc; \ +}) + /* * Allocate a new ddebug_table for the given module * and add it to the global list. @@ -1255,6 +1259,8 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; + struct _ddebug_class_map *cm; + int i; =20 if (!di->descs.len) return 0; @@ -1277,6 +1283,8 @@ static int ddebug_add_module(struct _ddebug_info *di,= const char *modname) =20 INIT_LIST_HEAD(&dt->link); =20 + dd_mark_vector_subrange(i, dt, cm, di, maps); + if (di->maps.len) ddebug_attach_module_classes(dt, di); =20 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 8E76C283153; Sun, 3 Aug 2025 03:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193538; cv=none; b=Sl81BwjagZ14+p4GdoTfeqXpeLmXsdgDENJ9tBzOnV1cObd+8NtGrOEKu/n0q5/Gmh+0UzPirGY2lfIU4c3isvTq3Etq37X9DlZr2Chv+k8xP/WFg272vVcKy+qimANYhdQa39CWUEvYIW/o1rSmegW96Y8IywZCYxWkwrS6l14= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193538; c=relaxed/simple; bh=HAnQGB2FRLy/1o4YSHzPTUbjSSAYCy3iPIynrWm0WGk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DHegh2+LH17qiIdBuZ/BNZim3sLNLOcS4C/sF6OI5MWW+NnA6Xz4uDwbRMB+3zHL89qyXy4h16Ugj/Jj4N/NG91vxbLzI2GZooqcDDY5ZsbUSquqE1KQyJRk57c+UDdxefEVStc4yYR5H0aIsK/BWJemcf709pCgAk9ejRRhC64= 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=a7/QxlLj; arc=none smtp.client-ip=209.85.166.176 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="a7/QxlLj" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3e3cd27178fso12834175ab.3; Sat, 02 Aug 2025 20:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193535; x=1754798335; 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=ORK9k3QUZJtuVsIu7FqLBNLHVp4N+O4ijcv5dzF1jJc=; b=a7/QxlLj8mJVix3R1mBcJHSd7F4Uy3huoQccZHXL1tcQ0/duVmgIaQg04gSbCF7AWH ug8dmQHjaNNt7TnWuJqpmaLufnrWv0EG2nXtw8FdCgu8p23RodmlR4IhIV1wBiu8GjPu +jkUNArWf8ZnzNaVSMINSoqAjBPGSteMhzxrmPiYGjkJYjGOJc1GXtMxgWxdbwhscUSM BBoxRlJzpGats4rY/RPADqJ4aKeavf+nNKQobGNZH2O8mRTnBaEO8qw/ZP3HiYrqvF87 z92dDDkOF8s9qifOBpdGyyhCJYCTe6LTEiwhSSoOWZEsqgRmJK4R5sWbDxpVD2poTxtU crzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193535; x=1754798335; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ORK9k3QUZJtuVsIu7FqLBNLHVp4N+O4ijcv5dzF1jJc=; b=xSrFFMyev8hdVByBgj2D0azOjFkZ/I7olxcTQbaXKbwo5TeIAK+J9NAKhg+WsKOpFf NXH8IUr1d17HPGpHOT9VO4xWQhN/yVQA1y/X9rz+FGX8Ey9BeoHhKYB0vmBitkEpgpFV isPG2V3PsFj2phtzPMdhIq9FWGQtQqLRdWWhRK/mDViIfRniG1aJWkxBH9XV4kAKD8sq FHOjaYjxaE0QNpYV04ELvPgF+H5J3Gf4rJwd45klUdppTn4Zfekse5z9bNDFXVqSuTwv ct3W2fHAD/DHTjhbrxDhncHA0qguOnybdABvrV05fu9TeK7W3WGVMp8+3lmyqnRuZDu4 CgYQ== X-Forwarded-Encrypted: i=1; AJvYcCWRF1w8FsXSGY0ZXY3/vR5/SyM+ouDZpddz9fSumB4ilrzQVy1NlvYTRypZ31Db+Bx0lxGwZAlwLLXFObF4@vger.kernel.org X-Gm-Message-State: AOJu0YxJYGMIjGXCziD5R+i89sx/XRWzaWm2UVpRqCekb0Z5ZHNiHk9B sLpQo4FOv4SbFjaKMfBDfq0GBuOQnjQYARkf+wu8kNHaI0cQNREqEy2yjxu9K/UZW+w= X-Gm-Gg: ASbGnctmgUSibtZxsquCs+P/trt632k9jr2mDcAlIBTNz7f6nJ8vYUmb0N1Yjdb761r bZA1d2lt2d/fkf1D2HSeOhrqKwH9j/u5lF/xON7lQsIawy75zWJUE9gndnoaotPdtNuaXZFwZ67 F6cGYPMn7HdcA4rJqtU6Kdg6uDQeCjQdcuM5f1GRO7jbMr5Wb0l/9Ng1NVbrZ8Usn1Plr0KIexY selMWcbZGyr7TYRQ9rumFUbnf9OfH95xyWLcFavcGCN5tzVTuoFC0c7M4xv68H/T2FThyJPIrd5 /u2wojnBrKDSfC8A9bqoB5Q4vjDPz0j6fmIS1n71esWic6vFy7JJKPTT2k91+NX8v1peQdSJ56f Lc68Bl1UXScVt/o0AfZw85glrb/9NDqZ5jv9f2EH6mioXNDr/c0KXg+fCiFdLDuPK3Bb31Vsy3T j9KQ== X-Google-Smtp-Source: AGHT+IEbSdNNbc1zVnKCCJZUuETqTQtoaGj2TcDdJPLDVMJba4Vzk2kJH+A6WzY4odoJMJfDdZ0nxg== X-Received: by 2002:a92:ca4b:0:b0:3df:4159:8fe5 with SMTP id e9e14a558f8ab-3e4162bc725mr89515755ab.4.1754193535436; Sat, 02 Aug 2025 20:58:55 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:55 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 15/58] dyndbg: ddebug_table.mod_name down to _ddebug_info Date: Sat, 2 Aug 2025 21:57:33 -0600 Message-ID: <20250803035816.603405-16-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" struct _ddebug_info already has most of dyndbg's info for a module; push debug_table.mod_name down into it, finishing the encapsulation. This allows refactoring several callchains, passing &_ddebug_info instead of &ddebug_table, and hoisting the "&dt->info" deref up. ddebug_table contains a _ddebug_info member, so its users keep access to mod_name, just now with "->info." added in. In static ddebug_add_module(&di), reinforce the cursor-model by dropping the modname arg, and setting di->mod_name at each caller. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- -v3 more s/dt/di/ internal interface changes --- include/linux/dynamic_debug.h | 1 + lib/dynamic_debug.c | 45 ++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 9d282e2444e18..f4d1d08cd5a7c 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -126,6 +126,7 @@ struct _ddebug_class_maps { } __packed; =20 struct _ddebug_info { + const char *mod_name; struct _ddebug_descs descs; struct _ddebug_class_maps maps; } __packed; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index bbbdb8aba0716..09f19155d7f02 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -46,7 +46,6 @@ extern struct _ddebug_class_map __stop___dyndbg_class_map= s[]; =20 struct ddebug_table { struct list_head link; - const char *mod_name; struct _ddebug_info info; }; =20 @@ -201,7 +200,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, =20 /* match against the module name */ if (query->module && - !match_wildcard(query->module, dt->mod_name)) + !match_wildcard(query->module, dt->info.mod_name)) continue; =20 if (query->class_string) { @@ -269,7 +268,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, #endif v4pr_info("changed %s:%d [%s]%s %s =3D> %s\n", trim_prefix(dp->filename), dp->lineno, - dt->mod_name, dp->function, + dt->info.mod_name, dp->function, ddebug_describe_flags(dp->flags, &fbuf), ddebug_describe_flags(newflags, &nbuf)); dp->flags =3D newflags; @@ -1133,12 +1132,12 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) #define class_in_range(class_id, map) \ (class_id >=3D map->base && class_id < map->base + map->length) =20 -static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) +static const char *ddebug_class_name(struct _ddebug_info *di, struct _ddeb= ug *dp) { struct _ddebug_class_map *map; int i; =20 - for_subvec(i, map, &dt->info, maps) + for_subvec(i, map, di, maps) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1166,13 +1165,13 @@ static int ddebug_proc_show(struct seq_file *m, voi= d *p) =20 seq_printf(m, "%s:%u [%s]%s =3D%s \"", trim_prefix(dp->filename), dp->lineno, - iter->table->mod_name, dp->function, + iter->table->info.mod_name, dp->function, ddebug_describe_flags(dp->flags, &flags)); seq_escape_str(m, dp->format, ESCAPE_SPACE, "\t\r\n\""); seq_putc(m, '"'); =20 if (dp->class_id !=3D _DPRINTK_CLASS_DFLT) { - class =3D ddebug_class_name(iter->table, dp); + class =3D ddebug_class_name(&iter->table->info, dp); if (class) seq_printf(m, " class:%s", class); else @@ -1224,7 +1223,7 @@ static const struct proc_ops proc_fops =3D { =20 static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) { - vpr_info("module:%s attached %d classes\n", dt->mod_name, dt->info.maps.l= en); + vpr_info("module:%s attached %d classes\n", dt->info.mod_name, dt->info.m= aps.len); } =20 /* @@ -1241,7 +1240,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug #define dd_mark_vector_subrange(_i, _dst, _sp, _box, _vec) ({ \ int nc =3D 0; \ for_subvec(_i, _sp, _box, _vec) { \ - if (!strcmp((_sp)->mod_name, (_dst)->mod_name)) { \ + if (!strcmp((_sp)->mod_name, (_dst)->info.mod_name)) { \ if (!nc++) \ (_dst)->info._vec.start =3D (_sp); \ } else { \ @@ -1256,7 +1255,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug * Allocate a new ddebug_table for the given module * and add it to the global list. */ -static int ddebug_add_module(struct _ddebug_info *di, const char *modname) +static int ddebug_add_module(struct _ddebug_info *di) { struct ddebug_table *dt; struct _ddebug_class_map *cm; @@ -1265,20 +1264,19 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) if (!di->descs.len) return 0; =20 - v3pr_info("add-module: %s %d sites\n", modname, di->descs.len); + v3pr_info("add-module: %s %d sites\n", di->mod_name, di->descs.len); =20 dt =3D kzalloc(sizeof(*dt), GFP_KERNEL); if (dt =3D=3D NULL) { - pr_err("error adding module: %s\n", modname); + pr_err("error adding module: %s\n", di->mod_name); return -ENOMEM; } /* - * For built-in modules, name lives in .rodata and is - * immortal. For loaded modules, name points at the name[] - * member of struct module, which lives at least as long as - * this struct ddebug_table. + * For built-in modules, name (as supplied in di by its + * callers) lives in .rodata and is immortal. For loaded + * modules, name points at the name[] member of struct module, + * which lives at least as long as this struct ddebug_table. */ - dt->mod_name =3D modname; dt->info =3D *di; =20 INIT_LIST_HEAD(&dt->link); @@ -1292,7 +1290,7 @@ static int ddebug_add_module(struct _ddebug_info *di,= const char *modname) list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); + vpr_info("%3u debug prints in module %s\n", di->descs.len, di->mod_name); return 0; } =20 @@ -1355,7 +1353,7 @@ static int ddebug_remove_module(const char *mod_name) =20 mutex_lock(&ddebug_lock); list_for_each_entry_safe(dt, nextdt, &ddebug_tables, link) { - if (dt->mod_name =3D=3D mod_name) { + if (dt->info.mod_name =3D=3D mod_name) { ddebug_table_free(dt); ret =3D 0; break; @@ -1375,7 +1373,8 @@ static int ddebug_module_notify(struct notifier_block= *self, unsigned long val, =20 switch (val) { case MODULE_STATE_COMING: - ret =3D ddebug_add_module(&mod->dyndbg_info, mod->name); + mod->dyndbg_info.mod_name =3D mod->name; + ret =3D ddebug_add_module(&mod->dyndbg_info); if (ret) WARN(1, "Failed to allocate memory: dyndbg may not work properly.\n"); break; @@ -1473,7 +1472,8 @@ static int __init dynamic_debug_init(void) mod_ct++; di.descs.len =3D mod_sites; di.descs.start =3D iter_mod_start; - ret =3D ddebug_add_module(&di, modname); + di.mod_name =3D modname; + ret =3D ddebug_add_module(&di); if (ret) goto out_err; =20 @@ -1484,7 +1484,8 @@ static int __init dynamic_debug_init(void) } di.descs.len =3D mod_sites; di.descs.start =3D iter_mod_start; - ret =3D ddebug_add_module(&di, modname); + di.mod_name =3D modname; + ret =3D ddebug_add_module(&di); if (ret) goto out_err; =20 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 2DEE72836B1; Sun, 3 Aug 2025 03:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193540; cv=none; b=jBOdDZHy8TJv74AQqxnPmmv879eMZxR2+JctPks1K422FQorCs6+uLs2E3oGQqw1vfJJgDM3LnvHa7LvExfWyfmMNMPDrPeurc8guH8NBEd8ORTXDSQmazYOC/rUQ2987gNq+59fWCQYWNrwtUz9rvZ9aW015MAGxM+yEjJWp9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193540; c=relaxed/simple; bh=B+Gns/puT9rTo+kq+GtrXC34UMIdtdXmOaBLmfbzszo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tfa/7FwHX88yi5CYsrQHifcg7mCay/ubFIyjnL4uAuUF9WVJ9kAqVDXjJX1f/OqnEl2w4sYyoVTnJDTYDlF8Uk6fX+BwO9pR0ZZnhGrrA2Z2SR2KoDzDzzVIJPGSN0yW5ey8iOiVa7Wx44EeJ5bfMcsd7n2CgAVmN/lxqmRGVXw= 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=dSI8WiV8; arc=none smtp.client-ip=209.85.166.180 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="dSI8WiV8" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3e3d94aa969so14695695ab.1; Sat, 02 Aug 2025 20:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193537; x=1754798337; 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=itVu6eA+K3SgodBwXFCxlGNsboCt8pB8fOl4g2pcNDo=; b=dSI8WiV8viV7VPJ1FgaEZGsPMQJr6BcUSKXhu9YSM6tpb6CRJqhscv1V5vkX4zc8jm fyWvSs0XidMUg6Q68/lIFTg8EhsAjH/5OtY1flY2Q9SyjrDl0JfDhOSKV/3l/10CeVaw gq4T2Pc7bsmz5o17e7dbPKDFH/ralGYVJ3WUApsVq0RZErV3ALU4PIn2uE/QTKlsUKA3 Ebb9XI289CzDlBMVOpSHAM56w8Vsq37U8v9o6O3VqmcFo2OCKmFCL5OBN7bKql5e0wkv rNVtv/8D7+uD1oWYmhJsfNgqiblGGRU1Mmq1I+KQ0x54xOYbl/LNBsM+FYeCqYVgj5Iz DrOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193537; x=1754798337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=itVu6eA+K3SgodBwXFCxlGNsboCt8pB8fOl4g2pcNDo=; b=Q2lNy+JPtFEa+u8RSlnjt6PB25Fa/PB92vuss6tTO4+3v1LN81mSef3m9uQZ0GTg/H 1uSuUdRWY0ON+o23PDlTpRRjwVcpLUFAMh8h8AHjNwX7uza0mdhjK07/WCQ2Tdik9+8R pn/VTNdlomOdnRskU4dZS2vfT+MK/XZpYbzhOESPeT3JGNiTo7vp8VHURu6F8fIoCgdO qZ+UC51+/KYcizvccwinNyjZ+8E1Q2ybDJ+8IBpXcGV0zSYczmkvZEVPTZLypUSCDU/H KZIFN9fGkcEsgR3isYCbvX8xj/t79xaMT76b9Lfuf2OkcPPWYkHJ0A7D8RMv3oRfSYbZ IBEg== X-Forwarded-Encrypted: i=1; AJvYcCUVJCObBmpVDcezGO7CziXGzsFRVyE9mnUZpEdeyCHKp69/DU3EbqwEIyQJ5IMTJBPpWngnqyz8W4h5Dmkv@vger.kernel.org X-Gm-Message-State: AOJu0YwoAHD9t+3skPAYPlITklwqFiCcan1oUlkgQfw3RlG+IIlXG/oK 2btjAqdFIkTDdCsbxN78achClZEpCQikbn5B8u3oYd1kJqdsUBniGAh8qDp/bTMpLcU= X-Gm-Gg: ASbGncsDSZ262RNEvZpmNgtMzamcckYq8Nab/J5jrhSTHfiJmi9lMBo9BiZSqz0Jgtc okPPHjSCMs14Jtyn3E6+I/AXxZUWSBn+tLYANKfGWYPaMOpLF2mIJu1Fo6oZORkRoDc36jdgDlu yhr91tO3qubS+RlLPrcpR/kkhuZ3bKtXxnz0VLAALzMt1jUB1qG86IOY2kHLXcCiWKveHSc8/5H eBb1hH5p2GepuXX/D9a5yY5+q6NiITBxJy++0exyMlUAfU0/wVRs1SDrNdFDZf/9p7gzcp919x0 8UQX/dFRYwCyMWu6q5oCr1qwLuS94/OnMF4uW83iSP6EGSWmefh0zxvoaOTQ97LxkNTTTKqfA2n 4VHSnQ79YYw8f/TKE1sCjI5hWnxgwllweq4+9R8nF2qlr7fpwwRMLbz0ihr9asLhuAXcCkTMafS m/+Q== X-Google-Smtp-Source: AGHT+IF7lhVbujEgWabmNj++lEZtk5CBRnmCuylney4Ytxb4NSL6xCQjPcdDT7J19WYnWE0O7WInvQ== X-Received: by 2002:a05:6e02:350f:b0:3e2:9eac:dc01 with SMTP id e9e14a558f8ab-3e416183398mr118847275ab.18.1754193537164; Sat, 02 Aug 2025 20:58:57 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:56 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 16/58] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code Date: Sat, 2 Aug 2025 21:57:34 -0600 Message-ID: <20250803035816.603405-17-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Remove the DD_CLASS_TYPE_*_NAMES classmap types and code. These 2 classmap types accept class names at the PARAM interface, for example: echo +DRM_UT_CORE,-DRM_UT_KMS > /sys/module/drm/parameters/debug_names The code works, but its only used by test-dynamic-debug, and wasn't asked for by anyone else, so reduce LOC & test-surface; simplify things. Also rename enum class_map_type to enum ddebug_class_map_type. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 23 ++------ lib/dynamic_debug.c | 102 +++------------------------------- lib/test_dynamic_debug.c | 26 --------- 3 files changed, 14 insertions(+), 137 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index f4d1d08cd5a7c..769f02456c8e0 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -58,27 +58,16 @@ struct _ddebug { #endif } __attribute__((aligned(8))); =20 -enum class_map_type { +enum ddebug_class_map_type { DD_CLASS_TYPE_DISJOINT_BITS, /** - * DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, one per bit. - * expecting hex input. Built for drm.debug, basis for other types. + * DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, mapped to bits[0= ..N]. + * Expects hex input. Built for drm.debug, basis for other types. */ DD_CLASS_TYPE_LEVEL_NUM, /** - * DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0-N. - * N turns on just bits N-1 .. 0, so N=3D0 turns all bits off. - */ - DD_CLASS_TYPE_DISJOINT_NAMES, - /** - * DD_CLASS_TYPE_DISJOINT_NAMES: input is a CSV of [+-]CLASS_NAMES, - * classes are independent, like _DISJOINT_BITS. - */ - DD_CLASS_TYPE_LEVEL_NAMES, - /** - * DD_CLASS_TYPE_LEVEL_NAMES: input is a CSV of [+-]CLASS_NAMES, - * intended for names like: INFO,DEBUG,TRACE, with a module prefix - * avoid EMERG,ALERT,CRIT,ERR,WARNING: they're not debug + * DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0..N. + * Input N turns on bits 0..N-1 */ }; =20 @@ -88,7 +77,7 @@ struct _ddebug_class_map { const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ - enum class_map_type map_type; + enum ddebug_class_map_type map_type; }; =20 /** diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 09f19155d7f02..2cd28a64578dd 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -646,76 +646,6 @@ static int ddebug_apply_class_bitmap(const struct _dde= bug_class_param *dcp, =20 #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) =20 -/* accept comma-separated-list of [+-] classnames */ -static int param_set_dyndbg_classnames(const char *instr, const struct ker= nel_param *kp) -{ - const struct _ddebug_class_param *dcp =3D kp->arg; - const struct _ddebug_class_map *map =3D dcp->map; - unsigned long curr_bits, old_bits; - char *cl_str, *p, *tmp; - int cls_id, totct =3D 0; - bool wanted; - - cl_str =3D tmp =3D kstrdup_and_replace(instr, '\n', '\0', GFP_KERNEL); - if (!tmp) - return -ENOMEM; - - /* start with previously set state-bits, then modify */ - curr_bits =3D old_bits =3D *dcp->bits; - vpr_info("\"%s\" > %s:0x%lx\n", cl_str, KP_NAME(kp), curr_bits); - - for (; cl_str; cl_str =3D p) { - p =3D strchr(cl_str, ','); - if (p) - *p++ =3D '\0'; - - if (*cl_str =3D=3D '-') { - wanted =3D false; - cl_str++; - } else { - wanted =3D true; - if (*cl_str =3D=3D '+') - cl_str++; - } - cls_id =3D match_string(map->class_names, map->length, cl_str); - if (cls_id < 0) { - pr_err("%s unknown to %s\n", cl_str, KP_NAME(kp)); - continue; - } - - /* have one or more valid class_ids of one *_NAMES type */ - switch (map->map_type) { - case DD_CLASS_TYPE_DISJOINT_NAMES: - /* the +/- pertains to a single bit */ - if (test_bit(cls_id, &curr_bits) =3D=3D wanted) { - v3pr_info("no change on %s\n", cl_str); - continue; - } - curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); - *dcp->bits =3D curr_bits; - v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, - map->class_names[cls_id]); - break; - case DD_CLASS_TYPE_LEVEL_NAMES: - /* cls_id =3D N in 0..max. wanted +/- determines N or N-1 */ - old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); - curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); - *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); - v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, - map->class_names[cls_id], old_bits, curr_bits); - break; - default: - pr_err("illegal map-type value %d\n", map->map_type); - } - } - kfree(tmp); - vpr_info("total matches: %d\n", totct); - return 0; -} - static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *mod_name) @@ -724,29 +654,17 @@ static int param_set_dyndbg_module_classes(const char= *instr, const struct _ddebug_class_map *map =3D dcp->map; unsigned long inrep, new_bits, old_bits; int rc, totct =3D 0; - - switch (map->map_type) { - - case DD_CLASS_TYPE_DISJOINT_NAMES: - case DD_CLASS_TYPE_LEVEL_NAMES: - /* handle [+-]classnames list separately, we are done here */ - return param_set_dyndbg_classnames(instr, kp); - - case DD_CLASS_TYPE_DISJOINT_BITS: - case DD_CLASS_TYPE_LEVEL_NUM: - /* numeric input, accept and fall-thru */ - rc =3D kstrtoul(instr, 0, &inrep); - if (rc) { - pr_err("expecting numeric input: %s > %s\n", instr, KP_NAME(kp)); - return -EINVAL; - } - break; - default: - pr_err("%s: bad map type: %d\n", KP_NAME(kp), map->map_type); + char *nl; + + rc =3D kstrtoul(instr, 0, &inrep); + if (rc) { + nl =3D strchr(instr, '\n'); + if (nl) + *nl =3D '\0'; + pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } =20 - /* only _BITS,_NUM (numeric) map-types get here */ switch (map->map_type) { case DD_CLASS_TYPE_DISJOINT_BITS: /* expect bits. mask and warn if too many */ @@ -812,12 +730,8 @@ int param_get_dyndbg_classes(char *buffer, const struc= t kernel_param *kp) const struct _ddebug_class_map *map =3D dcp->map; =20 switch (map->map_type) { - - case DD_CLASS_TYPE_DISJOINT_NAMES: case DD_CLASS_TYPE_DISJOINT_BITS: return scnprintf(buffer, PAGE_SIZE, "0x%lx\n", *dcp->bits); - - case DD_CLASS_TYPE_LEVEL_NAMES: case DD_CLASS_TYPE_LEVEL_NUM: return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); default: diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 8434f70b51bb3..9c3e53cd26bd8 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -74,13 +74,6 @@ DECLARE_DYNDBG_CLASSMAP(map_disjoint_bits, DD_CLASS_TYPE= _DISJOINT_BITS, 0, DD_SYS_WRAP(disjoint_bits, p); DD_SYS_WRAP(disjoint_bits, T); =20 -/* symbolic input, independent bits */ -enum cat_disjoint_names { LOW =3D 10, MID, HI }; -DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, = 10, - "LOW", "MID", "HI"); -DD_SYS_WRAP(disjoint_names, p); -DD_SYS_WRAP(disjoint_names, T); - /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 =3D 14, V1, V2, V3, V4, V5, V6, V7 }; DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, @@ -88,13 +81,6 @@ DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEV= EL_NUM, 14, DD_SYS_WRAP(level_num, p); DD_SYS_WRAP(level_num, T); =20 -/* symbolic verbosity */ -enum cat_level_names { L0 =3D 22, L1, L2, L3, L4, L5, L6, L7 }; -DECLARE_DYNDBG_CLASSMAP(map_level_names, DD_CLASS_TYPE_LEVEL_NAMES, 22, - "L0", "L1", "L2", "L3", "L4", "L5", "L6", "L7"); -DD_SYS_WRAP(level_names, p); -DD_SYS_WRAP(level_names, T); - /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") =20 @@ -102,10 +88,6 @@ static void do_cats(void) { pr_debug("doing categories\n"); =20 - prdbg(LOW); - prdbg(MID); - prdbg(HI); - prdbg(D2_CORE); prdbg(D2_DRIVER); prdbg(D2_KMS); @@ -129,14 +111,6 @@ static void do_levels(void) prdbg(V5); prdbg(V6); prdbg(V7); - - prdbg(L1); - prdbg(L2); - prdbg(L3); - prdbg(L4); - prdbg(L5); - prdbg(L6); - prdbg(L7); } =20 static void do_prints(void) --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 EBA6E2836AF; Sun, 3 Aug 2025 03:58:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193542; cv=none; b=oFqs5Jr2xD47XsnseD+NCB9AsKl14KyBxiQ6C7yaKDpjAJ7NWj3RPqL1YEOBtwPhynYcNbbnAyQz70pKekeD3On06tpc0q99KNnxfZ5FGmrYshZEmLOThzXBMkHJGMGTjBqmfv5Q0O16+5ELJ8qTLRbKdyupW8N5nWfvo36t+IQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193542; c=relaxed/simple; bh=pGzpScB4FvfMDHcLgpyyWavQsDfbLuu03YOpKQtIuyo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gjFMhsI5rbx/dZF1W7l7Q2yedTB6JV1Mx6Xc8w9kwAMchqXbsfR6gds1iBk1+uzNAVV3ZKP97JSBuqdd1xISxoyIXNgSZ6mHPP0Am8UJMjP7nKWR+Cc1mTgpae6QE21H8Srb0oj616VydeTQ+4s9Xhtcl8gzhRTXrMSD/B/mQD0= 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=HS/LuiT0; arc=none smtp.client-ip=209.85.166.182 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="HS/LuiT0" Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3e3fcf5b150so25031585ab.1; Sat, 02 Aug 2025 20:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193539; x=1754798339; 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=h3jtWlifFIXn6dr4/9tNs4L4urFD+Q2sgnFQO0PafGw=; b=HS/LuiT0Ic/bCF6lK+tIwwKPTmnvLl+5BwViwaTtyGs3mLg/5QcELynzKxLNCklPIU W4SRttT4pgNMHUJeBUduki4Od78WqzTPnU17p/dI6nVmwlI+y6LBlaTMJ+6eHHg3aSXo 3sWtbYmSyrYqIAl2NIEbChBtybycqxROffqLCS6bEHBeF6M9GkXnbGGuOGAZDKY/Pibk 4Rv9kCfdXSQFqjDoOKtt2WYvuKVG+1tskKtr4UX1mZayL8jFQZag2As6sILK21hftEIp HZ7f72vdYi9K//N7c5p9dpcF9gouM+8ZizQX+RtnKlxrO+X2fWHAB7FFGVaRJKBqE6oW WeMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193539; x=1754798339; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h3jtWlifFIXn6dr4/9tNs4L4urFD+Q2sgnFQO0PafGw=; b=qI17S+WqY6eqQAlKMajIzmS20SuLH3yQ+V5XdooHIyRZHqZ7Itrez/qeH3uzTgPYQX +yCTsmEoUVf1fxlsriX0MqQuQwW4pu1Nw9QwIjfIPN1LoTQgTXM2JqnljkKdYzncDVU1 Qp2OtiQBCNrx6ODQoHC3msVLEIYVsHPR54clOwM5Ls7ToT1ryEzWmmP22B+AyPL//Ev8 7G96VJmgbKhPV2Phvf5p02ZDjMY/Ten/gFEAQxbmjWbeY3kRrfHugtRaH+Menrg6OmUJ hJ/XMYncHXd/1yJ/+rQXtkjKzW8GDTqndAaoKkMGk/8dL586s26noqn+W22I2G1DDVNK kM3A== X-Forwarded-Encrypted: i=1; AJvYcCWdSW8KY7M4JLsV7mgVD8rrNDNs2zrVDmtg/8MhMUH58zNj0RRCwjiQUDjb9KzTy8nbzwlQTMjeCN/R8nYM@vger.kernel.org X-Gm-Message-State: AOJu0Yz4msfkpMxEOPRlECRbIKzdTvBONU7CPo19bKnSmuITe5bDWifC AVtu7YV9CDTFWJiv/Fhru34j8tcKq0YCJCeA8LZoMgRZcI3bhl1pJ7TY68KCHgGibNI= X-Gm-Gg: ASbGncsaGXeUpfQo0zC7kSvUTkrCTRk5eqFP/v/Forjx4FRp2thf7NArWf2sCqL38Td Eorg/i0eUHZvpB3y9Z4w/Ly2fldAQsqPw3AfYjj383T13RsbwG6IBNluZPtqYa6QwvngCseKeGe jcQUc3YpuaDpGq729eijrVF/VKda58dUE8nAD8ZoO3bQPgZonyco+VD8nAlLepyl6iM6t6/TwoJ vMlhLUHyTZ5pefjx2eVo6Gho+rcvQYBAf+8HXkoCSab9FQrmsdELMBTFYtEJpChp/uRqFoqvWmy 5fPuPDG5xCUGxFl9gInfBCi74uLFq5PHe2whZG9ct5c/l1yLtLP6Z6idMXqFKLhtNtHc/0yRIMa 0aJX1vt9xe5pD6HxYrxz52l3PJKiFmWeohTClUrR+7lhNsH5IbenYf7kJrdCTa8e6mB9BHzpS+S Pawg== X-Google-Smtp-Source: AGHT+IFnFa7esl25WN5ZEJe6Gs+OthrLbAJn5KRoUb1dZtUsqM5+LS4Wh5t6OG90ZoYSinrFT4LyzQ== X-Received: by 2002:a05:6e02:741:b0:3e4:b85:3cd4 with SMTP id e9e14a558f8ab-3e41617f076mr88117405ab.14.1754193538677; Sat, 02 Aug 2025 20:58:58 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:58 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 17/58] selftests-dyndbg: add a dynamic_debug run_tests target Date: Sat, 2 Aug 2025 21:57:35 -0600 Message-ID: <20250803035816.603405-18-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add a selftest script for dynamic-debug. The config requires CONFIG_TEST_DYNAMIC_DEBUG=3Dm and CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm, which tacitly requires either CONFIG_DYNAMIC_DEBUG=3Dy or CONFIG_DYNAMIC_DEBUG_CORE=3Dy ATM this has just basic_tests(), which modify pr_debug() flags in the builtin params module. This means they're available to manipulate and observe the effects in "cat control". This is backported from another feature branch; the support-fns (thx Lukas) have unused features at the moment, they'll get used shortly. The script enables simple virtme-ng testing: [jimc@gandalf b0-ftrace]$ vrun_t virtme-ng 1.32+115.g07b109d doing: vng --name v6.14-rc4-60-gd5f48427de0c \ --user root -v -p 4 -a dynamic_debug.verbose=3D3 V=3D1 \ -- ../tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh virtme: waiting for virtiofsd to start .. And add dynamic_debug to TARGETS, so `make run_tests` sees it properly For the impatient, set TARGETS explicitly: bash-5.2# make TARGETS=3Ddynamic_debug run_tests make[1]: ... TAP version 13 1..1 [ 35.552922] dyndbg: read 3 bytes from userspace [ 35.553099] dyndbg: query 0: "=3D_" mod:* [ 35.553544] dyndbg: processed 1 queries, with 1778 matches, 0 errs NOTES - check KCONFIG_CONFIG to avoid silly fails Several tests are dependent upon config choices. Lets avoid failing where that is noise. The KCONFIG_CONFIG var exists to convey the config-file around. If the var names a file, read it and extract the relevant CONFIG items, and use them to skip the dependent tests, thus avoiding the fails that would follow, and the disruption to whatever CI is running these selftests. If the envar doesn't name a config-file, ".config" is assumed. CONFIG_DYNAMIC_DEBUG=3Dy: basic-tests() and comma-terminator-tests() test for the presence of the builtin pr_debugs in module/main.c, which I deemed stable and therefore safe to count. That said, the test fails if only CONFIG_DYNAMIC_DEBUG_CORE=3Dy is set. It could be rewritten to test against test-dynamic-debug.ko, but that just trades one config dependence for another. CONFIG_TEST_DYNAMIC_DEBUG=3Dm As written, test_percent_splitting() modprobes test_dynamic_debug, enables several classes, and counts them. It could be re-written to work for the builtin module also, but builtin test modules are not a common or desirable build/config. Signed-off-by: Jim Cromie Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik --- -r3 turn off green at end drop config dep on TEST_DYNAMIC_DEBUG, since basic-test uses builtin params --- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + .../testing/selftests/dynamic_debug/Makefile | 9 + tools/testing/selftests/dynamic_debug/config | 7 + .../dynamic_debug/dyndbg_selftest.sh | 257 ++++++++++++++++++ 5 files changed, 275 insertions(+) create mode 100644 tools/testing/selftests/dynamic_debug/Makefile create mode 100644 tools/testing/selftests/dynamic_debug/config create mode 100755 tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh diff --git a/MAINTAINERS b/MAINTAINERS index c0b444e5fd5ad..4259d63c431a3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8455,6 +8455,7 @@ S: Maintained F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c F: lib/test_dynamic_debug.c +F: tools/testing/selftests/dynamic_debug/* =20 DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Mak= efile index 339b31e6a6b59..e13b55510e31d 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -26,6 +26,7 @@ TARGETS +=3D drivers/net/team TARGETS +=3D drivers/net/virtio_net TARGETS +=3D drivers/platform/x86/intel/ifs TARGETS +=3D dt +TARGETS +=3D dynamic_debug TARGETS +=3D efivarfs TARGETS +=3D exec TARGETS +=3D fchmodat2 diff --git a/tools/testing/selftests/dynamic_debug/Makefile b/tools/testing= /selftests/dynamic_debug/Makefile new file mode 100644 index 0000000000000..6d06fa7f10405 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/Makefile @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# borrowed from Makefile for user memory selftests + +# No binaries, but make sure arg-less "make" doesn't trigger "run_tests" +all: + +TEST_PROGS :=3D dyndbg_selftest.sh + +include ../lib.mk diff --git a/tools/testing/selftests/dynamic_debug/config b/tools/testing/s= elftests/dynamic_debug/config new file mode 100644 index 0000000000000..0f906ff539081 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/config @@ -0,0 +1,7 @@ + +# basic tests ref the builtin params module +CONFIG_DYNAMIC_DEBUG=3Dm + +# more testing is possible with these +# CONFIG_TEST_DYNAMIC_DEBUG=3Dm +# CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh new file mode 100755 index 0000000000000..465fad3f392cc --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -0,0 +1,257 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only + +V=3D${V:=3D0} # invoke as V=3D1 $0 for global verbose +RED=3D"\033[0;31m" +GREEN=3D"\033[0;32m" +YELLOW=3D"\033[0;33m" +BLUE=3D"\033[0;34m" +MAGENTA=3D"\033[0;35m" +CYAN=3D"\033[0;36m" +NC=3D"\033[0;0m" +error_msg=3D"" + +[ -e /proc/dynamic_debug/control ] || { + echo -e "${RED}: this test requires CONFIG_DYNAMIC_DEBUG=3Dy ${NC}" + exit 0 # nothing to test here, no good reason to fail. +} + +# need info to avoid failures due to untestable configs + +[ -f "$KCONFIG_CONFIG" ] || KCONFIG_CONFIG=3D".config" +if [ -f "$KCONFIG_CONFIG" ]; then + echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG" + grep -q "CONFIG_DYNAMIC_DEBUG=3Dy" $KCONFIG_CONFIG ; LACK_DD_BUILTIN= =3D$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG=3Dm" $KCONFIG_CONFIG ; LACK_TMOD=3D= $? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm" $KCONFIG_CONFIG ; LACK_= TMOD_SUBMOD=3D$? + if [ $V -eq 1 ]; then + echo LACK_DD_BUILTIN: $LACK_DD_BUILTIN + echo LACK_TMOD: $LACK_TMOD + echo LACK_TMOD_SUBMOD: $LACK_TMOD_SUBMOD + fi +else + LACK_DD_BUILTIN=3D0 + LACK_TMOD=3D0 + LACK_TMOD_SUBMOD=3D0 +fi + +function vx () { + echo $1 > /sys/module/dynamic_debug/parameters/verbose +} + +function ddgrep () { + grep $1 /proc/dynamic_debug/control +} + +function doprints () { + cat /sys/module/test_dynamic_debug/parameters/do_prints +} + +function ddcmd () { + exp_exit_code=3D0 + num_args=3D$# + if [ "${@:$#}" =3D "pass" ]; then + num_args=3D$#-1 + elif [ "${@:$#}" =3D "fail" ]; then + num_args=3D$#-1 + exp_exit_code=3D1 + fi + args=3D${@:1:$num_args} + output=3D$((echo "$args" > /proc/dynamic_debug/control) 2>&1) + exit_code=3D$? + error_msg=3D$(echo $output | cut -d ":" -f 5 | sed -e 's/^[[:space:]]*= //') + handle_exit_code $BASH_LINENO $FUNCNAME $exit_code $exp_exit_code +} + +function handle_exit_code() { + local exp_exit_code=3D0 + [ $# =3D=3D 4 ] && exp_exit_code=3D$4 + if [ $3 -ne $exp_exit_code ]; then + echo -e "${RED}: $BASH_SOURCE:$1 $2() expected to exit with code $= exp_exit_code" + [ $3 =3D=3D 1 ] && echo "Error: '$error_msg'" + exit + fi +} + +# $1 - pattern to match, pattern in $1 is enclosed by spaces for a match "= "\s$1\s" +# $2 - number of times the pattern passed in $1 is expected to match +# $3 - optional can be set either to "-r" or "-v" +# "-r" means relaxed matching in this case pattern provided in $1 is= passed +# as is without enclosing it with spaces +# "-v" prints matching lines +# $4 - optional when $3 is set to "-r" then $4 can be used to pass "-v" +function check_match_ct { + pattern=3D"\s$1\s" + exp_cnt=3D0 + + [ "$3" =3D=3D "-r" ] && pattern=3D"$1" + let cnt=3D$(ddgrep "$pattern" | wc -l) + if [ $V -eq 1 ] || [ "$3" =3D=3D "-v" ] || [ "$4" =3D=3D "-v" ]; then + echo -ne "${BLUE}" && ddgrep $pattern && echo -ne "${NC}" + fi + [ $# -gt 1 ] && exp_cnt=3D$2 + if [ $cnt -ne $exp_cnt ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO check failed expected $= exp_cnt on $1, got $cnt" + exit + else + echo ": $cnt matches on $1" + fi +} + +# $1 - trace instance name +# #2 - if > 0 then directory is expected to exist, if <=3D 0 then otherwise +# $3 - "-v" for verbose +function check_trace_instance_dir { + if [ -e /sys/kernel/tracing/instances/$1 ]; then + if [ "$3" =3D=3D "-v" ] ; then + echo "ls -l /sys/kernel/tracing/instances/$1: " + ls -l /sys/kernel/tracing/instances/$1 + fi + if [ $2 -le 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instanc= e \ + '/sys/kernel/tracing/instances/$1' does exist" + exit + fi + else + if [ $2 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instanc= e \ + '/sys/kernel/tracing/instances/$1' does not exist" + exit + fi + fi +} + +function tmark { + echo $* > /sys/kernel/tracing/trace_marker +} + +# $1 - trace instance name +# $2 - line number +# $3 - if > 0 then the instance is expected to be opened, otherwise +# the instance is expected to be closed +function check_trace_instance { + output=3D$(tail -n9 /proc/dynamic_debug/control | grep ": Opened trace= instances" \ + | xargs -n1 | grep $1) + if [ "$output" !=3D $1 ] && [ $3 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not opened" + exit + fi + if [ "$output" =3D=3D $1 ] && [ $3 -le 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not closed" + exit + fi +} + +function is_trace_instance_opened { + check_trace_instance $1 $BASH_LINENO 1 +} + +function is_trace_instance_closed { + check_trace_instance $1 $BASH_LINENO 0 +} + +# $1 - trace instance directory to delete +# $2 - if > 0 then directory is expected to be deleted successfully, if <= =3D 0 then otherwise +function del_trace_instance_dir() { + exp_exit_code=3D1 + [ $2 -gt 0 ] && exp_exit_code=3D0 + output=3D$((rmdir /sys/kernel/debug/tracing/instances/$1) 2>&1) + exit_code=3D$? + error_msg=3D$(echo $output | cut -d ":" -f 3 | sed -e 's/^[[:space:]]*= //') + handle_exit_code $BASH_LINENO $FUNCNAME $exit_code $exp_exit_code +} + +function error_log_ref { + # to show what I got + : echo "# error-log-ref: $1" + : echo cat \$2 +} + +function ifrmmod { + lsmod | grep $1 2>&1>/dev/null && rmmod $1 +} + +# $1 - text to search for +function search_trace() { + search_trace_name 0 1 $1 +} + +# $1 - trace instance name, 0 for global event trace +# $2 - line number counting from the bottom +# $3 - text to search for +function search_trace_name() { + if [ "$1" =3D "0" ]; then + buf=3D$(cat /sys/kernel/debug/tracing/trace) + line=3D$(tail -$2 /sys/kernel/debug/tracing/trace | head -1 | sed -e = 's/^[[:space:]]*//') + else + buf=3D$(cat /sys/kernel/debug/tracing/instances/$1/trace) + line=3D$(tail -$2 /sys/kernel/debug/tracing/instances/$1/trace | head= -1 | \ + sed -e 's/^[[:space:]]*//') + fi + if [ $2 =3D 0 ]; then + # whole-buf check + output=3D$(echo $buf | grep "$3") + else + output=3D$(echo $line | grep "$3") + fi + if [ "$output" =3D "" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO search for '$3' fai= led \ + in line '$line' or '$buf'" + exit + fi + if [ $V =3D 1 ]; then + echo -e "${MAGENTA}: search_trace_name in $1 found: \n$output \nin:${= BLUE} $buf ${NC}" + fi +} + +# $1 - error message to check +function check_err_msg() { + if [ "$error_msg" !=3D "$1" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error message '$error_m= sg' \ + does not match with '$1'" + exit + fi +} + +function basic_tests { + echo -e "${GREEN}# BASIC_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi + ddcmd =3D_ # zero everything + check_match_ct =3Dp 0 + + # module params are builtin to handle boot args + check_match_ct '\[params\]' 4 -r + ddcmd module params +mpf + check_match_ct =3Dpmf 4 + + # multi-cmd input, newline separated, with embedded comments + cat <<"EOF" > /proc/dynamic_debug/control + module params =3D_ # clear params + module params +mf # set flags + module params func parse_args +sl # other flags +EOF + check_match_ct =3Dmf 3 + check_match_ct =3Dmfsl 1 + ddcmd =3D_ +} + +tests_list=3D( + basic_tests +) + +# Run tests + +ifrmmod test_dynamic_debug_submod +ifrmmod test_dynamic_debug + +for test in "${tests_list[@]}" +do + $test + echo "" +done +echo -en "${GREEN}# Done on: " +date +echo -en "${NC}" --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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 3DBD8283C8E; Sun, 3 Aug 2025 03:59:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193542; cv=none; b=elxKOhG8fToMBk/ubwETEzkVKN24nrJ4dKHDX2KddGTDE0nKSQQQDGi/CKn92Cr6Hfg4iMyF20cWGy4OX6fiadaP2if3nljqQGjjoliogHhzI8+niie8VTCIifHI27pfDea8xESWc4vVPD3LHqQyjMQeru2UM2ZnV/ja0jTK060= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193542; c=relaxed/simple; bh=hwd4K1U+dKls1ayEPAWsDeMY0d8xsvm4A86uIfBoNWM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N+RHJiSTv/6cw1MYeKCkhhU8ycrB5cB3whMxk2oq9ZeZiP50X0vEdMuv3vlT10JWb+oU4PlyAAFd6WKAH/Cl82VxtVPrZZ1L1rZYNaZewqQlzrTB+oB573fL7Nc4QHxc78Bw0fm0O5S8BSl8pL1VU4sf2yQyVuEChhV0exDuQPw= 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=Ms1Y6ENr; arc=none smtp.client-ip=209.85.166.172 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="Ms1Y6ENr" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-3e406ca2d22so10975475ab.1; Sat, 02 Aug 2025 20:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193540; x=1754798340; 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=s7NHmQkQ5gysWD4rwW/j5R3bG6qHLaOgggFqVWsv12Q=; b=Ms1Y6ENr+Qey5k2H4YQ15LXLmykk+RbCG4EW2ZTNtoTDG906Oy55aZZVPQxkgM32Na q8JOXlJR+MO4JtcWfQ1uW/EKdZg96xwLYZUQwtwkJxbg0ZYOeGXXsQnr/8xX0pt4Chzj 1Bl9jpafw8TlOfH3jj5x1yLZm6HN9yo5WV1KKCnk05ygaOhVfQ+MeSXwVcSnMHBEQWs6 KwYyxocW0z7/U/OehCMMPlZg5zhmHtx/wk0OxGOoiYbHcD1uOJN6GfUHxg2NhOwYX7yZ qe0QXHUHc4VYem59yHo8GBE/Tn5l+uyeWakoTF4dBG7uH45IBUWozxQJfUu3WlXGObuQ gGRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193540; x=1754798340; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s7NHmQkQ5gysWD4rwW/j5R3bG6qHLaOgggFqVWsv12Q=; b=AOXJsL7T0WgF+qu0BLzpkxt+fXvP37oUp27bSckjwFyR6g/9KWx+RQw+RBBoYtymMq R0SbWvfPGtyQH8E8/Pne0YudXLtWbGsbahee23lLNatJJYS5yVFY20FNSeqVXfUjOY62 hYERjYUOdB9LO2kNrhkGHBc1e3LHzjj3P7T+C11hdK90PBi0jMQOZZk9fapg1s2DXiGS KsyNGdQFmh38GUDJ+h5f8PAg9MTaX2sBKzRvz66u4H9bxkXxB++I/t+65gip5+2oVw32 dZVGf18opuREr5n/DEvEcGpvNh+rxc0tqDkTIynaUSTwtQ5HQjn4J/v91DKjLFvYZkHr RQ/g== X-Forwarded-Encrypted: i=1; AJvYcCU/egrGmyJT0+AeOUgkA+Y0B6U/c+HoOg9fIFUhddsuHZonipXNnYmlKLZd9YrZs2u8Ku5L7rp36JMUg/67@vger.kernel.org X-Gm-Message-State: AOJu0Yz2GbhUGpBp4ObbNI6F6DiScCFAVOYhGK995JXAp9zCMCIhacdU Um30WSoZKcaz9P+0rtAZCBBlNjvoxVtBDxMDa0tl6vO50SmW5Rlohda/T++CNgfpY08= X-Gm-Gg: ASbGncv7bAEs2II73dSdNcg2NLCZ5UUrTG3UAEFyfZriasvIN04p2Yh3px8A9kB6b++ aJE3hwekl2dGhIoy+kDsMINI0YMPeyBOGPkO+pb+zd5mPQYAv/WB0NednAY/Q+uQ0zGB5yQxrzs iJY8VYYHVlweYO9DY98ttUjvXdsrSwxgq8uRwVe9SzLiNiYh2gsrOFH3JGdw+3migcpWpriw4Up n8Hy278N2dRQyHdux9rJV2So/RfxuHXYRrUGWoArJuTjqG7dKfQcYfMY/7ZEZeHCDsZu5VU5AFV ssTLG2w7z5d6UrbS7Xza5rYY6Imt70mCzILtH3pZcYfmL76AxjanosEHexGGyGYUcnxlCjPn+VO dxBz0hwqcI0tC/9vgc0A7ErtEonZUmBA9eNYVuOfFOTBm9lf40CKCJo1UBN0Ip1XKLbv5tsgNPz Ckdg== X-Google-Smtp-Source: AGHT+IHGjrGeB/JwKNMq2lNHvYPJcP3h9GIpyCQ+sHPo7dWlzj+a9+9jFlwqwwnEMpSJYhvD73NT9A== X-Received: by 2002:a05:6e02:2194:b0:3d9:65b6:d4db with SMTP id e9e14a558f8ab-3e416191d1dmr96253475ab.12.1754193540188; Sat, 02 Aug 2025 20:59:00 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:58:59 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 18/58] dyndbg: change __dynamic_func_call_cls* macros into expressions Date: Sat, 2 Aug 2025 21:57:36 -0600 Message-ID: <20250803035816.603405-19-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The Xe driver's XE_IOCTL_DBG macro calls drm_dbg() from inside an if (expression). This breaks when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy because the invoked macro has a do-while-0 wrapper, and is not an expression. if (cond && (drm_dbg("expr-form"),1)) { ... do some more stuff } Fix for this usage by changing __dynamic_func_call_cls{,_no_desc} macros into expressions, by replacing the do-while-0s with a ({ }) wrapper. In the common usage, the trailing ';' converts the expression into a statement. drm_dbg("statement form"); Signed-off-by: Jim Cromie --- --- include/linux/dynamic_debug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 769f02456c8e0..1785ef5b93b15 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -217,20 +217,20 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * (|_cls): adds in _DPRINT_CLASS_DFLT as needed * (|_no_desc): former gets callsite descriptor as 1st arg (for prdbgs) */ -#define __dynamic_func_call_cls(id, cls, fmt, func, ...) do { \ +#define __dynamic_func_call_cls(id, cls, fmt, func, ...) ({ \ DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) \ func(&id, ##__VA_ARGS__); \ -} while (0) +}) #define __dynamic_func_call(id, fmt, func, ...) \ __dynamic_func_call_cls(id, _DPRINTK_CLASS_DFLT, fmt, \ func, ##__VA_ARGS__) =20 -#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) do { \ +#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) ({ \ DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) \ func(__VA_ARGS__); \ -} while (0) +}) #define __dynamic_func_call_no_desc(id, fmt, func, ...) \ __dynamic_func_call_cls_no_desc(id, _DPRINTK_CLASS_DFLT, \ fmt, func, ##__VA_ARGS__) --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 873AA28467F; Sun, 3 Aug 2025 03:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193546; cv=none; b=aGvwz78sgDAyoQoVJPHYQk7aAKuHP07aC+rgavjmMDJ44AAr22Atg+Jk5jpKt+UQuPOXM83FLn3pYT1PDINYz4WpMY3DDW5lcJzcGIxY2ov05GypVU3otqWGcPi+hS2VZaFAxCEKE54CSmLLf327ylBDiyrpcfjOLABboUeodac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193546; c=relaxed/simple; bh=EvZZlzWNpIWbi7QPHWeNYfMmEcwV7ArU0XiBSkyMyCY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C9nXkFpRQkW0bXa4z/Cqfp1Cwy3n68XlSHdDbaNK5jdsnozaL2lYP7x6LpXjDCH9mEgSWH9OkbrWxG2rt9UL8Pk41Fb7rBFpy0P/18X0ZLJryKqyx+Km2QkMEwiVScpkY6GLkwbBNJdNf8rH9z3T46liojbZD4c020AHziNnv3g= 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=cDKhkQbY; arc=none smtp.client-ip=209.85.166.174 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="cDKhkQbY" Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-3e40d006105so14218555ab.3; Sat, 02 Aug 2025 20:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193542; x=1754798342; 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=jpDECMN/XR0FZhB3ZVOYTjHABOqLofF6ypEtWrGfFSg=; b=cDKhkQbYrQ5gmwCS3ARE3teXyhbkfw6yX11wf/ikiUncn6B/t9TidGBTyYz3LGomk4 yAyhT0TGuXf3PiOwwATRcIM5nAQskeZVxv3cuP+Fd0enVjHMp+0zYjkzVnmiud02qH/m 0G9sY3RS+aE2I1dkrQmjR+1kPFzg3i6Vl+mhn9h92/UUxcmhkXIIu8CxJ8+Q4AJbWZO0 bn3xPIQxBqYzZ3uHBEKXOBkjfrM/OQSdnwRAY2+sKTwROhyyEb22b3io4mHFFcjBHnhC PCDcImY8BUKgoMtX5OSMDeAA06K7vhFACBjgj/gfz+7wjJQBpmEaZ4XHLcEy7bpMmwjH /XRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193542; x=1754798342; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jpDECMN/XR0FZhB3ZVOYTjHABOqLofF6ypEtWrGfFSg=; b=L4JQgCFqqdyCw9kL7n1GxjT26KbQ7UT+mhUrjo/Q0WkRnZzIXXDhueBHZ3tvNPtvGr aKzkWqyqXFK7VmtixOTDuP4Q399aHYvJj6+kyUXBaiMdVadDSARSkF5jyD1A5ijC0Mo8 vM0akW5w4o8afYAwbjwh4eVtUeV39puvyb7GJg9au8ZXzj0ko4JLY4cD6QXXQzJgHHPL 3FlfhhQ2eIDYkQmLhCYm15SeXnB1dwnuVtvI3axg2a9DKHVH0LU/+gGhZtKK3s2iRp1u Trh/EL6Jk4lzo9C8BycgFXTfUNTQzwi7GlhuItTzI5FV8FHhog140N5+/9V+jYkZ/gXM q1DA== X-Forwarded-Encrypted: i=1; AJvYcCUAJg7zU5H4dvxo5NARQFAIcg0j9CR340ZikUZCskV/suRxhc5A9d7z/phDHNGkmZZ7sMlPKEO10UfaI4Iz@vger.kernel.org, AJvYcCUAvqI/FP87azdoa43+ZKhbBClEmKjFIsvU8xchuguWJmJdDK6TcVKmgdtlzyMqwYnyFSZFdvgwRhuQ@vger.kernel.org X-Gm-Message-State: AOJu0YwbqdyajKmSMoFSbZrxZHLg0IH27cwkG4GPMvz+T46rhaz57reX DVPBPA68l6KhjUa241GSvBWstzqCyAZHmLWyzVrfavys7F84E3/02PSvnl/mPqh31SY= X-Gm-Gg: ASbGncsSukGqOP25WtoNZvwZfzAMdJYB3q0YptGZdJwNC43fQZUDKUDDV3awK9TauEP jKKKwWy8GA7/9mvwL//yhbroJphahyvW2chLmon149BLdEB6mZToJpkiqao5u2RbRj9i1FSqkCD k0jrn4KgfZ4GolXiRi3oATX0pe9WgixJQHMgbB034CsPatFNOVF4CH/dSII3wWhG35C+T6G9ChH 8Vm5dYdpUv2blfI7XLb4KF0U/BSRQJCBQqNaKnoM4GV7s+2wPUCjdsYCCUO7PEN9INpw4v1LCJ3 lCBxyRHgLLSBYScguWOeBCq8TFPLPBIlf++KqAd1I+k1Gdw+Hdii16u+KmR7zT9i3OSssXJ44SX VZAlYBvssXc60OPiimRO9VliK7NIrg+CR5p5dJYXf5WZLYLSr5CaamCOsUXXIASM11u2o6gIBkF 9vew== X-Google-Smtp-Source: AGHT+IEWS1QJ17M7yMR5nyYeJ7d4hKGsEyPwEJ84vqEYgD3f99tTqxTvKRmLupaUsp2IAfhvoN4xiQ== X-Received: by 2002:a92:d30c:0:b0:3e3:f914:d774 with SMTP id e9e14a558f8ab-3e4161b2256mr60925185ab.17.1754193541865; Sat, 02 Aug 2025 20:59:01 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:01 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com, linux-doc@vger.kernel.org Subject: [PATCH v4 19/58] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP Date: Sat, 2 Aug 2025 21:57:37 -0600 Message-ID: <20250803035816.603405-20-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" DECLARE_DYNDBG_CLASSMAP() has a design error; its usage fails a basic K&R rule: "define once, refer many times". When DRM_USE_DYNAMIC_DEBUG=3Dy, it is used across DRM core & drivers; each invocation allocates/inits the classmap understood by that module. All must match for the modules to respond together when DRM.debug categories are enabled. This is brittle; a maintenance foot-gun. Further, its culpable in the CONFIG_DRM_USE_DYNAMIC_DEBUG=3DY regression; its use in both core & drivers obfuscates the 2 roles, resulting in incomplete initialization when modprobing drivers: 1st drm.ko loads, and dyndbg initializes its DRM.debug callsites, then a drm-driver loads, but too late for the DRM.debug enablement. So retire it, replace with 2 macros: DYNAMIC_DEBUG_CLASSMAP_DEFINE - invoked once from core - drm.ko DYNAMIC_DEBUG_CLASSMAP_USE - from all drm drivers and helpers. DYNAMIC_DEBUG_CLASSMAP_DEFINE: this reworks DECLARE_DYNDBG_CLASSMAP, by dropping the static qualifier on the classmap, and exporting it instead. DYNAMIC_DEBUG_CLASSMAP_USE: then refers to the exported var by name: used from drivers, helper-mods lets us drop the repetitive "classname" declarations fixes 2nd-defn problem creates a ddebug_class_user record in new __dyndbg_class_users section new section is scanned "differently" DECLARE_DYNDBG_CLASSMAP is preserved temporarily, to decouple DRM adaptation work and avoid compile-errs before its done. IOW, DRM gets these fixes when they commit the adopt-new-api patches. The DEFINE,USE distinction, and the separate classmap-use record, allows dyndbg to initialize the driver's & helper's DRM.debug callsites separately after each is modprobed. Basically, the classmap init-scan is repeated for classmap-users. To review, dyndbg's existing __dyndbg_classes[] section does: . catalogs the module's classmaps . tells dyndbg about them, allowing >control . DYNAMIC_DEBUG_CLASSMAP_DEFINE creates section records. . we rename it to: __dyndbg_class_maps[] Then this patch adds __dyndbg_class_users[] section: . catalogs users of classmap definitions from elsewhere . authorizes dyndbg to >control user's class'd prdbgs . DYNAMIC_DEBUG_CLASSMAP_USE() creates section records. Now ddebug_add_module(etal) can handle classmap-uses similar to (and after) classmaps; when a dependent module is loaded, if it has classmap-uses (to a classmap-def in another module), that module's kernel params are scanned to find if it has a kparam that is wired to dyndbg's param-ops, and whose classmap is the one being ref'd. To support this, theres a few data/header changes: new struct ddebug_class_user contains: user-module-name, &classmap-defn it records drm-driver's use of a classmap in the section, allowing lookup struct ddebug_info gets 2 new fields for the new sections: class_users, num_class_users. set by dynamic_debug_init() for builtins. or by kernel/module/main:load_info() for loadable modules. vmlinux.lds.h: new BOUNDED_SECTION for __dyndbg_class_users. this creates start,len C symbol-names for the section. dynamic_debug.c has 2 changes in ddebug_add_module(), ddebug_change(): ddebug_add_module() called ddebug_attach_module_classes() now calls ddebug_apply_class_maps() & ddebug_apply_class_users() these both call ddebug_apply_params(). ddebug_apply_params(new fn): It scans module's/builtin kernel-params, calls ddebug_match_apply_kparam for each to find any params/sysfs-nodes which may be wired to a classmap. ddebug_match_apply_kparam(new fn): 1st, it tests the kernel-param.ops is dyndbg's; this guarantees that the attached arg is a struct ddebug_class_param, which has a ref to the param's state, and to the classmap defining the param's handling. 2nd, it requires that the classmap ref'd by the kparam is the one we've been called for; modules can use many separate classmaps (as test_dynamic_debug does). Then apply the "parent" kparam's setting to the dependent module, using ddebug_apply_class_bitmap(). ddebug_change(and callees) also gets adjustments: ddebug_find_valid_class(): This does a search over the module's classmaps, looking for the class FOO echo'd to >control. So now it searches over __dyndbg_class_users[] after __dyndbg_classes[]. ddebug_class_name(): return class-names for defined OR used classes. test_dynamic_debug.c, test_dynamic_debug_submod.c: This demonstrates the 2 types of classmaps & sysfs-params, following the 4-part recipe: 0. define an enum for the classmap: DRM.debug provides DRM_UT_<*> (aka ) multiple classmaps in a module(s) must share 0-62 classid space. 1. DYNAMIC_DEBUG_CLASSMAP_DEFINE(classmap_name, .. "") drm.ko does this 2. DYNAMIC_DEBUG_CLASSMAP_PARAM* (classmap_name) if module wants a sysfs PARAM 3. DYNAMIC_DEBUG_CLASSMAP_USE(classmap_name) for subsystem/group/drivers use Move all the enum declarations together, to better explain how they share the 0..62 class-id space available to a module (non-overlapping subranges). reorg macros 2,3 by name. This gives a tabular format, making it easy to see the pattern of repetition, and the points of change. And extend the test to replicate the 2-module (parent & dependent) scenario which caused the CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy regression seen in drm & drivers. The _submod.c is a 2-line file: #define _SUBMOD, #include parent. This gives identical complements of prdbgs in parent & _submod, and thus identical print behavior when all of: >control, >params, and parent->_submod propagation are working correctly. It also puts all the parent/_submod declarations together in the same source, with the new ifdef _SUBMOD block invoking DYNAMIC_DEBUG_CLASSMAP_USE for the 2 test-interfaces. I think this is clearer. These 2 modules are both tristate, allowing 3 super/sub combos: Y/Y, Y/M, M/M (not N/Y, since this is disallowed by dependence). Y/Y testing exposed a missing __align(8) in the _METADATA macro, which M/M didn't see because the module-loader memory placement constrains it instead. Fixes: aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") cc: linux-doc@vger.kernel.org Signed-off-by: Jim Cromie --- v3- undo 1.9 simplification of ddebug_find_valid_class() ddebug_change needs map to see its controlling param change internal callchains to pass di, not dt v2 a. building 2 .ko's from 1 source file is weird; add a clear comment at the top to justify it (basically cloning) ln 138+ in commit-msg is insufficient. b. retire "DYNDBG_" name shortening b4 adding _CLASSMAP_* macros. c. s/dd_class/_ddebug_class/ d. s/\bddebug\b/_$1/g in header: chgs 1 struct and UNIQUE_ID bases v1.9 - commit-msg tweaks DRM:CHECK warnings on macros: add parens extern DEFINEd _var, static classnames change ddebug_class_user.user_mod_name to .mod_name simplify ddebug_find_valid_class return val improve vpr_cm_info msg format wrap (base) in macro body move __DYNDBG_CLASSMAP_CHECK above kdoc for DYNDBG_CLASSMAP_DEFINE v1.8 - split drm parts to separate commits. preserve DECLARE_DYNDBG_CLASSMAP to decouple DRM, no flag day. fixup block comment v1.7 - previous submission-blocking bug: missing __align(8) in DYNAMIC_DEBUG_DECLARE_METADATA on ddebug_class_user caused corrupt records, but only for builtin modules; module loader code probably pinned allocations to the right alignment naturally, hiding the bug for typical builds. v6- get rid of WARN_ON_ONCE v?- fix _var expanded 2x in macro dyndbg: This fn formerly returned the map which contained the class (thus validating it), and as a side-effect set the class-id in an outvar. But the caller didn't use the map (after checking its not null), only the valid class-id. So simplify the fn to return the class-id of the validated classname, or -ENOENT when the queried classname is not found. Convey more useful info in the debug-msg: print class-names[0,last], and [base,+len] instead of the class-type printout, which is almost always "type:DISJOINT_BITS". And drop ddebug_classmap_typenames, which is now unused. [root@v6 b0-dd]# modprobe test_dynamic_debug_submod [ 18.864962] dyndbg: loaded classmap: test_dynamic_debug [16..24] V0..V7 [ 18.865046] dyndbg: found kp:p_level_num =3D0x0 [ 18.865048] dyndbg: mapped to: test_dynamic_debug [16..24] V0..V7 [ 18.865164] dyndbg: p_level_num: lvl:0 bits:0x0 [ 18.865217] dyndbg: loaded classmap: test_dynamic_debug [0..10] D2_CORE.= .D2_DRMRES [ 18.865297] dyndbg: found kp:p_disjoint_bits =3D0x0 [ 18.865298] dyndbg: mapped to: test_dynamic_debug [0..10] D2_CORE..D2_= DRMRES [ 18.865424] dyndbg: p_disjoint_bits: classbits: 0x0 [ 18.865472] dyndbg: module:test_dynamic_debug attached 2 classmaps [ 18.865533] dyndbg: 23 debug prints in module test_dynamic_debug [ 18.866558] dyndbg: loaded classmap: test_dynamic_debug_submod [16..24] = V0..V7 [ 18.866698] dyndbg: found kp:p_level_num =3D0x0 [ 18.866699] dyndbg: mapped to: test_dynamic_debug_submod [16..24] V0..= V7 [ 18.866865] dyndbg: p_level_num: lvl:0 bits:0x0 [ 18.866926] dyndbg: loaded classmap: test_dynamic_debug_submod [0..10] D= 2_CORE..D2_DRMRES [ 18.867026] dyndbg: found kp:p_disjoint_bits =3D0x0 [ 18.867027] dyndbg: mapped to: test_dynamic_debug_submod [0..10] D2_CO= RE..D2_DRMRES [ 18.867193] dyndbg: p_disjoint_bits: classbits: 0x0 [ 18.867255] dyndbg: module:test_dynamic_debug_submod attached 2 classmap= uses [ 18.867351] dyndbg: 23 debug prints in module test_dynamic_debug_submod fixup-test-submod fixup-test Signed-off-by: Jim Cromie fixup-h-decl tweak-hdr-cmts-cls --- MAINTAINERS | 2 +- include/asm-generic/vmlinux.lds.h | 1 + include/linux/dynamic_debug.h | 118 ++++++++++++++++++++++--- kernel/module/main.c | 3 + lib/Kconfig.debug | 24 ++++-- lib/Makefile | 5 ++ lib/dynamic_debug.c | 137 +++++++++++++++++++++++++++--- lib/test_dynamic_debug.c | 132 ++++++++++++++++++++-------- lib/test_dynamic_debug_submod.c | 14 +++ 9 files changed, 366 insertions(+), 70 deletions(-) create mode 100644 lib/test_dynamic_debug_submod.c diff --git a/MAINTAINERS b/MAINTAINERS index 4259d63c431a3..7d92c21693dc6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8454,7 +8454,7 @@ M: Jim Cromie S: Maintained F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c -F: lib/test_dynamic_debug.c +F: lib/test_dynamic_debug*.c F: tools/testing/selftests/dynamic_debug/* =20 DYNAMIC INTERRUPT MODERATION diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 6fbdee1978210..94d3bc099c66d 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -366,6 +366,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELL= ER_CLANG) /* implement dynamic printk debug */ \ . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__dyndbg_class_maps, ___dyndbg_class_maps) \ + BOUNDED_SECTION_BY(__dyndbg_class_users, ___dyndbg_class_users) \ BOUNDED_SECTION_BY(__dyndbg_descriptors, ___dyndbg_descs) \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 1785ef5b93b15..c45f5b76763cc 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -71,9 +71,39 @@ enum ddebug_class_map_type { */ }; =20 +/* + * classmaps allow authors to devise their own domain-oriented + * class-names, to use them by converting some of their pr_debug(...)s + * to __pr_debug_cls(class_id, ...), and to enable them either by their + * kparam (/sys/module/drm/parameters/debug), or by using the class + * keyword in >control queries. + * + * classmaps are devised to support DRM.debug directly: + * + * class_id =3D=3D=3D drm_debug_category: DRM_UT_<*> =3D=3D=3D [0..10]. + * These are compile-time constants, and __pr_debug_cls() requires + * this, enforcing what DRM devised for optimizing compilers to work + * with. UUID overheads were out of scope. + * + * That choice has immediate consequences: + * DRM wants class_ids [0..N], as will others. We need private class_ids. + * DRM also exposes 0..N to userspace (/sys/module/drm/parameters/debug) + * + * By mapping class-names to class-ids at >control, and responding + * only to class-names DEFINEd or USEd by the module, we can + * private-ize the class-id, and adjust classes only by their names. + * + * Multi-class modules are possible, provided the classmaps share the + * class_id space [0..62]. Same applies to subsystems like DRM. + * + * NOTE: This api cannot disallow these: + * __pr_debug_cls(0, "fake CORE msg") in any part of DRM would "work" + * __pr_debug_cls(22, "no such class") would compile, but not "work" + */ + struct _ddebug_class_map { - struct module *mod; - const char *mod_name; /* needed for builtins */ + const struct module *mod; /* NULL for builtins */ + const char *mod_name; const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ @@ -81,11 +111,34 @@ struct _ddebug_class_map { }; =20 /** - * DECLARE_DYNDBG_CLASSMAP - declare classnames known by a module - * @_var: a struct _ddebug_class_map, passed to module_param_cb - * @_type: enum class_map_type, chooses bits/verbose, numeric/symbolic - * @_base: offset of 1st class-name. splits .class_id space - * @classes: class-names used to control class'd prdbgs + * DYNAMIC_DEBUG_CLASSMAP_DEFINE - define debug classes used by a module. + * @_var: name of the classmap, exported for other modules coordinated u= se. + * @_mapty: enum ddebug_class_map_type: 0:DISJOINT - independent, 1:LEVEL = - v2>v1 + * @_base: reserve N classids starting at _base, to split 0..62 classid s= pace + * @classes: names of the N classes. + * + * This tells dyndbg what class_ids the module is using: _base..+N, by + * mapping names onto them. This qualifies "class NAME" >controls on + * the defining module, ignoring unknown names. + */ +#define DYNAMIC_DEBUG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) \ + static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + extern struct _ddebug_class_map _var; \ + struct _ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_class_maps") _var =3D { \ + .mod =3D THIS_MODULE, \ + .mod_name =3D KBUILD_MODNAME, \ + .base =3D (_base), \ + .map_type =3D (_mapty), \ + .length =3D ARRAY_SIZE(_var##_classnames), \ + .class_names =3D _var##_classnames, \ + }; \ + EXPORT_SYMBOL(_var) + +/* + * XXX: keep this until DRM adapts to use the DEFINE/USE api, it + * differs from DYNAMIC_DEBUG_CLASSMAP_DEFINE by the lack of the + * extern/EXPORT on the struct init, and cascading thinkos. */ #define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ @@ -99,10 +152,36 @@ struct _ddebug_class_map { .class_names =3D _var##_classnames, \ } =20 +struct _ddebug_class_user { + char *mod_name; + struct _ddebug_class_map *map; +}; + +/** + * DYNAMIC_DEBUG_CLASSMAP_USE - refer to a classmap, DEFINEd elsewhere. + * @_var: name of the exported classmap var + * @_not_yet: _base-like, but applies only to this USEr. (if needed) + * + * This tells dyndbg that the module has prdbgs with classids defined + * in the named classmap. This qualifies "class NAME" >controls on + * the user module, and ignores unknown names. + */ +#define DYNAMIC_DEBUG_CLASSMAP_USE(_var) \ + DYNAMIC_DEBUG_CLASSMAP_USE_(_var, __UNIQUE_ID(_ddebug_class_user)) +#define DYNAMIC_DEBUG_CLASSMAP_USE_(_var, _uname) \ + extern struct _ddebug_class_map _var; \ + static struct _ddebug_class_user __aligned(8) __used \ + __section("__dyndbg_class_users") _uname =3D { \ + .mod_name =3D KBUILD_MODNAME, \ + .map =3D &(_var), \ + } + /* - * @_ddebug_info: gathers module/builtin dyndbg_* __sections together. + * @_ddebug_info: gathers module/builtin __dyndbg_ __sections + * together, each is a vec_: a struct { struct T *addr, int len }. + * * For builtins, it is used as a cursor, with the inner structs - * marking sub-vectors of the builtin __sections in DATA. + * marking sub-vectors of the builtin __sections in DATA_DATA */ struct _ddebug_descs { struct _ddebug *start; @@ -114,10 +193,16 @@ struct _ddebug_class_maps { int len; } __packed; =20 +struct _ddebug_class_users { + struct _ddebug_class_user *start; + int len; +} __packed; + struct _ddebug_info { const char *mod_name; struct _ddebug_descs descs; struct _ddebug_class_maps maps; + struct _ddebug_class_users users; } __packed; =20 struct _ddebug_class_param { @@ -287,12 +372,18 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, KERN_DEBUG, prefix_str, prefix_type, \ rowsize, groupsize, buf, len, ascii) =20 -/* for test only, generally expect drm.debug style macro wrappers */ -#define __pr_debug_cls(cls, fmt, ...) do { \ +/* + * This is the "model" class variant of pr_debug. It is not really + * intended for direct use; I'd encourage DRM-style drm_dbg_ + * macros for the interface, along with an enum for the + * + * __printf(2, 3) would apply. + */ +#define __pr_debug_cls(cls, fmt, ...) ({ \ BUILD_BUG_ON_MSG(!__builtin_constant_p(cls), \ "expecting constant class int/enum"); \ dynamic_pr_debug_cls(cls, fmt, ##__VA_ARGS__); \ - } while (0) +}) =20 #else /* !(CONFIG_DYNAMIC_DEBUG || (CONFIG_DYNAMIC_DEBUG_CORE && DYNAMIC_D= EBUG_MODULE)) */ =20 @@ -345,8 +436,7 @@ static inline int param_set_dyndbg_classes(const char *= instr, const struct kerne static inline int param_get_dyndbg_classes(char *buffer, const struct kern= el_param *kp) { return 0; } =20 -#endif - +#endif /* !CONFIG_DYNAMIC_DEBUG_CORE */ =20 extern const struct kernel_param_ops param_ops_dyndbg_classes; =20 diff --git a/kernel/module/main.c b/kernel/module/main.c index 8515a6184be09..a554dab32133d 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2695,6 +2695,9 @@ static int find_module_sections(struct module *mod, s= truct load_info *info) mod->dyndbg_info.maps.start =3D section_objs(info, "__dyndbg_class_maps", sizeof(*mod->dyndbg_info.maps.start), &mod->dyndbg_info.maps.len); + mod->dyndbg_info.users.start =3D section_objs(info, "__dyndbg_class_users= ", + sizeof(*mod->dyndbg_info.users.start), + &mod->dyndbg_info.users.len); #endif =20 return 0; diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index ebe33181b6e6e..bf4184d91562e 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2970,12 +2970,26 @@ config TEST_STATIC_KEYS If unsure, say N. =20 config TEST_DYNAMIC_DEBUG - tristate "Test DYNAMIC_DEBUG" - depends on DYNAMIC_DEBUG + tristate "Build test-dynamic-debug module" + depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE help - This module registers a tracer callback to count enabled - pr_debugs in a 'do_debugging' function, then alters their - enablements, calls the function, and compares counts. + This module exercises/demonstrates dyndbg's classmap API, by + creating 2 classes: a DISJOINT classmap (supporting DRM.debug) + and a LEVELS/VERBOSE classmap (like verbose2 > verbose1). + + If unsure, say N. + +config TEST_DYNAMIC_DEBUG_SUBMOD + tristate "Build test-dynamic-debug submodule" + default m + depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE + depends on TEST_DYNAMIC_DEBUG + help + This sub-module uses a classmap defined and exported by the + parent module, recapitulating drm & driver's shared use of + drm.debug to control enabled debug-categories. + It is tristate, independent of parent, to allow testing all + proper combinations of parent=3Dy/m submod=3Dy/m. =20 If unsure, say N. =20 diff --git a/lib/Makefile b/lib/Makefile index c38582f187dd8..4f3d09a466414 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -81,6 +81,9 @@ obj-$(CONFIG_TEST_RHASHTABLE) +=3D test_rhashtable.o obj-$(CONFIG_TEST_STATIC_KEYS) +=3D test_static_keys.o obj-$(CONFIG_TEST_STATIC_KEYS) +=3D test_static_key_base.o obj-$(CONFIG_TEST_DYNAMIC_DEBUG) +=3D test_dynamic_debug.o +obj-$(CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD) +=3D test_dynamic_debug_submod.o +obj-$(CONFIG_TEST_PRINTF) +=3D test_printf.o +obj-$(CONFIG_TEST_SCANF) +=3D test_scanf.o =20 obj-$(CONFIG_TEST_BITMAP) +=3D test_bitmap.o ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_KASAN),yy) @@ -215,6 +218,8 @@ obj-$(CONFIG_ARCH_NEED_CMPXCHG_1_EMU) +=3D cmpxchg-emu.o obj-$(CONFIG_DYNAMIC_DEBUG_CORE) +=3D dynamic_debug.o #ensure exported functions have prototypes CFLAGS_dynamic_debug.o :=3D -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug.o :=3D -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug_submod.o :=3D -DDYNAMIC_DEBUG_MODULE =20 obj-$(CONFIG_SYMBOLIC_ERRNAME) +=3D errname.o =20 diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 2cd28a64578dd..fa8d1ee214066 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -29,6 +29,7 @@ #include #include #include + #include #include #include @@ -43,6 +44,8 @@ extern struct _ddebug __start___dyndbg_descs[]; extern struct _ddebug __stop___dyndbg_descs[]; extern struct _ddebug_class_map __start___dyndbg_class_maps[]; extern struct _ddebug_class_map __stop___dyndbg_class_maps[]; +extern struct _ddebug_class_user __start___dyndbg_class_users[]; +extern struct _ddebug_class_user __stop___dyndbg_class_users[]; =20 struct ddebug_table { struct list_head link; @@ -159,20 +162,37 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } =20 -static struct _ddebug_class_map *ddebug_find_valid_class(struct ddebug_tab= le const *dt, - const char *class_string, - int *class_id) +#define vpr_di_info(di_p, msg_p, ...) ({ \ + struct _ddebug_info const *_di =3D di_p; \ + v2pr_info(msg_p " module:%s nd:%d nc:%d nu:%d\n", ##__VA_ARGS__, \ + _di->mod_name, _di->descs.len, _di->maps.len, \ + _di->users.len); \ + }) + +static struct _ddebug_class_map * +ddebug_find_valid_class(struct _ddebug_info const *di, const char *query_c= lass, int *class_id) { struct _ddebug_class_map *map; + struct _ddebug_class_user *cli; int i, idx; =20 - for_subvec(i, map, &dt->info, maps) { - idx =3D match_string(map->class_names, map->length, class_string); + for_subvec(i, map, di, maps) { + idx =3D match_string(map->class_names, map->length, query_class); if (idx >=3D 0) { + vpr_di_info(di, "good-class: %s.%s ", map->mod_name, query_class); *class_id =3D idx + map->base; return map; } } + for_subvec(i, cli, di, users) { + idx =3D match_string(cli->map->class_names, cli->map->length, query_clas= s); + if (idx >=3D 0) { + vpr_di_info(di, "class-ref: %s -> %s.%s ", + cli->mod_name, cli->map->mod_name, query_class); + *class_id =3D idx + cli->map->base; + return cli->map; + } + } *class_id =3D -ENOENT; return NULL; } @@ -183,8 +203,7 @@ static struct _ddebug_class_map *ddebug_find_valid_clas= s(struct ddebug_table con * callsites, normally the same as number of changes. If verbose, * logs the changes. Takes ddebug_lock. */ -static int ddebug_change(const struct ddebug_query *query, - struct flag_settings *modifiers) +static int ddebug_change(const struct ddebug_query *query, struct flag_set= tings *modifiers) { int i; struct ddebug_table *dt; @@ -204,7 +223,8 @@ static int ddebug_change(const struct ddebug_query *que= ry, continue; =20 if (query->class_string) { - map =3D ddebug_find_valid_class(dt, query->class_string, &valid_class); + map =3D ddebug_find_valid_class(&dt->info, query->class_string, + &valid_class); if (!map) continue; } else { @@ -569,7 +589,7 @@ static int ddebug_exec_query(char *query_string, const = char *modname) =20 /* handle multiple queries in query string, continue on error, return last error or number of matching callsites. Module name is either - in param (for boot arg) or perhaps in query string. + in the modname arg (for boot args) or perhaps in query string. */ static int ddebug_exec_queries(char *query, const char *modname) { @@ -700,7 +720,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, /** * param_set_dyndbg_classes - classmap kparam setter * @instr: string echo>d to sysfs, input depends on map_type - * @kp: kp->arg has state: bits/lvl, map, map_type + * @kp: kp->arg has state: bits/lvl, classmap, map_type * * enable/disable all class'd pr_debugs in the classmap. For LEVEL * map-types, enforce * relative levels by bitpos. @@ -737,6 +757,7 @@ int param_get_dyndbg_classes(char *buffer, const struct= kernel_param *kp) default: return -1; } + return 0; } EXPORT_SYMBOL(param_get_dyndbg_classes); =20 @@ -1049,12 +1070,17 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) static const char *ddebug_class_name(struct _ddebug_info *di, struct _ddeb= ug *dp) { struct _ddebug_class_map *map; + struct _ddebug_class_user *cli; int i; =20 for_subvec(i, map, di, maps) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 + for_subvec(i, cli, di, users) + if (class_in_range(dp->class_id, cli->map)) + return cli->map->class_names[dp->class_id - cli->map->base]; + return NULL; } =20 @@ -1135,9 +1161,85 @@ static const struct proc_ops proc_fops =3D { .proc_write =3D ddebug_proc_write }; =20 -static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) +#define vpr_cm_info(cm_p, msg_fmt, ...) ({ \ + struct _ddebug_class_map const *_cm =3D cm_p; \ + v2pr_info(msg_fmt " %s [%d..%d] %s..%s\n", ##__VA_ARGS__, \ + _cm->mod_name, _cm->base, _cm->base + _cm->length, \ + _cm->class_names[0], _cm->class_names[_cm->length - 1]); \ + }) + +static void ddebug_sync_classbits(const struct kernel_param *kp, const cha= r *modname) +{ + const struct _ddebug_class_param *dcp =3D kp->arg; + + /* clamp initial bitvec, mask off hi-bits */ + if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { + *dcp->bits &=3D CLASSMAP_BITMASK(dcp->map->length); + v2pr_info("preset classbits: %lx\n", *dcp->bits); + } + /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-= param */ + ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); + ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); +} + +static void ddebug_match_apply_kparam(const struct kernel_param *kp, + const struct _ddebug_class_map *map, + const char *mod_name) +{ + struct _ddebug_class_param *dcp; + + if (kp->ops !=3D ¶m_ops_dyndbg_classes) + return; + + dcp =3D (struct _ddebug_class_param *)kp->arg; + + if (map =3D=3D dcp->map) { + v2pr_info(" kp:%s.%s =3D0x%lx", mod_name, kp->name, *dcp->bits); + vpr_cm_info(map, " %s mapped to: ", mod_name); + ddebug_sync_classbits(kp, mod_name); + } +} + +static void ddebug_apply_params(const struct _ddebug_class_map *cm, const = char *mod_name) +{ + const struct kernel_param *kp; +#if IS_ENABLED(CONFIG_MODULES) + int i; + + if (cm->mod) { + vpr_cm_info(cm, "loaded classmap: %s", mod_name); + /* ifdef protects the cm->mod->kp deref */ + for (i =3D 0, kp =3D cm->mod->kp; i < cm->mod->num_kp; i++, kp++) + ddebug_match_apply_kparam(kp, cm, mod_name); + } +#endif + if (!cm->mod) { + vpr_cm_info(cm, "builtin classmap: %s", mod_name); + for (kp =3D __start___param; kp < __stop___param; kp++) + ddebug_match_apply_kparam(kp, cm, mod_name); + } +} + +static void ddebug_apply_class_maps(const struct _ddebug_info *di) +{ + struct _ddebug_class_map *cm; + int i; + + for_subvec(i, cm, di, maps) + ddebug_apply_params(cm, cm->mod_name); + + vpr_di_info(di, "attached %d classmaps to module: %s ", i, cm->mod_name); +} + +static void ddebug_apply_class_users(const struct _ddebug_info *di) { - vpr_info("module:%s attached %d classes\n", dt->info.mod_name, dt->info.m= aps.len); + struct _ddebug_class_user *cli; + int i; + + for_subvec(i, cli, di, users) + ddebug_apply_params(cli->map, cli->mod_name); + + vpr_di_info(di, "attached %d class-users to module: %s ", i, cli->mod_nam= e); } =20 /* @@ -1173,6 +1275,7 @@ static int ddebug_add_module(struct _ddebug_info *di) { struct ddebug_table *dt; struct _ddebug_class_map *cm; + struct _ddebug_class_user *cli; int i; =20 if (!di->descs.len) @@ -1196,14 +1299,18 @@ static int ddebug_add_module(struct _ddebug_info *d= i) INIT_LIST_HEAD(&dt->link); =20 dd_mark_vector_subrange(i, dt, cm, di, maps); + dd_mark_vector_subrange(i, dt, cli, di, users); =20 - if (di->maps.len) - ddebug_attach_module_classes(dt, di); + if (dt->info.maps.len) + ddebug_apply_class_maps(&dt->info); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 + if (dt->info.users.len) + ddebug_apply_class_users(&dt->info); + vpr_info("%3u debug prints in module %s\n", di->descs.len, di->mod_name); return 0; } @@ -1354,8 +1461,10 @@ static int __init dynamic_debug_init(void) struct _ddebug_info di =3D { .descs.start =3D __start___dyndbg_descs, .maps.start =3D __start___dyndbg_class_maps, + .users.start =3D __start___dyndbg_class_users, .descs.len =3D __stop___dyndbg_descs - __start___dyndbg_descs, .maps.len =3D __stop___dyndbg_class_maps - __start___dyndbg_class_maps, + .users.len =3D __stop___dyndbg_class_users - __start___dyndbg_class_user= s, }; =20 #ifdef CONFIG_MODULES diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 9c3e53cd26bd8..6c4548f635128 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -6,11 +6,30 @@ * Jim Cromie */ =20 -#define pr_fmt(fmt) "test_dd: " fmt +/* + * This file is built 2x, also making test_dynamic_debug_submod.ko, + * whose 2-line src file #includes this file. This gives us a _submod + * clone with identical pr_debugs, without further maintenance. + * + * If things are working properly, they should operate identically + * when printed or adjusted by >control. This eases visual perusal of + * the logs, and simplifies testing, by easing the proper accounting + * of expectations. + * + * It also puts both halves of the subsystem _DEFINE & _USE use case + * together, and integrates the common ENUM providing both class_ids + * and class-names to both _DEFINErs and _USERs. I think this makes + * the usage clearer. + */ +#if defined(TEST_DYNAMIC_DEBUG_SUBMOD) + #define pr_fmt(fmt) "test_dd_submod: " fmt +#else + #define pr_fmt(fmt) "test_dd: " fmt +#endif =20 #include =20 -/* run tests by reading or writing sysfs node: do_prints */ +/* re-gen output by reading or writing sysfs node: do_prints */ =20 static void do_prints(void); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_para= m *kp) @@ -29,24 +48,39 @@ static const struct kernel_param_ops param_ops_do_print= s =3D { }; module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0600); =20 -/* - * Using the CLASSMAP api: - * - classmaps must have corresponding enum - * - enum symbols must match/correlate with class-name strings in the map. - * - base must equal enum's 1st value - * - multiple maps must set their base to share the 0-30 class_id space !! - * (build-bug-on tips welcome) - * Additionally, here: - * - tie together sysname, mapname, bitsname, flagsname - */ -#define DD_SYS_WRAP(_model, _flags) \ - static unsigned long bits_##_model; \ - static struct _ddebug_class_param _flags##_model =3D { \ +#define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << (base)) + +/* sysfs param wrapper, proto-API */ +#define DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, _init) \ + static unsigned long bits_##_model =3D _init; \ + static struct _ddebug_class_param _flags##_##_model =3D { \ .bits =3D &bits_##_model, \ .flags =3D #_flags, \ .map =3D &map_##_model, \ }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, &_flags##_m= odel, 0600) + module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ + &_flags##_##_model, 0600) +#ifdef DEBUG +#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_model, _flags) \ + DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, ~0) +#else +#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_model, _flags) \ + DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, 0) +#endif + +/* + * Demonstrate/test DISJOINT & LEVEL typed classmaps with a sys-param. + * + * To comport with DRM debug-category (an int), classmaps map names to + * ids (also an int). So a classmap starts with an enum; DRM has enum + * debug_category: with DRM_UT_. We use the enum + * values as class-ids, and stringified enum-symbols as classnames. + * + * Modules with multiple CLASSMAPS must have enums with distinct + * value-ranges, as arranged below with explicit enum_sym =3D X inits. + * To clarify this sharing, declare the 2 enums now, for the 2 + * different classmap types + */ =20 /* numeric input, independent bits */ enum cat_disjoint_bits { @@ -60,26 +94,51 @@ enum cat_disjoint_bits { D2_LEASE, D2_DP, D2_DRMRES }; -DECLARE_DYNDBG_CLASSMAP(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "D2_CORE", - "D2_DRIVER", - "D2_KMS", - "D2_PRIME", - "D2_ATOMIC", - "D2_VBL", - "D2_STATE", - "D2_LEASE", - "D2_DP", - "D2_DRMRES"); -DD_SYS_WRAP(disjoint_bits, p); -DD_SYS_WRAP(disjoint_bits, T); - -/* numeric verbosity, V2 > V1 related */ -enum cat_level_num { V0 =3D 14, V1, V2, V3, V4, V5, V6, V7 }; -DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, - "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); -DD_SYS_WRAP(level_num, p); -DD_SYS_WRAP(level_num, T); + +/* numeric verbosity, V2 > V1 related. V0 is > D2_DRMRES */ +enum cat_level_num { V0 =3D 16, V1, V2, V3, V4, V5, V6, V7 }; + +/* recapitulate DRM's multi-classmap setup */ +#if !defined(TEST_DYNAMIC_DEBUG_SUBMOD) +/* + * In single user, or parent / coordinator (drm.ko) modules, define + * classmaps on the client enums above, and then declares the PARAMS + * ref'g the classmaps. Each is exported. + */ +DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BI= TS, + D2_CORE, + "D2_CORE", + "D2_DRIVER", + "D2_KMS", + "D2_PRIME", + "D2_ATOMIC", + "D2_VBL", + "D2_STATE", + "D2_LEASE", + "D2_DP", + "D2_DRMRES"); + +DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, + V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); + +/* + * now add the sysfs-params + */ + +DYNAMIC_DEBUG_CLASSMAP_PARAM(disjoint_bits, p); +DYNAMIC_DEBUG_CLASSMAP_PARAM(level_num, p); + +#else /* TEST_DYNAMIC_DEBUG_SUBMOD */ + +/* + * in submod/drm-drivers, use the classmaps defined in top/parent + * module above. + */ + +DYNAMIC_DEBUG_CLASSMAP_USE(map_disjoint_bits); +DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); + +#endif =20 /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") @@ -115,6 +174,7 @@ static void do_levels(void) =20 static void do_prints(void) { + pr_debug("do_prints:\n"); do_cats(); do_levels(); } diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submo= d.c new file mode 100644 index 0000000000000..672aabf40160d --- /dev/null +++ b/lib/test_dynamic_debug_submod.c @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Kernel module for testing dynamic_debug + * + * Authors: + * Jim Cromie + */ + +/* + * clone the parent, inherit all the properties, for consistency and + * simpler accounting in test expectations. + */ +#define TEST_DYNAMIC_DEBUG_SUBMOD +#include "test_dynamic_debug.c" --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 87393283FF0; Sun, 3 Aug 2025 03:59:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193546; cv=none; b=XjblILbfqFzqag3icDx7dOFn6lRKEqjNhGB8T6//3MpXI6XUFNnQeLslya2ASC8yXr1vzPO2URM4gWE7IaP0t+dTI8m7fzbUju22l/4Xy7tX/iGak1xyHZRQDxNTKHH6GPPIWKtKKQSIrJwnRIld9K1VO+rvSygzZXe/3jfSHbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193546; c=relaxed/simple; bh=kJEs7iRnBPV+ssYFDY1mJw2zjtdUyEbxS11ES1cB40w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sjfFSw4HfOCyU4LfIsB+PzO3RajtC/oUADQHqkYQwdS/XIm1tR0npX2l7yDFKh0KJ9aahPQqHkRxYOhoIQsxvQ3iKk2cjoCOHCF1a84r+7W+SaUjVIcnzpUjAUmV1j4Mns50kMtokPF2XoZeLApt0ounSFtVaToYoWHW+S6iDQw= 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=Cp6kIzMq; arc=none smtp.client-ip=209.85.166.174 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="Cp6kIzMq" Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-3e3e4a5715dso8643005ab.3; Sat, 02 Aug 2025 20:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193543; x=1754798343; 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=mklWiZZXeNw0IAiROdlhKulcLq5JIjmrYvDuK+b6IIw=; b=Cp6kIzMqcbxmKVIwnFQJzxo8yYTUVqI9IusF7XLh4/adypWRwmIN25RkMfoYr/vUmC pJGVHeD1Gqd67EbKD6e3706vNtCmyjFYmhJ7ALG1XI6e4EYpfOZ2x9M+m/y1j1fuhvWW T0vULLpMkVf/WXlfYnILFNbvhFuWtYpSmC+DVx08S9ZjCkAUcAVhdpVH+AgddIrcRnZc KA2hrpgZ1AlKc2RGne+ZE95dSmr0ySzJFEPStO0TkOay7Xh/2FvcMPWne32s58unpXtR WfP6bLigCXDfkjxYz1y3mS3j6m+4gMLUkWZxc7F/PCrDRU6UXiCaiAkoMB+YiNckn+eq aIPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193543; x=1754798343; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mklWiZZXeNw0IAiROdlhKulcLq5JIjmrYvDuK+b6IIw=; b=EAtGXB69f5a21m+j9JTPKRZK2Nh323/Y7syHiLtPR43gx6cbFZUhxisvAt0PRJjhSu cvqH7knRc+Grmj6lqCki6zkZ4RDaXRLSPkKsx8ymZwhFI4lGfLNXV/iEvrFdrQ/xkV13 5RidsCDlZ9HUvFrGP8prMAYJuaFbxPX02ztmc+Rw/p0QfGUSw6iEK4S3JEmySptQOmMr 2kQy3/SeVSyhhB5G2SbWLsHqLDWIo1Id+vh9Vn2GJij4LnecnqWSX8FmvWO349TUlqwL kJeP5TLxyR0Nntsn0z2kKFhb9Um+Lm7353F/KbtkzL200IR9IgK6YT5DOkk6qaHJkl2v 4k1g== X-Forwarded-Encrypted: i=1; AJvYcCWBrlbrsGis7dgMArCBkPdeaBIlnvfbtEcgm3IJ+WE0M783LBz077ThEBgMpeluEMC3Fl1akEBRcmUJ9YGn@vger.kernel.org X-Gm-Message-State: AOJu0YxCa2m+Zr+o4BdZCDzdd/jGKFS/TO1K8X61gIbfT3UJJmS/C3IO qSfA9+xC4lv9XEpjT7WbUI9BnfNULtC3ATNonKQvANG4aeTP0gHkcsnJOWoDmATnQP8= X-Gm-Gg: ASbGncu7dK+kfNqWg/4GFLt3ZUNZ6YPlaqC4nPbiqbFKIm+xW4vPP3RAMytjWPmvtNx 8UUCAQpi9joYAeHJ6mKDPtPuyfjHMvIU/pzuVSu7hhKb9GlAUI47VxZSiyuuc+OB3pSRtZ3LHqQ DGFTiDvMfFzS2cPae5Wqo85BFhkdznMh1v4LGEkymQaXVxPX0l2A+0gcqNxYfeWWSlYRh3FoYYv 72vgJUttZWu+8b5CX42Pb4C87s7SHpd8nvZzcJ7JvUaWJip8mKKH4WL+CMZ12ToZS3Ln8tSbZvw Kj63mtVLqhfmanjUbr7QkuQ1WGFl51q4wOjaKAGbKcVHHKKvJWB8PX7Bld+KYNt8DIZ23X6cZcE DF8WdGkaE0q4XhKLUlPgQYk/3mDnEwjNWv2sDyn0D4XlbRKQeXp6LOKZPJVJews2VdjMGrhie1Z dpfg== X-Google-Smtp-Source: AGHT+IFogGu9+LdtIzbyfZnfCUHN86E9vT1zZI6TQuyF240cWd9LVlFw1Za2fBbgX19XjcZHFKFMwQ== X-Received: by 2002:a05:6e02:3e8b:b0:3e2:a472:2122 with SMTP id e9e14a558f8ab-3e416191f81mr84787815ab.14.1754193543320; Sat, 02 Aug 2025 20:59:03 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:02 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 20/58] dyndbg: detect class_id reservation conflicts Date: Sat, 2 Aug 2025 21:57:38 -0600 Message-ID: <20250803035816.603405-21-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" If a module _DEFINEs + _USEs 2 or more classmaps, it must devise them to share the per-module 0..62 class-id space; ie their respective base,+length reservations cannot overlap. To detect conflicts at modprobe, add ddebug_class_range_overlap(), call it from ddebug_add_module(), and WARN and return -EINVAL when they're detected. test_dynamic_debug.c: If built with -DFORCE_CLASSID_CONFLICT, the test-modules get 2 bad DYNDBG_CLASS_DEFINE declarations, into parent and the _submod. These conflict with one of the good ones in the parent (D2_CORE..etc), causing the modprobe(s) to warn Signed-off-by: Jim Cromie --- --- lib/dynamic_debug.c | 29 +++++++++++++++++++++++++++++ lib/test_dynamic_debug.c | 8 ++++++++ 2 files changed, 37 insertions(+) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index fa8d1ee214066..d6687623c5a96 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1267,6 +1267,22 @@ static void ddebug_apply_class_users(const struct _d= debug_info *di) (_dst)->info._vec.len =3D nc; \ }) =20 +static int __maybe_unused +ddebug_class_range_overlap(struct _ddebug_class_map *cm, + u64 *reserved_ids) +{ + u64 range =3D (((1ULL << cm->length) - 1) << cm->base); + + if (range & *reserved_ids) { + pr_err("[%d..%d] on %s conflicts with %llx\n", cm->base, + cm->base + cm->length - 1, cm->class_names[0], + *reserved_ids); + return -EINVAL; + } + *reserved_ids |=3D range; + return 0; +} + /* * Allocate a new ddebug_table for the given module * and add it to the global list. @@ -1276,6 +1292,7 @@ static int ddebug_add_module(struct _ddebug_info *di) struct ddebug_table *dt; struct _ddebug_class_map *cm; struct _ddebug_class_user *cli; + u64 reserved_ids =3D 0; int i; =20 if (!di->descs.len) @@ -1301,6 +1318,13 @@ static int ddebug_add_module(struct _ddebug_info *di) dd_mark_vector_subrange(i, dt, cm, di, maps); dd_mark_vector_subrange(i, dt, cli, di, users); =20 + for_subvec(i, cm, &dt->info, maps) + if (ddebug_class_range_overlap(cm, &reserved_ids)) + goto cleanup; + for_subvec(i, cli, &dt->info, users) + if (ddebug_class_range_overlap(cli->map, &reserved_ids)) + goto cleanup; + if (dt->info.maps.len) ddebug_apply_class_maps(&dt->info); =20 @@ -1313,6 +1337,11 @@ static int ddebug_add_module(struct _ddebug_info *di) =20 vpr_info("%3u debug prints in module %s\n", di->descs.len, di->mod_name); return 0; +cleanup: + WARN_ONCE("dyndbg multi-classmap conflict in %s\n", di->mod_name); + kfree(dt); + return -EINVAL; + } =20 /* helper for ddebug_dyndbg_(boot|module)_param_cb */ diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 6c4548f635128..1ba4be9a403ae 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -128,6 +128,14 @@ DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_= TYPE_LEVEL_NUM, DYNAMIC_DEBUG_CLASSMAP_PARAM(disjoint_bits, p); DYNAMIC_DEBUG_CLASSMAP_PARAM(level_num, p); =20 +#ifdef FORCE_CLASSID_CONFLICT +/* + * Enable with -Dflag on compile to test overlapping class-id range + * detection. This should warn on modprobes. + */ +DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_CORE"); +#endif + #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ =20 /* --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 DDCE4284B36; Sun, 3 Aug 2025 03:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193547; cv=none; b=T4vjxC5MEDOD6IpZ+CjSlY6qL06d+AO9K59TYdNc4U+2fEpavXF6aY5zMmd2e2AJg2re6+YAWOEmb6kAvu6zL6wzS+gUT5om02r7/Z9aB0Y1yJn1fMqDfsUBg7HFqOexpVU7tvujR6xBY1nFIX46hs/BGR5YpZxewb0awMN4Vps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193547; c=relaxed/simple; bh=vkSC7vPauoDuBmeLWkmXvMWHe3k2JYQ8L3Vcdnp1IpA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RffrJ7XO3TA9lgQeojyZBB/UwsrrPysAAXPf4wr+wfKC4NxV6vxHcyq7UId0QEsFA9AvlsHg8L4GJXyTH/dznwHpeuehmwkFnEu1tTdkhfnjg7RoL4T1ZFfgHn1itReAPxGmUJIO1GXurrh0U8AGwaFNQI+AVUptNHngHtrsIx8= 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=irepHcCf; arc=none smtp.client-ip=209.85.166.180 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="irepHcCf" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3e3d0cba6a7so12045805ab.0; Sat, 02 Aug 2025 20:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193545; x=1754798345; 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=ARFL6N/7u0yBvj65+SeUK5cuQkDEObUSqpQweZqDyQ8=; b=irepHcCfB/qjyyY3axQNOo4FV4AWeNDPWEWGBaMkdYbkH/OxNEyBnwnflsni2e7EOQ BCOmG8FhQx4F9jMwdpUuBrnm3IlmcanKFEW4qS+cynwkER7L0nLlmIDjvcaM9Qz4EFK6 r5Ja1m+B5Lm4ct+ip6nzHuHujiLkJhco2l5q0qr6UqDfr/q1OZqAbh6PHizQsT5+WQLp AmBqUN1aIpghqFgh0yNUJukObXmAfVzgdtUlGyrffSJbhtvC4NzQ8N9av5R0J8T4RaTD uVT1D7CF4+GkzMfQ+Pyp6SObMKYQNN4M9wujwfoKKchdxi1N7kzp5y11T1vn70HGbPIP PWMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193545; x=1754798345; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ARFL6N/7u0yBvj65+SeUK5cuQkDEObUSqpQweZqDyQ8=; b=aMKPO2cuXIkrFyikxce+1ANzwLvBq79q9lD/59QtvlELAbm2Qr6QHZVcPAYLOQxtaT oMCF1MdTCAukNf7+CV65apYfMYlGO4XDaiOxnSC5SMUqAqvxNnBMs5FC1kCUWndM7ee5 4LYLAV31je2BRd4YQ7HB9UKKYYtyEbrFW9vL6MZiouJ1Dt5X46jjTKd/3sK3ciNheCoW rPkyPeEBGiWjHwhyKrPvnz8vE/TIZgTGJ62ChgiRSq0sfJNfvJLjhsNSMAwaa3RkoVgy CNTZAR17OrJCGCiWUtGnhojeXt9yyjRA91hvdYHSDuZ5VskrQT5+laTrOTVVNRzLp9ZT SX0g== X-Forwarded-Encrypted: i=1; AJvYcCVj9FIQWglovaEq2jk5NziWgbfVXC1AfDLLUk7mpJqk2oFM2YFoN8emDuPEVE0r8FWL58kx10G6mPMS0jAV@vger.kernel.org X-Gm-Message-State: AOJu0YxfCaSxIr+NtoyQUHjncLoU27AW6+0lYNKODrFFFOZ3nmb7D+xu 8txc7DNM5hGEpqiQuSYe6DcCDIQM0n7wTHQaXYSCMDHPF28kg4S6PviPgTrON/iq+k4= X-Gm-Gg: ASbGncucC5x6e3qylE6lP2A5LirFkqJXzWMHwkWs62+5rE35tN1vdzP/qSNeoQxqen8 07psRk3CXFwwIS5rdgKLjsRJnG9Jjv6zSIvn7oMCJo4tcyqCY9RnxswPYL+ve1DHudX8RAdqqUk IuHY8lQekQG8Q+bDYLVwWlepk8/TozCzGdDIK8n+kW0TWpQPXTKnJO7T55vCWaZrKqribFmRKTJ ElNHB6MnXGNwZdlZhRr6Tz6UonM7804DhqzkcGrAdBu3WCpzBc3BKGTGxlfLRPhXNlG4kyPgNaz RxV0bqJX44mky3qjpYj5NpsrGyKVkGSrWju42+IoZyrWGe4cuLQr7TLiF73l0sQ5lYitkuvv/Gw 1OH+Zyp5e5QF1uTM5RLV5XrwovMCJxxeixSovS7UfuQ0+bXSKlTPPEWzwWwTAIV3d29cIa8lFNA WG1A== X-Google-Smtp-Source: AGHT+IEBzXwTpz+6kufpgt0kt/EVEpquD0XeO5VyPFcOTsTn6fzv2h6s3BTW+bB/H1codZT3P8zPWQ== X-Received: by 2002:a05:6e02:2208:b0:3e2:9aea:8049 with SMTP id e9e14a558f8ab-3e41615d13emr88848645ab.13.1754193544756; Sat, 02 Aug 2025 20:59:04 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:04 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 21/58] dyndbg: check DYNAMIC_DEBUG_CLASSMAP_DEFINE args at compile-time Date: Sat, 2 Aug 2025 21:57:39 -0600 Message-ID: <20250803035816.603405-22-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Add __DYNAMIC_DEBUG_CLASSMAP_CHECK to implement the following arg-checks at compile-time: 0 <=3D _base < 63 class_names is not empty class_names[0] is a string (class_names.length + _base) < 63 These compile-time checks will prevent several misuses; 4 such examples are added to test_dynamic_debug_submod.ko, and will fail compilation if -DDD_MACRO_ARGCHECK is added to cflags. This wouldn't be a useful CONFIG_ item, since it breaks the build. Signed-off-by: Jim Cromie --- v3- $macro_name =3D~ s/DYNDBG/DYNAMIC_DEBUG/ prev- - split static-asserts to __DYNDBG_CLASSMAP_CHECK - move __DYNDBG_CLASSMAP_CHECK above kdoc for DYNDBG_CLASSMAP_DEFINE silences kernel-doc warnings --- include/linux/dynamic_debug.h | 9 +++++++++ lib/test_dynamic_debug.c | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index c45f5b76763cc..9bcada421e88e 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -110,6 +110,14 @@ struct _ddebug_class_map { enum ddebug_class_map_type map_type; }; =20 +#define __DYNAMIC_DEBUG_CLASSMAP_CHECK(_clnames, _base) \ + static_assert(((_base) >=3D 0 && (_base) < _DPRINTK_CLASS_DFLT), \ + "_base must be in 0..62"); \ + static_assert(ARRAY_SIZE(_clnames) > 0, \ + "classnames array size must be > 0"); \ + static_assert((ARRAY_SIZE(_clnames) + (_base)) < _DPRINTK_CLASS_DFLT, \ + "_base + classnames.length exceeds range") + /** * DYNAMIC_DEBUG_CLASSMAP_DEFINE - define debug classes used by a module. * @_var: name of the classmap, exported for other modules coordinated u= se. @@ -123,6 +131,7 @@ struct _ddebug_class_map { */ #define DYNAMIC_DEBUG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + __DYNAMIC_DEBUG_CLASSMAP_CHECK(_var##_classnames, (_base)); \ extern struct _ddebug_class_map _var; \ struct _ddebug_class_map __aligned(8) __used \ __section("__dyndbg_class_maps") _var =3D { \ diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 1ba4be9a403ae..e83b34b6d6b95 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -146,8 +146,19 @@ DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_C= ORE + 1, "D3_CORE"); DYNAMIC_DEBUG_CLASSMAP_USE(map_disjoint_bits); DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); =20 +#if defined(DD_MACRO_ARGCHECK) +/* + * Exersize compile-time arg-checks in DYNDBG_CLASSMAP_DEFINE. + * These will break compilation. + */ +DYNDBG_CLASSMAP_DEFINE(fail_base_neg, 0, -1, "NEGATIVE_BASE_ARG"); +DYNDBG_CLASSMAP_DEFINE(fail_base_big, 0, 100, "TOOBIG_BASE_ARG"); +DYNDBG_CLASSMAP_DEFINE(fail_str_type, 0, 0, 1 /* not a string */); +DYNDBG_CLASSMAP_DEFINE(fail_emptyclass, 0, 0 /* ,empty */); #endif =20 +#endif /* TEST_DYNAMIC_DEBUG_SUBMOD */ + /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") =20 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 9A31128505A; Sun, 3 Aug 2025 03:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193549; cv=none; b=kNwwi8zP5osWCQu+6GV/WgXdTCxZGFAWeQM9TTmxosP0DMjlmNszI2TQWTFs6u1kShT7gzdJtMS3PhEPNk+ms7ItU8062wxBmWnuwwHXp3xa+c6ICG+39nvHbD1XVy3SN8VQW/HsT+W75bg/0UfkYSCMSi3h65VpAvOc3poeTNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193549; c=relaxed/simple; bh=UARPWlrU2aN9MPdomRDtK8jRaN4i8p4AaHr1kdIFDkk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YfILpPvjJKy12pUvka1wX/CHqJLPmU2GA/31bRfe/ya6yjqv6pecWsTQYJzfNxU/iHJXYEgMkT+FgZ8LN+aeY0l1AY6aGTCfRDw3Z0r/WpY1+WmYGGC7nfYMSOQErEmiY1T8MiKsuPWNcjQ5PF24bz8dKyYmV+Nx6g2XHWaTaOE= 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=N8rolDlK; arc=none smtp.client-ip=209.85.166.45 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="N8rolDlK" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-88109d54abdso81454139f.1; Sat, 02 Aug 2025 20:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193546; x=1754798346; 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=81bWgn76neJvQmIetnUY9QrXJo1xKmDBqiRUkV9XO/8=; b=N8rolDlKu3q6M8EZtoAQrDkQvZqC1eCyrcnFFrQBgJ/H9zVCwyH/zjMrqIQjJttBfY JYKrRh1M9GEaZK/FgC02DgnkC8gh/D1jfult5d/7dBgkICbFagEyE9ImfmEiGtPM6sVk Q02qCQw9x4sDWxbrWTjbcALiq64fJQjmcs+wdYCm/P0rUhveEQhvcu9vKaxjoBz/2xZC KEwC3Zk/k7vniM7xzJvFFxSs0KsNeD5jmJ9bg3fs9E69Sd9T2Nn9d4v/+gDDOYr2hcyi S3HFrs01fp7niLi9ijLXoWYcatuFijd/Wb9gI/c0PLF326K3q5osiK3JIMOV0NUHLA+u 20iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193546; x=1754798346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=81bWgn76neJvQmIetnUY9QrXJo1xKmDBqiRUkV9XO/8=; b=ov5RmKQH5wfa3i+7vGSDA3/JoASdJ6HEM9ntnhgy5/sR0P0KMI+zq3z1EqoDnwqK3D bt7TtsC+E2l8ZAiA41aWu9I4XKWoU3KlolvXVi44F5aa/g75bDrAWJ33iyx1S7yvjnXQ J+fzWi3WtHHNKvfQkZPlPIL0zDEwvFb/AFyJ74ryUQ51cy3QIkWMcJLFr8EeLOiP0dDy cQo6qL791PPjUq8SJw5jsJnWcq8cyKS9Ptu0s8lWT4SeiGIvL85Jak67EkNWYSi3tcCH 1AWJeDuc6j5X9KuV8VkKObaoXRfaPX9kn51BLQm91qJ07DtxKlE2D6TNlXz4ykxgIfYC V1/w== X-Forwarded-Encrypted: i=1; AJvYcCVuRamuE1okZhqr/VRWpUua+ehAYjgd9LNEEGOc3LZNlFFohPr9enfz62lDVva8YFbes8GygnjDDeqA+0Q2@vger.kernel.org X-Gm-Message-State: AOJu0YwLQS/4h2lLJAcgtMxUNVeYHLG1sAfzs53y6dlUaQWDTECaAOjw iEBgP4M4f2q1hzp5D/zZU740V6BtoNg/03nWsd1uvp97uaF37H45zG4UbfAMMSzHRsY= X-Gm-Gg: ASbGncv4QfdwtknTtrGHFo5VZ3QkiM1304cFofmj1HIiBQ9oFFWxHMuDbPn3T3sUUEq +V1XZdasoWCIIDJXM7iNW5M2IxuweS8Qaq6PsJc4vJ7CUW2/vFd4za3HFt5tmslAfmQRE/+REnl tYpeiubT+2TcqonOJ4XVfV42uwenZBjgHhw9HQ78lo7mL+kD1tYHmah3SFtzV94pqh1yZzzdUkL pquW08YMDoB5ytsdOt0ahHJrquj3HBPiyT+fvCGewm7NbAwUkIaPO0WBluBmHOKwI5oeWPV+gpe OUT90ITyLrDFt28+AToOEiuiICNkMOCqfQrsET94s3JflS+Tocc275FV0AsbwZFzC0FV///pw1X YVz8haa/Apw9EOvd0jCiUCJDS5fGgFu505iitA9qHDCBsoqCVxR0zaN1031hySBBKdKI24A1UWo ZUOQ== X-Google-Smtp-Source: AGHT+IFoAVWLiheF2E67Np6scTtkKmbEoqDI0XN5GZeGYOfVbOkwBUJIixlaV+eykRMBCUEIeZ8d9A== X-Received: by 2002:a05:6602:487:b0:87c:5a38:45e9 with SMTP id ca18e2360f4ac-8816832a528mr807300339f.3.1754193546523; Sat, 02 Aug 2025 20:59:06 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:05 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 22/58] dyndbg-test: change do_prints testpoint to accept a loopct Date: Sat, 2 Aug 2025 21:57:40 -0600 Message-ID: <20250803035816.603405-23-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" echo 1000 > /sys/module/test_dynamic_debug/parameters/do_prints This allows its use as a scriptable load generator, to generate dynamic-prefix-emits for flag combinations vs undecorated messages. This will make it easy to assess the cost of the prefixing. Reading the ./do_prints node also prints messages (once) to the-log. NB: the count is clamped to 10000, chosen to be notice able, but not annoying, and not enough to accidentally flood the logs. Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index e83b34b6d6b95..8713537363713 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -29,18 +29,30 @@ =20 #include =20 -/* re-gen output by reading or writing sysfs node: do_prints */ - -static void do_prints(void); /* device under test */ +/* re-trigger debug output by reading or writing sysfs node: do_prints */ +#define PRINT_CLAMP 10000 +static void do_prints(unsigned int); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_para= m *kp) { - do_prints(); + int rc; + unsigned int ct; + + rc =3D kstrtouint(instr, 0, &ct); + if (rc) { + pr_err("expecting numeric input, using 1 instead\n"); + ct =3D 1; + } + if (ct > PRINT_CLAMP) { + ct =3D PRINT_CLAMP; + pr_info("clamping print-count to %d\n", ct); + } + do_prints(ct); return 0; } static int param_get_do_prints(char *buffer, const struct kernel_param *kp) { - do_prints(); - return scnprintf(buffer, PAGE_SIZE, "did do_prints\n"); + do_prints(1); + return scnprintf(buffer, PAGE_SIZE, "did 1 do_prints\n"); } static const struct kernel_param_ops param_ops_do_prints =3D { .set =3D param_set_do_prints, @@ -191,17 +203,20 @@ static void do_levels(void) prdbg(V7); } =20 -static void do_prints(void) +static void do_prints(unsigned int ct) { - pr_debug("do_prints:\n"); - do_cats(); - do_levels(); + /* maybe clamp this */ + pr_debug("do-prints %d times:\n", ct); + for (; ct; ct--) { + do_cats(); + do_levels(); + } } =20 static int __init test_dynamic_debug_init(void) { pr_debug("init start\n"); - do_prints(); + do_prints(1); pr_debug("init done\n"); return 0; } --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 78DCC27E7E3; Sun, 3 Aug 2025 03:59:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193551; cv=none; b=J22U7Kxe8/nZ0Cp41n4etm/87n5/673lbfTsvyl6JG9ULGSOZviJOR4Wf0oJDjwoRFzjI/BagbDBIvbdHBkOh9lQJBxHLYjdO5Oom3m9xCfcf/e15lFY6ioNPxCs2QOX+MIuc6ZQHS/u8Mw91Mm+nNuFO/Rs6Oa/lPLSlLjLCd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193551; c=relaxed/simple; bh=IniLYgUSTHGFusUkLHKW9gzMSDClABs1e5KnGmsM/xA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uzz6Pj9/Sl/hhfH+UbnMJOrt4I2gC4HouLSGDzI+KCb/qSlcXOnb+4oFyGaDuCAoRkZBGK43GDq3HDHg3KY+y24VKU/0QEwnBqwEXTW1ZSdDP2QTE9+DTIm1ZhGsfDyJugQI7xMfMjkX21+DRE9dtqNUL1TdFvcoYa0XRZd3Bis= 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=lljzSblB; arc=none smtp.client-ip=209.85.166.180 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="lljzSblB" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3e3ee9c7815so14652365ab.3; Sat, 02 Aug 2025 20:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193548; x=1754798348; 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=iM5cl3dsaaefjUDV3g7+lN+I/LIpHzIWjRiuGDJAMTw=; b=lljzSblBEbnzP4kL3A3cvWTmkGD5Z21LvQTC7TMrbqB2PH5FGnaUpBMNy91QNX47Gh 39R+ovLkZnL9PbQPOe3AKDs15ndn6BM0WBLMvG7/EstQXKDnSaXyYeYeBSGtAx7kvTKw wj8Qu6kLg+zyIrxGDhSxCvJ0BGeQOpcbV3XRL5UDw2r/4orccUwsojP5exJdnH14FU2Y 21rWG2iq4JZ+N08WZj92Gdybo69FKs6acDiphHJqIH81osFQFm4wIusX1LJKkxI99QhV V3Otya2p7jWPc8+idfaZMGMT1UyJ+hzwPra50gSrIE79G319SdRKF0N5yopGq3U5BddB iyeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193548; x=1754798348; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iM5cl3dsaaefjUDV3g7+lN+I/LIpHzIWjRiuGDJAMTw=; b=in+zRvsgU6PaAVf8tDgy+rOeUjFl5jNbOVOLY+NgPefqVPQQ/9VwwlQM3SGBp3Vb6c qH7T3cRZvZ+UcSvN07eo5LQuvZrZxoAA7kj8ZHLJ+Ab+1HhnH5+G08rRYoyibDksCtCf YCcABcAzuX4JKYYS8BcKPSO3nK2pRbm+DOLMYuqjaATNq5ADNpw33LNtBWC3zP0aCNxu qlW/waAnx6SIb+76zWWPBJprh1qqCZXsbL+5yDSjn6fupkSOtUxfJzEcfvXy+OrTRtAE HXPc0DA9MKopEGMWY4KJb98YDG6F8nLhs50lXh0UXVn96LK5+OUBhuN1YrZBrTpkKfKk XJbw== X-Forwarded-Encrypted: i=1; AJvYcCUdQic+i3uHkNv+JDj+30FXk6WoKe0fiyuKap2ABqNNsYVEm5JgcOTy1CVY5OTfjnsmZ/oozJKUrau0VkAS@vger.kernel.org, AJvYcCV/xF1fIs4yESHN7lHtY3vNx5lf516bsPJeNSO3ZtJSbqTIuOJ6mhzcs9me3cED7TKzb96lAVDSC9v1@vger.kernel.org X-Gm-Message-State: AOJu0Yxp24rrehZEWc1/TcTzqAwD1nlXRjGgadCcRO+3Re8etNOt90t6 Akjd/4Mb48fzkpXLwah7ZT1KaA/9srRnAZ+BPPE1HPn89IlPhuzyYrTGx4XCmkWeWgM= X-Gm-Gg: ASbGnctcUuwtK+w0623BWRluzitV9BaCu8EaVTs4uTUc49pCC1/Vu2MgyrZkZXZzCb1 xtkBaTqMvflwPjmRQDK25qJGcNj7l6tM5ycnoOy2KDHzX9SMiIAf5j94o6a6ibYdusMNW7gi3l3 tgLYlx7tNrdCCEqxtX5TESvsdJs5G9IleuZu5A6kxccFVwHKafsqEMlM/h07V7l8DyswjaVe0b5 v1HGZLmnBUDy37t/jiGKWQ8AkAJbunX5zbEb6j9riYMR19BCpY6tyFvX/Zu5dglowRF9AmQonMJ L3XrieOGpmN8mn1yEC37uOmkT5ztCluofwhFSI5yg5yCr8AmT6cyzFDmgqcrDTvHSMUa0lw9pKB m5LeWlDubJGHZdbBOVJeSJkwVL/fIZhrpdpXigc7Mm6FpbkWTD09Kz+dCgAseg1vg18BlH9gyGA Waww== X-Google-Smtp-Source: AGHT+IH/unqedwsZLzea1UrYJ2ImjMxVTW1iBpTRcCz5raPVKq3p/sR643AQSxczt1LlvBBkdTbHNg== X-Received: by 2002:a05:6e02:2384:b0:3e3:f67a:7dfb with SMTP id e9e14a558f8ab-3e4160fb74fmr104622345ab.4.1754193548289; Sat, 02 Aug 2025 20:59:08 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:07 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com, linux-doc@vger.kernel.org Subject: [PATCH v4 23/58] dyndbg-API: promote DYNAMIC_DEBUG_CLASSMAP_PARAM to API Date: Sat, 2 Aug 2025 21:57:41 -0600 Message-ID: <20250803035816.603405-24-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" move the DYNAMIC_DEBUG_CLASSMAP_PARAM macro from test-dynamic-debug.c into the header, and refine it, by distinguishing the 2 use cases: 1.DYNAMIC_DEBUG_CLASSMAP_PARAM_REF for DRM, to pass in extern __drm_debug by name. dyndbg keeps bits in it, so drm can still use it as before 2.DYNAMIC_DEBUG_CLASSMAP_PARAM new user (test_dynamic_debug) doesn't need to share state, decls a static long unsigned int to store the bitvec. __DYNAMIC_DEBUG_CLASSMAP_PARAM bottom layer - allocate,init a ddebug-class-param, module-param-cb. Modify ddebug_sync_classbits() argtype deref inside the fn, to give access to all kp members. Also clean up and improve comments in test-code, and add MODULE_DESCRIPTIONs. cc: linux-doc@vger.kernel.org Signed-off-by: Jim Cromie --- -v9 - fixup drm-print.h add PARAM_REF forwarding macros with DYNAMIC_DEBUG_CLASSMAP_PARAM_REF in the API, add DRM_ variant --- include/linux/dynamic_debug.h | 38 +++++++++++++++++++++ lib/dynamic_debug.c | 60 ++++++++++++++++++++++----------- lib/test_dynamic_debug.c | 47 ++++++++++---------------- lib/test_dynamic_debug_submod.c | 9 ++++- 4 files changed, 104 insertions(+), 50 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 9bcada421e88e..2d959f1f8cd30 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -223,6 +223,44 @@ struct _ddebug_class_param { const struct _ddebug_class_map *map; }; =20 +/** + * DYNAMIC_DEBUG_CLASSMAP_PARAM - control a ddebug-classmap from a sys-par= am + * @_name: sysfs node name + * @_var: name of the classmap var defining the controlled classes/bits + * @_flags: flags to be toggled, typically just 'p' + * + * Creates a sysfs-param to control the classes defined by the + * exported classmap, with bits 0..N-1 mapped to the classes named. + * This version keeps class-state in a private long int. + */ +#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _var, _flags) \ + static unsigned long _name##_bvec; \ + __DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _name##_bvec, _var, _flags) + +/** + * DYNAMIC_DEBUG_CLASSMAP_PARAM_REF - wrap a classmap with a controlling s= ys-param + * @_name: sysfs node name + * @_bits: name of the module's unsigned long bit-vector, ex: __drm_debug + * @_var: name of the (exported) classmap var defining the classes/bits + * @_flags: flags to be toggled, typically just 'p' + * + * Creates a sysfs-param to control the classes defined by the + * exported clasmap, with bits 0..N-1 mapped to the classes named. + * This version keeps class-state in user @_bits. This lets drm check + * __drm_debug elsewhere too. + */ +#define DYNAMIC_DEBUG_CLASSMAP_PARAM_REF(_name, _bits, _var, _flags) \ + __DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _bits, _var, _flags) + +#define __DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _bits, _var, _flags) \ + static struct _ddebug_class_param _name##_##_flags =3D { \ + .bits =3D &(_bits), \ + .flags =3D #_flags, \ + .map =3D &(_var), \ + }; \ + module_param_cb(_name, ¶m_ops_dyndbg_classes, \ + &_name##_##_flags, 0600) + /* * pr_debug() and friends are globally enabled or modules have selectively * enabled them. diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d6687623c5a96..f7c81a9140bd2 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -666,6 +666,30 @@ static int ddebug_apply_class_bitmap(const struct _dde= bug_class_param *dcp, =20 #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) =20 +static void ddebug_class_param_clamp_input(unsigned long *inrep, const str= uct kernel_param *kp) +{ + const struct _ddebug_class_param *dcp =3D kp->arg; + const struct _ddebug_class_map *map =3D dcp->map; + + switch (map->map_type) { + case DD_CLASS_TYPE_DISJOINT_BITS: + /* expect bits. mask and warn if too many */ + if (*inrep & ~CLASSMAP_BITMASK(map->length)) { + pr_warn("%s: input: 0x%lx exceeds mask: 0x%lx, masking\n", + KP_NAME(kp), *inrep, CLASSMAP_BITMASK(map->length)); + *inrep &=3D CLASSMAP_BITMASK(map->length); + } + break; + case DD_CLASS_TYPE_LEVEL_NUM: + /* input is bitpos, of highest verbosity to be enabled */ + if (*inrep > map->length) { + pr_warn("%s: level:%ld exceeds max:%d, clamping\n", + KP_NAME(kp), *inrep, map->length); + *inrep =3D map->length; + } + break; + } +} static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *mod_name) @@ -684,26 +708,15 @@ static int param_set_dyndbg_module_classes(const char= *instr, pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } + ddebug_class_param_clamp_input(&inrep, kp); =20 switch (map->map_type) { case DD_CLASS_TYPE_DISJOINT_BITS: - /* expect bits. mask and warn if too many */ - if (inrep & ~CLASSMAP_BITMASK(map->length)) { - pr_warn("%s: input: 0x%lx exceeds mask: 0x%lx, masking\n", - KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); - inrep &=3D CLASSMAP_BITMASK(map->length); - } v2pr_info("bits:0x%lx > %s.%s\n", inrep, mod_name ?: "*", KP_NAME(kp)); totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, mod_name); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: - /* input is bitpos, of highest verbosity to be enabled */ - if (inrep > map->length) { - pr_warn("%s: level:%ld exceeds max:%d, clamping\n", - KP_NAME(kp), inrep, map->length); - inrep =3D map->length; - } old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); @@ -1171,15 +1184,24 @@ static const struct proc_ops proc_fops =3D { static void ddebug_sync_classbits(const struct kernel_param *kp, const cha= r *modname) { const struct _ddebug_class_param *dcp =3D kp->arg; + unsigned long new_bits; =20 - /* clamp initial bitvec, mask off hi-bits */ - if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { - *dcp->bits &=3D CLASSMAP_BITMASK(dcp->map->length); - v2pr_info("preset classbits: %lx\n", *dcp->bits); + ddebug_class_param_clamp_input(dcp->bits, kp); + + switch (dcp->map->map_type) { + case DD_CLASS_TYPE_DISJOINT_BITS: + v2pr_info(" %s: classbits: 0x%lx\n", KP_NAME(kp), *dcp->bits); + ddebug_apply_class_bitmap(dcp, dcp->bits, 0UL, modname); + break; + case DD_CLASS_TYPE_LEVEL_NUM: + new_bits =3D CLASSMAP_BITMASK(*dcp->lvl); + v2pr_info(" %s: lvl:%ld bits:0x%lx\n", KP_NAME(kp), *dcp->lvl, new_bits= ); + ddebug_apply_class_bitmap(dcp, &new_bits, 0UL, modname); + break; + default: + pr_err("bad map type %d\n", dcp->map->map_type); + return; } - /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-= param */ - ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); - ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); } =20 static void ddebug_match_apply_kparam(const struct kernel_param *kp, diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 8713537363713..d7975b635f17e 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Kernel module for testing dynamic_debug + * Kernel module to test/demonstrate dynamic_debug features, + * particularly classmaps and their support for subsystems like DRM. * * Authors: * Jim Cromie @@ -62,24 +63,6 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0= 600); =20 #define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << (base)) =20 -/* sysfs param wrapper, proto-API */ -#define DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, _init) \ - static unsigned long bits_##_model =3D _init; \ - static struct _ddebug_class_param _flags##_##_model =3D { \ - .bits =3D &bits_##_model, \ - .flags =3D #_flags, \ - .map =3D &map_##_model, \ - }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ - &_flags##_##_model, 0600) -#ifdef DEBUG -#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_model, _flags) \ - DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, ~0) -#else -#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_model, _flags) \ - DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, 0) -#endif - /* * Demonstrate/test DISJOINT & LEVEL typed classmaps with a sys-param. * @@ -110,12 +93,15 @@ enum cat_disjoint_bits { /* numeric verbosity, V2 > V1 related. V0 is > D2_DRMRES */ enum cat_level_num { V0 =3D 16, V1, V2, V3, V4, V5, V6, V7 }; =20 -/* recapitulate DRM's multi-classmap setup */ +/* + * use/demonstrate multi-module-group classmaps, as for DRM + */ #if !defined(TEST_DYNAMIC_DEBUG_SUBMOD) /* - * In single user, or parent / coordinator (drm.ko) modules, define - * classmaps on the client enums above, and then declares the PARAMS - * ref'g the classmaps. Each is exported. + * For module-groups of 1+, define classmaps with names (stringified + * enum-symbols) copied from above. 1-to-1 mapping is recommended. + * The classmap is exported, so that other modules in the group can + * link to it and control their prdbgs. */ DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BI= TS, D2_CORE, @@ -134,11 +120,13 @@ DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_level_num, DD_CLASS= _TYPE_LEVEL_NUM, V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); =20 /* - * now add the sysfs-params + * for use-cases that want it, provide a sysfs-param to set the + * classes in the classmap. It is at this interface where the + * "v3>v2" property is applied to DD_CLASS_TYPE_LEVEL_NUM inputs. */ =20 -DYNAMIC_DEBUG_CLASSMAP_PARAM(disjoint_bits, p); -DYNAMIC_DEBUG_CLASSMAP_PARAM(level_num, p); +DYNAMIC_DEBUG_CLASSMAP_PARAM(p_disjoint_bits, map_disjoint_bits, p); +DYNAMIC_DEBUG_CLASSMAP_PARAM(p_level_num, map_level_num, p); =20 #ifdef FORCE_CLASSID_CONFLICT /* @@ -149,12 +137,10 @@ DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_= CORE + 1, "D3_CORE"); #endif =20 #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ - /* - * in submod/drm-drivers, use the classmaps defined in top/parent - * module above. + * the +1 members of a multi-module group refer to the classmap + * DEFINEd (and exported) above. */ - DYNAMIC_DEBUG_CLASSMAP_USE(map_disjoint_bits); DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); =20 @@ -229,6 +215,7 @@ static void __exit test_dynamic_debug_exit(void) module_init(test_dynamic_debug_init); module_exit(test_dynamic_debug_exit); =20 +MODULE_DESCRIPTION("test/demonstrate dynamic-debug features"); MODULE_AUTHOR("Jim Cromie "); MODULE_DESCRIPTION("Kernel module for testing dynamic_debug"); MODULE_LICENSE("GPL"); diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submo= d.c index 672aabf40160d..3adf3925fb867 100644 --- a/lib/test_dynamic_debug_submod.c +++ b/lib/test_dynamic_debug_submod.c @@ -1,6 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Kernel module for testing dynamic_debug + * Kernel module to test/demonstrate dynamic_debug features, + * particularly classmaps and their support for subsystems, like DRM, + * which defines its drm_debug classmap in drm module, and uses it in + * helpers & drivers. * * Authors: * Jim Cromie @@ -12,3 +15,7 @@ */ #define TEST_DYNAMIC_DEBUG_SUBMOD #include "test_dynamic_debug.c" + +MODULE_DESCRIPTION("test/demonstrate dynamic-debug subsystem support"); +MODULE_AUTHOR("Jim Cromie "); +MODULE_LICENSE("GPL"); --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 BA1EC285C86; Sun, 3 Aug 2025 03:59:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193555; cv=none; b=WngIHEMkIbqBlkVsIIjyByDKX+6ZolukpNRaJuZtUmbRGAz6evMLmTkRxTH5uxHFuClE877y9Z2bZ2pT4neBa/7FC+oXKkdCq2Qem3B2+H2HIbDU1k/7GEmVrzbppD9V5rt0RgXuhO5pye+VHxX3QV5rvMDrzD2K9KpnuNtsPJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193555; c=relaxed/simple; bh=hesI4dm3s4j1+X5aTp+etFPGxZP+aiHovIljjEOVtBQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FJiiTn67xojDRKdr4eA8Vgzka3YMJhLiJS2SVahrIJvUoRa8878zEumytcjQzV22JqX+zfHnXPcOa88xNuXl2104aSqD7u2pGwHWzUrQ5fW87BHiU3tqwpVZSPsiyYN09tbFyUz2amXxy4DpJ4in7yQf4T4aUZoUAf4g1E7p0ec= 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=K1LOiB+h; arc=none smtp.client-ip=209.85.166.181 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="K1LOiB+h" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3e3e4c564ffso20213875ab.2; Sat, 02 Aug 2025 20:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193550; x=1754798350; 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=Zh5DtSmdlg1q4BLyqHiCWDwX2HlPvGGP8eXC9e2gYuw=; b=K1LOiB+hjStWa0j9zc6yM420jw8S1RN4G/93GuNVDHKe25L78JSC/iuUKVbUZlnBlO 6u3mhsdHrZdXkjT8LahI53lpKa/JXHkRvYNH2wJbzWH7Oiqj72NJ9IvhWYbTcLDR8aZm 16LkhKCwxMS39oj8JDSYiZDp7alzCKLe46k25nqlKczEbT+795Dmx9DiIxQDeMVJaofz K2TkYafXwfIIMsYFTGZM7tYWZYXcA9D1ZFRH51Vv4ImbcO2VELrrbtJB7z3kV3BeXVA+ E4CHzWWmKzx13HXEWZpF5DXJCTvufN7ZjYjiPfYMfrwWvYEjjm62oYQBN2phdMUKWEKi 8Ntw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193550; x=1754798350; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zh5DtSmdlg1q4BLyqHiCWDwX2HlPvGGP8eXC9e2gYuw=; b=B2pkTardnLJpkOi9j1MPVoUE+msA2AF3NSlPBt0hJWDhLTWLb+Sq9jFRIy9K4dpHJN VLOkTqzNq7krNkU5GQt4EYawtT+UlRDE0Bvxf3v8gGwlgo47kdeF1Ekbp6vLlWevbCpQ hccT81w6Ps/b2k5JaIRtKonbQu8Vsn93kdKALJSf5hBc01PGAw6UOit73e8PwlAQYAjI 9y+DWExpR8h8FVlM49Xo3rj8k1Phl1MLKjRENE5T43hY2gFsTQ5/586c0KipcYI0gcF2 7yxWmqoE6DKqo3edXH3RIvuEYEPe6gHFPO1UTcJiJ4Rei4jWxloj/GGSvpD6BcjQcrj6 FFjQ== X-Forwarded-Encrypted: i=1; AJvYcCWpLBZGgtxMegueFD2XcBxttsRisMbdxvQXDIsW+2oYD/Pr3DzsgleNrHWHXFFAkgZe9ZWK0SDp8rLKbvzN@vger.kernel.org X-Gm-Message-State: AOJu0Yzr7pc8h83Gy713XQdta1Zf7jkWnDtRPh3HNpIyr9GBWLawPk63 VlrPlHMJ7f6wjHXsPC3JkjDXIGIgEbIJ/9ruVyA7mNKRejo1qbAcKMibsgeFBKY9lbg= X-Gm-Gg: ASbGncsdHjgDeTOnrsj7FhBuUSEh0QAtzS0fuHAmfe+HyBSR03pPgd2RfLwuM9DNWXA 1KJ2GDa4E/R6EIVfAUNR9/iazCFZ5s99OFk6w2hG3Tddy2oRsEp9wGIq5ICTzFuO40tP2lE5SMG i+mwUDGEW77K7a3oUC2w5WhI6qEhn52DmSS+xUvcavsOJtgnMGuAXtw0zCkssZ6lVotYTSj6Z7Y wbm0aX3gAow49uVrUD9x8+4dPMhFXs4WEXi1hOHT06otVBjDE/bYErWmBafmav8G6zDsa716l0K 6LhB1jqKc3folE8PTPszTGeTA3hU+wLW3LasLINhA5ljwXSvaKZxN1OYW7u4H3c3GSmuENEMUIJ CC7zbjp56HvX+6BzhBAxOB3UNTvgOsFKmRmcG3rfStJnHsQ8a9CTJ1Kn91oU0X77ds3Cc8OUdqL 1dmQ== X-Google-Smtp-Source: AGHT+IGzml5f7C+H5Kt0Jq64zG4cgAy45VHUQatQ7Tr04zry1DUjTuhWBZAgrxnx7adjKMLqc/eW8Q== X-Received: by 2002:a05:6e02:1f06:b0:3e2:9e9d:a978 with SMTP id e9e14a558f8ab-3e4161cef34mr112108265ab.21.1754193549778; Sat, 02 Aug 2025 20:59:09 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:09 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 24/58] dyndbg: treat comma as a token separator Date: Sat, 2 Aug 2025 21:57:42 -0600 Message-ID: <20250803035816.603405-25-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Treat comma as a token terminator, just like a space. This allows a user to avoid quoting hassles when spaces are otherwise needed: :#> modprobe drm dyndbg=3Dclass,DRM_UT_CORE,+p\;class,DRM_UT_KMS,+p or as a boot arg: drm.dyndbg=3Dclass,DRM_UT_CORE,+p # todo: support multi-query here Given the many ways a boot-line +args can be assembled and then passed in/down/around shell based tools, this may allow side-stepping all sorts of quoting hassles thru those layers. existing query format: modprobe test_dynamic_debug dyndbg=3D"class D2_CORE +p" new format: modprobe test_dynamic_debug dyndbg=3Dclass,D2_CORE,+p ALSO selftests-dyndbg: add comma_terminator_tests New fn validates parsing and effect of queries using combinations of commas and spaces to delimit the tokens. It manipulates pr-debugs in builtin module/params, so might have deps I havent foreseen on odd configurations. Signed-off-by: Jim Cromie Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik --- - skip comma tests if no builtins -v3 squash in tests and doc --- .../admin-guide/dynamic-debug-howto.rst | 9 +++++--- lib/dynamic_debug.c | 17 +++++++++++---- .../dynamic_debug/dyndbg_selftest.sh | 21 ++++++++++++++++++- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 63a511f2337bc..e2dbb5d9b3144 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -78,11 +78,12 @@ Command Language Reference =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 At the basic lexical level, a command is a sequence of words separated -by spaces or tabs. So these are all equivalent:: +by spaces, tabs, or commas. So these are all equivalent:: =20 :#> ddcmd file svcsock.c line 1603 +p :#> ddcmd "file svcsock.c line 1603 +p" :#> 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``:: @@ -167,9 +168,11 @@ module The given string is compared against the module name of each callsite. The module name is the string as seen in ``lsmod``, i.e. without the directory or the ``.ko`` - suffix and with ``-`` changed to ``_``. Examples:: + suffix and with ``-`` changed to ``_``. =20 - module sunrpc + Examples:: + + module,sunrpc # with ',' as token separator module nfsd module drm* # both drm, drm_kms_helper =20 diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index f7c81a9140bd2..17651a8267567 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -299,6 +299,14 @@ static int ddebug_change(const struct ddebug_query *qu= ery, struct flag_settings return nfound; } =20 +static char *skip_spaces_and_commas(const char *str) +{ + str =3D skip_spaces(str); + while (*str =3D=3D ',') + str =3D skip_spaces(++str); + return (char *)str; +} + /* * Split the buffer `buf' into space-separated words. * Handles simple " and ' quoting, i.e. without nested, @@ -312,8 +320,8 @@ static int ddebug_tokenize(char *buf, char *words[], in= t maxwords) while (*buf) { char *end; =20 - /* Skip leading whitespace */ - buf =3D skip_spaces(buf); + /* Skip leading whitespace and comma */ + buf =3D skip_spaces_and_commas(buf); if (!*buf) break; /* oh, it was trailing whitespace */ if (*buf =3D=3D '#') @@ -329,7 +337,7 @@ static int ddebug_tokenize(char *buf, char *words[], in= t maxwords) return -EINVAL; /* unclosed quote */ } } else { - for (end =3D buf; *end && !isspace(*end); end++) + for (end =3D buf; *end && !isspace(*end) && *end !=3D ','; end++) ; if (end =3D=3D buf) { pr_err("parse err after word:%d=3D%s\n", nwords, @@ -601,7 +609,8 @@ static int ddebug_exec_queries(char *query, const char = *modname) if (split) *split++ =3D '\0'; =20 - query =3D skip_spaces(query); + query =3D skip_spaces_and_commas(query); + if (!query || !*query || *query =3D=3D '#') continue; =20 diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 465fad3f392cc..c7bf521f36ee3 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -216,7 +216,7 @@ function check_err_msg() { function basic_tests { echo -e "${GREEN}# BASIC_TESTS ${NC}" if [ $LACK_DD_BUILTIN -eq 1 ]; then - echo "SKIP" + echo "SKIP - test requires params, which is a builtin module" return fi ddcmd =3D_ # zero everything @@ -238,8 +238,27 @@ EOF ddcmd =3D_ } =20 +function comma_terminator_tests { + echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP - test requires params, which is a builtin module" + return + fi + # try combos of spaces & commas + check_match_ct '\[params\]' 4 -r + ddcmd module,params,=3D_ # commas as spaces + ddcmd module,params,+mpf # turn on module's pr-debugs + check_match_ct =3Dpmf 4 + ddcmd ,module ,, , params, -p + check_match_ct =3Dmf 4 + ddcmd " , module ,,, , params, -m" # + check_match_ct =3Df 4 + ddcmd =3D_ +} + tests_list=3D( basic_tests + comma_terminator_tests ) =20 # Run tests --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 A7D5127EFFA; Sun, 3 Aug 2025 03:59:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193554; cv=none; b=Q1QGYhc0pH61RqlX53XH+bMjoh8vzJN0bMtggvEVJtoIT4+ZfIUtDZjK3Sa3AI1xo7K5lLMuQEfhYOhXpcj+ARMUABUm6yWRNtArtvlfEPYa4mU4K5cuB91bS2ptsRzfgFTPFlsYVg6v3cCNnwOqwozwIkqxmQzU+4pGKf/kRrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193554; c=relaxed/simple; bh=jCChffBvv0YOPbk2zUSOBbOkNITbVXURkad9Ur9lJEs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PaASLg8uOypXYVho2dXot4eX2Ng2IbMh2+7OcV3d2bgfMOwcPxogd25GANhhx87x4weFhbY0jQ1aA18sifNXqpLSrD3U6zXylu2kebKFIIV6zHH/3pS5Us09Hx5Q+fl+Zl8Rd27zZTZsDNeJgyANZjw7F+3iF68XFjkXqQnTCPM= 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=duCAgV0X; arc=none smtp.client-ip=209.85.166.41 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="duCAgV0X" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-879c734f0e2so60018039f.0; Sat, 02 Aug 2025 20:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193551; x=1754798351; 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=hIsLV3TB8k5ucu5pn8ENFVJkOV1b1Zc619vHbx6KE3Y=; b=duCAgV0XZK+syI4p8Xpl6y30MlM3dqvU49MqkLQPSv/N3gzSLQJtiaQUHzxA9807GH u7KbXPuqtqJNkm+I/l8hRE/MhNH4pIxZ8Yv5E2UTePH4thZRYg3rlJqFqXVDov7cOZPs 6mEhtFy8ctgCrJN/Rc9s+IHjmWYwHTegTUKxzqiVvs7xfefh/PdprYxgD97EOLQxIIwy uvRcEWHWZBG+bS05mZU57D6rWiC90ulTcluF6UStS4Tyb3SCr2cZ000yGQPl/TMFeGAi T0S6Ma02TKs/ledTI5HPVad5JgasUBb6T6K7rvcHnHzpLxkGVEkfeoxQVYPokFVVIUmS Oxgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193551; x=1754798351; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hIsLV3TB8k5ucu5pn8ENFVJkOV1b1Zc619vHbx6KE3Y=; b=k3ELZeeGTytcnex4hVYvttk38AWD17mE2lHBn0CzVDe1RNQ8vd/DNJAkV/ejsmCsb2 mznXnnJUual1c89Cu9fjn+HhnA4uQ42A48y8yGOsqVuA00D6yAQCFBIhf5E+SsL+cECC 2fDrzu93yZsyR1+xTEpcLg8rZJXnhPpgL8g//k0uO7wBct0lFKAKbPHhNwPIfAj+kE06 VkWt6gOIyupgHW7vFL3YCIoplnPVyWB8+Gf4bnZhPZDnnpG+p9XFM7pJrMfU8On/4Eg0 SOuIoK7+rOoo95iLoQxlTo9DdQLqsSaJ1896/S2z9JMoNXck4rHH5vW1cYHHMLN3dqMs gU3Q== X-Forwarded-Encrypted: i=1; AJvYcCVxA5Ei8ORY6pb8n1FHgqR4/EApGZa9XyIfUb3A2Sy/ihAJdlVKLjM25szyvEHg8nFTNlYcdYERMoYDBzI+@vger.kernel.org X-Gm-Message-State: AOJu0YxMlyjoMc7YDIpTleuozcAFj+WiJF+YE+7r2JXG8D+uns2Dt55b bCdmOEBiAh3TJrbWDypCzcaowt0/1U3k9vNzytzC+6/7J8i2/bNZ+gFlg8A1k7sJpZ8= X-Gm-Gg: ASbGncsycgM+mYw2w+TCh9e9PqR8aaXXvfdakK6WR7HLX+ITw+MMxtCRJtogseIyd26 yOIXKImbcw68kLBljX+Ctzr9/kilXG2m5vLe0LfaCxQjDuwtVD9fmdlIt3tpK4qnYzPITe2Iv9h w7Ii0yr5W7+TFlrtjpfwOl2c8K2mmDrnz80ofwGEeRkWldRLo23TC6wOlDcUkPfBRPYr3hZLshn 6ysWYHxtmvHnpQTXhg1WvKy6ZNm9bJtV55eMnaN/QrpbEdTb5Xjs+uNEcw3tNhWqSPSI5BmR2ai iiBu9ucuTF+w3krQ/nEiUt/7br/hQjw+cgJi96XNRJXEZ1z3cNfmEGBbjo8QJldR74W8u5amaW5 W2FAtfJOzN5T5e1UrQtmxaxbMaczumgrZfykbkuy6EuGbiSGlJU1RBSOE9skwgyrPxTpRSJg3fV DfBsul97kenZhj X-Google-Smtp-Source: AGHT+IHMTb14erlWcx3uPanj+74lbfKJy77PmyqgbUaexrywFum5PC+8tMgu/EFNKc+XsZAX1tA4QQ== X-Received: by 2002:a6b:5a06:0:b0:876:a7cc:6eb7 with SMTP id ca18e2360f4ac-881683b27eemr751673739f.9.1754193551518; Sat, 02 Aug 2025 20:59:11 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:11 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 25/58] dyndbg: split multi-query strings with % Date: Sat, 2 Aug 2025 21:57:43 -0600 Message-ID: <20250803035816.603405-26-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- -v3 squash feature, test, doc together gate new test, which needs test-dynamic-debug.ko test-percent-escape --- .../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 e2dbb5d9b3144..1ceadf4f28f9f 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 17651a8267567..73076709d169e 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -605,7 +605,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 c7bf521f36ee3..513f6cb1db1d8 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.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 D5E5D2857F1; Sun, 3 Aug 2025 03:59:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193555; cv=none; b=kuWHjJzgrY1Gs7XZQFuNT8jn491xdB78RggPTfz4GEPALmPOy6fNTN7HmC9kRS7aANS6JjXcfp1F/rtISCRCQgyQdA6sU/qy9Ovp6XlfKVgHDn7O7wKCzQ7k2X7KChPZG0aHrmzDMVltCj/qTnZjKVQzhqLiQXEntb3aC0GHE8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193555; c=relaxed/simple; bh=gORfCbMZL6Wxvhl95sxzwqPJVD/1w/NNZ0Jd1TmBzXw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DIkqbrbxdQ0Eanz+BnA/j096DoSkG3yXNgN/eL8Kf4SjX95LTtfbtm7CRkZfOJkUwZF8gzdJDFL6K5WD8uUlX0VlBpi96RtIhXe0++PInvxGArUFZW4NTh5pfiW1GKSy81DM5KWMqb0iQGA8T8kXwjYw+3Z7BsoRVVJqSt+Xnr0= 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=FRoamkkR; arc=none smtp.client-ip=209.85.166.176 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="FRoamkkR" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3e3dbda56a5so9951075ab.2; Sat, 02 Aug 2025 20:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193553; x=1754798353; 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=107A+iGieriBtcIEvITMI+JSyLEcyFCk4tsRW7oIEjk=; b=FRoamkkRVWpcGpK4UHSQnTtwWPXqTHQ2T/z+ObsJelaxXbuPfwZ5929zusDRGSGsrH T9gmgBimRMTI3ET8NUQMn3kYpzZ/ePrwGMJ3gsNCw4SI6JUJAepa9N45EqVJFH+cwHIt UdTiKdYfd4B7qPOhcfu+za3y92LdDSJPdU4+xke4CxnhqfgczykLl0ra5ihx65WL0pLH 3BCvms5KNoo28oiFlTK5qhtpSIDRB4wvH6ZR7Ar0+YNmKfSahSSljyehAia+6R/nx0qj XI0FSw9e/MSJADoRwdHAVbWmDWtsZQxR36JlrsRBmtnfpH57BYHV66UpAJSbZV3wrNNh 0G3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193553; x=1754798353; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=107A+iGieriBtcIEvITMI+JSyLEcyFCk4tsRW7oIEjk=; b=A3gtFPCxL3NHyeMBmezVgXtfirkeMrhquZJfPE/cYyQUjVgQrwh7TYDF+JzcSMOUMp nRyEhsfpDhGKCzeNrkM93/JAc2gp2nNPf7TxKJ0EpjygINTRrGP8V3i4OhDcYfkbQHYV 13btKNtxBIsfl2V/RnzQXhAaK5ZA4VL/WXlMdpeF3STwza5exR9kmTmFFuqA2c4IsZNd 2uCL0AVvw2cX9IKzyMo1zt7jfMR6SZwQmMeJmn9w3kZRhKaH4gDzo9k3qecF0KEm8pqI 9GVklM4AdCJEWCWZT5rbQh+7+DL3N6aUH9DmFWnTOUrSMvnACxsMt3LZnFWsqBzcME5P 7FXA== X-Forwarded-Encrypted: i=1; AJvYcCWTxVFFbye1ZAL0EzgbqxEM5OY6ATCoDfvatJye/65jxs4WDPmsPcjTXEJ6SUUJy06N2kb1eN6O9HvSt9GS@vger.kernel.org X-Gm-Message-State: AOJu0Yw03YKGeAYEUdAoSwiIVNOobuow40is30mDhGxlvEmu/tN5rUJp HS0pdfKb0/D9F4ylrsU1AXNMtmkOMDiP3ZoW3+vu81tFL45vWZi5Vo0ySpb5i1IKFow= X-Gm-Gg: ASbGncscNbW2qmfeXjKBHGFTEvy0yMUpxCSoyBZpSMS1xupjEC22QvVkOCwMVFay5Zr mRVm3eoXROSIOe2okz92JaRUMn5h+bM8Qk+7eP/QW2n1zfQwWGF1KAMffyRRa+Ft/3U45wfafAs 4TnTI1SUsLYeiHJg8C9RDk+MzGZDk/lQEBMPvYZnyVNUJa2ja1zA1E15XMhI4voGHhmpL766dyb MqG+6w02myXPMgv6RYNuTn4e/KMqz+MzxqqNwjM9YEoZEyliel71kCxQDR1aRFBjlheEnYVRdoV BizNbsnoBcIjUu7IanlY+lhnQTbvCVoyEuG6pHqoHQ7Q1YDJ2lGSNAWXpCEzVSCHKoP/tJwG8Pe iVio2PQkbBauJbtljqWuPs9V6j73wEjGFtXBH7U/Y9h8M745HwG6cnUd/sjIPeNyKsuVUyckhSG IT6w== X-Google-Smtp-Source: AGHT+IFEpYnc1XKOtvTxu6uAAxg044+wAtgG0lAGsg41AxxCrDtrtzNsUPBwA6fhtq1RSc/6sEyECQ== X-Received: by 2002:a05:6e02:2388:b0:3e3:e42f:279e with SMTP id e9e14a558f8ab-3e4161b6f2cmr101215625ab.15.1754193552837; Sat, 02 Aug 2025 20:59:12 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:12 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 26/58] selftests-dyndbg: add test_mod_submod Date: Sat, 2 Aug 2025 21:57:44 -0600 Message-ID: <20250803035816.603405-27-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg=3D modprobe arg, and the test-module's classmap-params to manipulate the test-mod*'s pr_debugs. In all cases, the current flag-settings are counted and tested vs expectations. The 3rd scenario recapitulates the DRM_USE_DYNAMIC_DEBUG=3Dy failure. 1. 2 modprobes (super then sub), with separate dyndbg=3Dclass-settings check module specific flag settings 2. modprobe submod, supermod is auto-loaded set supermod class-params check expected enablements in super & submod 3. modprobe super, with param=3Dsetting (like drm.debug=3D0x1ef) modprobe submod validate submod's class'd pr_debugs get properly enabled The test uses multi-queries, with both commas and percents (to avoid spaces and quoting). This is the main reason the test wasn't earlier in the patchset, closer to the classmap patches its validating. With some tedium, the tests could be refactored to split out early tests which avoid multi-cmds, and test only the class-params. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- r3 - skip test if LACK_TMOD older drop -v used in test_mod_submod(). V=3D1 does it for whole test ifrmmod at test end (Lukasz) test-mod-tmod --- .../dynamic_debug/dyndbg_selftest.sh | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 513f6cb1db1d8..09937dca3056d 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -279,10 +279,83 @@ function test_percent_splitting { ifrmmod test_dynamic_debug } =20 +function test_mod_submod { + echo -e "${GREEN}# TEST_MOD_SUBMOD ${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 with class enablements + modprobe test_dynamic_debug \ + dyndbg=3Dclass,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + + modprobe test_dynamic_debug_submod + check_match_ct test_dynamic_debug_submod 23 -r + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct test_dynamic_debug 46 -r + + # no enablements propagate here + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + + # change classes again, this time submod too + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add so= me prefixes" + check_match_ct =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 + # submod changed too + check_match_ct =3Dmf 1 + check_match_ct =3Dlt 1 + check_match_ct =3Dml 1 + + # now work the classmap-params + # fresh start, to clear all above flags (test-fn limits) + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + modprobe test_dynamic_debug_submod # get supermod too + + echo 1 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 4 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( V1-3 + D2_CORE ) + check_match_ct =3Dp 8 + echo 3 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( D2_CORE, D2_DRIVER ) + check_match_ct =3Dp 4 + echo 0x16 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( D2_DRIVER, D2_KMS, D2_ATOMIC ) + check_match_ct =3Dp 6 + + # recap DRM_USE_DYNAMIC_DEBUG regression + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + # set super-mod params + modprobe test_dynamic_debug p_disjoint_bits=3D0x16 p_level_num=3D5 + check_match_ct =3Dp 7 + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =3Dp 14 + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug +} + tests_list=3D( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) =20 # Run tests --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (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 7BDC4285CBB; Sun, 3 Aug 2025 03:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193557; cv=none; b=iIgwN/+YxwCED9D+GSWuQd7TQ2r18AjWYFvWEjEZ0JzN281mdSgnNvgc5VxUHrs5k52bqd500m0YX84aJVkh6nK+kWQSPmrQRKtiqhtqnoDSFbntq4OOs48y65LEBsWVtJnEN5JYHsOaNMr9ZQEhn0EVccABsuVq0xhbzkLTIVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193557; c=relaxed/simple; bh=UmPjnvOFHtKRbBydls84D8Tx+iu+38ZTcfuwy6MUclQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DPJ4FSv+YzbfB6NGLRS7i1FwVeam1S+T/YH1MWbEsCZbUeEX1NmrZ0bIHyPZtQ0dbzxEPihmy3FK6Havm6o0jll0E88OYb4rK7ri05iyzD8y0DaNkcFGsHpvygVPnf1D7PqfXJ5I4syZjXOb//cEL0AKoXxtVFM8ZJdPImZEM50= 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=mixe8w8A; arc=none smtp.client-ip=209.85.166.46 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="mixe8w8A" Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-88120243d9cso156615939f.2; Sat, 02 Aug 2025 20:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193554; x=1754798354; 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=5JChZIjAU7+USVRGiGiVr4WOFlmx1AN0tqDn5UCQfXA=; b=mixe8w8A4p36X3uYrvZPrlMW8sl9TorXneSgvEP2qjDRTq7FjZH5mTUpjy7OokEox4 CH9jrXsss9e4N7UMkn4EZcpHyONv4bTAvAFvjtpXufglhraw2VXSxPvkts4+z30c7msH bF5buC+bTRgSDhslOlcfOreWFD4PKrw1QSkRFuGlmej+WlT1l0YECcTKQkB+CYwCywN0 tS//IPE23RqKz9eDYlCZ65nxtn5AeZDVVuv2qXFDxPKe0tgIH5OIpjk0eAdXI9qgy3nQ xdGqGMm8Gbc2Nl8Tbjj/0+x2tZ2pturtW/SAeglYhOCUcbsKekr1sXqPZ8IcJ1TuyBIQ gtWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193554; x=1754798354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5JChZIjAU7+USVRGiGiVr4WOFlmx1AN0tqDn5UCQfXA=; b=l3tuGXhmfbsz35DUsY6eGCidIdNiq0MJIzOadSclbpu/NMUlaZYnnlbcHJPCzIn3HP buAuhJAUPBmv+XkTzJw6LXny+V6L/xQ31RqOIto0ankhtbYO6cLhjyZPen179FgjkFPC mU/L841rUV8xW4axkGmBp/wBYlcd3yQtOpOQZgmoxPd0jNGpJRt6z+nKVnd07bMrAndp 2I8QLV7UXwm1euc8NLxn3BpkavKARH7Q70Bzch0vXSUiRXnVehpEDVblk2amOlh/ZNvV So/SW/MorhyxaNBqlNWG7Ac9MufnNsC4q8WwY8yngqBHB+NOJCqVSlJLH+hml/S2l6K5 iJog== X-Forwarded-Encrypted: i=1; AJvYcCU1YVPSBSDf7G+PAjP/58ENwQ5QacUSgJisYpBZOK9GTz8ptLTq5FBa2ciQR5jg7KqPo5rZmj0F2xw/rKRo@vger.kernel.org X-Gm-Message-State: AOJu0YyfUExTQiCRz2GKsBP88DfgOBGEEhFW89n+4QXMpGAv7aT+t+Dk gZqEs8Y8dbGGfhFuUtAOU6UyMDMn2HO1nmJYoNVuYrbLaNEwzQYz2+HvnAkBsKSzBpc= X-Gm-Gg: ASbGncumm8bX1TTiiiIcDSvkQMC7M9zT0LtRx9N+VNzK2a2Zhaq4lUDSQPLGrn+MMsJ D9qQgCvOnmiA2YOnQSTevs60QBMOgrQDMT6ykLi9tudhp5bXkVBWaR3bX2D8cRncx97tlD/aVrP s22FmIKy4N6w2fnJEMyCylc6eQnz8sB5uzYbTe37Ni/JHhTDTnjDGTnzgGl0taFoWqC+DMFLVwX hT2LSdjNVn11h0EKZVfhFPjfgQDpLaxOM2+n/njaeHKx9/v4LH4cXuKmF/WXWBT6W3naTpw4TCQ kzHnNDsTkHD4nQIe7RFTHxRWMVaW12CAP1vVT5c50PnCI7CnmHYBNZ8CRubVHiGU4T1eO9YTk67 zlNBdJmz4qkRnw51TSuqM3fSKfCjAVhjQbaq9LgXNKZVLXIPxOeL7FkAqbQ3cXZQ4pt5drMZyVs kOtw== X-Google-Smtp-Source: AGHT+IEXs1RKwGF33rL3y1Nq7WtmCCzyqjf3/JqP1fnRxFHeHfpiw5ELqGV5x4Tl+RUFiy+AkiHSIg== X-Received: by 2002:a05:6602:6206:b0:881:7474:1b78 with SMTP id ca18e2360f4ac-88174741e8dmr448868439f.8.1754193554242; Sat, 02 Aug 2025 20:59:14 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:13 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 27/58] dyndbg: drop "protection" of class'd pr_debugs from legacy queries Date: Sat, 2 Aug 2025 21:57:45 -0600 Message-ID: <20250803035816.603405-28-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Current classmap code protects class'd pr_debugs from unintended changes by "legacy" unclassed queries: # this doesn't disable all of DRM_UT_* categories echo "-p" > /proc/dynamic_debug/control # name the class to change it - protective but tedious echo "class DRM_UT_CORE +p" > /proc/dynamic_debug/control # or do it the (old school) subsystem way echo 1 > /sys/module/drm/parameters/debug This "name the class to change it" behavior gave a modicum of protection to classmap users (ie DRM) so their debug settings aren't trivially and unintentionally altered underneath them. And by "symmetry", if they're not picked by "class FOO", then they're excluded from adjustment. This allowed all previously conceived queries to work the way they always had; ie select the same set of pr_debugs, despite the inclusion of whole new classes of pr_debugs. That had 2 downsides: 1. "name the class to change it" means that every class must be individually modified, quickly becoming long-winded and tedious to adjust all the classes in a map via >control. 2. It made the class keyword special in some sense; the other keywords skip only on explicit mismatch, otherwise the code falls thru to adjust the pr-debug site. So this patch reverts to the traditional view, it drops protection of classes from default/legacy queries. But it also refactors the skip/continue choice to allow the module defining the classmap to protect its classes from unintended alterations by legacy/class-less queries. Next: Author choice: use of DYNAMIC_DEBUG_CLASSMAP_PARAM() means they want the drm.debug style control point. We should presume they want it to reflect whats set underneath, with only "class FOO" qualified queries changing the callsites beneath. CC: jbaron@akamai.com Signed-off-by: Jim Cromie -- v3- s/slctd_/selected_/ pitch the PARAM control of protection. --- lib/dynamic_debug.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 73076709d169e..548a82a178d49 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -197,6 +197,17 @@ ddebug_find_valid_class(struct _ddebug_info const *di,= const char *query_class, return NULL; } =20 +/* + * classmaps-v1 protected classes from changes by legacy commands + * (those selecting _DPRINTK_CLASS_DFLT by omission), v2 undoes that + * special treatment. State so explicitly. Later we could give + * modules the choice to protect their classes or to keep v2 behavior. + */ +static inline bool ddebug_client_module_protects_classes(const struct ddeb= ug_table *dt) +{ + return false; +} + /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -211,7 +222,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, struct flag_settings unsigned int nfound =3D 0; struct flagsbuf fbuf, nbuf; struct _ddebug_class_map *map =3D NULL; - int valid_class; + int selected_class; =20 /* search for matching ddebugs */ mutex_lock(&ddebug_lock); @@ -224,21 +235,25 @@ static int ddebug_change(const struct ddebug_query *q= uery, struct flag_settings =20 if (query->class_string) { map =3D ddebug_find_valid_class(&dt->info, query->class_string, - &valid_class); + &selected_class); if (!map) continue; } else { - /* constrain query, do not touch class'd callsites */ - valid_class =3D _DPRINTK_CLASS_DFLT; + selected_class =3D _DPRINTK_CLASS_DFLT; } =20 for (i =3D 0; i < dt->info.descs.len; i++) { struct _ddebug *dp =3D &dt->info.descs.start[i]; =20 - /* match site against query-class */ - if (dp->class_id !=3D valid_class) - continue; - + if (dp->class_id !=3D selected_class) { + if (query->class_string) + /* site.class !=3D given class */ + continue; + /* legacy query, class'd site */ + else if (ddebug_client_module_protects_classes(dt)) + continue; + /* allow change on class'd pr_debug */ + } /* match against the source filename */ if (query->filename && !match_wildcard(query->filename, dp->filename) && --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 EE97C286436; Sun, 3 Aug 2025 03:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193559; cv=none; b=VengCC5DVXzMSjf732O89HbZzxeOR2RGid8kQtN6nKIGM6NfTLT3wzoZXEgfiqE0C+FMnTKZUK3YVz213kKb+dM5bJaVQy8J/Y+9QXAQ84gyFkCZq9SBCOpsgpJBHXhhfKAzlTlS3e0FbYKZ72ZXei7i1P3YsxpHp6K+2BfWUJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193559; c=relaxed/simple; bh=Jj0f9JkUdyvI8rnvS13GD8oQmp6layChoeb3nY10K0s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DeQ7HT4J649SkusB2c4UjMFTdCqrVl/zo/JPwLu+NdonA6xNtmXQR+NKsJVx1UjR7RYUsdiVOfePTmev59UeMX5hbSLmTt4jxQt/r+NI862tCoFFvl9/gWPjGBhxQhXMWjdfj8tcMk9/zqK21y3Pbz/UmDYljvEMqKv/GORWdEw= 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=dboArhtb; arc=none smtp.client-ip=209.85.166.45 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="dboArhtb" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-8811ab2b559so242683939f.3; Sat, 02 Aug 2025 20:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193556; x=1754798356; 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=HXquqH7KII4sF+LJ1AfrwTmzreYTzxHzyyy3sHAB95g=; b=dboArhtb6ZK1ql8BicZPTKKBT5Dt7lI2c3kKsuGoO9Ab4CUwtveJztosLMpqUFx5tN bEzTPYQqWG+4gFBcgTcSjKE9KBR5mo0i575LjZqYHWmHm+X1rTLNJ6TtZqlJoX2f/Q36 jkKCo7HEiFuIlryy1G83cVSwkcY/T16hohk1FuJN9tYVsijUUmFMOGvV3v4xNsAANzN8 OhBoBTranx50RlWyKAJUWretEFHGWzf46bVFpFLgAGjG+Z38nhLcrL68pEak+CjvTG0E Jc7GPAc3cc3I29WxcSnMzv31BsNo+n2cqpnc5xpL3Y88FI5pqVK7saukbmrXjB8RQNUd 0LZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193556; x=1754798356; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HXquqH7KII4sF+LJ1AfrwTmzreYTzxHzyyy3sHAB95g=; b=lvqUxrE40I5aIlzGHcEZ/2431lapJ4GPAIr/h4dUAoiXWCr+bL4PIeKz4FAuH0+rEw 0HS3U0CLwyfk6W/lbkEYVtBWOBd3YQpcOaVXaxfK4fYtrhyRgJwRrtUeS9a9IMhOZTNN vayarsvcMjtQvoRu6ecIxu814xTB/pYG7hyrqZj9meFC4MQeiyOkwPN7jjEVGMJ+XQPE dLyk5ViFHCcq1xpd/76evW5GZf1Tnnr+t53IXzy5CB32emR5ut8MJUHAO/ayluWhXFdY dAPjdg7wq8U9TIcLpxlz9M0iupXs46O8FUyQdIXR2o+F3V6LxsPGP44DPcVyRvcKJNMX SNow== X-Forwarded-Encrypted: i=1; AJvYcCX4lRxMbW1a76p0qvFzu4c81JuBYQa0CrhUuJN+VAVIQRozVYwdEdtD/yom2uU9+TUrYWmnq/7q9e30Fsk/@vger.kernel.org X-Gm-Message-State: AOJu0YwTh/JPFBsd9/45Nspb+TywqtVh+2kWBTTDm6lNgMgqEvssUAer L5bfV1xinR0T9USQEDz1Pq8XlDgHIKbZQJlruOYph1/Xej7H1cQJUC530jq0HVVfJxQ= X-Gm-Gg: ASbGncs+2Mq/BS+5dGUcMh1KbnB5mAmNohNx4bnC/4HCZom37e7lJEtsrp3KrbUVlBz YpTFPuajybMCPitLmDOiAeorkZv+gyGYtNxRSlJpf9osivKMF+v1n8OntedcY5Rpf9NlGDYAutg uwGw0d8yEVocfjMIkz8l4LpguMTDRepTbwwq5XSCbSw2SD7CEbdEE0xhaDCwRJz1v0klQ+Ryo0p k9UII5gqDTYjmF+8zCl4Om5mV/kw4iTCb972Z+ZeGZaxNt9hcCiBdd+fCB15EFNKWF7N6T4a98y 5BbfEWMSgGZjvzrxfS0ASDRJ+So1c0wRGBpyHjchwlGSkYZibrQ2B2cEUBCdAoKScdbTfy88BO4 H7oDwPHZT3MasXcTu4SLZl7pW+VxTd80Wc4Hu7te0RrrSmIZAuFRCh2lKptl5LkVISTwP2k7r/Z JJ8Q== X-Google-Smtp-Source: AGHT+IHEnyztiCzMLSKzxMv0/iqEKnGgfqHvaJUwVU2gtBDtmGy6WUb/KQqWprxWVGQiSsEBcFCLfQ== X-Received: by 2002:a05:6602:6b81:b0:87c:34e3:1790 with SMTP id ca18e2360f4ac-88168313db5mr806307439f.1.1754193555783; Sat, 02 Aug 2025 20:59:15 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:15 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 28/58] dyndbg: restore classmap protection when theres a controlling_param Date: Sat, 2 Aug 2025 21:57:46 -0600 Message-ID: <20250803035816.603405-29-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" DRM has always had /sys/module/drm/parameters/debug (ie drm.debug). Without dyndbg, this is their only control point. One could presume they like it - in any case its a system/user interface, ie ABI. With dyndbg enabled, drm calls DYNAMIC_DEBUG_CLASSMAP_PARAM() to create the drm.debug kparam, wired to our param-handler, which writes a "class FOO" query for each bit in the classmap. Since no new interface was ever contemplated, this is using >control. Since drm.debug is ABI, we should not allow class-less queries to alter our implementation of its settings. This patch provides that protection, *only* when theres a PARAM. This is the user, expressing their wish for easy control of their entire classmap. They also wish to trust its settings. Classes without a PARAM are unprotected, allowing admins their shortcuts. No such use-cases exist yet. Anyway, this patch does: 1. adds struct _ddebug_class_map.controlling_param 2. set it in ddebug_match_apply_kparam(), during modprobe/init, when options like drm.debug are handled. 3. ddebug_class_has_param() checks .controlling_param 4. ddebug_class_wants_protection() macro renames 3. 5. ddebug_change() calls 4 when needed. IE when applying a class-less query to a class'd pr_debug / drm_dbg_ Historical Summary: -v0 - before classmaps. no special case keywords -v1 - "class DEFAULT" is assumed if not mentioned. this protects classes from class-less queries -v2.pre-this-patch - protection macro'd to false -v2.with-this-patch - sysfs knob decides -v2.speculative - module decides wrt classmap protection seems unneeded now, TBD NOTE: protection is only against class-less queries, explicit "class FOO" adjustments are allowed (that is the mechanism). Signed-off-by: Jim Cromie --- v3 - new patch --- include/linux/dynamic_debug.h | 16 ++++++---- lib/dynamic_debug.c | 55 ++++++++++++++++++++++++++--------- 2 files changed, 52 insertions(+), 19 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 2d959f1f8cd30..bc26bc9128c1c 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -100,8 +100,9 @@ enum ddebug_class_map_type { * __pr_debug_cls(0, "fake CORE msg") in any part of DRM would "work" * __pr_debug_cls(22, "no such class") would compile, but not "work" */ - +struct _ddebug_class_param; struct _ddebug_class_map { + struct _ddebug_class_param *controlling_param; const struct module *mod; /* NULL for builtins */ const char *mod_name; const char **class_names; @@ -231,7 +232,12 @@ struct _ddebug_class_param { * * Creates a sysfs-param to control the classes defined by the * exported classmap, with bits 0..N-1 mapped to the classes named. - * This version keeps class-state in a private long int. + * + * Since sysfs-params are ABI, this also protects the classmap'd + * pr_debugs from un-class'd `echo -p > /proc/dynamic_debug/control` + * changes. + * + * This keeps class-state in a private long int. */ #define DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _var, _flags) \ static unsigned long _name##_bvec; \ @@ -244,10 +250,8 @@ struct _ddebug_class_param { * @_var: name of the (exported) classmap var defining the classes/bits * @_flags: flags to be toggled, typically just 'p' * - * Creates a sysfs-param to control the classes defined by the - * exported clasmap, with bits 0..N-1 mapped to the classes named. - * This version keeps class-state in user @_bits. This lets drm check - * __drm_debug elsewhere too. + * Like DYNAMIC_DEBUG_CLASSMAP_PARAM, but maintains param-state in + * extern @_bits. This lets DRM check __drm_debug elsewhere too. */ #define DYNAMIC_DEBUG_CLASSMAP_PARAM_REF(_name, _bits, _var, _flags) \ __DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _bits, _var, _flags) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 548a82a178d49..c3e27637d9357 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -198,16 +198,26 @@ ddebug_find_valid_class(struct _ddebug_info const *di= , const char *query_class, } =20 /* - * classmaps-v1 protected classes from changes by legacy commands - * (those selecting _DPRINTK_CLASS_DFLT by omission), v2 undoes that - * special treatment. State so explicitly. Later we could give - * modules the choice to protect their classes or to keep v2 behavior. + * classmaps-V1 protected classes from changes by legacy commands + * (those selecting _DPRINTK_CLASS_DFLT by omission). This had the + * downside that saying "class FOO" for every change can get tedious. + * + * V2 is smarter, it protects class-maps if the defining module also + * calls DYNAMIC_DEBUG_CLASSMAP_PARAM to create a sysfs parameter. + * Since they want the knob, we should assume they intend to use it + * (in preference to "class FOO +p" >control), and want to trust its + * settings. + * This gives protection when its useful, and not when its just tedious. */ -static inline bool ddebug_client_module_protects_classes(const struct ddeb= ug_table *dt) +static inline bool ddebug_class_has_param(const struct _ddebug_class_map *= map) { - return false; + return !!(map->controlling_param); } =20 +/* re-framed as a policy choice */ +#define ddebug_class_wants_protection(map) \ + ddebug_class_has_param(map) + /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -250,7 +260,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, struct flag_settings /* site.class !=3D given class */ continue; /* legacy query, class'd site */ - else if (ddebug_client_module_protects_classes(dt)) + else if (ddebug_class_wants_protection(map)) continue; /* allow change on class'd pr_debug */ } @@ -650,6 +660,7 @@ static int ddebug_exec_queries(char *query, const char = *modname) } =20 /* apply a new class-param setting */ + static int ddebug_apply_class_bitmap(const struct _ddebug_class_param *dcp, const unsigned long *new_bits, const unsigned long old_bits, @@ -1228,25 +1239,36 @@ static void ddebug_sync_classbits(const struct kern= el_param *kp, const char *mod } } =20 -static void ddebug_match_apply_kparam(const struct kernel_param *kp, - const struct _ddebug_class_map *map, - const char *mod_name) +static struct _ddebug_class_param * +ddebug_get_classmap_kparam(const struct kernel_param *kp, + const struct _ddebug_class_map *map) { struct _ddebug_class_param *dcp; =20 if (kp->ops !=3D ¶m_ops_dyndbg_classes) - return; + return false; =20 dcp =3D (struct _ddebug_class_param *)kp->arg; =20 - if (map =3D=3D dcp->map) { + return (map =3D=3D dcp->map) + ? dcp : (struct _ddebug_class_param *)NULL; +} + +static void ddebug_match_apply_kparam(const struct kernel_param *kp, + struct _ddebug_class_map *map, + const char *mod_name) +{ + struct _ddebug_class_param *dcp =3D ddebug_get_classmap_kparam(kp, map); + + if (dcp) { + map->controlling_param =3D dcp; v2pr_info(" kp:%s.%s =3D0x%lx", mod_name, kp->name, *dcp->bits); vpr_cm_info(map, " %s mapped to: ", mod_name); ddebug_sync_classbits(kp, mod_name); } } =20 -static void ddebug_apply_params(const struct _ddebug_class_map *cm, const = char *mod_name) +static void ddebug_apply_params(struct _ddebug_class_map *cm, const char *= mod_name) { const struct kernel_param *kp; #if IS_ENABLED(CONFIG_MODULES) @@ -1266,6 +1288,13 @@ static void ddebug_apply_params(const struct _ddebug= _class_map *cm, const char * } } =20 +/* + * called from add_module, ie early. it can find controlling kparams, + * which can/does? enable protection of this classmap from class-less + * queries, on the grounds that the user created the kparam, means to + * use it, and expects it to reflect reality. We should oblige him, + * and protect those classmaps from classless "-p" changes. + */ static void ddebug_apply_class_maps(const struct _ddebug_info *di) { struct _ddebug_class_map *cm; --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 8D3D3286D73; Sun, 3 Aug 2025 03:59:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193561; cv=none; b=hRRV1MLKqHznnw4FokXCbMnngn2TNAuknEmFVG8RnAd+RMTFJZ131/Vi4cZV7uawn+VBXm9jZHSjTKhL4nSK3npzTSXhRmqlNOq3644thwxe1huHIsoQLJoT5Ps/nCH8u+sgEEiHw7piYPhNzAGqxZe2brRV1b0fAYUA1bZo3Ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193561; c=relaxed/simple; bh=hfhdyPgNPmI59nT/uW5MmPjomrGBwFDKj1cx3ofW7kI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hGMTaMVg3mNZBEvGI9xPmjA+cwbZH7+ZBWgUqNU5nNic/8DLW0qk7plUmSI8wKjKD/hOLr2Dc39ya9ZBtItCYTdLydaBuJN87kt5ylH/NLqPMBNaRf0U6q/Y6vbGEnTn+OX5s9xvM8hmCGKN6w5ebh/ud2haf5stgeval72Tglw= 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=ahwxK2Nm; arc=none smtp.client-ip=209.85.166.181 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="ahwxK2Nm" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3e412f3a0f0so18938315ab.2; Sat, 02 Aug 2025 20:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193557; x=1754798357; 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=HeJcBthhmF2i0ZuBLswvHjerHxMSPDvK/fXonxnOFN8=; b=ahwxK2Nm/l562/Db6dQx/8pdL1a33/jaLdvZlazK6tIEENlmNfIZO2P+CVlXkhpUCw +B0FtjhzmU2FmWHDIk/dl6X2XtW/lqFmBBYOPYoCSJiEAugjFnjncHpIpOretdpxgZWg TdqGKE0VRgA2TogxhGsGwC5Y8zK+iYcSd4y9wCFBGhC83jSSIQD+BKWmMOG4cwvZsvB/ EjouA9PIK40exXBTp2lcy5aYP4kYOnrs4GTN/ANnICVvxesS1GWV1LU/epoZoGBPHdWO 6siEpYBVCic0jse6vExyofHWxzXy10uOgm6VD59wjYOJfk9wpYW54G/lU1aCcD+ByGlK Fqhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193557; x=1754798357; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HeJcBthhmF2i0ZuBLswvHjerHxMSPDvK/fXonxnOFN8=; b=LnqmRT7UwD+0DNRjOcYvjaaF71jad2OlPErD3MiSvk6Ww6p+UfbYQ+eOt2FHtp6FoV 60BQeTPlr0D8i3hGteyoPHiFVHXsxeL0U1Deh9wNl5R3e3OD6ZK0R7Y3d/ClBu1YSKNI 0+ikQSftRMxscuueOjk/mADcxDM09yRnMg7EFy3BN9c3zG5Q/6uzDjO8/JVELgUP/cxA v6shlYJBdaTAeNBqxjZuBDXYiyR44QnVckmo+R1byKTelh2BieQGm6df2GOUHr+cNnTW qODlc9+zsZLnUxQ3OcHLXW/bUApbGO27EIqbeN5ADb+C0tfrNZM/KI266ObQr+YXHlwF vL7A== X-Forwarded-Encrypted: i=1; AJvYcCU42MTr5NaDz32AGmh6qFE4KdmKPK5q/3s24ujTRaNTuaKJp58Xgry2OxwN7sw8ojQVMBNEYVopjF8BYp89@vger.kernel.org, AJvYcCUdqVCS+OYAJ+wKIPX83ByGWv3xgwY+lJQGy0YbL/8bf5n53iVcKzG2TwzBLZt9H/+26fQNDWjXfjfB@vger.kernel.org X-Gm-Message-State: AOJu0Ywl+q5+FwPbQShLb/R0d8zZ8sxAPYAsgJ8J4tWq31Q2kgWMLMBr WurwCmd+HKI3CYNlgfsRw8s+iSV+4BdyhsgtWoYsHA/tnv77CfphiBWkJe8/Lp1pbQY= X-Gm-Gg: ASbGncuD6I4tYevki/jjBsHmseJAtaUyIGK2y7Nn4TIfqGFvKm0IxVKyRgy9hA3LL0G H1UAEAfmIikWOZcv9Ax9zDTmwaURyjKqO26H3E17LB7qfwyRRGZ3QTG0bhjj3ILzToMuR6WUDzt 9Co8CCApE8C9GlDEo32WIymb3hKhYmVoOCPzDukDZ/R0bMoqrRyawQlF5RZJaQ56FkSfPLxJEZh Y+4hs7P7RWbJ9WdHOjl4BX6HzvIhyhtm0UlEDPBAPsGVINo+2XcQ5EIFhlQbLhukWulO9hPB/U5 XDEElF36Gpa0HF63CzxeN50yJyJ3KgCB0FGmfnqOmFTIiEXjQjEdz3vzuItfcyric1OCWJkqzn9 OxEnBuxP2PJQJfB2ZAJA7obAoB8qL3lDhI0UA5HPzShBgJPvmcgpURAH2h02Zjde5XyM2j6StG3 FKKw== X-Google-Smtp-Source: AGHT+IHrzCRd82nJmWB4NzeYPcpOd69cqcO9QfV4pWarBbSRRr9gtL6A2/9Lh/HUHDDW9s/Kka8FzQ== X-Received: by 2002:a92:cda7:0:b0:3e2:9fa7:a60a with SMTP id e9e14a558f8ab-3e41611a0aamr87564645ab.3.1754193557316; Sat, 02 Aug 2025 20:59:17 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:16 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com, linux-doc@vger.kernel.org Subject: [PATCH v4 29/58] docs/dyndbg: add classmap info to howto Date: Sat, 2 Aug 2025 21:57:47 -0600 Message-ID: <20250803035816.603405-30-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Describe the 3 API macros providing dynamic_debug's classmaps DYNDBG_CLASSMAP_DEFINE - create & export a classmap DYNDBG_CLASSMAP_USE - refer to exported map DYNDBG_CLASSMAP_PARAM - bind control param to the classmap DYNDBG_CLASSMAP_PARAM_REF + use module's storage - __drm_debug TBD: some of this might be over-specification, or just over-talked. NB: The _DEFINE & _USE model makes the user dependent on the definer, just like EXPORT_SYMBOL(__drm_debug) already does. cc: linux-doc@vger.kernel.org Signed-off-by: Jim Cromie --- v3- rework protection around PARAM v0.5 adjustments per Randy Dunlap v0.7 checkpatch fixes v0.8 more v0.9 rewords fixup-howto --- .../admin-guide/dynamic-debug-howto.rst | 137 ++++++++++++++++-- 1 file changed, 126 insertions(+), 11 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 1ceadf4f28f9f..556e00299ed35 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -146,7 +146,9 @@ keywords are::: "1-30" is valid range but "1 - 30" is not. =20 =20 -The meanings of each keyword are: +Keywords::: + +The meanings of each keyword are:: =20 func The given string is compared against the function name @@ -194,16 +196,6 @@ format format "nfsd: SETATTR" // a neater way to match a format with whitespace format 'nfsd: SETATTR' // yet another way to match a format with whitesp= ace =20 -class - The given class_name is validated against each module, which may - have declared a list of known class_names. If the class_name is - found for a module, callsite & class matching and adjustment - proceeds. Examples:: - - class DRM_UT_KMS # a DRM.debug category - class JUNK # silent non-match - // class TLD_* # NOTICE: no wildcard in class names - line The given line number or range of line numbers is compared against the line number of each ``pr_debug()`` callsite. A single @@ -218,6 +210,24 @@ line line -1605 // the 1605 lines from line 1 to line 1605 line 1600- // all lines from line 1600 to the end of the file =20 +class + + The given class_name is validated against each module, which may + have declared a list of class_names it accepts. If the class_name + accepted by a module, callsite & class matching and adjustment + proceeds. Examples:: + + class DRM_UT_KMS # a DRM.debug category + class JUNK # silent non-match + // class TLD_* # NOTICE: no wildcard in class names + +.. note :: + + Unlike other keywords, classes are "name-to-change", not + "omitting-constraint-allows-change". See Dynamic Debug Classmaps + +Flags::: + The flags specification comprises a change operation followed by one or more flag characters. The change operation is one of the characters:: @@ -394,3 +404,108 @@ just a shortcut for ``print_hex_dump(KERN_DEBUG)``. For ``print_hex_dump_debug()``/``print_hex_dump_bytes()``, format string is its ``prefix_str`` argument, if it is constant string; or ``hexdump`` in case ``prefix_str`` is built dynamically. + +Dynamic Debug Classmaps +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The "class" keyword selects prdbgs based on author supplied, +domain-oriented names. This complements the nested-scope keywords: +module, file, function, line. + +The main difference from the others: classes must be named to be +changed. This protects them from generic overwrite: + + # IOW this cannot undo any DRM.debug settings + :#> ddcmd -p + +This protection is needed; /sys/module/drm/parameters/debug is ABI. +DRM.debug is authoritative when dyndbg is not used, dyndbg's PARAM +cannot undermine that guarantee just because its optional for DRM to +use it. + + :#> echo 0x1ff > /sys/module/drm/parameters/debug + +So each class must be enabled individually (no wildcards): + + :#> ddcmd class DRM_UT_CORE +p + :#> ddcmd class DRM_UT_KMS +p + # or more selectively + :#> ddcmd class DRM_UT_CORE module drm +p + +That makes direct >control wordy and annoying, but it is a secondary +interface; it is not intended to replace the ABI, just slide in +underneath and reimplement it. + +However, since the sysfs/kparam is the ABI, if a classmap DEFINEr +doesn't also add a _CLASSMAP_PARAM, there is no ABI, and no protection +is needed. In that case, class'd prdbgs would be enabled/disabled by +legacy (class-less) queries, as a convenience, and because there's no +need to enforce irrelevant rules. + + +Dynamic Debug Classmap API +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D + +DRM.debug is built upon: + +- enum drm_debug_category: DRM_UT_<*> - for short +- 23 categorized api macros: drm_dbg_(), DRM_DEBUG_() +- 5000 calls to them +- all calling to __pr_debug_cls(, ...) + +Those compile-time const short ints are good for optimizing compilers; +a primary classmaps design goal was to keep that property. +So basically .class_id =3D=3D=3D category. + +Then we use the drm_categories DRM_UT_* enum for both the classnames +(stringified enum symbols) and their numeric values. + +Its expected that future users will also use categorized macros and an +enum-defined categorization scheme like DRM's, with dyndbg inserted in +similarly. + +DYNAMIC_DEBUG_CLASSMAP_DEFINE(var,type,_base,classnames) - this maps +classnames (a list of strings) onto class-ids consecutively, starting +at _base, it also maps the names onto CLASSMAP_PARAM bits 0..N. + +DYNAMIC_DEBUG_CLASSMAP_USE(var) - modules call this to refer to the +var _DEFINEd elsewhere (and exported). + +Classmaps are opt-in: modules invoke _DEFINE or _USE to authorize +dyndbg to update those classes. "class FOO" queries are validated +against the classes, this finds the classid to alter; classes are not +directly selectable by their classid. + +NB: It is an inherent API limitation that the following are possible: + + // these would be caught in review + __pr_debug_cls(0, "fake DRM_UT_CORE msg"); // this works + __pr_debug_cls(62, "un-known classid msg"); // this compiles, does nothi= ng + +There are 2 types of classmaps: + + DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, like DRM.debug + DD_CLASS_TYPE_LEVEL_NUM: classes are relative, ordered (V3 > V2) + +DYNAMIC_DEBUG_CLASSMAP_PARAM - modelled after module_param_cb, it +refers to a DEFINEd classmap, and associates it to the param's +data-store. This state is then applied to DEFINEr and USEr modules +when they're modprobed. + +The PARAM interface also enforces the DD_CLASS_TYPE_LEVEL_NUM relation +amongst the contained classnames; all classes are independent in the +control parser itself; there is no implied meaning in names like "V4". + +Modules or module-groups (drm & drivers) can define multiple +classmaps, as long as they (all the classmaps) share the limited 0..62 +per-module-group _class_id range, without overlap. + +If a module encounters a conflict between 2 classmaps its USEing, we +can extend the _USE macro with an offset to allow de-conflicting the +respective ranges. Or they use the DEFINErs macro-api, but with new +enum symbols. + +``#define DEBUG`` will enable all pr_debugs in scope, including any +class'd ones. This won't be reflected in the PARAM readback value, +but the class'd pr_debug callsites can be forced off by toggling the +classmap-kparam all-on then all-off. --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 794FA286D6D; Sun, 3 Aug 2025 03:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193560; cv=none; b=EqbQggbrQ0yxEfhvHvA/9x+P1pk9EtDf00R4TE0cLxerPsb3J6oO8UKMD7w0ls7VDuSvXLxGgG67OWjfTPo5lv6NxBpBy7NHBe0O5l35L+GHCOdySY4ffcEhxUyDWdQ1SV2UqIUr/UfmziDgqTt8cNr7lm/pztCoRNERHf9D+UY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193560; c=relaxed/simple; bh=dhKK0siARiyhwFBf6trDPwkOh9NrU2YLkf8y0htXsW4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pJopWJruqLMokqZm25ymuj7n30zhbn93L/a7vdOJcJPLRbsRWxss7KPAV37f9ABgcluxKjMm7BxzJ9VPUEBDYM+BwzCBRQBQJXRfnnIDJaQqIgtLnQOoJD1Cw88FdpERGtVMry1ltCA5IQYK48vf35uKxtM/asRRSJG/wv/vCrA= 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=jg+pLkOn; arc=none smtp.client-ip=209.85.166.173 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="jg+pLkOn" Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3e40212e6ceso14462895ab.0; Sat, 02 Aug 2025 20:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193558; x=1754798358; 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=L2ReCJfEK5pKTcOheDemwRlm+fJVRguF1Peh0eFAuDY=; b=jg+pLkOnL3gUBPkatwb5crKONvQCy2BlXK88UDxxF9Gob+4LvE+ySTKsUii/BmEord UFGHRbmWfFtbmcvZa+LiteY/w+qrmlGejMBKjrO027e7z3rSi9b/NDXuFfLHMQv2q+pr q3LeXYUKTU/TXfUFL7Z+OTtnK6XJioa3XaR54LzqkAIcPrUJe0x8eLX0mSojJ15x/stR A5Ok+66YyRffdZIFBNGrkN2KcxUsQlQTirXiZo16CUSAI8K6D+rbwSIYvwf85EAsfvmp feR1D9dsrOmiYhsPrPSZ/LQW5xG75za6jD6DvpNV7fuEsHyA1QP9Jol28iI8i5fGcGR0 yoag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193558; x=1754798358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L2ReCJfEK5pKTcOheDemwRlm+fJVRguF1Peh0eFAuDY=; b=nC3ogNOItzbTDXKyK/Pogj9vzkWptYkVggQx2QLJELSQc2vMW0J5qqXv9CjDTV1QHE fGfB1j0toUzpoS1NTy0zuUBLynKoDmM2OttayB23AGCJCDnFDC2KDheFqH7LARI6FLQN +i33Ju7rBxBhu5QMnlGucUtcCP/nvvsmOv4+kU4qtPE0CPYAfW+zPp1gyXKKvHEh96oD N4PDGjGWP809qz6+O9DMozGP1fZRyn+558ljLxgeb1jweMKqWqAWgLRDh3SRumGhuO0X 1WE3YvV9hYY8iLYv5iet9DXkGeNGXORpPvifVfvVh4o7p27NHUElxXM8xBbs920aPP+3 tq5g== X-Forwarded-Encrypted: i=1; AJvYcCWIxlXAOGSMnDYi9BINmkfVDbuuuWt9fvS0axubd5561L67IDCrXwk+KV5hwP3I3+DpX+tjxpoKiJAjI3nr@vger.kernel.org X-Gm-Message-State: AOJu0YxS9gvmlArNF1UqgntpKB0sSrLL8fm1pNvRI2I4KFh+Ycdjip5Q wAaNWNmu5TSiaiMzhDZidA/0nVbfhEdfbuTP6e4Mj2JUEHFcAfs2erxfRILI/Nzi9A8= X-Gm-Gg: ASbGnctOpRj01ZGkOWbmqdWxj2+ksjxo/CEVTVRqVCEujPfYXGIjngcbb1ZeTdIE0C0 V2c8qzexwynjM8Id+xonppa2oeeuGbgm+3OyzJnSQaPE6E81hWrCjo1X1dybX7P6QOepKj4dVWY FmZOeGXI54tySFPeDrkoen9XmrkkFwnByZGlhwtQRzJA8KOjRTU/my7kcPeCdKN9zXl30QRt2/v O5IkH+3zkiSkSZBu172e/3jsTRLmCsC0dOeDdRIoqL9mRL1Czn/RpIT/aayAptNk0vkSC6OQ1xz ZMfzcnK8tXvOQ1VROl8I1mADWfx7YGAkTijgLiZlr1rK8xQYWshJkup7fVqmFD2AweCQvJRA7by bcywCnRJfAwT9Ok1JMRW24dbThGQG5VpepHG+5R4cyvvOS8NkjSxh3LwNWugLjgNorOK0M7QMEZ CS4Q== X-Google-Smtp-Source: AGHT+IE2FO7VIZaFeVJY5KU2r630EjFzadS4s75s0S/BwhMpT2559l4J/Oty1dGX6agEpkO8lUIXsQ== X-Received: by 2002:a05:6e02:3b82:b0:3e2:83aa:1375 with SMTP id e9e14a558f8ab-3e41615baf9mr95938835ab.14.1754193558557; Sat, 02 Aug 2025 20:59:18 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:18 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 30/58] dyndbg: reserve flag-bit _DPRINTK_FLAGS_PREFIX_CACHED Date: Sat, 2 Aug 2025 21:57:48 -0600 Message-ID: <20250803035816.603405-31-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Reserve a flag-bit to remember that a pr-debug callsite is/was: - enabled, with +p - wants a dynamic-prefix, with 1+ of module:function:sourcefile - was previously called - was thus saved in the prefix cache. NOT YET. This allows (later) to cache part/all of the dynamic-prefix for each pr_debug that gets called. The cache contents must avoid the Thread-id (its not callsite), and could avoid the line (to shrink the cache). But then line needs %d each time pr_debug is reached. ATM, this is just the flag-bit reservation. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index bc26bc9128c1c..0f7476456614e 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -38,6 +38,7 @@ struct _ddebug { #define _DPRINTK_FLAGS_INCL_LINENO (1<<3) #define _DPRINTK_FLAGS_INCL_TID (1<<4) #define _DPRINTK_FLAGS_INCL_SOURCENAME (1<<5) +#define _DPRINTK_FLAGS_PREFIX_CACHED (1<<7) =20 #define _DPRINTK_FLAGS_INCL_ANY \ (_DPRINTK_FLAGS_INCL_MODNAME | _DPRINTK_FLAGS_INCL_FUNCNAME |\ --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.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 7069028725F; Sun, 3 Aug 2025 03:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193563; cv=none; b=D11/4SKFTk4wJZFSDH18Qz5LvnS7Ct5qdbU1nDnPUgtPewCf4pTSQzS7Oifw14GxdifaqLOt/RKcU6pN82JtuTXuhIA0SW4TePX+F+a9lEL8F+LkDdmGENoS48BGdsioXeBDow5DwjJb1xkuYTQZvWW4pMib3HgmXMnYDDLe7LM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193563; c=relaxed/simple; bh=n5iKMsIIu2/P6zRK0US0stmRoXhG6gIyqo4tYMLYMyw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nDAtK4OSUMxY1Qqo2DFKeLV6GZ6/vsjDwRBOjmu4VkgLMkBEuLyTpIm81aAtkknn8AuYZJ9O1Q1NBQwfvMu1OpKlLSBooiGMed+iyG0X76lT6hUtNA6oBRX1ZGopsVc2WUugamaizgUODKjBCyWNewtVeXBP5WbRUzYFy+Uqg0c= 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=lagH6D1A; arc=none smtp.client-ip=209.85.166.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="lagH6D1A" Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-3e3e4a5715dso8643375ab.3; Sat, 02 Aug 2025 20:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193560; x=1754798360; 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=QtM07pJzYNN+E8iBAeVUHbxcWX+I3Pz7zufEOWphlcs=; b=lagH6D1A/3RLaqMIFawwW3KGYYYgEqDsFFOXk08nLlNBA+3FYYTEcsbRoO6lKRPmjN nCa3GVBnHbdAJvm6HsZnChtRfAEn1OS8T64BuPp9dl6r/+1aZYx88XXGBhBffkXm2q5j LOzqCrFeJSZBqlgLw9bKNRS9IlWXD/vTLdu4+e6lP6/+LoW805JIILJmB5sSRXF6KapA vuFiPCQd25jOZfdNfP70eLKzeWAGlwRyXyqy/nwG69Ujy0frrGtPcKDfeXQqNmawyAZW MFjXKAi1ra2fFSBspJH2uhQLyUp+WbuByYvjCj0r6qswgBaAGLR8Gq3yhP0Zicef/sIM gZug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193560; x=1754798360; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QtM07pJzYNN+E8iBAeVUHbxcWX+I3Pz7zufEOWphlcs=; b=AnqcVSKmh3HDkVXQDcwq/sxNJ4C/VGPMEhNkoKJJeUQjc0/Q2v3NTnS4ci1glDnvhc gZ+XwD6YdGmBRoUhhwNNzhhFBFCbn6CwaTBCuO78fagldLn/tC0kKNazUcCpepvUlODh +ujo8icTeF3xG49SD4frXuOEiNNcaVlidemUdLyNLQ4FGzzJJxF7BN+YNe/ZU9O9CW0W NnYgpl3UaK69mhNtXv7d3dKN/2a0nQA0O6w/8CXq3GmraJgF7ASLTxozoBCq5I6dYAAN 0/f/9GPdaTnjOabDE8IKu9aYt4AuDwhrFwYUvDu8YVkFJd51nyberw/rKce/vOfX+4Yw QSyw== X-Forwarded-Encrypted: i=1; AJvYcCVE/3DjSolULMmv+BB3+rCamlCc1emX7BTJFzZefk6M74caTWXNt0tF5Zkknl7yKix9gMhW7+hbVc+P2jpu@vger.kernel.org X-Gm-Message-State: AOJu0Yyl4Se5SyBzKAL/rUwCDgA+R5bHiuParggAHZccRap3oye0vbKU I5dY5/AgIM8zXeUvNr0jA8LpJq3DKX+9zPiLZqRAehMTJ82tbPpNqNlY4rOvg/B0otg= X-Gm-Gg: ASbGncs16OtIKoSncl8/M+vf1J8GtRL0r11yYtDIoVoy4ItFkDPZ9Ieb9IdpgqUW54M PPTeSmjgmWIzYKMEmFweRk8JysDoYPM0of5NKfV2NSNktknw6LIzvuCWbm+gOl1m8vyIvL9FPhF x7jc0CNb/xGZF7Uww3pxVf110vjcI4ajy+KGqdtJSJRdUxkfPI6rPxxRWwyjTghTw/EDGQqU3Ve ZGI9Z9p0zLVS4sxVG1IO99qREr7AGfqEg8zucWzhBhi9M2R1ly6xvzHvkXnojOCGrEq4NumIWkr ImbJ3gBn8CUAr/NoFXvRx1mYAGp6ZHpC7PYnjhAPjvIvS84iOijPjGx89ZWfzx9S1UMffs1Cd66 UYgeHRAP+uBbcIzhvbptgZQWBWkd7rH0hE5X7KrhwC0pvslTCNjr0IrRRldCtp4aDa19Fqt7UTL Ii4ej1XUL+B5wKbh5jSU5qU/Y= X-Google-Smtp-Source: AGHT+IEkAFQydYpFJvb1kzqjmURuxfZ7yJ+hop2qWEkeOQ2xbV3exZjxsMe8uB4jwvdg4HEc9Ir9zQ== X-Received: by 2002:a05:6602:6206:b0:875:ba1e:4d7e with SMTP id ca18e2360f4ac-8816832db31mr945512039f.6.1754193560218; Sat, 02 Aug 2025 20:59:20 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:19 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 31/58] dyndbg: add _DPRINTK_FLAGS_INCL_LOOKUP for +mfsl flags Date: Sat, 2 Aug 2025 21:57:49 -0600 Message-ID: <20250803035816.603405-32-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" dyndbg's dynamic prefixing can get expensive; each enabled callsite's prefix is sprintf'd into stack-mem, every time a pr_debug is called. A cache would help, if callsites mark _DPRINTK_FLAGS_PREFIX_CACHED after saving the prefix string. But not just yet. _DPRINTK_FLAGS_INCL_LOOKUP distinguishes from _DPRINTK_FLAGS_INCL_ANY by selecting *only* module,file,function fields to compose the cacheable part of the (+tmfsl) dynamic prefix: -t thread-id. not part of the "callsite" info, its from current. doesn't belong in the cache. it would spoil it. do it in outer: dynamic_emit_prefix() -mfs module, function, source-file they are "lookups", currently to struct _ddebug fields. could be accessor macros to "compressed" tables. then they might be worth caching, ready for reuse. -l line this info could go either way. I elected to include it in LOOKUP, so in cache/inner fn. this makes cache larger but avoids sprintf %d each time. smaller cache needs smarter key. All enabled together, they compose a prefix string like: # outer -----inner---------------------- "[tid] module:function:sourcfile:line: " So this patch extracts _DPRINTK_FLAGS_INCL_LOOKUP flags-combo out of _DPRINTK_FLAGS_INCL_ANY, then redefs latter. Next re-refactor dynamic_emit_prefix inner/outer fns accordingly. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 0f7476456614e..d64f13a7a7394 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -40,10 +40,11 @@ struct _ddebug { #define _DPRINTK_FLAGS_INCL_SOURCENAME (1<<5) #define _DPRINTK_FLAGS_PREFIX_CACHED (1<<7) =20 -#define _DPRINTK_FLAGS_INCL_ANY \ - (_DPRINTK_FLAGS_INCL_MODNAME | _DPRINTK_FLAGS_INCL_FUNCNAME |\ - _DPRINTK_FLAGS_INCL_LINENO | _DPRINTK_FLAGS_INCL_TID |\ - _DPRINTK_FLAGS_INCL_SOURCENAME) +#define _DPRINTK_FLAGS_INCL_LOOKUP \ + (_DPRINTK_FLAGS_INCL_MODNAME | _DPRINTK_FLAGS_INCL_FUNCNAME | \ + _DPRINTK_FLAGS_INCL_SOURCENAME | _DPRINTK_FLAGS_INCL_LINENO) +#define _DPRINTK_FLAGS_INCL_ANY \ + (_DPRINTK_FLAGS_INCL_TID | _DPRINTK_FLAGS_INCL_LOOKUP) =20 #if defined DEBUG #define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 C92E82874F8; Sun, 3 Aug 2025 03:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193564; cv=none; b=aQ6OxbFmm03M3svL6f2O/zgSuSuCq4jLcGsHVigcep5/JApZRebUu6Aabeux7lAEwu2KBbIrylvXOxnMjpMnNman5ULcXgD9XqWSg7ggggRhgOFrGAAuGZgV3x8eh2luy71vUduV+xf/MFsGbqklPKBVoVVlfFPxpz4Cmc9ZVzo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193564; c=relaxed/simple; bh=sL1lkdjAUCQyqokA7st7/Z+BY2dzq6VNkgUjkZK49wE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PUyEw/NKuJWHD2AV3E5cfA1La0FWtsRx+ywnFOouv2ZeOJMPoulyg7wbF7a1TMMBO9mi2eDmayExenB6m1e/OayQZVxHEIdR/3xhNCcbkLi+ggGSbVLDA/ydJ2nfw4+wwiXKMOPpa3ISetum5YhwXtIvFobiRX2Pn27kmszPvCM= 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=TbYP2hE1; arc=none smtp.client-ip=209.85.166.169 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="TbYP2hE1" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3e3c34a9b4cso38296645ab.3; Sat, 02 Aug 2025 20:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193562; x=1754798362; 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=WA9BT3YNmpiLht3dKaMvYWse8nMOfTq2XV6jwNxcq68=; b=TbYP2hE1Q54uNqU0pGoXjoLmgOtula1dnC7xEejCUxKHK3Z0fCHYATtY1rlLd0d50v dLN6xPDUkwG5E96sfQ6asnSsYta5Yvo019uaNn0gm+17WCpIXy4sO2GJyQcCk+n5Otcy HhFwGGX+ftS0Sb49Kl5O81cX2dvaCxFQ/USrjXEdYi+GoI1fKw1Qq5Qn26ZryK2Ck6pN j9kl2sDzY8thZDOEB2UxeumwX/uPpDGOdCP3ygp8ywk0ZRnBO8wO+WN+cXSXBCHM5P2Y NUlKSGWJWmwbWAYtecyfxapy1Re62Nnu3+ROF8ft1jR5ah4nGIx1c2DmyDtdtWf2SAR8 uE4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193562; x=1754798362; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WA9BT3YNmpiLht3dKaMvYWse8nMOfTq2XV6jwNxcq68=; b=U2vg7fU1xUm56q4rZAZDB5oz/wb3Zi5AbjFhhgYnYqds2Rz3vSgwxnnRrYMDpItyi5 6SLhqcyZ0jIc383vFEB35xPUkszD5i95iw/CdtpVTLERJ2sAK3gTmS0XI9/BknfyOVJz G/1Vab3+3gSaiDus4RzuM/5yJrAVJ0QbcD6BJefurYZM6s2bhzmzzwVD1J082ezKguL2 MzcAFKNuadgmOwXZ07ObUwBMAcd2sLNA6hQ5oYAbnOvdkt8T5hGb6V26D5hycjIfAQn1 UBpIkV6fpkSqI/znduwyMR/q881veim32Lt53g5uBDk9OzCJgvWNbRUg3tv0cDDYSiv7 qjMg== X-Forwarded-Encrypted: i=1; AJvYcCWITwcqjfp9XJ0D6tFu3qCYnj7s7j4O3AMHV4HIHpEOQnKuFvbgrXu85WzIfbeoP1s1u+7qAjx/IzG5IEUk@vger.kernel.org X-Gm-Message-State: AOJu0YxQ5lvUyYZGdmEPJXCs5IXdHGi6PuDHoFq44c7gko1EcPBOn0Ie 62srUm26NmngpsJgC1LXpl9y1IidYlzdImsW/sk4XdNTWKHtUjrO5O26YgG3OJlWBP4= X-Gm-Gg: ASbGncuIyp9IRGLoSbbGSZiE8lR0cQN7YzodhZaQMCfOhVKqSFDi5gXx3j2HZmaQzs4 G9jIOTz3j10yNYyi3F3vQM2vHn2iwAOBxfWRu3pT9S1zEfG99mHJ9aevkkHdg+GThXUmfl75Kq2 NoXakn3dAGxRH7Dy4O3lgOwYdKW0+PYNmoVq7rkcGll+3YMAZ1FdJ0CDXIUisb9vkHSa8BPSSYR boYBoKNlGuDq+qLejEJsR06JajJRhYKd3sQvvKJyioWbeOxUzMBOMg3X1NZ/Pb+6RUlXExR5tgD Fl3iYULUybzBmaPFOWlSs50osmSqVWEkRCVzssJJGhiWCuYEM0yz2ebab6jnZSty1VtNvRCwYFM Y9p02fRj1gmSq+IH0IkKNowjoAxC/ugCamb0UmlMllscB6RoLzM7ejmYp1AnxRUt1LM5u4KFHpj RZIQ== X-Google-Smtp-Source: AGHT+IHkYA6Ve5qjyBOl298LajPA2dLsLYiKeEEffa0px/i/mFWvep0iac35UJUfFk5w3QjlIsT70Q== X-Received: by 2002:a05:6e02:2382:b0:3e2:a7a1:8cd8 with SMTP id e9e14a558f8ab-3e41611a075mr96109765ab.5.1754193561731; Sat, 02 Aug 2025 20:59:21 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:21 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 32/58] dyndbg: refactor *dynamic_emit_prefix to split lookups Date: Sat, 2 Aug 2025 21:57:50 -0600 Message-ID: <20250803035816.603405-33-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Split dynamic_emit_prefix(): 1. keep dynamic_emit_prefix() static inline check ANY flags before calling 2 2. __dynamic_emit_prefix() prints [TID] or if +t flag check LOOKUP flags before calling 3 3. __dynamic_emit_lookup() prints 1+ of: module, function, src-file, line Notes: With 3 only called when needed, print the trailing whitespace unconditionally, and drop the pos_after_tid var. By doing TID in 2, 3's output is cacheable in principle. A prefix cache would allow de-duplicating the redundant data in the _ddebug tables, and replacing them with space-efficient storage which is not fast enough for every-time pr_debugs, but would work to fill the cache the 1st time its enabled and invoked. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index c3e27637d9357..26261b5f99f05 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -824,19 +824,8 @@ static int remaining(int wrote) return 0; } =20 -static char *__dynamic_emit_prefix(const struct _ddebug *desc, char *buf) +static int __dynamic_emit_lookup(const struct _ddebug *desc, char *buf, in= t pos) { - int pos_after_tid; - int pos =3D 0; - - if (desc->flags & _DPRINTK_FLAGS_INCL_TID) { - if (in_interrupt()) - pos +=3D snprintf(buf + pos, remaining(pos), " "); - else - pos +=3D snprintf(buf + pos, remaining(pos), "[%d] ", - task_pid_vnr(current)); - } - pos_after_tid =3D pos; if (desc->flags & _DPRINTK_FLAGS_INCL_MODNAME) pos +=3D snprintf(buf + pos, remaining(pos), "%s:", desc->modname); @@ -849,8 +838,29 @@ static char *__dynamic_emit_prefix(const struct _ddebu= g *desc, char *buf) if (desc->flags & _DPRINTK_FLAGS_INCL_LINENO) pos +=3D snprintf(buf + pos, remaining(pos), "%d:", desc->lineno); - if (pos - pos_after_tid) - pos +=3D snprintf(buf + pos, remaining(pos), " "); + + /* we have a non-empty prefix, add trailing space */ + if (remaining(pos)) + buf[pos++] =3D ' '; + + return pos; +} + +static char *__dynamic_emit_prefix(struct _ddebug *desc, char *buf) +{ + int pos =3D 0; + + if (desc->flags & _DPRINTK_FLAGS_INCL_TID) { + if (in_interrupt()) + pos +=3D snprintf(buf + pos, remaining(pos), " "); + else + pos +=3D snprintf(buf + pos, remaining(pos), "[%d] ", + task_pid_vnr(current)); + } + + if (unlikely(desc->flags & _DPRINTK_FLAGS_INCL_LOOKUP)) + pos +=3D __dynamic_emit_lookup(desc, buf, pos); + if (pos >=3D PREFIX_SIZE) buf[PREFIX_SIZE - 1] =3D '\0'; =20 @@ -859,7 +869,7 @@ static char *__dynamic_emit_prefix(const struct _ddebug= *desc, char *buf) =20 static inline char *dynamic_emit_prefix(struct _ddebug *desc, char *buf) { - if (unlikely(desc->flags & _DPRINTK_FLAGS_INCL_ANY)) + if (desc->flags & _DPRINTK_FLAGS_INCL_ANY) return __dynamic_emit_prefix(desc, buf); return buf; } --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.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 55F12286436; Sun, 3 Aug 2025 03:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193565; cv=none; b=cdkfwVQtRlRryv3SP1Zbs4aWiWG6OcpxOFuL0i5vphHSmx8vhqcAhieSNq+wXmLNyxEUlQsBn+0W2tFSBeK8cd31itlq/VwT4JuiNqCne1S5WTgk+x+dyMNyqeAI6hhc/ZiHrUGDu2yOBHWq9+Ckx6cZmWTNnucGszOnTiduVIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193565; c=relaxed/simple; bh=Qf0BV9EMCsNaV3/y85/Yi6kzzZVn/+XS79as0FRxtxs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m8Q/SxNSTtBuYhjlRuYdPHb+0owL+XmJNWwzyORTWQyrpNHzKhLzce9XmCvEaOSeJDNyZ03nw9a4M6qBdGV40yazGZuPQQyorZl34tbTpV1tA05sJ+trVBzD3eULFbVK2BFM7d385+gUtl5Ji5uL0RYFgCrDeAzpufqWKWwLG0U= 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=IKs2lu2l; arc=none smtp.client-ip=209.85.166.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="IKs2lu2l" Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-3e3f152700fso12488315ab.0; Sat, 02 Aug 2025 20:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193563; x=1754798363; 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=d9PcjPUjmFrLewSvRSEJPDWXh0n51inHqjt5GPCorNY=; b=IKs2lu2l36xU9rpb20z5oJ/GGWva7dnRR7UsDk8xXzyNcs6pxDRulwxLBo2O8MdxBz NHVz3c3HIeKc+fN71/W0ExnLn44aWWaTBIiYqIg2TpHN1mP14AOk3V7C80UIHv439db1 JleLF8BkbiUURxPFds3La4Sol6fzT0k1TT5sdL03CebFva9o2SDmpUIphogpnjKqc4zb LNpCg61dk+EvSszhlz+xf447hG5dSkQKQvoJ5hgO7JEPipvLwvOSQbnQxWrMMMKOx/D/ qgRsYJov5r5KOO/pTFeJLUBPCnjmdmSrxLsTs0bVmcbi8ym0HOIyHS3BhMpGX5T6asWK V8Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193563; x=1754798363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d9PcjPUjmFrLewSvRSEJPDWXh0n51inHqjt5GPCorNY=; b=AbP2geI/5e2d0NzbfnVfAuR40OE+mE+epEXwiPHxDzF4iDmshef76ejmMou2kfY9cX S5ybhwKcpIpktF2onWV67Oq3Zo/QYZVb+9zDcSvfG4bw7Ty6eoEAfvIQtsa8QWMzm8NP 2SgDXlQaILB9JuDqCxuX8oSkYdC9ebJxNcriCHu/sfiFcqqG52/AXHrcjHp+7bdsahq1 PT4muIgmPhaXYXHCKkS4yGjIWh+4GlaYbAmLbJU6dXzWDXT9gToiPww1oGCTlQhwCatk z564Ka0UoUAE+6FBAFq9cgMV8jLec6UQoqOGmindKhXF6iibK3pqWS+DUhi1Ah5CV+Ef /aDQ== X-Forwarded-Encrypted: i=1; AJvYcCUlHme+bS0AbmFPaijYcRt8juHH2Up6P5HgBniqwu/bYJfgmF5A2Zyj+9X1lcVOgHs0OomcNHA+bm6C+Uzl@vger.kernel.org X-Gm-Message-State: AOJu0Yxs+1zxQelM4JBMRjv3xQrPkcoATcJkcJoAUD246NnJQSAek2/u xuw60jpDPrQlLAR3x/amgDKu5gAdPJpsfuLldamF5IQ+TM0YH16fumFg3PDevdem4JI= X-Gm-Gg: ASbGncvGEIfKsPMCdZO8MW5xaIFBYaKuvZQvnwHJuJulW9HvTrRkoCEG/z+b3FjcVP8 T0/xKnd30XJN+GkmNBqlbzzmoqnBIT+a+Hw4dtNp9cSuLDVXPInwVMAblZWAM1ghJljkWiECWz6 vw9tHC+QSwzpTW8Qyk/RFS0UBjjN1D6WefosfQLW6zCQUBOZwd1bYEe4AOZpN9jLNboXiBQ4fN5 hJ9LOFC3fWXlibs2uAZzafPAlUGWiYuHG5wLMUi+25X+htrlgW1FyUH6iGvdkirV1nlTaVp6IER kcYQQMlLTzXdU74lMlIJmdDH0UOQ7lUM9A0aIzhE1w6i1oz/cJpSUVZEXw2fSRMamxP70j7s2UY p2g1FprvDpQVMU36N4AlIF8zpCCOQS+d5u14dg6tee8jGKGpP81tATFzgh7E0dwzJA5i+AS8se0 csTg== X-Google-Smtp-Source: AGHT+IGHik12b+NzuHXdXH1TPCs7I43pZRfGChkNXR0L9WcmFgFx3EM2Cq+84hECD9IhAilvjxg83w== X-Received: by 2002:a05:6e02:1f85:b0:3e3:e78e:4e0a with SMTP id e9e14a558f8ab-3e41610d65cmr100228055ab.1.1754193563265; Sat, 02 Aug 2025 20:59:23 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:22 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 33/58] drm: use correct ccflags-y spelling Date: Sat, 2 Aug 2025 21:57:51 -0600 Message-ID: <20250803035816.603405-34-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which disabled dynamic-debug in modules built with: CONFIG_DYNAMIC_DEBUG=3Dn # 1 CONFIG_DYNAMIC_DEBUG_CORE=3Dy # 2 CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy # 3 NB: this adds the flag (when 3) more often than strictly needed; modules built with CONFIG_DYNAMIC_DEBUG=3Dy (!1) don't need the flag. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg descriptor factor= y macro") Signed-off-by: Jim Cromie --- drivers/gpu/drm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 5050ac32bba26..96b57b34bc505 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -3,7 +3,8 @@ # Makefile for the drm device driver. This driver provides support for the # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. =20 -CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE +ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE +subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE =20 # Unconditionally enable W=3D1 warnings locally # --- begin copy-paste W=3D1 warnings from scripts/Makefile.extrawarn --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 AF4542882A0; Sun, 3 Aug 2025 03:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193567; cv=none; b=F9JTOb6JIuIw6+1z3oedS1eTW868wzXUBQXrL2GK+F2RlX8LDBgoBLVeUaLtt39KUKs+xVQFIqFgORLdVfTQ9NBX4LhZfdUsLCdpWhsHNX+qRm5Iy1V0DHYS/AnxEtm9++JuzheWGoUpSLyS2WFQ3dP2XrbFbvEJHhcwf/GDn5k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193567; c=relaxed/simple; bh=LA1Bxp6ccKS4RMXz0bdyr/rvpCjVEFZv3WJIX+Ftijc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Orr8amHaEKyL1SnWNJaeteU4NX65ciaONzyndjagvbUGUwFUcH56mFvLw7NPlSWDkHUttd+hOIpOwha44RtUyEIOml+aFCp0ieCyCx0B1e/r8HWOT3t1EBLAy0ygw6zsOX82xmBPHj8g2+zR9NrZYA6zs6RbOjZXfoVyglsWwLU= 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=dxq58q8C; arc=none smtp.client-ip=209.85.166.173 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="dxq58q8C" Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3e40050551bso23420185ab.2; Sat, 02 Aug 2025 20:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193565; x=1754798365; 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=qE6JxyQwiWHZBMKi6WQ8cp8jsc9voUk1gJ0tGlbbje4=; b=dxq58q8CgminzbFoCuAL3rXLb+Fn5iBaOr6y5+X/6XSU3qoRZvnfUZ2qKXDxvzIS2E nWAB57GLW6RCBUoFGQliMNnw6TgCy3i/P2rrekw/oyBtqoPPCZAIb2NhkU+oWPy5BTV/ 5COB/TN2D2NT20cF70sS665mzQhCyDDQJcCGpJaEDv8B0JgPwMr/3E8UNLoSumupp6aC G87t5XDW77Ip2u3MLogOYVF89ZGuLx9oCo9v+fiioGystvmIFZ90rA5zNWiPjJrGtAJz 0Ju4QPN3eGdkl/NcJjJ144vHiBFUc9YfDH+MeOZQfflui8/wFQcXOf41FDvXWoKy/UXU WftA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193565; x=1754798365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qE6JxyQwiWHZBMKi6WQ8cp8jsc9voUk1gJ0tGlbbje4=; b=UVBgTMhEPi7xPdi8ugnMKwaCj7aigaPfK+e+cOyPVVQaFVmUd31pITFJUI3TLxtm9f qmV5612YBrSOjaV77rzYBT5WC4oZ/N77XDzkbxnQQVxvtjHKXmIpk2LtAuFso3evE3sI mzfzQ3sTwb/aQimaAjiCFnJTnJnozEOsBS7bHSIorTk7Or4bp1NYBIK1BPwZSO4OtHy+ mbLy5MHrEg9sqK31EZe9im11DL6KewZlnH9LIr7y0u6zmRiaA4L0cbmB8s7Q+7+wCklw x7EozvAI38HmXiiFp01SgYBOqlb9cbEQ72TTNCrQSNArcr64Q1AVSUqBBoa9MDCZ1xTj chgg== X-Forwarded-Encrypted: i=1; AJvYcCVj6OWm6ucnx0VMBzs+AYQwup4Ov98twg+DFrPFZ4RZJZPNJoB/tSyScWX/nnbhIVhK0JvtbzZLWTGbj4x+@vger.kernel.org X-Gm-Message-State: AOJu0YyFvYs9OhzVuOwmPL8rq7d1poaacE71O3SzTNx8oq5rEc2GlDw7 BsCoVDC/qbu3lXdLuWAQTdUw2fcy/1BEffXu6S4IwUBx0x6JKIpcgJA5uu5+9VyCWyI= X-Gm-Gg: ASbGncsDcGNsYTriLLRtVzwe3WVc9t8Sl1Op49w8Kx4U+kcUWI5QI0HvJOYVRZjsLmB 76jpS2c78gnTQichgGKV82xmFxjHHgqoiGxfePT0z3cUfnOGXuxjxsj7lKsIZyI3RU4AUaVorPH lV0RcRyIZqTWZxTL5DV5A9hRL/uK3QPY8yhhRE2PlyEXZCMy+0c5hlFegJjpSUyKmMiPusrXinL 42gsc8fvQ22r/bDP7wwn354aFiaKVmYCVPjxjQ9eo2/gkncgVjy7rdAIfgtHjT6At6zntNYVEJY xKZKdOVmKJYMSMuZTm9sl/XeYzO81wqfgj8u7kGtaae6lQQhxZ7Qi7h/rXQYZjIzobUhORPNrt7 OnSYxiK2I/Ua3rQOyLsBOEa2pmx301HIRs9mQAsca4xF13Rkp9fi+zUGWPhJ2PVPOVL2nxLTMHP QNbbkizdL/tByR X-Google-Smtp-Source: AGHT+IEcJd96ZbRdB8HACajO/EedKr9dmR2Fy+zza3wMWxlrICb3NJAXPqemd5+ww/dq/aKcOT0zCQ== X-Received: by 2002:a05:6e02:1485:b0:3e3:c6a6:2799 with SMTP id e9e14a558f8ab-3e4161e006dmr101903435ab.21.1754193564670; Sat, 02 Aug 2025 20:59:24 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:24 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 34/58] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2 Date: Sat, 2 Aug 2025 21:57:52 -0600 Message-ID: <20250803035816.603405-35-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to do too much. Its replaced by DRM_CLASSMAP_DEFINE, which creates & EXPORTs a classmap (in DRM core), and DRM_CLASSMAP_USE which refers to the classmap defined elsewhere. The drivers still use DECLARE_DYNDBG_CLASSMAP for now, so they still redundantly re-declare the classmap, but we can convert the drivers later to DYNDBG_CLASSMAP_USE Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- this ignores a checkpatch WARNING: Argument 'name' is not used in function-like macro #70: FILE: include/drm/drm_print.h:148: +#define DRM_CLASSMAP_USE(name) the macro is empty, and correct. only 1 arg is expected. --- drivers/gpu/drm/drm_print.c | 25 +++++++++++++------------ include/drm/drm_print.h | 8 ++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 79517bd4418fe..a3b70d104afaa 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -55,18 +55,19 @@ MODULE_PARM_DESC(debug, "Enable debug output, where eac= h bit enables a debug cat #if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG) module_param_named(debug, __drm_debug, ulong, 0600); #else -/* classnames must match vals of enum drm_debug_category */ -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +/* classnames must match value-symbols of enum drm_debug_category */ +DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, + DRM_UT_CORE, + "DRM_UT_CORE", + "DRM_UT_DRIVER", + "DRM_UT_KMS", + "DRM_UT_PRIME", + "DRM_UT_ATOMIC", + "DRM_UT_VBL", + "DRM_UT_STATE", + "DRM_UT_LEASE", + "DRM_UT_DP", + "DRM_UT_DRMRES"); =20 static struct ddebug_class_param drm_debug_bitmap =3D { .bits =3D &__drm_debug, diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index ab017b05e1751..03b0a2bbf91b3 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -141,6 +141,14 @@ enum drm_debug_category { DRM_UT_DRMRES }; =20 +#ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG +#define DRM_CLASSMAP_DEFINE(...) DYNAMIC_DEBUG_CLASSMAP_DEFINE(__VA_ARG= S__) +#define DRM_CLASSMAP_USE(name) DYNAMIC_DEBUG_CLASSMAP_USE(name) +#else +#define DRM_CLASSMAP_DEFINE(...) +#define DRM_CLASSMAP_USE(name) +#endif + static inline bool drm_debug_enabled_raw(enum drm_debug_category category) { return unlikely(__drm_debug & BIT(category)); --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (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 244A92882D9; Sun, 3 Aug 2025 03:59:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193568; cv=none; b=WNGz6U7Ctef0itsVxtJm93OSlcsE/YhJZKvcQ/3VnUlix/n7Ayj6ei/O8Hkn/8hv6r9SSJC7KqaCBrVYTr1KV9XNcxnnG2q+xAuY0yFvC+f8116xPFNxtWu71QMmJYSTdG6UGEZUcMfg7r5SzE+lF6oAXadZ3rbIBW7RhPtmogg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193568; c=relaxed/simple; bh=PX9WCXb5F8CSwcxQi5N9WJNdwHa/mMWtQGYqtojaU/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MsXp+QO6KQQj25c469jdEmn2YHe1B7d1VYe2MFYVykexrzt1cyQwvx8ggsFjDWrthX9/94lZ2IefRJQD6pN5ENbycYIaw8eUgK18kI05SzTQwNIvjSJepcEarzvxw9v8VKP77Rp3DEt8Yg2PRI1giw7gH3pzMxVVz1zuDQ5LuRs= 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=Cs+Iy54w; arc=none smtp.client-ip=209.85.166.179 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="Cs+Iy54w" Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3e3f378ea68so21345705ab.1; Sat, 02 Aug 2025 20:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193566; x=1754798366; 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=wPCuAnoyt2yaK7PHqEP4KAuT17bxG8DAm/V2Pw+3mVE=; b=Cs+Iy54wigTQZ1OnQPHLZ0Ni3z7++hBa3UEkPe1J6/jC7tdy6Ggu/dWMnnujbPuoNA zSrmMqDvAXZUM7nrEBfRgYCd030bDIR/jogli7RmCnv++e7JUta0KvUTn+VzbGAog2Gy JZwT0nM/Ai+RuKyuXQQRE+kjUwSNmOHD2E8GYjr7LSqDrrPQPz1s13Lfx30KvyG5Sagq aTSo3AywtTbkT6OYomaPKcZbAOnX4ylbrU7ekHgELegL1Hp2cpbkKm3HkpBv06b11h2j FZCfk53AgC1sZSRxewwG0bn6GWTbsCtKkcbJgnaMxOirwcdqwhoSFksiNiXuNlSWOn9C DeTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193566; x=1754798366; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wPCuAnoyt2yaK7PHqEP4KAuT17bxG8DAm/V2Pw+3mVE=; b=KnMJQ/Yw+c2VnvfQa59CW/mQFpdxbnSlXMJAp4onEVbwRrdKoNbT60SLjLe0gBtJ+l 6qstt5NrwQycZbIj92hNBDTQkGFWOjQc7l8BWIDsZ6E5qMTf6DOFx/DfpbqcruFz80sx ddOBEwILbVkW5JpYzlixtD3pWTOcMwcfoND4bBPH/AC1NxW/0Yw/EpAGi4dIImhgDMol Wsyitn9v2F/f+ltl2olZuHAtIk+4g3M+/ll7PXWhoOqwnMAOJnh29OVw2ivkE4JFDY4k T2K8ZZukgdNU7XOINLzAIGsWMnxI1HpC2dMcnfvFJZ2SlkuHknSMjixUIDU/9g4GonRB tiug== X-Forwarded-Encrypted: i=1; AJvYcCWmhU59R9cZmadVPZfC7Dk/Cvo1WtEiKKQg0IiqP/BVan24Bu2jCGdMwnzwVapMnUP4qxMSZv14Cu3c3vBb@vger.kernel.org X-Gm-Message-State: AOJu0Yxzjg0l+kHGBZrUMFOJe4aRsynPBZKWkfSh92hjrN6DCKE2vafu AohjIzehmI/ycdv0kYrnuTDTp+B536JFjNbo1qEb+QF+KgQ5W93BCR6tMOZ7BhclczQ= X-Gm-Gg: ASbGncspbigPy6eU4FwrAaSIDVOwtQGwRizqTRhj6PwiotE4fYd5qJk8nY6bcE8+s8S GZ3p8/CHugb5t64P61Qp15w6Al0vExhSnQHNxvyI9uVDVrQvSWLrQ3h8GBqu8Jgj8u0PC1IaTnX OnSZVTHUKd1CWFeFfaNx+/FHKFREIoKMvMwM7O93fxNzCuUbNm5/QLrB86wNx95Vt8ZjbgohoVx bcPqcBDi3I7crE2N7P6v+tYmmO2WirYuESl/wgsvZ8I1iYClmwFuw8aDYQkFFQFyAJ2eJjXC8pV fEo3H9V1f7XPOmjuHNtVUui/Dld2m4xA+pY6KdyfcYULoUTMlgWiN3Qg1X2mBG99e00Pf5nem96 vRoxXeKyqzvLJwQRihvjn4dWsCp76tGZwdip/aGUwJg8IZxoKkmk6eOC94OeV0YBgwXRZCPVG4R CnMVDqirYW00Br X-Google-Smtp-Source: AGHT+IGoLnVRK0ZsQUveSL4ZB3Aom5SaUMztjFiNEQTdBWyQuqxM4dmylhRHkY6dHcuDvZjPdgtOKg== X-Received: by 2002:a05:6e02:308a:b0:3e3:fc9e:b2d4 with SMTP id e9e14a558f8ab-3e416176df0mr85880415ab.10.1754193566087; Sat, 02 Aug 2025 20:59:26 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:25 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 35/58] drm-dyndbg: adapt DRM to invoke DYNAMIC_DEBUG_CLASSMAP_PARAM Date: Sat, 2 Aug 2025 21:57:53 -0600 Message-ID: <20250803035816.603405-36-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Invoke DYNAMIC_DEBUG_CLASSMAP_PARAM to hook drm.debug (__drm_debug) to the DRM_UT_* classmap, replacing the ad-hoc wiring previously doing it. Add DRM_CLASSMAP_* adapter macros to selectively use DYNAMIC_DEBUG_CLASSMAP_* when DRM_USE_DYNAMIC_DEBUG=3Dy is configured. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_print.c | 8 ++------ include/drm/drm_print.h | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index a3b70d104afaa..46d53fe302047 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -69,12 +69,8 @@ DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DIS= JOINT_BITS, "DRM_UT_DP", "DRM_UT_DRMRES"); =20 -static struct ddebug_class_param drm_debug_bitmap =3D { - .bits =3D &__drm_debug, - .flags =3D "p", - .map =3D &drm_debug_classes, -}; -module_param_cb(debug, ¶m_ops_dyndbg_classes, &drm_debug_bitmap, 0600); +DRM_CLASSMAP_PARAM_REF(debug, __drm_debug, drm_debug_classes, p); + #endif =20 void __drm_puts_coredump(struct drm_printer *p, const char *str) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 03b0a2bbf91b3..769036b2942b8 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -144,9 +144,13 @@ enum drm_debug_category { #ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG #define DRM_CLASSMAP_DEFINE(...) DYNAMIC_DEBUG_CLASSMAP_DEFINE(__VA_ARG= S__) #define DRM_CLASSMAP_USE(name) DYNAMIC_DEBUG_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) DYNAMIC_DEBUG_CLASSMAP_PARAM_REF(__VA_= ARGS__) +#define DRM_CLASSMAP_PARAM(...) DYNAMIC_DEBUG_CLASSMAP_PARAM(__VA_ARGS= __) #else #define DRM_CLASSMAP_DEFINE(...) #define DRM_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) +#define DRM_CLASSMAP_PARAM(...) #endif =20 static inline bool drm_debug_enabled_raw(enum drm_debug_category category) --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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 96E1527F4D0; Sun, 3 Aug 2025 03:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193570; cv=none; b=MYHYaKjFCeSUeTbNYTOMNYNxGDjttMvX+HzpbfVO11GBB57bUZwvM4673INHRH0T/WV7k+gUTg4XKBZ7V1AM2gXzviQiaOQdBhcVxNwHc+fIvwfnr/UX7VG2b/r516HUdZF1WTwTvR5WoRlbFW0W3Tu7LFhTbRjWNX+X3fmiMqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193570; c=relaxed/simple; bh=y6vnPmBDqUZHr/kSBjYUVpfgpIrykQHkP6w1C9mQCmk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lzQwO+zaREKTxVB0ChVTJJnnyyelK4Y9E06gx1bGxFXvvC1MuzOchlPcev8uZMaS4DLDVzhGAfm88NejcBAE2PwUhVjvGOt2oLKdXU/VKrEeofOQXwgZY99U3+eK5vgm9kVevol8x6c688mY4dc4fnboQr/TZW+rAP6drNbtE7M= 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=BBZ036T6; arc=none smtp.client-ip=209.85.166.172 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="BBZ036T6" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-3e40d006105so14219835ab.3; Sat, 02 Aug 2025 20:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193567; x=1754798367; 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=hi5FRwOWbvP0Q9Jpmq/JvqKOu63Zljwrve6PAtUtdG8=; b=BBZ036T6PGB7fpehvNlUzoeIzG7URipiJZ4wCUQ9/p7Z1UBTOcH22KeKuiEw8xxBIK ZDAz8Wyqbs7osXKiuq1LY6piKrAXx2hwpNbCXmJvSxTqjPfHhcArXX305AXG2873EDo/ 5hBtOBqrjIOCZn1OGeYoG2T3vgdgIeSmGtMxerrtydYDjcX0r3snn+Gx0G9oJPR1lXLy GYyGUt9jAuDbebTstGQ9I0TVwTUn8vJMJxhWLMtvmNqQmtJexox206NncbBxLdDGnbDA KmMyw9ZwzBXdzP1kzsF7U6NhcCNU7Mq6qvRu7xkKKOwpHjhb45Zb16D7BCh8aN1wRgk3 wdqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193567; x=1754798367; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hi5FRwOWbvP0Q9Jpmq/JvqKOu63Zljwrve6PAtUtdG8=; b=ihBIdCorpuPXGEnWwglzE9KnvtyEBnDs9q8xSnWjCcOhud7ctbWx7BcEjfvYF7O7Aj aihpUbrTp+J/akjmo1zLsP2/ZeZpSWmPxT+m0p4ESmJwuKOTe4XwJiWTzsoBLXQyOXMl lokzUBSPbLztv5BNHhnzhbiu8SzEzOv1nbPqDZaxuws5JuBdLPQmQ85tnpoy/s4qD0Wz WfGIdIqyBIr7MwRzsRkGwdpZvz4m/sQcOKRsslvOlb0pMZ8ATbWcvyZbit0PAHB7Zic3 l2D84IUDkFWepDfv3wYckXw6fetEMqnE9puyv8qd7kktcmp8RlHNCKnrbJ9CT9f5gIVt +LeA== X-Forwarded-Encrypted: i=1; AJvYcCV/4Ot73duz2kCRzUHECNmQImBAynWYbut+LxvzMHPK7UGrHjoFUs+64iKNLWFa1N80rjQkGGJxjChxxhUT@vger.kernel.org X-Gm-Message-State: AOJu0YzMXLTPD4Sra34SQ7b9dlqr8v1mw4KrPOGdY9Q1ap1uyrKISV9a beQ3SXIKUIAPPbgBhvpzl5r/4w2dZu5AEgUVDAtU9kBPGQipc38WrV++EgX+XY+puo0= X-Gm-Gg: ASbGncuqcl83h5GttrwGulYpmgTvxUTyAY6RcOy7UemmJqnof622G52/GWW+wlnpqJz yrMzD2r3hSoFlBRb9UqTv/9GybeZ4G3b/WVLa6J5z/SflabUGiAEV9uIRCBM2nO1L7A43XnkkOw iSfY7BxWU8u+kbEwr4JxIpMMSnwg+Zk8LCrr/a0bMuuPxw6OzZ+Obputhgi1hx0Y+F1+ck4O7AX MgEZ5dHIYbLqx384UM08nWttfSBnHH8BmryfqW+YoZfLq6cpJa2Zb6TQGHDo8skdjHSwHaccPqn EyLmI9+/JCZxiCkvxdHGlNVn4bje3ll/h3kDMHc4v3QCKtMP0GZzg7FrCnxf7vviP1laHnLRe9r 2ozlYa0wgxzDetJruhpB516nuNXQdeiBvWe928vqY0g/hJhyR0N/R9hUgNJhyWHBfwTihiTQUaJ 2yvw== X-Google-Smtp-Source: AGHT+IEu1fZhS4PGdMY445gHt6SyAM90kHYvE6rk3Vh6MeLyr4clbAteyYxBE5x1gS+10mLcC/WLSw== X-Received: by 2002:a05:6e02:967:b0:3e3:faaf:df05 with SMTP id e9e14a558f8ab-3e4161ae4a2mr76953355ab.16.1754193567464; Sat, 02 Aug 2025 20:59:27 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:26 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 36/58] drm-print: fix config-dependent unused variable Date: Sat, 2 Aug 2025 21:57:54 -0600 Message-ID: <20250803035816.603405-37-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" With CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, __drm_printfn_dbg() gets an unused variable warning/error on 'category', even though the usage follows immediately, in drm_debug_enabled(category). For static-key optimized dyndbg, the macro doesn't actually check the category var, since the static-key patches in the proper state. The compiler evidently sees this lack of reference and complains. So this drops the local var and refs the field directly in the macro-call, which avoids the warning/error. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_print.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 46d53fe302047..41ad11247b487 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -212,9 +212,8 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va= _format *vaf) { const struct drm_device *drm =3D p->arg; const struct device *dev =3D drm ? drm->dev : NULL; - enum drm_debug_category category =3D p->category; =20 - if (!__drm_debug_enabled(category)) + if (!__drm_debug_enabled(p->category)) return; =20 __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 A2406288C05; Sun, 3 Aug 2025 03:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193571; cv=none; b=TQ39v5L1+0lWUt1PP45Ve+jrkN1GnjZCx1L+nn1BynztgRx3mAC0Dt+4VgKWl2zRWW1Uk+lNatAXKvHy4jTaOtElRywXYzda13RRSrCk1Hc7isTauL48CrAA+nwQ4WaImpCishY8H0EjZSTxIlW70lyx5hEsU1pFeNglVENFjNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193571; c=relaxed/simple; bh=NEuXYWs1Nu3RUtMYz4WulmDGQSS835PHhChst+S3OwA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EFbeyDMYf5Adfq+1beeX2owFew0m9LW6FBebXU31LsZiZSS3ABonk5yxXISSFg2sApheX5z31vErRXi2g2x0NqWy/6Hy5DA/ByEI0rsKs6Vv/axUcWoD4v/B8VPFiwezgfFm0zzRt31hUeRq+Ub2f4P7UsESFGnx3mUqBhEHNhQ= 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=cCLxm1QY; arc=none smtp.client-ip=209.85.166.169 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="cCLxm1QY" Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-3e3f449fa6fso30582495ab.3; Sat, 02 Aug 2025 20:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193569; x=1754798369; 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=EDxCUuQjUGu8gAgTcWoe0tjlRu1oBXDA/+Q2bzPJkMc=; b=cCLxm1QY0nitueS3nlppF6yZPPtbfZsUaygvQdtGx+IWTyJxCAi5Ad5n9b9NqeY53C IHorqv9NiPcg0AkjZPOmbrHrha9W++6CItK8CLU4hI1F12CPKCYtji0kaOShpkukh1Tq M0w7H6nwcYJtCMAiDqwF4tr+ucR4oeRaHCKLTU7p0AxQoIkWA61fbJJT/CXjR5X4HoSl 2/KAKgpW+us4CREXUD7TwYzW9Pj3xtcYFiDDowmHqYYKCt9mfh8jyL0wAG/rMaTpjBWQ P9hw5lcJF/Xo4mFtDLrEhEmrgQz+3zkAA41Vo31kh+Foxbl1g2OrhWhDw8Ctwhyo6M6P Cziw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193569; x=1754798369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EDxCUuQjUGu8gAgTcWoe0tjlRu1oBXDA/+Q2bzPJkMc=; b=ChGNGbt5z5QhSSByzTf1HWRa6GCLy6k+UW2eVoj5//8vHa2MgdzvUUQS+YMk+TJUVx 1AbIxt5MpBmY51YNP0Ad3ScrnlyXxfpY9SqxJrwX8YFA45ftNTeBF+1lHCKmgoKFvp/T uBFoBmqi//f6sqaNvsFxLggB6NeXrXYGhqEP3HA/ko/YZYl05HGG6TnwN+Yim5MUMHvF zNLMMDESI7n463urdpeG0qbIaxetLiiuHBCs3kgnJKY7DNyYCPpErDDlf/pkZGTG+N8a 55gDgiJnll8JfcCeei9WCNdFrqmyeo6qsqP+rSuD3Hgl6BzGk0wgdi/HaZAJqtCCvRzh Gfqg== X-Forwarded-Encrypted: i=1; AJvYcCUDm45Kwo0tGkxYwDWmx7NuFg2fq9+GaYgk1za6m5JkB/5VNLxnAnen/2NSZSlXWyuO699vRufGkhSqdnjl@vger.kernel.org X-Gm-Message-State: AOJu0YzB0MNBs8DsAbKqsiD06P8ZqIT52gU3934FXx/DJFw4G7GqEhrd mZRU/r3KQ82I9Hjw0/niX4bhhhiy2VCHAWJrece5521l9Rxf3we57uUFH3+idUp59vs= X-Gm-Gg: ASbGncu4nDwF85H5C7IoBv3wB7QYrFfibvYpC9eP/t7l8PneCwYwfUSW+qmBLIAmZfl TqcVCOHjZn1loiVVtCi1Spws2/0aLIf0jt+CkMjHYfDykGEkCQJVWoBLml49MlKe0QNeky0kEQO 4RjteEA1rs4EqWO18JULHO/juF0HJp2DZnIYexixCwr7ZxmvC9rxgLmNeGZ76ou7pr0kD+JuqNP g2q8u8MEmG6trXzFlA4C0cX+C/NkAs7CTIw9Gagxmgq/tB1R0Qa28nGhvfrDSiymHor6lJbVkwa bok5wvYMq721xBTYZKn6w0gqW18HY0Dc4qoveFIhhOsIzTL92bLPLROXZcYB74DkcB6BA5OzzVZ 7nCjVSBHLhQEP4KGzO+1IMa7s57Kfyxh6FFH3E7jr+cGLpyNr+5WNMafT1N/OFjT2Wk5RLE1T5x iCkQ== X-Google-Smtp-Source: AGHT+IGth3u4prFPioIoRO0ZqX+noSjESd93MJR6zagV7L9uNGSa8yCZng+SW2QdyW/djCNVq3SQ3g== X-Received: by 2002:a05:6e02:8e:b0:3dd:89b0:8e1b with SMTP id e9e14a558f8ab-3e4161b3e64mr95013645ab.15.1754193568672; Sat, 02 Aug 2025 20:59:28 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:28 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 37/58] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver Date: Sat, 2 Aug 2025 21:57:55 -0600 Message-ID: <20250803035816.603405-38-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/= amdgpu/amdgpu_drv.c index 4db92e0a60da7..b235e1e8c6180 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -245,17 +245,7 @@ int amdgpu_umsch_mm_fwlog; int amdgpu_rebar =3D -1; /* auto */ int amdgpu_user_queue =3D -1; =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 struct amdgpu_mgpu_info mgpu_info =3D { .mutex =3D __MUTEX_INITIALIZER(mgpu_info.mutex), --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 55C44288CAF; Sun, 3 Aug 2025 03:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193573; cv=none; b=IBqkYI86u9QDDP5aDL41ycy3CziBGUQ/MDbJJkEcEO3dRweTOV74XpajcMXPpCW18ymAZTgbzvMTWgFuDZfDq2YCW99TRGR9G0/lSEYewAqke6dj+D01y9tmjslKPvYyyyKzzTKuQZXYulVRngf32ZbI/6vtbwr7veMzDyS1p4U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193573; c=relaxed/simple; bh=zT461b2FzFFJCZzizTkbtgkGyEOGBSWSF2g13psQ6ZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WTfD7O0wXcCkJn/1l0hA8Vav2DSLTCzwn8j14xd5emXxEjhewbwfHvznq/rnTOnplSjlskI8Pck542DoynXJZC7JzJYmTeXK6+X9qSszTavDTDFQ5jeMYu/sfHHla7eKlrjCC4OFwADBPAM/sb1hvedtRCbSXI2mHTihAOvJtNc= 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=EbIBDuPT; arc=none smtp.client-ip=209.85.166.180 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="EbIBDuPT" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3e3d31a9ac7so12935055ab.0; Sat, 02 Aug 2025 20:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193570; x=1754798370; 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=IqxoGMNKs0zT3PFEOQHIVmiXhAzu6aMNCZrDaU5Xy48=; b=EbIBDuPT4IKz9B0Uwna8R1mxuYXV45GdByO4Ko/RP3tnCpA5IG0ekDgLMSW1GI4i5U MoxL35BwEhyrwuDo79OZZGRxPxUYKHG3Ue3jBh3CTEXfnfQDZ8aYxirLwJiELl8olJpF 7bF4UovhHBe7ypFRgZ6gpf6vOKKLsOGAEWYu91/VSBhsAo48SRNQfPeviAxv3cBiX+z9 MQp34jwrnKiLwp0c5mz0k3im1JlibFs3ZRJxtc5/q2H6dKtUrutWo3Oyj1js3Timuxn7 GsB+8c35K5ZJXm7+NzyFIoP3mB4ePg3+ULQoSNWx1sbDhHJzIaSTrvbVOeCJlJfzCoAq o7iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193570; x=1754798370; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IqxoGMNKs0zT3PFEOQHIVmiXhAzu6aMNCZrDaU5Xy48=; b=Y/dS4r2bUPRRRkz0lnVdIEUUTuj0WweS5MF1vVL1yL3UQYgApSpsXKkjvBJ1bO72XZ ZYNMtn2IzObXyLOz+5duUWTONi5sDytRFPHoTo/lzi9ke0qLwqTsi4C8K/r+OK+sW+Tl YCGTbW/Xsce3xORvbtFsPXCt6ELXkrBseY0IF5Ypzjuuy3m/lN10tET0DYkfX33uNCUM aZSE7XFeuqmRrpe9LYImpvMKH/rLh8OJ54tkK/N5FS5oDOhoSB04aEZgNAJut4GtEBJL UgxcWD5dkmsk6QKVxFx3udUU9fQlfpzoydnPSbiYu4B4W/KHEbsHGVobI7wjW3eKC5Xv sVvA== X-Forwarded-Encrypted: i=1; AJvYcCXWNCp8R2DWZb508jiKwpHX7WqHixlKQze3eU7VmW7SQBmvcR+AeRaPGHqIy9ey632i1kYKtOhmX098RlIg@vger.kernel.org X-Gm-Message-State: AOJu0Yz90tEszoyVmzZfF/nXXdrNXn4v42IgTjeb0xA4sxlo6RX1h2Av BCoy2cq52C0Ks79kHrtLOX0IiaRLZlit8Q583V0YiltLPWOnjUd+u+np7Er2w3vMk/Y= X-Gm-Gg: ASbGncse8jt/+RhVFa9yzHXEwNohqduMvx0n+89qjqX+5pSLL3whd2fY/LTNHSZ8tiE DNl1YGi0opSqcvou3XmxzzxdgX919LwinwSM7XisCRogQCRyZya0XqBiAnhZlsdmmo8pY2Jv5cr qsHR33Q7skJ9lI5Nzx50IwjeNfTfZGi7P0LHTOFql5bpoq7SI6XloATQ8tdjr9B2jW5sGMMmHAa yQmh2U/Hr2H1QGlKkmxZkoEdWWpwJyz0Q+BkD16fN2Yv7HjnLL63E2Xe1rbHQ3YIDnAnHsnXoGy FK/zFuHvKSWzv3qzB4TBZ4hx9Teot/GYgLY14onf3oD7fHStMNcE3XzaUzAqDlWEQK66wpEzwjx 6ipWfZ+S7SqAebm9yUmzKTKOphRYx4QVJ/aNW6/TzLo3AGGXz7//TsMckaarsr1TAN8IGIRe+r8 6LLA== X-Google-Smtp-Source: AGHT+IHsfQJoD6SRNz26VMT+qJigHz89jvyvI66oHmBULdJ7IaJZxTqFyxCoP7GQo4VUZTT9hDwD9w== X-Received: by 2002:a05:6e02:370d:b0:3e2:8e44:8240 with SMTP id e9e14a558f8ab-3e416345ab5mr91990955ab.11.1754193570153; Sat, 02 Aug 2025 20:59:30 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:29 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 38/58] drm-dyndbg: DRM_CLASSMAP_USE in i915 driver Date: Sat, 2 Aug 2025 21:57:56 -0600 Message-ID: <20250803035816.603405-39-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/i915/i915_params.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915= _params.c index 37746dd619fd8..2dc0e2c06e09f 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -29,17 +29,7 @@ #include "i915_params.h" #include "i915_drv.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 #define i915_param_named(name, T, perm, desc) \ module_param_named(name, i915_modparams.name, T, perm); \ --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 BCBEA288CB6; Sun, 3 Aug 2025 03:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193574; cv=none; b=sjXPe/S1PZ37fJZMeGZzBDYruyBD8xgMHS3yl6dyn+RWOQr1Qfp/emPfEg1+S6SQRYWkT+30eGJNDGiUK32nL3SFOD9SIJ4SHGHh1Be1wXoo2cuJxeWY0uY2hWlxV4pHQOJj4B9iGaEk0tdqc14w7QNgphWth6TEENZDSRkVOIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193574; c=relaxed/simple; bh=LZ6g4CutEvHxV+teM2ugp7arz0EefutykRgDZEB7Cjw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o1xxQPChoQtZz2tAwTvYRuG0ZxBA5HKGyrc/25nwH5IK0QCPS49wQK5hAXaQISMFcrUiTKwHmdPj52Nzc8QDv98dk28u1RJJmRYoHkHRc0wZH9aUEWh/fNp4uqKF9wkMol9Z4+f8ImM9ccEWmotz85zeVneLuB3/0rmWwvMyXX8= 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=dw/PdZgr; arc=none smtp.client-ip=209.85.166.181 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="dw/PdZgr" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3e40050551bso23420725ab.2; Sat, 02 Aug 2025 20:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193571; x=1754798371; 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=iyoOqz+KNU5cHFw0iNonI9mdJpTRYeIGpSlVGT5QSqU=; b=dw/PdZgrCkafpZA7MMZL7oxFK20eGFPoJW5m6YxSH2qq2x/H9pote8HxcgTuYWTtmr 4nv17JYJcRY9cAqegNnTIAMTm5CIH3ydIlFCwf2gTHgz4Kv5kzDV5+kd1Nfq8Iig2Dg6 gRbNGiUhKZ1jZAxrCHzA6ZeYQtaX4X6+Vz5fniN4AjuqKlOCsbL51+X0sURmJo+A0qEK tr0ZNSnYEc6mqe/0twFRS39X5CKV/xo0N80dnsrFiE07G5djjTg9qTO36KoB6N/2P3Ts 4NG4SJT7BRIp6tLupQSI8xFGqzsV75hKw/PZ55qhVaO/yXxTj2qcgP2xPu5EAKMoyfvK lPBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193571; x=1754798371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iyoOqz+KNU5cHFw0iNonI9mdJpTRYeIGpSlVGT5QSqU=; b=aTyLd7IjYzEbuGZIftFvMb/veSRPfE5Elv5PKFQEzLQKcQWETRteowfnhJ6AxWXmRG /TjfSkBO9KmN6CJqe/u9vRFbDXfAXey7AGzuR0h10DOxmUooDKVIFdJmJZ+fayREU2v0 kJspSWmkphJT70ameyB6Vm7JO67WdKmAUrWo/aqrpQzpEdums9JbtmejG2ldS2sjA0rh zhI4cClVLj0YouMX6xCGilacI86QbfwobXEBQWP8O/u3J6npiIOZdLuJkubqvfo8aVl6 WgLm1g+IBuEQ+ORCNx9ZbZOmkWgRPjIF5IbOpI0rFzdqIhCH8LD7eA2hDLcL2yf5sOFS LIAw== X-Forwarded-Encrypted: i=1; AJvYcCWzOtmQ5tUs+vSDDQscOJ4xUZyHU9JDS2/SEpOUIvNSPEge1Y7LqkveSei+Dew/rWE9QxcihfpyQe1TwgQW@vger.kernel.org X-Gm-Message-State: AOJu0YzMTphWogFySza2pj7Ah6xfhbs+tYkGEj48KiR00mZpa677tUOu YxwL86BhcYsZx4lPlzEr4/js6Q3jEIZdkNRw3fy+LAaC5Qg3oIWlSaowfxJNyN9LKTY= X-Gm-Gg: ASbGncvjpEVETiC2UazVmsnPC/UCDmvQ817yyRiej9tTX4BjumqUNMvNVyaHK0/PYsN GjIJUItTtjMnnvA7pxh1LFb8JgIto1fTeHqosNo+VyvvBx00nR/tWjtGCoFa7PMuoWNB44Sqmq4 YjvWVwzu0+ecNGKsokDZh3HleGtRaSIjLPd3lEs/Nvpdnj6vMyILxbVWsKSBCw1yPQtZQsQYf5C 7WIbCTWhUqmliesMgmWtbX4Az9gaErA844s8VPRAorx5wnvbBnovcBZ9gzjzrBEEM6hCm3HtOFx LKWmHsPrCEZXMLOpbHZtKdLXQKigGd/trQUcKGvv4AfMcn8URtJ4m+ybv4fY0svZW3dKEOWE9Lf DRKvTenisMSFG+hXb289hEXL/W17tmolp0IkOqjxywOVck1g5W/kCvNd7iOij/ArshFibvdF6P8 6KjQ== X-Google-Smtp-Source: AGHT+IGah3M6q8sow7PmA2xw/j3+4wUg16/XNoOr3ocRA+wBN5F5xifQppQnjG3O+XbNYtlZUh4PWQ== X-Received: by 2002:a05:6e02:2686:b0:3df:45bb:2900 with SMTP id e9e14a558f8ab-3e416109eacmr108511895ab.5.1754193571601; Sat, 02 Aug 2025 20:59:31 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:31 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 39/58] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper Date: Sat, 2 Aug 2025 21:57:57 -0600 Message-ID: <20250803035816.603405-40-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_crtc_helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_h= elper.c index 39497493f74ca..8d169a6d7053d 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -50,17 +50,7 @@ =20 #include "drm_crtc_helper_internal.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 /** * DOC: overview --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 F1C81289355; Sun, 3 Aug 2025 03:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193575; cv=none; b=GpsF+oB/BpS9nQ/cOtWKgEO/go+rHojvlnGEPWIaz62FtxrSEEV9ED4OoDc7cds7ZCu3nKojITV9Zqfl9pOWgrThgh4N3XqaMA0GVu2WleI1WZlgcjy8LXHza8xEgqZ6zvdfF/BBbUwifktabMU3Aa+/pbCbcmI26v0AqjoyiEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193575; c=relaxed/simple; bh=9EdmxALKthrsaiHkwGl5/a1JlnNpzHteLrz8NOZLATM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tRI7nf4yzL4mP05Tphe6IrATII3+SKwQgnSJwQWRWKIeuDtEPdd0O2TOZSdEY+o39p7qqf3uMUfV/++c09D5a4s73foSqVV8q3s0+zHkVjgspO8v0M3oDnUK8JsHWFjIUfzJMhsH5SQMkWufMAhftji2dwDgvVtEGanAZrvS+KQ= 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=VW4RBkb3; arc=none smtp.client-ip=209.85.166.182 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="VW4RBkb3" Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3e3d2ad9180so12217005ab.1; Sat, 02 Aug 2025 20:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193573; x=1754798373; 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=aX0wy3dIOkODQINpUya7i2089vNboqetAJr/ccri1K0=; b=VW4RBkb3FX1YAtn7H/3oojzhGuQvI+EnywtArUxl3qc0FxDQKO5Q4StyoEwvvW2shJ muZhN0ilC/rgGMKNMKpzEu4ve8yK52/9wFh66uaqEX80VbLiaRbNQKfb5J3Tj85kD3wg mpnH2z8K8ZD0KDFGPHlHgWP4m4IP0CkD0H7m7uBhhnOlsPPRkeAGk5keFK7yBwntdSn3 t+cmrjMpYMvO9mcbXRO65YAuNWN/zuqfgdIhaqrGs/mSblMeU8YuJJn/0DVT+qlDkdiJ 1we7ALNuSYqOR9KHTemifnOm6L/HF8gdmcEfa4VpAY0nCXfZ1D2q0ctMtQYlLHEyJIM7 3OMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193573; x=1754798373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aX0wy3dIOkODQINpUya7i2089vNboqetAJr/ccri1K0=; b=ZMrQN5LLFkVCQj1S6JAxDZwgN3y7yCsS2ztindmiJDoBjfIUSG7569d6CPxXYiKO3U 1dPUTyv6K8AriJXlmbey1ibo+g6SkiQJrEqEKb3XmeclP0UvSZb4xjY+ZSHsU2DFutgQ 2z3/rUWkv+ueF9CaFpHXDSX+QPlnBTfQgIiDB4MtDoHcradJ5aszXGnUFqq5naegCeYJ fyc03esgofQFh7vMnWc4TW/ZfTbM/V81EwM4iDJ3+xB57uPXA3GAoRxOwvBAHxWQX8x0 0ZYqL7/DLY5nBZkKeXI8GL/89GZTfjp28D2gmC+Zelf7gJ0o8o3KOcvzV1OvozesAy2D x94w== X-Forwarded-Encrypted: i=1; AJvYcCWpWyG7em64Iq19Tb/kHY4TNeZrh5/9tl4FSpD8WNFd8M1R/Of/NeGl5pdNFVAl5TAdKYTd3Kr2RFvTVXxr@vger.kernel.org X-Gm-Message-State: AOJu0YxWEpZkt4mhtHRq7WfHthL6sgwVoVPdG0nyz22SznY4Xv8hVOPK X5bTw6kzIJmx0u+AuGAuv/3k9Wj1rs8X9IiR8XlG1kQ+2DghxR/Z9hKFFcBawcWivu4= X-Gm-Gg: ASbGnct31u326Lr1wrP3EdUYRxN8E7NkWJxBfrAz+BsnjagGn3ypmiKI1SftZk8PGDz TmpC9gtdeMDjcyb3e0LhdFcTVHOOHZn2WmbdVDzkO1gjIRvm1awi5Hi7vgSSQgLTm8PeNuGqCzr a45LzhOPN1Dgsx/lQqkw06z5plsM3RaTcB1GLvVaDMlvvb5jHHwqhkNZPMlaoXF7Xf6AA3xVbPa upLkY+t1mHq67cjQqofOme5HbL0WnKm/aicwUgORvIXAHRHITDngxoRwr+thgcbFknTa4/OmehV 2Uk8qKAuIdeSsrzG2DkSZtimhmksvPRVa2nrQqAJTk+4txDRxRfkrmfXgCXo7xT5zr/VQJZ518x SbLVsPBMZVytvmhVLrj0dsMfmuapMzw53z1YD6gaAgHuKY14PYL65kfgoosTecc6UyobT4y1dVK HDFA== X-Google-Smtp-Source: AGHT+IGc+JsMKOicIj4OsJejzSDjbJADbBCmxpF9C67GucCVwf4NPItA66Nt3F/BJKgx0ySRSJwRNw== X-Received: by 2002:a05:6e02:228f:b0:3df:5333:c2ab with SMTP id e9e14a558f8ab-3e4163772c7mr75665075ab.17.1754193572894; Sat, 02 Aug 2025 20:59:32 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:32 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 40/58] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper Date: Sat, 2 Aug 2025 21:57:58 -0600 Message-ID: <20250803035816.603405-41-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/display/drm_dp_helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/disp= lay/drm_dp_helper.c index ea78c6c8ca7a6..f296fb9de0aa9 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -43,17 +43,7 @@ =20 #include "drm_dp_helper_internal.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 struct dp_aux_backlight { struct backlight_device *base; --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 651C7289804; Sun, 3 Aug 2025 03:59:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193578; cv=none; b=o3ZIrC6B+huZpMKvHlJJdBTYegA3Tp7+96DtrtwrS60zR3WAtTQ6ffkXxWQ4B+rjqkryv1cvk2UiMbMH8cEqTcdPpC3lOyWtQXPbwZ9lNZEv8oZ+mhv0A2t8HwHAT5ML5Uxh3KHpJeYDFS9FgLZmwj7miMFB+21h8G6Mw3Nr2Zo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193578; c=relaxed/simple; bh=1MlDlJ3OsgwYpJvGaUAnLZryHNKyoID1gz4OE6Ymt+8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h6Ktp3dkM6tQDlrGwkqJ6FpzmhBD63px7ZWWos8Iiz9sPK3gVtAD5BqdwQjfmw0OmLP4muICg7M/nKBn+U+SzmxmGxwUdfsp4vETLQWI7PYGWAZnWra0f51VEdBCctliII+oQRV37QchnuDZUhiipw5UTwz/wk+MD7TH0H6yM8Y= 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=eEijXF08; arc=none smtp.client-ip=209.85.166.54 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="eEijXF08" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-880f82dfc7fso170581439f.2; Sat, 02 Aug 2025 20:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193574; x=1754798374; 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=cyXTuG/pzO1S6KpBihte/IbjP5bnnmbeKtywtvutYYE=; b=eEijXF08cJXSK9v0OrHQ5f7fBY9ZWAf3ywlzr15rfWI1ImUzOH7CWWBETi8iUcyx/I ij9ocExyCiDTKWE5G+6CsqNgUertBIbiciKHzYj4FjlKzn1jKNtsYp5dtnzAsgOnuQs2 Ha0FqSovVDbwX0HghAaqC4aVCMmoc/hu//3Oxso2WGSe4EtApwMazQQEGftnBxrvaGMb pXQdJpR/Az/wygpKIC41dZ/cZIrlLJNLnOu0GjVy4MqXSHhskT58f7mGTZM9kNuyin+Z 2CDA1woqMDfARLJq3HDCwPK22gzthtSJMMA7UQJUo+UCOGpg/pedsMzSncnMcIYY4FTi L0/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193574; x=1754798374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cyXTuG/pzO1S6KpBihte/IbjP5bnnmbeKtywtvutYYE=; b=Ec/jC+togJvjBcOtkezY1ejlNr47g+WkUihdBpzwlnJYVOroKHQ115VXwpxOze78Bg g8r7UGtCzLZY0qAU5iDuAtz21K8eK0rJO8/FlJjV1JIgCh/yB3suu/QDKu7sxOnki3AG HVIHqRTXxzT21+tUw+Ffs26jif0LqnCKKn18Brg7ZEl3b3ox8sloGrziFrh6tY+GhDWD hEP1iCROHsAPW2+ty/4g0ltSHNTM7owi6pHb9fPOsBnd7zcVcAk4tzlcV/scbMuicwSl gQrB9nC8e1UyFWYyei82ZjWMcRqscGY/9ZUeFyyjr6TCbpQw2+Tp2ytdg52GoAqcLkkB evjQ== X-Forwarded-Encrypted: i=1; AJvYcCVAKa8x6Qubj8KWwYvf40QOh2eOBy3dGWlJGmUhN2esCci3o6Ltb9B79Jddp2yHFjaEfIORnqOO2uW+A45X@vger.kernel.org X-Gm-Message-State: AOJu0YzBUVsZQ9KaC7Kmo+AN4D6k2QCEmpBiZO6VGtZkhkl1TlIp9XHa SLpWtdD8wHcEZdPPE+02VG3SKgoaRizeW/soLTMjLnFAJ47PiBwfphGsLqfZIU4fFsM= X-Gm-Gg: ASbGncu2+N4mrWCGWSXSD8OR64H0j0n2Rb7CEaQgSHDhMFQwG02Wwu4nCE3oyEvE4bU BPHrB6e7mFdUlxTvPBXR7nVk5JDWoYNc/PLYs66E+F4DtZUDhM6kO0V5iVRnfueYBI10/l0sMH1 w5Yx/CuaUEEFCaMYDuPoKX+B+7lOajkzCEzpls32RimTEI7+JnILhIprTuo7217utjXgYcrX+3z lhtqDFX19AqYzDdRG5IKoB5LsmoAba78k2bqcXlhFlI2NTOmg5EiautEVHLw186u6rPYLqSqZfa ns9qMb4JRIQyVnny0KOukrCVt2Dx1T6Rf4gaZ/MTwkWQ0HHC5tNYz1064ngg4BSo9J5u3hvdsDb KLJWEjQbSHYoNSWaJP9qrdEfc5o6iR/xW0WmoCh9ma3GfeZAEEOdEM5FKa+OdLfPY906P/FS7Sw MQzQ== X-Google-Smtp-Source: AGHT+IHHqpsxNwrIe1Yt8T+K5YT7f/N6jKSRjyJTXO375mjvAA+bcSXnn5xdTY/xrxu6S63FNdOpXA== X-Received: by 2002:a05:6602:1545:b0:87c:41d0:9982 with SMTP id ca18e2360f4ac-881683515dfmr900119439f.6.1754193574199; Sat, 02 Aug 2025 20:59:34 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:33 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 41/58] drm-dyndbg: DRM_CLASSMAP_USE in nouveau Date: Sat, 2 Aug 2025 21:57:59 -0600 Message-ID: <20250803035816.603405-42-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie --- drivers/gpu/drm/nouveau/nouveau_drm.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouvea= u/nouveau_drm.c index 1527b801f013a..67caebf768483 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -74,17 +74,7 @@ #include "nouveau_uvmm.h" #include "nouveau_sched.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 MODULE_PARM_DESC(config, "option string to pass to driver core"); static char *nouveau_config; --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 A1559242D94; Sun, 3 Aug 2025 03:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193579; cv=none; b=HkEYG3NnbFFpc8r+f7rZ8XU37mW3S6wlebXmxMgYsquNncitwMayJj0Pi+IORkI0FNY0VXtgPvB37gg3sXWE3uofwHuBdM6ywekbxcWQGfRSXyv/zcexEhy5Ea1Rrak1l/JE9E75uCXGSvjYytejlwJgeT31M3viq4a4v9aGh+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193579; c=relaxed/simple; bh=w+FJv13AQ8WVCA5XNpRXQKjYjlEJCePVP8Zmp1IYLa4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GR9Aw0Xp/WHRbRpLRSJhy/UNR/vQHHC0N9URkqVzkah93cw3CKJLi2TmEf553s1yVIa38gQYNIO85XgIpJ4dVC/oqLHjt1YqWxsRNiY8QnMxVUsYYkow/FPydvs/HF0+TCFrtlN9zwXFgc4iQoxaOflDghVZP5DfUjuU9NoxtIY= 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=DPDbI14n; arc=none smtp.client-ip=209.85.166.174 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="DPDbI14n" Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-3e3e926fdeaso12249835ab.1; Sat, 02 Aug 2025 20:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193575; x=1754798375; 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=zl5QPlbYy//3A+9v3q0806p6kCi+/AVd1aBX/P0nslw=; b=DPDbI14nWIGBXdS8dECd1sRq7Ub9uZA2r22/zpDVsK1FdUet6zaG/t7pzwcne7CHtX ldxrREttlJdTU9vhZSDYjzx7YRbWqr4JpYEJI16lcDWyoSMkTVhZ2nCFyk4xQFrfJpg2 omxGo01WMmn1BgUbar4vVVGh8sijbW/AusQkaJgAfLc9+dADua7LHlTiKlcEJ8hc7ODP PsLWqeuBEA3r8iwYMItkPxBDQBeQ+tHWe1fuwUfgnYoe1Dx8vaUzanwYEdruKBwOHUu7 /0sOnsug1d+xyCtuW2i4i9gp4nvC8BUFg1Ptnb4Rf86cBF1Mtuqx8Aolz/XKh1yekAd9 IEaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193575; x=1754798375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zl5QPlbYy//3A+9v3q0806p6kCi+/AVd1aBX/P0nslw=; b=LXOFBbPEFTNHul7p30XABkQ+Hp3ZvOM+7pTHE5U30ParuQ2VcGfQmysfWf7xA4OFDM ALZoi+gwBtvN2IbNYvqJHqw3GAZvpb1zwub/cjEC9k4Ob9r7RYKwBcaS8kdfb3znK30R mzV0zYhHFzkV022ug9NUuoJLnoSBgBmpdx5F/u8hLrWuJ8NEnWiU6TsUP2u0Q8BeUVOS s6cd8lrRLSoMG8IArhTJyze7Vk85Axl4roDzjW5NV4TBGosA4T89z5xk9JXlSUzL5Ebl gA/ywjcm9ZVOctvUVqJcks87xXva/qfVCQPrxB3oJxE1aeMS/TMkkOWUHqiSubibY6mB uhzA== X-Forwarded-Encrypted: i=1; AJvYcCUjox9nnIz3vjqblnKbBMc5FFautNub3IDm4ZJQ7dyGxARjPv1N3lFG+erKnIk1v/PaeEAQBOLLlUykb3Rj@vger.kernel.org X-Gm-Message-State: AOJu0YyScxfsJdAdfqlxlCes4vLUb3fRrOYI+3h+ur9tkIRXUaJfXPXX MLxNZ/Jk3JRBQBbWjyhB5FYtEiM847Wwwe3LmNqgceRAOORXukjBnstqujzQ9DgU5KQ= X-Gm-Gg: ASbGncvYEuPhyyS/kAW5jTqZl8qE44y9g/o+r/3ow3dAhZWfWyO33T+1O7FU650QGbo TMgxlcVVsX/qaTQqcbmswwhDZaYuIYIS/kLFuGpSQ1D7629ibiBgHnUYejhEO72tK8Otj/cDUQ9 4xJi4lbtXx4Ld7SPLXSiUwCooILKpNHCrcMaKE3oE/2OTrNpjKzyFznkaZk6qileaysmT3VWckV No6wHSOjbNRlaenm6c/jqfx7rVVaW32xlIperz/3tiM5xs14JOereUzQbdWuxuUl38rnlk6aGpR WoxVSwpnsTPfMOSsM3DAsKe9zmYxqJc+aoVzUsXnBbAZfkV+pafcIKxD9Spp/O7hk3JAkFAisbu DWFu/uAhQkEeH433bXZYnMvNFRINHu0hr+X+ZD6hR6nctZjigeyBFHX6cEuuLTKxdT3h0qYNGew YgKQ== X-Google-Smtp-Source: AGHT+IESuEDr8QZLisykL64g4ba83tdiLk29yQO3uqavO7uuyBzNgS6eJTj2v9K17Lorh8odwbLS3g== X-Received: by 2002:a92:cb86:0:b0:3e2:9f1e:e291 with SMTP id e9e14a558f8ab-3e4161cec37mr78734765ab.21.1754193575462; Sat, 02 Aug 2025 20:59:35 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:35 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 42/58] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver Date: Sat, 2 Aug 2025 21:58:00 -0600 Message-ID: <20250803035816.603405-43-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, this tells dydnbg that Xe has drm.debug callsites. Signed-off-by: Jim Cromie --- drivers/gpu/drm/xe/xe_drm_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm= _client.c index 31f688e953d7b..52ccc4701e067 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -21,6 +21,8 @@ #include "xe_pm.h" #include "xe_trace.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /** * DOC: DRM Client usage stats * --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 02130288CB6; Sun, 3 Aug 2025 03:59:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193579; cv=none; b=kTHnpHGL7Z8vsp+dYPUwM/X+z6+B6YZgl/VH+uw5JrI+Cbmlt/Ch9TPQm77ztXPGLMmBELwuqpn8kDF6Nk7r3deYFbV6I+l57Wd479azcFwfIncJTDo35b7ee1sgNCetbmttuKD6E/jyncswGieyLAeRL3+Ug4UvUsyubu5k+jQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193579; c=relaxed/simple; bh=m6Xg+//mj9dpGiOrfICOJC0Zi1POUDB8RUeuevn2i4g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZaqcNyLR2GiR4qjJebg6BUjlw6Rt3vDBQKj4f4qiJW4IqOOBc7MZh7OIttcjz3dYo1rGLPS4Dwx6X2PuC6iBn0A4y/vWdj5V2I/WfvnVmwD9iPr0ektH/CMIOck9eQQoZiCaFL3LkQJLpKqVXF3VrTEpKJ/KlIl0jFcKp0G/dpo= 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=jMM/8ast; arc=none smtp.client-ip=209.85.166.182 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="jMM/8ast" Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3e3ee9c7815so14653695ab.3; Sat, 02 Aug 2025 20:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193577; x=1754798377; 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=QFh2RZochPrtpmKEJNCfPiOKK4EQdlmU3N2ti5dUWmM=; b=jMM/8astZLMCh7zI6U6Le/a6mF4Gc+rLirAmGCi6Oom4Bx9Bf2x9xV7ah+C0sEqcMt o/rMXV3oTsMYvFAuP0vD3NBrfRz+DncyYem1pKNt7pXcalXdy2mDxL64JF/zMP707DU1 TLdcmHRRODWAfTVZSMRgJVEEmi+p03N3wsOr8LBL/VmB4mXboQ9GGXjU1sSB2L+4Orzj mZQlyA6jup9vVCWKLSZTDv1gxj6XvRop+sJarC1+kdGtRF6dLiGIRdeQSlrU4HGHGaDG uHZx1x9CrWuWzn2oO+1PtGaH3V4uhv/ehVPRrw0TvH14wTmUmp4LuNNklnrRgPgT7tLw zugA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193577; x=1754798377; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QFh2RZochPrtpmKEJNCfPiOKK4EQdlmU3N2ti5dUWmM=; b=tTxYbzxZDEwJvFvtf7LZbwANKxzzT/U+/9LoZCfNVdcrM2nNdQVVZbOY2EKzQYE/5m 8LgyaDsgaUD2iHrtKt4gvK44kxg/DKUviOGdXRqz7ybPlQFidqc78K3oQANrGr7d0JFo ImcSaPn0PSpKxSKXOQJky+o42V9OyNcDenCYPRVO/BugqYlJqA3Ey7WvpdtNnmQ0QWsw 7uanO/U+dxlLJM5Qs5OEajEEKJvNzDAkuxVEsqYrmyAAiHhLmgrk4aYyVD72y3ATMRn8 XTLUwxEBB6rSaqJOnwiOZAXhASnCGjEzXuhmYa79VToVB6zy5GrUO0B/HI5/2k8rkhuS gh1w== X-Forwarded-Encrypted: i=1; AJvYcCVyleZfzx+gLlm427O/HyoFV5W4InNW2iHqE2S2woZVdUkikZ5G3++5LZeBHBT1jv9m+5jqzq/3UVoxAvLs@vger.kernel.org X-Gm-Message-State: AOJu0Yyg5BlYiseMLSrOcfZbzs35KuBm4bnCB9vOpkiD0FjhwimjiUDi u1mCwv3H28Jd2Ybrc8ayzPAiKh5RZmf2aMM0a0mQIZPIYs35SMTjChE+c/52eRKUu98= X-Gm-Gg: ASbGncsw2cGoW+KPVRISKtdH2jsfM12ltGt1f4IRfYUl2InNWbnmoDde6YNtnErrHXO K843ou7ndBlqEqCTJ7SbQXWwZp5k3B5QfqK5z3WBBKcSLYRS/PP03q22O8WYmPryqnum5IwaJsC +Abzmgsn/c/EYkI6kGRNXW8rKDkOwMKHaVzkYoP/GthOs/PxAsAAfmJ98d96utKqmCpXD02Euhx cyU52dccB290Pff796UtQEuq5mOptvRDn67DwmFaqFnUGZ+eNK4BctFpMWkn8XqvqVHp2aOA+AY F8niPn4efKLM82FG5x3ZD/lLJRHrGxZ1efmxgsEy9GgzxCll7H3TmYZy9TqbP5wCqFPqfdIzvpD 4DRFWKHItmu+6bG2tc9Bo9Ahtu00XtC/592bGdnw6XEGZT0Bbs4BL7UZQEHQqwsTkM+g1FEbbhH KEKQ== X-Google-Smtp-Source: AGHT+IHpBDdR6FigTlQRJF71kEZPG5C4dRibFN0rdBgPoSfyb0NYf4gIgt2t1ZdaE/8lcZCX/fEPYQ== X-Received: by 2002:a05:6e02:32c4:b0:3df:3ad6:bfb2 with SMTP id e9e14a558f8ab-3e416180bbbmr90758155ab.17.1754193576851; Sat, 02 Aug 2025 20:59:36 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:36 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 43/58] drm-dyndbg: add DRM_CLASSMAP_USE to virtio_gpu Date: Sat, 2 Aug 2025 21:58:01 -0600 Message-ID: <20250803035816.603405-44-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/= virtgpu_drv.c index e32e680c71979..4487b5a41cbda 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -48,6 +48,8 @@ static const struct drm_driver driver; =20 static int virtio_gpu_modeset =3D -1; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, virtio_gpu_modeset, int, 0400); =20 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 DFAF527F01B; Sun, 3 Aug 2025 03:59:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193580; cv=none; b=pJWvCPXaYVQ/LclY88tNovq5lKDwIftN/nnTNjZIK2P3+a4N8qBzi/3FFnFy3B+NdFX/sJLbqJsOws/0HlkuXW+9IeQbo1HdYjX9bNOst4a3PnbDrGABPs50449Cx6yZV8RdtXxSVZbE7VEzGMU/NmnrHFZaA42c6uYyFBcb74c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193580; c=relaxed/simple; bh=f5PrK47FlRKJOakqtnmBs6fL1o35KvAR1TWlTg7EMWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ToVZNks292adZ2Ya+G/l+NPR/f1+pqw1QfIdbyUzFlFfu077YwANBVDdzv6nSFraBhwZLqQ0pvNf8ug1qzPA1pw3znhtZ/1lsiT2mmtE8tXgpuvFayAcp91RwSyhQUQM0QJNlFRRue3wnGHIV4cmgahuM+AU58SSzhkvH5tEHsU= 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=V3jKSm2s; arc=none smtp.client-ip=209.85.166.176 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="V3jKSm2s" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3e40ac40940so12344455ab.0; Sat, 02 Aug 2025 20:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193578; x=1754798378; 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=YD1c9lgMbY1eaVT6v6ivEZXAlodIcOc1Rh1pqLxYHFs=; b=V3jKSm2symfhc+BaypY7sT9Pz33Ux7KKyifc40PHSJBfg7w5tvfO+KMDiJnsbkQiSV 6c+auDCQfVVy8IVWcmrhpoWeJr8auElcRCOcLFCHEMqp1P6BDbtKOalko/KnzszXELAt McXirSBX/nyU92TeBatk+qiaqaw+7HzFXmuOzc+K7cJdctbpqcc4aaKcXpYUpKJZa23O lKMzJhGLXaO+0Le6Kbb9h+XxO/im02YoHh9im01NjgK8PE23qVopL+3cJ147BEqFLHhr 5+egKm6HXou/+nOJbAbbrPzpEAzDtduqgGmlcaorOSgZ/SFLLdZ+DSFeXbVEYMehKz/O FUdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193578; x=1754798378; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YD1c9lgMbY1eaVT6v6ivEZXAlodIcOc1Rh1pqLxYHFs=; b=bDgl6GjGEZyo5TQ3rkjjUDB2T56sjqp0G4Y5ByI0py8ZbbluyOnkUBY0LZ9H0jgm94 WJ9D5XvW4Sjg2JE8nFft7Lge59aMbBO7Iy2D39wjc3q8YKscVqj1QQ85GMkUTnq2auxL M71du3FqCtI2UEDO1B150zVzbpp/QWlKJUcP1rvYdnNx7N/4nf+O6IefpuN7B9vulVXo 7DTMIcIzlr3s2p+2/d1ZbSykl3WVzDwjAoqE7s2PN3Xps53zdfOkO2YAgJpItWVGg7gZ kZy4Z4dvi7KNl/Jbi6uNk6UNFyRYV+bNZUGkYZ3UfWX07Ksobss8GIgtuK3N39P6xPsX mkIA== X-Forwarded-Encrypted: i=1; AJvYcCWHwD8wOGpK6BsyHPZ0HKUpB8DaR3nFiybqfgXfceCz6+LLSVK700W367sphQAOsKIcEfGZJZWqd3kLuyer@vger.kernel.org X-Gm-Message-State: AOJu0Yyu2GTeii203/iINDOJMhukkRaTWxJhN9DqoLbIbMX46mM+aj9p Xrae8gyYnxvoBa6rEH9buEyQ9flcdilg0xr11uE7mKxSpLEBVlMMjYT+KUjLJeoAO1Y= X-Gm-Gg: ASbGnctTbuUj42W1ud/dTRoA+TeIShDcRqnZBXxeg3pp94J9D/OavRHafTPcgT6j/8c BeWpPbKaZWD6DP4nm31/8F91Y70yBJRoSzP3k/0PmIMrSqmmRrVIcMcO2t1F4dCbykh9gRGz8Wf ZfZJkk9Mco1dVPLTOXPxACyQ8vsZCi1w8lX3Bw4RT+FjTRchrqR0tjG8AwEvlYTk9/8igEftUET 9VKm54Slihsfm8YGZJial+iYFmbgnlPkN0BABL5I87ymXc9NW9phnpuKW3RRZMDCWbIF7BFPl5v uDvMpaYLrcyiaOWOSJ67tx3/LACc+gmjjGot1ZvId4u/0o4iJATvw1qv7MEWN2PztKsULcM5J3Z 91ksAbIWAtqxqFDBmgLoWFrURGcuHYs9lmEOLs3IH6qzqjgSAGvOYX1HRDytWwqMrAJwC2SA1lP ERwl5gF33bfqky X-Google-Smtp-Source: AGHT+IEjmtrpy7aLLw6jvxFkKmow/fhVsLi167CpcWmTeMCa0QQeXgukw0jkAUEoPTovODFGo/PAgg== X-Received: by 2002:a05:6e02:4403:20b0:3e4:64e:4fce with SMTP id e9e14a558f8ab-3e4064e55d9mr146712775ab.8.1754193578031; Sat, 02 Aug 2025 20:59:38 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:37 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 44/58] drm-dyndbg: add DRM_CLASSMAP_USE to simpledrm Date: Sat, 2 Aug 2025 21:58:02 -0600 Message-ID: <20250803035816.603405-45-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/sysfb/simpledrm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simp= ledrm.c index a1c3119330def..3562d6dacdc9c 100644 --- a/drivers/gpu/drm/sysfb/simpledrm.c +++ b/drivers/gpu/drm/sysfb/simpledrm.c @@ -34,6 +34,8 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * Helpers for simplefb */ --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 DE52A28A1F0; Sun, 3 Aug 2025 03:59:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193582; cv=none; b=fvg6VBTt6Lc6cZ+4g70sUk/j8n2T1MpA90KXhih90YlPqZluJGruQf0h/QduIHgC+ZkejDrjstgldIgyxkonJh6wrkNKRwsTUkK9WTDDIZGPQ0IZmzM5xsKcls/YHfvsjMGIZYc92MXDx3ZFq5c4Xe9h418MmmVNuqJv6ZDFZqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193582; c=relaxed/simple; bh=MDGWeJbDY9VZMdZnaXbOaD5IMcEPFMIZ48niWvEaiyw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DqbGT8JCnPy0K8W0SFrccIfGa0OJMay2iKafGv3sfeKYwWkz3TKpVBH0kcDC3E2eEfkpJ08YsmTVQUhkQnAxlzd2f0KNaF2+wsmY3u6W19rWMjcuDNeYzOiYBZYTWZk5yfar+FN8TvwCuVH0A0sK88fz1yo0mnGuQqV4eHo2cpY= 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=FIQSCF0w; arc=none smtp.client-ip=209.85.166.173 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="FIQSCF0w" Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3e3d94aa969so14697495ab.1; Sat, 02 Aug 2025 20:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193580; x=1754798380; 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=YE/O3uk9iB25GeoIbDmsvAu+mgQCi7QyigFWvEFq3Wk=; b=FIQSCF0wlpPhLv8SGGW3bZTlePb6bwnB7N0wMIL1EUSSpV1mk7pLeTHb5nLeRBjEmD fxzrRL+Se3P6tSOJONy4j4bIHk7cVF//50VeG6QVQpAn7oO10tqDqiutQmVDL1hAxyTH VQga+MzR4P0iYhpVLFtvOqLxljfC/+/o7RM85cJ4nJAVBINmg4P+/E1JDsKs9igaeC2i leO/NwRedg+EN1j8kWeFTNiPE/pLinQFON8xgtz2CMYlttU8hEf4NfwSf9BU+Rdhrkuc bLd9gWvk1PBBlwPKv2tUZ+5xkH3EB2w+b74UQs1HUdXO0mbU1YOlum9pF3xBGXyiI6pm bobg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193580; x=1754798380; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YE/O3uk9iB25GeoIbDmsvAu+mgQCi7QyigFWvEFq3Wk=; b=ZsSy31kYRDL5DLK1I+9nNPrmWoK6jgfyUC0Cye+A1er6LPA8loLGJBntO6Rw/2Jhco zL9rxB30oX3YC68I9Y/uMoXNt6LFTSee8yrxkVr3zJ48YdEADf7ShNvy9CmUtO6SL1UT wn1yz4Vy9Ey6Ds+mhS2etKmQK9preXyKUHdqOVheSeMPU9gUbapuQFtPhfE6wzJDnZM0 s9FpkQB3kW9t7HUJWNUTlmp8bFDnO5mL2swtfgTm0op+O0Ww0F7POMznwaXJNu9G7Dzb mUSxYY1VbrP3ubFNAFDlzzLitAIJdUZjRqyWTcrmODboqpBIiLDR0sAXq+BGwTX1u0ib X0rQ== X-Forwarded-Encrypted: i=1; AJvYcCUFZZfonwiGg2gyMFZH6XGhnqoV3YhssoGuUWFkW+uVVWh0kc6Fd9JVl8b9YtrQVAYpLnIxR/L2nUmuqDlf@vger.kernel.org X-Gm-Message-State: AOJu0YyKHD4/QEz305eSUW1m1U2rWtb2D5W7kth+M+ukd0OGK3Y1U66Y iqc0qV7luCecC0tBFQs1RDjrLE55WIzXz1OWAXJqMpjIzWh5Jv2Sa0s5ylUZuwLLl6Y= X-Gm-Gg: ASbGnctg59N6wEVeFEZLrmQMRA6m/lFsl5MeizNZJNMFwB//7LNR6AJ7KM32VvjfNul YfveiK6IgOFEjpmmJoV4VcHoIRQw1jn+xXzc5izKGAfrYyIUtnbPKS7IlT74NNoBUp2stBPwLzF AqkrzfkEGQnasXEH5jtFH+/tBU71jjODc3zBUTmu4PIyazAdZrksKh5m+6FxYNzzPzzwOYHcFnn H8lX3q+oL3xEpSCtm+DdzpBxrhwFLqenyfFtkVqfGzRK/dFLpN4cAeo235yBCkCS7mpNFOTUwHg JBjgjSnBHSdf52yuLbUZacmjLulnO4z/Dgc2DovP9uoN6WpDZ/sAtR4nEKcRcVED+ZJy3jORnhN F7oVwlTPoy6L+7+mdLuffO8uV6Aa4JNAxYzwBMrEjvvMbyXOz2jZG6fmQm/YIblqP13QIl2zHrt g5PFON2q6AN0tl X-Google-Smtp-Source: AGHT+IHMF0Stckwb4tgrilrVESFlmaGnVXMaPmoUxRg8HxQvWlfXjPvvkTeyvK1bWCUd/wSr8kLBNQ== X-Received: by 2002:a05:6e02:2707:b0:3e3:f9fa:2c8b with SMTP id e9e14a558f8ab-3e41610837bmr85829345ab.8.1754193579730; Sat, 02 Aug 2025 20:59:39 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:39 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 45/58] drm-dyndbg: add DRM_CLASSMAP_USE to bochs Date: Sat, 2 Aug 2025 21:58:03 -0600 Message-ID: <20250803035816.603405-46-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/tiny/bochs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c index 8706763af8fba..dbcc8ba70dfa5 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -59,6 +59,8 @@ static int bochs_modeset =3D -1; static int defx =3D 1024; static int defy =3D 768; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + module_param_named(modeset, bochs_modeset, int, 0444); MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting"); =20 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (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 06A9428A40A; Sun, 3 Aug 2025 03:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193583; cv=none; b=B4WWthXFdwoXmcJDoi6uF1biwG8Flpe9JlP2vJLeh79HyzKqQElDPdZVZrqLshMwlDLNbd1KnEgb3S+j58ytDsPFmkOyZQx+2MWaZTNlI/DYgxdbRQlZC/+An/TJJkk7MulBepyjLXlhGtUQ0N0kw/XDiFUxRLLJ8hKfIaE6kbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193583; c=relaxed/simple; bh=9AWLyFTN5wRl5J8KrLPnw4Ehn79E3O0jf/C+O+lJ6GI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JBSVAzzTOf3v8ZB695Z94/lrng4BZ/a3BpOmXgy/u3MAxDxZzm4b01Umeqj1z8TRmWuvW9K80b6eaMnHDezuj/UVTde32UZ6xJeHeZdqtAeqZGnvxFe8PLCOwWjIJDPgEFEFowZdY94pMBMStP059+kXuIO1o/czoAQUvPVaNPM= 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=foK5zyFS; arc=none smtp.client-ip=209.85.166.171 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="foK5zyFS" Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-3e3e4c564ffso20216205ab.2; Sat, 02 Aug 2025 20:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193581; x=1754798381; 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=Q2dm3Is+hmVrCyHRXfMeY87/RIu8WM4w64xIqHyRgwI=; b=foK5zyFSo+Nl77bFr/oyG3a6pT4ojz2U4FtVR6F1MFT7hb3dQojqpvkB1XsliECC6h hkTqB7WCFw2H4JxhZfxBFTV26ozNhCEiy6uqTsyAsUaNAvpk6Cwl7G7eWMav3nbL2BzQ Gw3Qp1PN9tkEBpgOKggpJXh7BkntfhMgOdGaDGlGJS4+k60wBsGZ2J5Fq6qDHk8yyeHP s0ouf0LCQF+KLAT4Sk2uxq6IEt0qbrmZD7Pwas1/69P9DNzenyuvjBABB78vtCUkseSj m/SAS3OYMBP3wpYAUawzokKCn/OxfogpZEbuhjvyj9/HvASq7rx78XUCdjVh0U83CGQt ZaLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193581; x=1754798381; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q2dm3Is+hmVrCyHRXfMeY87/RIu8WM4w64xIqHyRgwI=; b=jWio9c6wfRG0qz/MjIJcN9Bvte6voKAoQpZwnjqALNnI44WOkwNXyk6OYjqsrwzvAR isNzyZKh76qcQ8NHRA5JA51QDjkyE2drI9Lu5rRsFCd4Dcs2sWHlhRNDpHdLHASRMl8/ CbLjx4zcubOVk2o1nGjoKX6rrf21CxMyuHmMyRb0VH+HPsHAgtrJXZ895OJQzmlOB2Nt QSMO3RwCsnYaoAqycudMccb0ovTavVlixufxeyfGzkeeapfY1oai7NbRhVWPPm8UXgkH I7RU3AEC9gp9O6BZUfh2iJpFO25oMaZt6q0d5XK7NU9eCUn4R2IOnRKy3nJHRj8921Zv ZPkg== X-Forwarded-Encrypted: i=1; AJvYcCVCryu9A+9tMeP2PF7K0gdb9om2jlwXyCmEDZ3t8clPhpkYYhJjlDxN2e7j0brv5E9bAOynC5EeEFEfacKu@vger.kernel.org X-Gm-Message-State: AOJu0Yy+hi86QmZx+DtuZ6hrWcEiB39BXYKRDoWCerX3SE67Z6bk8x7B W5r+PQ3KbqvEzj/a0mRYWEeua450q3UYtzoZT5B4P7xfUWsGklHTUjV5u9hPkq7u49s= X-Gm-Gg: ASbGncuYFk4/AFqkd4ZDTBwtmwQWbh8DW7LHSuK0YuKFgk5awejTsptghRhLO4fApEH lHa5bi2Ahc2DV7KSq9q0nMHLFaTTlm07yI0ZaQFLGCIkxcoRMRDwuoyTGdf7N/jHdqshSOkio+U rgTnu9BF+ia8OiySCUV41hlR8/CWoie8xHkT1QZBp42lSXFWYwIUbGgJShUlmL7zGgb5d4cbqq5 dbZ1JYVm+EP4UQcdKGP8P0f8zMqjfDDB337wnOdKVaLt0VAsdUOgh44ScWr9So/flbpKiknpRE0 DflFBZBhLYzc7nA0Ny2jRGqwpi0rX74BicR0lVDMlg3Nnnsq83yQNdn5+FC4GlGFGxWVsg0WzXM blWGD2c7H0leFNEDq48650V6plMAtfpjuT8ixzOCe74lt6UjldJGi4GCAoeOh70pGgxLId6/NQI qQDA== X-Google-Smtp-Source: AGHT+IHicophLwIo0f3Ezs0eOmSQt7ySKYvJ63NCgmDZPmmfZpDGy7DzzpgME8ux0Ifq1iE3S3f0yQ== X-Received: by 2002:a05:6e02:17cd:b0:3e3:d197:b567 with SMTP id e9e14a558f8ab-3e416117005mr96473805ab.9.1754193580921; Sat, 02 Aug 2025 20:59:40 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:40 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 46/58] drm-dyndbg: add DRM_CLASSMAP_USE to etnaviv Date: Sat, 2 Aug 2025 21:58:04 -0600 Message-ID: <20250803035816.603405-47-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" etnaviv has 5 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs as well as plain-old pr_debug()s Signed-off-by: Jim Cromie --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnavi= v/etnaviv_drv.c index 3e91747ed3393..70759b7d338f9 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -25,6 +25,8 @@ #include "etnaviv_mmu.h" #include "etnaviv_perfmon.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * DRM operations: */ --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (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 6DB3328A719; Sun, 3 Aug 2025 03:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193584; cv=none; b=IyOaFUyw4/kgEEQ38MdNzQ/IgR5vTSEz1H4BjxQBCoAUx2hGWj0u0WlVTZ3ZVDO06i97B4w5aPgKhbFdRZSFwa/MvfHYrVAKzWyKWinOoW4BImrI84cdDT/5igzI6A5VQMlw2HWM9/bvNGgd4uidMs/mcTFISPwg4GoyEekOJdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193584; c=relaxed/simple; bh=yPOQvC11lGxyyVTCaGqScENme6lmMis1h2qncjA181E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wi/H9g6akJty3Wx1mHJfuFBxxXtTr3y3AaxXrww9XM316YzqNHkHG96M4lTK6Z9zandeb1ZGCFQyBOG0kmER1aZxA4eWJ1nk0xwSPrQjNMepb2UvXSSCK7Lq9XiVeqaQr4tXU2yuaVL+EmIpgcEZi7hrBzrbxDLBYXqgcFPHaYs= 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=lrT2MR6A; arc=none smtp.client-ip=209.85.166.171 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="lrT2MR6A" Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-3e406ca2d22so10977155ab.1; Sat, 02 Aug 2025 20:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193582; x=1754798382; 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=GwuwWG68g+QZ7vXSMh09UV2N2ibuGEdSUwCCEWlJHLI=; b=lrT2MR6AelR7gtTFhtGkNvbwMdMe7Kuic2E8sZbm9hUn36Ws7s0FV1C000ylsfr146 S35zqPVxQRSB6Y2XlGSPdzhneE/mZc+Y7OhTplUK9TsyohU9jjYKcvKw2QlLBCf2TU1N zHO9Z/weVFz6ioKehZErloadMYzN+Rbz8cUiyqd585oh4Cnn5GbNlu6JTcazz9RCs5lK J6rNK9Mz4222xJPz9vF6c4/wV3Dt618r5L9olYj03UvOM8z+qomNhcrWJmgygXQm5kKD r4Vyv15CyGEv7IsxuKAKcIuhyopCNzwwoE+Q9I/8Lq/f186PsHQilVT4nvIeghfBrcdP 1XYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193582; x=1754798382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GwuwWG68g+QZ7vXSMh09UV2N2ibuGEdSUwCCEWlJHLI=; b=IauOfIwyyCnp3oKQfGE/mupoU/AAtQCOD0OviKanlWHvt2e8ZcxCqJk0s88FG3bgA8 JL7KtitphiyF4S6Qt+gfVvjUM6hkqtJvqjzRXzR4aV61xYPnnFYWs7T6f6iTEZGwbVa8 /TYDFxBabPzcOXqHicAjXoGSSU3WmZaG9gb6Zj/QZIlq44LtE6JqwVKgI96yaW4/LF/C Nxa3whSltnUny62O0fr3U1weOTSNpPmirkeNGkxSJ4FE7p8+sKNbId9mmK8p9r8MgLmG aSK2uclX9qBqwLNR633VTGdD85m7xHSAq3n9mEfn2zxtnakrJoSbsT1N0LrcxY7nUkhu Zvug== X-Forwarded-Encrypted: i=1; AJvYcCXl+dGzVptX8MjgDdkqrXQI6rYPY/Ed+ljyzowR5oD7RZgRWDxxE/CmGZL+/bL6mdf4ZFrNfJMT49TIxQf6@vger.kernel.org X-Gm-Message-State: AOJu0YzpWW0GaT72s7myHz7TGI8l/V0ilav9B4VPbfHM/NjWMj7o+lzg ObnnSpWCP3h5x7l2O671aIFbKOCB4DVZ0LBKj/Eg9sSCgoYJrLH9YOSJqcCwonQ9tzk= X-Gm-Gg: ASbGncv3UcdNG8OWBE4rVutA97hRVx/Y38mJmi1xSFhoFhDOm073aOdUXfVoZaO0CPH APcv9HQmQEA+LlzYAVSHU2fGtyYecHqhHviuRiU1KQr2o9UtPC25SbMyXs6wkdlaIgGxVmFt9ZD h2l4IIftlY/to98mIP+TxYLACLBKCzkYXly8dXOxWn6GXo055wWn//TnYoEWyxe4KnJ17SHH/Dm mediQN8VfCg63YVeatyQ70YLPqxD/IdDayk7xawAAKdzACkd5mYYGEd2r7Zb7gaA9F6928r1zDZ Ev5SMaf/Un5TaCnNWS+pERUo8BaVPtRit0sv6U3B+mvoVRz/RZYatFH7mm8ZilOgBtBCF+ANLet JNrljwciE+91d8crzQRZtVMDBPfLowJnP3w87KRQzNBCORJctIAimFebChrv8Tt2UAe+Nb+epEa loFg== X-Google-Smtp-Source: AGHT+IFaErFuUf9RL3fjjyrvGPnDiEq4WAlpEJt6vAzu9IAFkK0y610sccboRpj+vz07MAgou68UmQ== X-Received: by 2002:a05:6e02:318a:b0:3e3:ee1d:58e with SMTP id e9e14a558f8ab-3e41611c04amr94519705ab.6.1754193582396; Sat, 02 Aug 2025 20:59:42 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:41 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 47/58] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver Date: Sat, 2 Aug 2025 21:58:05 -0600 Message-ID: <20250803035816.603405-48-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The gma500 has 126 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/gma500/psb_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_= drv.c index 85d3557c2eb9b..dc72388ed08d4 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -40,6 +40,8 @@ static const struct drm_driver driver; static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id = *ent); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * The table below contains a mapping of the PCI vendor ID and the PCI Dev= ice ID * to the different groups of PowerVR 5-series chip designs --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (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 1008E27FD40; Sun, 3 Aug 2025 03:59:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193587; cv=none; b=MDAmcbMWc4+SAHjLpPB6lNZoKDry8HZS5XAEa1q2drNhZ9kamU3In6NOvkq7BHtCi00VD2/h4V+ArRz8WZnL7r7jm47cnfpUASkZPcnk1Q8p7b/+yJ9Kht6+p4UDdpVtJZGPKML7yyZXqz6+3fVv6X4MKBWjBoaivb2gS+U26bI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193587; c=relaxed/simple; bh=cWMj3UNMewUmw+1ja2nbNiC8T9Mn2RMKVFopgCgA22c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LlqEnLNng/KSndvQuGE9wRSSJuaY9CEWnZL2l9jxKy7EFmH35ybKzgp3tPXII5DpM1JEa1y5aDa7gImQB+hq5VioftEGh+zsbxnj0/8N1PRFjoSlS3BgTVOG9etCFQ6fUg3ROUznyvEFTHq/IBIxrMPFfrKSjGC2qG6L/ZjejCY= 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=crVZMg2U; arc=none smtp.client-ip=209.85.166.46 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="crVZMg2U" Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-879c214fe6dso30595339f.1; Sat, 02 Aug 2025 20:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193584; x=1754798384; 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=Xsd/qFJRqh5DgAbSh3xpznnIfN6HELFfqd9qkYYMxBk=; b=crVZMg2U8hYB8zYbjupqtSoDYKNc1EGEVkYrCCG3UF6/j2xP2RCvs38oTJsQsEkvWf s89pRNwi9pLBKedusTAkK3NRe9ZA1qeksKNuwADj02vKgFHqW24RKfg8NH6du3tpIMKm yKeJjdVuDmlTC7U9kZeQmeNmSWuPbZdgFymiTYkBV7Af+b6dA7LbB46NJ37r//jcbXW/ MJ0JLqkLDZli/qsDbt2lFiRJ5njvm/j/l8lgDvOMVhxRO7bl0jFpj9RmdodxZoU1bS7Q HXZekthgkX6hu0orSXLwyqOQMn/49rPKUeuOw68mt//yRFrbBPMT/MQp3I5RPLG726d0 KhsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193584; x=1754798384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xsd/qFJRqh5DgAbSh3xpznnIfN6HELFfqd9qkYYMxBk=; b=E+sXtFD37ZahlcugOicEAiJm6kDklp1UTOvbXMgYI+kTulsF1/ErbiFeM3B/wp08r/ RqDJ2QyazlY4KuG15gW+tgchZEW2Jil7JC1xqzkvDJcxyl62n7P4OEkl/EYZFCTmgalN CXShhujmOW2YBJApaqHilddRhT/fpFuR/RsOyWO29txhqC1wlAQmIIetro7RjyFJNfFk G4LkU0DURql7WcneALSRwH6SblSTYxuYIYx+X1V3ppbOj0APTL0jUw7TgN7zRPc61T0c hTnAFa8dfch6Ugd14p+Rlmc95bDrbtJgvHtXLjwXAbDCDUOOWIA2Rs2OuPj1k5dliBDU YPeg== X-Forwarded-Encrypted: i=1; AJvYcCXDFS0PrIGH5d2EBSvbou7fr0Xopp4QKYgx8AkAd+aryFqAqhhIxB5mgkLGltVArv9at4JsdxX881k/kWRY@vger.kernel.org X-Gm-Message-State: AOJu0Ywa0LUuL8fkWzqZZj5ie62bfYeVY3/Zxli8JJcfAkRqCg7fuk+j vC2cywoLyPPGrSQsqMaDxP/pjsEMV//4I7CDh+1QZbRiAOgfKFY/Bd9I1JDBwJGet/o= X-Gm-Gg: ASbGncvjg8gg32as6rl7lXR9+rNyx9r4PDZeYLdK1KqfaWsJ6qaKY5hkYWlj2O9cetA m+utEs8gtHwW7u5JgrTe5U/J5Q6qmtYcZYb6c734L4NldT89at4raZhXy55iXMseBxNuZkj/mhu wpAsNnGpundwh/7XuZRazELIbRvAO+IuyOenBpxq/eGv+kfrMKRCtrff/mDfvSU3FsGx0pOT9SG 161Bxecht/g8K4Q+DKLX5qdE4DVSJDar0hiEmrzBT2zs2H3r1Py+a1ZrYwDILann2eT1PX2kqFV oXiYGhCHRX1e9RcBdMnwcgUB5JASTyfSCp7lRaE0k0AGUBZRCOYpTPc356SrNDJ18f7vSthY6c4 Exd0AU6WJ5lNBSkuCjeyvowmBEL6mfJ8Vz2gyPvTHnwuHMlCKPttYdtjt5MihgqbiVdi6ivDVhf k1BA== X-Google-Smtp-Source: AGHT+IF5gmZRxVoJe/ZrtZudgNIc0O6RXiQi/MncQOQVxzlu4r2b5IK1NE9kZPr2rom2pyyvDkmK3A== X-Received: by 2002:a05:6602:2cd5:b0:87e:7359:133d with SMTP id ca18e2360f4ac-88168353137mr921122239f.8.1754193583881; Sat, 02 Aug 2025 20:59:43 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:43 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 48/58] drm-dyndbg: add DRM_CLASSMAP_USE to radeon Date: Sat, 2 Aug 2025 21:58:06 -0600 Message-ID: <20250803035816.603405-49-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" radeon has some DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg about its use of the class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/radeon/radeon_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/r= adeon_drv.c index 267f082bc430a..6eaac728e9665 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -253,6 +253,8 @@ static const struct pci_device_id pciidlist[] =3D { }; MODULE_DEVICE_TABLE(pci, pciidlist); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static const struct drm_driver kms_driver; =20 static int radeon_pci_probe(struct pci_dev *pdev, --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (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 8E543242D9E; Sun, 3 Aug 2025 03:59:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193588; cv=none; b=aIVwXLl8x053SPg4vlanbFwqpHSdMcgFzmVm5yTegO8w0/oXZLvBkgh1wad/xm+6PDyRLHQ+E1kzOiCEZpPi6Tdh0pqe6AEE10GZKIL3CAMs2CAlxtsYzlDJGiufE6HwiFw5jAD4IdG0cQXl5qQc4xK8Pvk38uIoVEceFzgEkRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193588; c=relaxed/simple; bh=gmOXj8fzw3jBsxjlDVxd5CorDTDpPquxoIawKB2G0xo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dy1whD4cqMBh2GJ9+lQh8dksVFLTUF1o3nIrVCz8yb2inl3SuXMKshvvtY+3Glvq+1YK/5tW8QI5nc8SGqDYIP+MHX1aIendJ0OdbVpfUDGPNntNyW6JKgngz5v3rzQyIYtjwvDlCf8ETYQAGMHyTSzOUfmGIqmXPySU1Wb2hC4= 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=Q1eUTSDz; arc=none smtp.client-ip=209.85.166.178 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="Q1eUTSDz" Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3e3d7b135c2so40564605ab.1; Sat, 02 Aug 2025 20:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193585; x=1754798385; 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=elSrGuxO7Gdrr9JiYJ8JX6gnRfA3s/NTbfdze1JVBo8=; b=Q1eUTSDzo8rKMqsSOYrYMadz7htbveUGtTw45DvA2xV4xl3TtjDIz5N7DXv5yV5I+L wFPhl49I8zfhSFJJu0uLxpasnPAx/tj1TlSn81MAxPWPvI33pMbpnpyVdEww1CyZawG6 GeC1+ksPM9q5FzrFzEpnY9mgcNKSs2Q/CWPSHjWLbVmzj4T4J6YBLHoGLPlssoOEuzbS 9wQKfTcg5S7ea12vY2VjQnBt5CZSce60ti31AwPTGzAoF+SXkJyYEusLxXP9/CapbLLH mUXKDaHW8YiJgWmTYHzQIXOuLClTV6lB4bjtLyG5H8CBosFpBxjSyzYLKwZBpW+iTRXU g+xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193585; x=1754798385; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=elSrGuxO7Gdrr9JiYJ8JX6gnRfA3s/NTbfdze1JVBo8=; b=i79So835BQNAM0Kp9K5jY8mb57Ya9IJ5Dx04jUkWBnpbM5V6Ea108q/AfVgumZS8JC 7aYeKKIeWYrD3aB5oRjkBsOhevTGIoGM4WyVoXq31R/drPQS2cO9HM7SYGn1cMlqc72h ibW9DmJ14u4KqEFxK/I9DEl9hH3wpzWOOCFoiMf5UvwB9zrRE4qVaFVofby4DqJzUDBV zfjZ/Gy4IryWhwkb4IakHE6/QomDQSUZE9/WBYH9IXiqZQligFFNHz/1P0AfVUl2sYnP oMXbMPAK9KhjWy2I6Q08oDwGMLJ2MVy9exNB/Ik9LgD7TEUiPvzG+eJPO7qXbnaAvWaQ CRPg== X-Forwarded-Encrypted: i=1; AJvYcCVKgTfRDTxg0j2ZmSoV2W6yqFR3AFl0nOBtINydnZxpakmg1o+jZReBR7hUpLu0rVOeUS5WsJFGvhgnoZs6@vger.kernel.org X-Gm-Message-State: AOJu0Yw7k0HR3v4+Pm9W27C0AvmzEoAF50oYD+YBXZzhh7O3ApmA6A4a Aa29IhPEi4YoY5ldGK9UpCZO8eZOUhx1utQqqth9yXyKQQ3ccDdNtSJ/QQjeKALMm/s= X-Gm-Gg: ASbGncv9InlVIoeTlc6oQtkDUT1gMuCwVZ58mLNSN5ItMiUVviGRMuYvCQZAgV4+qkk al4WRBsLXE9+Z/Hh2vM6vpbLbx/usqf06c4CgRhR6iZNC5L9INtihuntC/uMiX9cZBmZxmfmjRk +CwADK3mZM13nI35R7S+j4md++ZZGYOrimsXV2SB4v4MkinZmwh358GNiUdBnPAe7a2Hb1/U7xj x0sP6basWhN45Hy42YpA9UAm26DHPxu4oeV46bLa/GkJwMhP5FxaVzy7lvA5TRv06ymaDrGkle/ 3yueEIcg11z02WSS4nVdngH1IMAyK1D4oV4TKHhK2QludUk0OByre6FbaAml6/VgyBUUjZyB1Wm m43C/TlNT6Do3IJ6t7lK+7nqHRpiRdbi1/+qdQ+3QpYnr6XCWfCXKFlMo05bikDYmGUW9CDtW4x 6gjw== X-Google-Smtp-Source: AGHT+IH2v/yHbrftOiZCv+3aNfsvxCzIweIV2VBjxfjxpqhUxRJcHX4wYrnxPDdmodWbE9uh3slotg== X-Received: by 2002:a05:6e02:1f0d:b0:3de:25cb:42cc with SMTP id e9e14a558f8ab-3e416192458mr92390555ab.10.1754193585333; Sat, 02 Aug 2025 20:59:45 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:45 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 49/58] drm-dyndbg: add DRM_CLASSMAP_USE to vmwgfx driver Date: Sat, 2 Aug 2025 21:58:07 -0600 Message-ID: <20250803035816.603405-50-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The vmwgfx driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/v= mwgfx_drv.c index 5205552b1970c..24e9f6fde1bbf 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -259,6 +259,8 @@ static int vmw_probe(struct pci_dev *, const struct pci= _device_id *); static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, void *ptr); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(restrict_iommu, "Try to limit IOMMU usage for TTM pages"); module_param_named(restrict_iommu, vmw_restrict_iommu, int, 0600); MODULE_PARM_DESC(force_coherent, "Force coherent TTM pages"); --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (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 BB89A28B41D; Sun, 3 Aug 2025 03:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193589; cv=none; b=NcgwKyHhwvUpPiqRgdTsJP/pOflMTtcedqQNj1pvnB6ts9d9Oy7V7xwV6ENz/CkgDZEOQzcefNeGCummKGX56l1HfycobkNkBZTnhllMp8yecJR/X6BOEber8U9Pkl609qz44OZYOQxfmqvMmC7jWK8xiFrKG0PvIsRY75hJ0Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193589; c=relaxed/simple; bh=N3EoyuzODfPWQnX29Z81KHejIdqx6hmlepp49hsmKeI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=htIaA+66MpQAfWtbDhbt4O/lmy6/DZCRRHzY/3NZc1LGefjQs5xvowyOKcQNKj41aTGRgFwH/xoOQoHKSXBltVLLncU/IX1p0ORal6g1eC8kdvJM6RQVvDSBx5SFLVt+G0XjJ65yo7xbAJjotF8C2hJ0QVi1clTSbUnCu4fU70Q= 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=Xg+DB9/R; arc=none smtp.client-ip=209.85.166.170 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="Xg+DB9/R" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3e3d94aa969so14697725ab.1; Sat, 02 Aug 2025 20:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193587; x=1754798387; 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=r2JGFRfrIhHONHk9F3zUV83hFGKQa8jTEAD0j3plUI0=; b=Xg+DB9/RbxIvMwW7dzeQ+ti+objx9O0klc7RbdhlhijJ9Ll9MrcwM0tPt99bORmytB rd7rwmA6uOd5hlkfnZH83ZqBw2K94utrcwzKWjdlIh5BPGQ7cZ+Y7RH+/67+sWXATC7E CJ1guASs9ZvhIK3kSXKQsXoqNHtjDfGj4VKqv7DW/pIe9dThbLha8W0O3XwUJSAds1HY hHwGjvZe3RJ6Nj07NnghkcUAvt+Qubsv/XT6CA9AAGp8gS8yaEuG5TshVy9HJKk9G73N UM764DVsDHgOtWSf9q41uIieBBwbtnJRx5LvhvJS8p5dZJw4csQH45SS4peKenHSsBe8 5BaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193587; x=1754798387; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r2JGFRfrIhHONHk9F3zUV83hFGKQa8jTEAD0j3plUI0=; b=akpltjSzwChg8HEKaVnk5xg3eW2QQcsXvJXsbAt2mvZ2QNi5Kg/MdHTFtmKbUVm9Za JH8jh4x9Ht0tHQ5yMPLDv1tY6v7aCkkIayIZzDAXv8NTE98oQAlV9PIt2w7mUTKwO0vL +Eb7jwnGYN6xsPg4KEli+T5C10wHUlq3/8IP18PO/7F0GBOfThHkX/FnASGnDwKdEBgg s4tRzA+Bd6fgMgiA8RO6zfliCsz/GkH6bKpLM+noN6fBmx3ZAvlnyJSZGTG9jnRBz/zH Gt2qbU3iBtmvazWqcWjSsZuXZexpFSUV+qn2ZfDo4JVQUYtjl2QA2Ap0CY8kzPFhKuiM dcTA== X-Forwarded-Encrypted: i=1; AJvYcCW9Iccj7ckH9BfMlfQiRksVCni4awpiTl57P1TId+jX0NoFTfDrGg04bzYcVNHggXELrt1bvJYrFrjre6P7@vger.kernel.org X-Gm-Message-State: AOJu0Ywx07+6X9qM2DPJoDFY/wVa2FDcYo/cGXeNELBD+QgO1UPut4hC sd3qP2SFgAgfPZydjgTqeA7mjrwF/PFclDxrkYUmBGl7gi4/F9lNeLPuwMaI5URozhw= X-Gm-Gg: ASbGncvjF6UDAiyOT41bXGbfUEd471sySbj1bX43lx8eaTXIeMlz/fAVEvJJ7jdqp0Q lQM10jG++EpO9om7eOs/vIpBKr9BBDGHUxmFDslA/9u6/EC8ahBfv/UR1bInVAKxWwxPtMAcZHj hUNmTFwBxgRXgY98EKYeod3TN66dH+FL1/sBuRsFq+ljsuLPYYXyCFEZbg7QSoWOZ8D2WMTXS0+ 1LGGHG5bS9GVt7bt7iZTl/xBv8MM6K9edyBl4kFue1homUJpHtSb/F5OjNSK2frFP684YWbG17g w9JPiI7Bmsq7XOzD1TCSp0nPSuIFZIHe1zUG6wJX462QfJhBj/gtBkKCvXGDkkh8zTg5euk3Mpm jPnCi1/ORyXFkRFA/7HBcslLRnJSomKXK7phtCkVqjanYU4eFdnxun95E18ZAHnckryUb1b5XVM 7cOlnOGiu774EV X-Google-Smtp-Source: AGHT+IHqVFvq1DXgRalOAEJ4e6OJ3Wn8/7Lu6yNitZbnZoklyriFDbu+1seaMWuZezPTVSx6Id5Rjg== X-Received: by 2002:a05:6e02:3042:b0:3e3:ccdb:6ccc with SMTP id e9e14a558f8ab-3e4160fb7femr85375625ab.3.1754193586726; Sat, 02 Aug 2025 20:59:46 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:46 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 50/58] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver Date: Sat, 2 Aug 2025 21:58:08 -0600 Message-ID: <20250803035816.603405-51-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The vkms driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/vkms/vkms_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_dr= v.c index a24d1655f7b8e..29e47700688a9 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -37,6 +37,8 @@ =20 static struct vkms_config *default_config; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static bool enable_cursor =3D true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.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 2BD2E28B50E; Sun, 3 Aug 2025 03:59:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193590; cv=none; b=byCrvRNCcNcJhRpassFUTR2tkcRao1vhmmhjw53F+96CoN6BLhcipSASyvgxICVFX3ByPT/FZDkWwScUfTpkzI/sJ79d+HmQvMt0dsrsb0omQ406zsunle25blRaYtb1gRMi6gvYo5jLGRmiCrsILW/9DHNa05ozoqURgjgL2f8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193590; c=relaxed/simple; bh=9aI7lG0Tl2hJuBK90YHBJAsoJ/8cxUI8i1v/f3BffTs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MDklFiLYsgdp8WRS3+bQx7hsnm0Mo6R4wneVHCSLFFOjAZ+u+PAPBsq+tO9J8mLJN/D5Pbp5OZPj4L47DknsD6O3OZG9eHrCaKUGwEdhhTb/vHXxJVHQvBYFT8VBxDcYvnclqDvMauNkNPYSMVJk+0yyOCb1jWalG65IlRA4+04= 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=HM9S8sdK; arc=none smtp.client-ip=209.85.166.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="HM9S8sdK" Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-3e3f01612daso11600565ab.2; Sat, 02 Aug 2025 20:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193588; x=1754798388; 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=2Y2j3K6T9pEbVJmy/1+mQG/Hh4BA91G5pqycFLMj9u0=; b=HM9S8sdKQ02SlLx1blG5dKFHMqPWAsqVyRi0irWsh2RRQL7oqNyOxAv1dxR2m680qN AQm/8UL7JwjrDHqLA+mcI4BPXXvjLRSwS94ukMcKHYxs8eGg/yW6b1Pwp4BxICDJs2mJ EXfO45Meu4jYQ9w8UemKR3+OoYdvWzogcCEiB/nKZF6O+LxfnHdVSIjYNGdGg971Mgta ehox/86vyZKDkFfhk2XTumuhvJxTYxcBzljC1dj6qKsGnOSUpE7QgypkEC1rccGzgeSO saHSZCeznrAvj3MKCDrD++Fc1J2rjnbWecSm7TqvhL+fwSjGUPsmYZoEfJmpTbMmwACw Uwvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193588; x=1754798388; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Y2j3K6T9pEbVJmy/1+mQG/Hh4BA91G5pqycFLMj9u0=; b=g9Sa553Iatbbmzh0wPmoKcTVHIpEjeTaGWLMVuLL6nIfT18mMqOOrRn2A6BHgYXj96 K/32EmwD586+bplDrgdl0p/sKIAQ0S3ymWnPJOIrV7iZ7bC9H6hI5nIM4geZdzJqhW+i 0VFLx5xa1FI1d/97Q+YWFZjM0DIMTh57pCtA4m3Hu6HZFT2clvPispXKSJAcF58Hi3Ay i1QDMZNrv1AitXpuLKQFwdUDrcIpNqxMpZXL2iDIj0kdd84LOuydHw+hDOoz3M4y+X1e LH0R8wPJq+ryAF8T0CUqsvnkQOwIEba/WqBat/YHPY63iudeO0HUrvpd5DB3Nyh7pbkr 4BAA== X-Forwarded-Encrypted: i=1; AJvYcCVo9P715QLtK4yZInNoKF420/2FYO8LxAj3ur4KNNhuLL82Yav2qMG9SJ2Z5MdaHo7xT+rhSdUwtGa2+WZm@vger.kernel.org X-Gm-Message-State: AOJu0YweQpS+jeI6lxQ1iKGq99apgIJTugGRrtwuyMUdZPF+Mt+muJZC BKaPzmCLFwy0lK21wAg3FMLdvNGgLImUjk8rirXg/ZwAPeCR4vhgwwkuuD2PMS1fOgM= X-Gm-Gg: ASbGncuZP7fXlnA/LhtzFvz85E4e+S/+572NIXd5U8B3jRQeA8fpArINrsxMHXpD1+X jlbKbVmQV6SioQYu4DaHbarroY+iU6r83q9S2CnySrDaUAEeqprE/9EWLWJtfRS8fsfhL5bP3I/ Jjs5QbVDJHewM/sp57kG88mViCiT9skjzdUpBM7bF5pZdB7ZJLQcRS90Ox+LTgdM5Tod2z0NH0l JHNPb8RLGp6Dsx34lYKC5eRiZs0z4lZnnO6qlFkdO3Ec3mrTAZrFpzK+dzph0Rnf05AjN0ga2kI BIT24nESzfkgZqToWQiZ9uWSmjCPh+VFvsf28yj4AbdC6ZRXyjkioiNzAg4TujjSBp6gtj3pyCa LFfAchow/KOFQQoVWWWuUhPT8wiwB25x2ThIvJMobTO5vrmiR6yqbo7eov2z4zshw9++629Zg+2 sC6A== X-Google-Smtp-Source: AGHT+IG5rAfDnGWWHI38mC3T85otZ6jr6iMt5B4TFAIz2EjPIhuXzfVe7WbaaJ0FoMpD7p5DssgRSA== X-Received: by 2002:a05:6e02:164f:b0:3e2:a749:250b with SMTP id e9e14a558f8ab-3e41615d149mr81988415ab.14.1754193587969; Sat, 02 Aug 2025 20:59:47 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:47 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 51/58] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver Date: Sat, 2 Aug 2025 21:58:09 -0600 Message-ID: <20250803035816.603405-52-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The udl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/udl/udl_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index bc58991a6f144..5ae66ffd72bd6 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -21,6 +21,8 @@ =20 #define NR_USB_REQUEST_CHANNEL 0x12 =20 +DRM_CLASSMAP_USE(drm_debug_classes); + #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE) #define WRITES_IN_FLIGHT (20) #define MAX_VENDOR_DESCRIPTOR_SIZE 256 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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 51D121386DA; Sun, 3 Aug 2025 03:59:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193591; cv=none; b=RBWakY1xxe6hcVRzUJO/0QjLOFh7R7JM4WIiWaZ2hmeoZqE7WVPInRjG6+fnIUHyk6l8VZNJAPr+8FK0J7T4eYAHfv2WJ9GhNGPtFgzYHxIBckwnV/nRbaRI3F2ij83zKyuBUQPq421tVrBMcAeHH9luguiDCVrqpUm0Vg233SU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193591; c=relaxed/simple; bh=bhn3w/EhtRuNYTr1IXJXYIE620PvvuGY4Dj4Dvx4+hw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KtcOw2koDsB26xXWweDQ8lwa8NnEHXn5trDf/hvThqw2iDkJay2RV5xVC2dfvk5xf0dM1sz1F0np+gWQZKvVl6ER+Hxs54YUELvyjmhPmbNJPm7Yx5d93pT4cF9wK6uWdajMBdT7Ndcr6m1hAcnlzwnvH4esLWvcHDmzsT7GCdk= 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=FC+OgfMC; arc=none smtp.client-ip=209.85.166.172 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="FC+OgfMC" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-3e3faafe30fso25242435ab.0; Sat, 02 Aug 2025 20:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193589; x=1754798389; 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=9UXktWfyU/nC8G5w+/5cLAwZreh7IMfsApWH9fi/o5I=; b=FC+OgfMCbV7LSsuol8IGkaw8Cd6g0Vj5rQHeomGZjT/Z8bZco/Fe6lvED4+D2mbhhB cz7vXNDQWuPh8845qMXWYpFCdNSFW0FlYYX1kCHsIqiU0SnGuYLbTl4XwIZAgCtPcLqn 5RQJl67xjEhxMVfiNJ/FsCYgVX3+xt4KB3JDFdsfii5jQB5clPOL5THc4Upht5hE6Pyc Khe7MbSveHaMtKMTXdgD0kPDcANCy6IzIlfl85d78/MvnP460LU7vbquWJw0z2I46XCY DYzAToVtaPJIpM4pLA/MrEwDdJ/iUB28rnd4DItyM5CJJmfJt5pyLBcHsmT9OvaeJBzt Q5EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193589; x=1754798389; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9UXktWfyU/nC8G5w+/5cLAwZreh7IMfsApWH9fi/o5I=; b=HSXpDrrmGtT32u4Kt8jsQknXjBxI3Ngau4Zz/tFPLn2p1yiB06wBi9ePpxCKg2p79L a2aZ5h24a/XkCAiDBD/bbHr4syDAuMkNRrfdikPZvKdeJrj5n8amZdMa02yr7KOpvGoG PkSKD2Ju18ERtb2U/ME711s9+wm53mWQMf6eR5T60WmiTKaXaHtq4eV3UonIQr/lRZG/ R0O8DjlbPsIfSpbngWRsqmMjefypjjR0r36o3BBKpiWugwcV7tMR9QLz+CgvfTBcLX8t fZUnYockrD6nYLxmPf866crnth0dVBR6dlNWZkoAaxZzCah2+LuQpnWZxYnZgLoknmA2 HQ8w== X-Forwarded-Encrypted: i=1; AJvYcCXD6ONM0X5tZ9Z+TSUEkR6cKOg91opimbNt/oMdtxocyU1a4rUadfCOHiHiJUTMQFeRNLLEbbwowdI5Tews@vger.kernel.org X-Gm-Message-State: AOJu0YypR2p8MuBp12VcIxuG8YvZeqwpuzkq61CqfE1Rn7FfsWMmQmlM 4zpmUDlT2XLeOshpKLQ+HIe0EvAl+yILY9f5PGcFGGsOcGdeo/U58mWZR8tc3NPOmgc= X-Gm-Gg: ASbGncskCabfpXqXk6qnN0lGnFvWuQrzbf0qTBebKWQo0Slaky7liUAogwPF/qGpP3l ZKU+Vv0nBHaM/Go1V1EuYTxUm2opL62ZAmpmco4KcEBCONAUKu0NyUiP1+Kyy1t3NCXxgtjJvu/ k63W4ybjbxdv5stYZG7I5jPeC/vNmyu3q0dkUpwS8PtmBx0F+RlinQI2xIn+gjdeTQHMRFg3Fya gLDWC8RtZNvvS86e3ZAl7hmKHM9rue5dVYr+x7mU4VbbUHOgH/+n/hvHnErXpqI4kVkQlmsW9vq S5aFbmPiI+GemoB6kEczZfqZEFbDEBWXHMNBM4v50SzsYuNxj9etTtkLByv2PPV127PpNCsJIyo LbQWsNEc0zYQAvJ7YioDB2fhowZxBRfYu6ON+H2/ieyWBQL/KkDmbtyvKhLm4ybCbK1QaYIVJ2m UktQ== X-Google-Smtp-Source: AGHT+IHgubDEoBo5SwwKlV7BEp7xGRXkCfl1MA6t15Y/tj05GEqe4gbfRTAzanGZnInCRSiMQrumQQ== X-Received: by 2002:a05:6e02:2164:b0:3e3:d1ef:83f9 with SMTP id e9e14a558f8ab-3e416116d3fmr99926145ab.6.1754193589138; Sat, 02 Aug 2025 20:59:49 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:48 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 52/58] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver Date: Sat, 2 Aug 2025 21:58:10 -0600 Message-ID: <20250803035816.603405-53-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The mgag200 driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag20= 0/mgag200_drv.c index 32cd8ac018c08..f0b5b57646727 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -27,6 +27,8 @@ static int mgag200_modeset =3D -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, mgag200_modeset, int, 0400); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + int mgag200_init_pci_options(struct pci_dev *pdev, u32 option, u32 option2) { struct device *dev =3D &pdev->dev; --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 A097228B519; Sun, 3 Aug 2025 03:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193593; cv=none; b=qI4ccszoXC1o3B325y4cvVLVCNqRZ8FwzZiYfU5FfdVKZJXo1j3nS59LHH8Fm+/yCPcRZAnIH8TSypdDEPEZi+N16oTt5VELyr6GQMJ96tXZDJJiKrfK+bSowD5qIH9eY4XzvVtkv5+OjyXJlT+v3BucHz/HdRahxih7KgaLM5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193593; c=relaxed/simple; bh=jkOn2xBk0cLb442PiJIEZjuOEN+OznhyNqZ7NJoJTyA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U0E6ErVBFUjokZLNxOyoeM1yilrPG6M42zfChdrvp1RfbZ8vnu/MktyHCwDaCA6fAcqLNqBUOwTmk3xp46O1+sqZZI46V/qCgv+ayQqT8vGZ6vMmpqRZwNRxjKc3qjGjMgthFERWf6hZ1+5x4gkWsZBRO21FeNt5MMdz32vgNg4= 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=jYkc9N7Z; arc=none smtp.client-ip=209.85.166.176 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="jYkc9N7Z" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3e40212e6ceso14463955ab.0; Sat, 02 Aug 2025 20:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193590; x=1754798390; 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=Ec8mexx4J8gKYlYC4pXrJdWhIH/flCkBKAIsxaGo12M=; b=jYkc9N7ZGv5k8kf59wIohr5AJOudZd+zMmvBQy/L1hhZStk9M+CsbQFPsNvxjJi6jy VYWFcatJjQx2JRJh8pP+ZL+e6YuXK3NGAM22DbP/ADtYj0vZscf6bzzbStqHprgUbDba 3C59n5KCy3Qp2Hr7Nh2RWjScidglr7OeNDIjdmcoV0j7gRRkWh4GCuihzhd6pDvpmk6q GXeV5WhtRcLRB0S6skKVUlDeA2OlWeiLqiqnJsY3koqh+RD//X9NZu4oKkpTTnRspTRX KCFsk91+7kWTxE3cCunGrvFNvLDFXPGDUxbY+U1Mmdd+4OaQhfbwoU4PlQStP3JDGnID o8bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193590; x=1754798390; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ec8mexx4J8gKYlYC4pXrJdWhIH/flCkBKAIsxaGo12M=; b=P/BUcvyvqEjfFGzkVXrk4vRST8WjrhxGcuwoRUnVA8PVgL13m8uhkeUU62r4HJ8FgD mFbBO/R5fXiAo+liDNyQ4AVQstl953mtBluMbaKMm2yVayWQiueSFxIMWqe5lBvB5vQB vyKvZYpFUKJTnt7h/0i+JmRSpy5bjP7UJMO3+lzsa/LlfVVoqH+HfcbyVlNSSSrZMZB/ jD5jLmaQUsuZ6ZqEcoplcK/iLFatG7QMixWDqvpOB9G6bNnEA1iD/T4Rsw9JvWeU9jyB CdRtNN3X9ob/e+4jOCkOwMzyv+XRdnYdK0RoFwa79bOCUu61Q97gjqIiNZGibD9+f9Vo hKKA== X-Forwarded-Encrypted: i=1; AJvYcCX+C9wTeMg5h2G8Drk0WqQQ++vn2gWdUJdWa9zNuPdQXwFtyw9xHVoFI15tcUEupDKs6rsGOfuBo5Q4iVIP@vger.kernel.org X-Gm-Message-State: AOJu0YyJioQk5GtoOebSrKXda4d6+4a5O8QtnIIVbllpS22c/bXulvb9 4TdavfrctQbioN4ilwUM4pYl//VX5+YFQS7Cig3w46pnE+tl5MiIgwSVpP1NfnDJ2f8= X-Gm-Gg: ASbGncumIBm/uw4zebqBb8Yv1IVTfckllAd7JCplPi7FISz769BTKK/tWyo9edFjBJg bzJWkCsaxGY1SXBAfqE9bXqg2rxhovQZlLgipMycHZtItOHX1VACZcYiqAUC0Unb4WOL7RP11Kd PRo2im7rkwa9FvBY/H6OHXtluLSf3xdZaNy+NirpMwXVYzJUW06gdVabXzD4qhzpm79k5VtaR7E meWYBfHh0rSMmwTdbgEkzltClYqArWPoOXKHateXA6fdFUPKTAk4GyrE1CUDWFRzgU7RCZBNAoq IQzXuiH11QWCV4O1rHHQATSU8/gTLkPijEElQBfEQP4IQh6vP/30QOnnz6QAfjdUz4U0VlhoGlP o/je5e17JsyydTeRR6/pCqh8+VXB0NJ5DJYG35UOOVW9IGB18QbgNRpUSa9nap6EYzPbQ8wCUGR RVyw== X-Google-Smtp-Source: AGHT+IF/wtqWPX2Zi7GTVg1C35Kj0vqsIIXy5Rg7Uw34TkqPQk+fiEKJa0lSA2jtCZZXOMZn37J89w== X-Received: by 2002:a05:6e02:216d:b0:3e4:ba2:2cd1 with SMTP id e9e14a558f8ab-3e41617ffa8mr84699525ab.16.1754193590548; Sat, 02 Aug 2025 20:59:50 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:50 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 53/58] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver Date: Sat, 2 Aug 2025 21:58:11 -0600 Message-ID: <20250803035816.603405-54-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/gud/gud_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 5385a2126e45f..5b6797b80ff01 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -32,6 +32,8 @@ =20 #include "gud_internal.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* Only used internally */ static const struct drm_format_info gud_drm_format_r1 =3D { .format =3D GUD_DRM_FORMAT_R1, --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 D04FC28C01B; Sun, 3 Aug 2025 03:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193595; cv=none; b=I11r7lRYTsbxauGDUoUm74oTwl0jYcej+MDhUsqyDlwFK71d3Yr656xSZXpmbPdXjbTiLX4NQ+RiyfCTJVhoLfFO/1TbilIQYi6auPeeeMQflU1Y05F2YBxX5E1EtfPf/F5a13aTXIfY3Pe650FGAJs4K3aV8Wb1gG5xWUkYS8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193595; c=relaxed/simple; bh=hqMVdGr72w667hB+DFSofV3pMlb3USxVvkpVSb8uY20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PEqmQBJt/+j148Yp6dXu7S63RXvko0wr+g+yp+ACqhu1QrKYD5GbMRxsXJ0bvd1y9IrVVUF9t0fRy6uEwPdjPW5T0ZLmVXKSn6idu6uLeQexTZAKZoxCfU7gLOU3ZxgcYvUltqrIUUfMJ/nGjlYRMmxTgHGxQKvIgWPJpd9XqY4= 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=OY/FUXSF; arc=none smtp.client-ip=209.85.166.181 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="OY/FUXSF" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3e3d0cba6a7so12047585ab.0; Sat, 02 Aug 2025 20:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193592; x=1754798392; 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=UUd0OZUdA8b96Ytm4NIRmXIDrelAvQRst6I1taJ2Nl0=; b=OY/FUXSFMwsyqA1fj/sRVoAxdyo8UFE90bbxNN0vM1CcWTQs8qxUBKPgq1VsINVnj/ zm3N0u48nNMf4C2hB6ggkOGNZWFCDwMO6ZMEvH+cyF4Gy1xOE1lXfUepNufYteusFWyR kNFXezNeYmOvWL27iAEnzd8+gHQltdUkwZLGy5i0WxKMsNHWR+RXE7ucexvOLKZOZYBz xiHa38eGV8mkiHClP2CB9xUlSI4NQ7XX6MOue99hD+yKmMoY5qgIUShwTUlDFqf90vuC 8gh7WeYS/AH6Am3G71GUG8KjWXoT9A1sgzR6r8FDG08HghDoOU6vB/zAPqIu9jPSDTYj y8eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193592; x=1754798392; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UUd0OZUdA8b96Ytm4NIRmXIDrelAvQRst6I1taJ2Nl0=; b=reDRcqRiVjFeiw+GjSnuoit8YhhWKjlHD/ZBKFMlcms3ZUMchRSwyNhyIRJwwl+4x6 jZtGIn0USNbv1Z8yiwd02gO4L+J6YmjXYRozsZYzyZ2ly3bpOeSIRSGOwuSePOoz4R4f 3V/pjbX2JgP0916sBj9MiX3G8pw+YVjA1VLHkw5y5ngMM7iHo9dfcHv9BbF1vU/fD3Dq hj9eqePiCW5X1jlVVnQi++YrZKop1I5cgtZCXLnrhZ10s6UZK0CoUOgFbbZ2KS/PPiu7 Ps7EVHsIln8vG5Z4dVcqFCKoHIcEq3KGL1Wq3pNqLMW/5v1/dvEKaAnyatY3qgP0IIIr V9qQ== X-Forwarded-Encrypted: i=1; AJvYcCV8U0qK831qXVZj0gVX5sedb4uZXqvzYrd6GM3J3wTqX0cgXWeyabZKOa3E7BvYyVbL5YO9TdvfTXUtHTac@vger.kernel.org X-Gm-Message-State: AOJu0YyHpjLZ+qjhG6mfsvYYFRHN7j1Jq36MDs34dUY7vAG4nnAUz7Um Fzdu8AysooF4SWI2M1PZYdEXLQgvUlHbS0S/xOorLKs45+QOG6NfymTX8VtwIlXhzAE= X-Gm-Gg: ASbGnctEc3C+Hk6xAdMNe+N7AeUUZrPpcuybBjOiZ/oAt/b8fULNYdgWwbs6/RBADCc ZALYL/2EJuly/Q7mkHwhwBPYbseXcIIxHon4K2Oc8ys4Mrib92ZbVao4z668fT6M17lpvIM3nUE SmB8fR3t+vrUSN0rW+ZikRIVklpNU84ykda6r8zsxKpdpX5YP3dvWRaoYgk4WsJDosbxFQlbjTU a316mENp2gmwLtTi1pKNSf5B8TkcdPj7toWHNTi1IPsRLcWCunIMRcylJvstFLBa7y49wYMVUVT 9UELRJi5rQx1ZT/xErIRiqiFk9bA4p9/T5AixNaLxZiki0SPpuDj3KwWWYDLwnvy98gXxfkBlhA 5xPQm+W9XLEZL8L+D9fu/3iLyvumRhe1V/7vKi1+sPEOEIXWcK2WF+dFGuHGy7sK449Em4upqps uJ+Q== X-Google-Smtp-Source: AGHT+IEyhw5mUB/eNoeEely1BTFanJ4yHz9P0sfCu6Pe+TFRcVR4LSDg6aFmHhG3P/FtSBF/ZASr8Q== X-Received: by 2002:a05:6e02:1fe8:b0:3e4:b9a:8ae7 with SMTP id e9e14a558f8ab-3e4161081afmr88579355ab.7.1754193591790; Sat, 02 Aug 2025 20:59:51 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:51 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 54/58] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver Date: Sat, 2 Aug 2025 21:58:12 -0600 Message-ID: <20250803035816.603405-55-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The qxl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 417061ae59eb4..c18577a3153d6 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -66,6 +66,8 @@ module_param_named(modeset, qxl_modeset, int, 0400); MODULE_PARM_DESC(num_heads, "Number of virtual crtcs to expose (default 4)= "); module_param_named(num_heads, qxl_num_crtc, int, 0400); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static struct drm_driver qxl_driver; static struct pci_driver qxl_pci_driver; =20 --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (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 DFC3828C01F; Sun, 3 Aug 2025 03:59:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193595; cv=none; b=l8DteIyn7NaZEBqtPFWRRQWRWm0C3vZK7EPupAxeD/VwdpjihO5/YZgj7hRtDtRdGuL+8dY8FeeQRG83tFPwai6R4ecnSh9qE/cLMClRDedt8nlXiBfRn4c6c7voOFIbEQQWwNwbWlqw+QkZC/wgJBWdf11qmlLe8k7DbmqDTrw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193595; c=relaxed/simple; bh=ioVw2SWj/SFT6Sjv5QNeS4VxrtX4X80veAJphsEyrp0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oF0FQv8kVrkoQ8hEO0pR3xU/Yo6R71C9pXnaTJBAd+df1Hr2YUDCDFkG4EMdPoWRCHTCZxHE9m+t+QjFkDpDMRMw/tSTImC8IeZQxGIbPC8L4zQhsdYBRhXblwKba1UTTwWpcAPIz04UZkfpo6/KCa3tqxevmfycjCItNCLXpGY= 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=gZw/xYTV; arc=none smtp.client-ip=209.85.166.171 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="gZw/xYTV" Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-3e3f0287842so27597745ab.3; Sat, 02 Aug 2025 20:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193593; x=1754798393; 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=AXiCwepwhznbX1KBNscjXPO4baEWE9aXjHhFme2k8Rc=; b=gZw/xYTVye88FLAP+orR10LTp4EVuVoJ92bp9ytZuCSITl1VArtUxJlSl7QJtE7ttY H20uKlYybx5iI9+IVTsIdqDE2Zg1LNvV+H7fR3tUZ1Svv+HUWKpMC4aoceHJMFtdbr/y uYdyxCNr/GwOIwMzViG2Qm3vhoBRGyM7AdYA9zt0BXxbVe6vYKs3us/errBl0uX54Z17 8jMVofHOTP+ZEk/ycZDnrEmY3bhqVJAYmCv4xkb1E5QbAorE8jOG/3rI+3cZOq8Hmq9t elehLaxFhcDLeg1U/8TWf8bLUPDrpqBX0xM+XatmR+AsoyI31lCXug8Vuq+hHOu9Xvzs y9YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193593; x=1754798393; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AXiCwepwhznbX1KBNscjXPO4baEWE9aXjHhFme2k8Rc=; b=KW4mquxlawrWbVk3fB0FoHtTfeLKte+TiRHgULfGltdy7JpDM24akjhRk/S0wv1j5H I98DSFV/xaD36RfB7F0/FvsEh3fUyqCwYMsQT4sp+JV+jEfb38QZgt937hSkHRLHxLEa YaLTl5npBhxTTjLQ05VXtmcBiFbqa71xnWtvWoXyFFkCc/NmbYNWdU1LvlwJABvQL23e CEjrer8wbCThWVZ9ryAVe6V+7lqJvum/rJSONezHOZLeVxHsXAM9PajlQl02ldEPRDrp jT10hVxcNQ3Olxe/bU9oBW1eR8YuVT+SXcrM1WHv9F1D4PXJuukovWLdNDYL3Enw8H9+ ToBQ== X-Forwarded-Encrypted: i=1; AJvYcCVeEwx2KxvGcoTXl+GvnFKkvO/S8lGS4z5E360V0ZyMnp/Apity8oBzklUAbWJf3RC7pouX38bMsq/27Njr@vger.kernel.org X-Gm-Message-State: AOJu0YzwQdCbRQ4HAGGbnGfqN/3jieO0dxtxVLMCXmJvbgEz/86qYgNq XV5SFAamKxMUZgEROZoMXmv2ZyQLFwYJP/kHc5rCnL0CCh6mlL5m9/P5VFWMx0lU0/o= X-Gm-Gg: ASbGncsR9KZIfpPrQEb0fkbrAKlm26Mv9jTRvCcz8gMMcZSehc8SLn8SIRHTHpjHPmc F56wLCh+77KU6kwgmDN0Kh0St2ZYR094AKbkLClX02Wxrmh3AfbrKc4f8yKG0fXUzfrqVPn2We5 b4zRRifxiCcJfBEOSa7x96NyonJ1CWQtBRhkVxis+FIGL9Z62Qruc1HDYm7XCE+ihCVyA5wXBcD 6un8OnvpeOyMw1Y5XlkJsLBD+jcYB2MPmaKVLM6A3e1Eeuek2fAYiFXmwBw1xNwHkv/buYWUgdu RL4aIvIqUR2u4d99/B0KdiGN5WPq5nBxOyjiZSkjEC6GimtfitB4vrvn/mTvdMuZRqPQK787BYO RKuWFb7SR6XhtIcU03TT9QxaOaOd6iL4/lf+fxuZTR8LJFiDXMlzfYWRl0HdigY+IyVktYDnt4v Awag== X-Google-Smtp-Source: AGHT+IFRhlTHb2lQE4L0miOq7NLbPvlGhLYYpHWAVoxzVxg4lJp/ceeEQ8khoVmbBOpRBlSLgtRD3g== X-Received: by 2002:a05:6e02:1689:b0:3e3:ef79:5a8a with SMTP id e9e14a558f8ab-3e41617efe3mr89164355ab.12.1754193592938; Sat, 02 Aug 2025 20:59:52 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:52 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 55/58] drm-dyndbg: add DRM_CLASSMAP_USE to the drm_gem_shmem_helper driver Date: Sat, 2 Aug 2025 21:58:13 -0600 Message-ID: <20250803035816.603405-56-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" The drm_gem_shmem_helper driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_gem_shmem_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_g= em_shmem_helper.c index a5dbee6974ab6..95ff79abbcffc 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -23,6 +23,7 @@ #include =20 MODULE_IMPORT_NS("DMA_BUF"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 /** * DOC: overview --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 0D83928C032; Sun, 3 Aug 2025 03:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193596; cv=none; b=faEDduL0NcIjx1vKucNkxSSRmg/U+tRiofhO3f/A2szDkjSbhO8QyH2HAtl8v+d4iQe6Tp6Cu3sJMRN24/KEpTrSbzkgMq5SDAd1myLqXSFLtMd6WlFPGVrgZuY5TqchzZ87Tzop5L2rXyogaN8PYEzAUgOSQ8ylgb/2vtVhXCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193596; c=relaxed/simple; bh=JknfdaXi8hjrUfCFrJlaKqp9Ypoqe0ctXIo2vRiUbuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=seXQatf9SMWe1bS4pJOHesVIMkCbVAfhNAx/PMHz4OFINdIAoahcdg/3BOVl0ahLc8pB9Zr7/tkEmV0u7W09PunxxYE1b5p9uPXmJ4uti8TXY9jorVV5fYU7cjP+d3src9xfXndPR3fEP9M4FeSkiYvejc2RVntbfkcPWIvpVY8= 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=RqOTBbn/; arc=none smtp.client-ip=209.85.166.176 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="RqOTBbn/" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3e3f0f29d09so9438295ab.2; Sat, 02 Aug 2025 20:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193594; x=1754798394; 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=e7JGVPkiEV50TUkm9gkR7fN/RD0dLhNLulKstVZuKxw=; b=RqOTBbn/oBAdy9ld+J3qpLGAdyWCibL7JRKFTP+PUw2VoKeIHQGX/CG2RVuKUZwdjF uRufyJJ1HLi0qT49WF5Tc+dhtiOlkmuOdI0xkyn3NIEHCfymJRDmL4IzB7m0xHGW+8fH +73l0sj370qs9EhH7R8eFD6HmggJGz91C79z17LgO92gNGuxqYtLDnTeNSr9h7nWiFgG KgL2f/ba5A6O6o0kcOVsI1e/Z8Qu2gCGO+bZxl0H0+Jyvg30Rngr1eZBGCd9vBm3xYYC 2nfPM56ittJsz9z7ZheNi4sndyptxRpKfm0pqt0RsGBGmQJ1UVY38WKCsNIAIbVmxViL Oy4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193594; x=1754798394; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e7JGVPkiEV50TUkm9gkR7fN/RD0dLhNLulKstVZuKxw=; b=fjJ/sYKSaSgHneUz7idW5aav1hVGk9EyLioM4nP/HsegEpAu1B72fYELH5b1iDBWYy Qfs6pbmsFfAn/E7PNdzcM1mVrbGbCoejI0aVdjuJ4z8JBWxLEXB1N2yfbGf0yEmZvGOA 4STEQkxaSZdcY0CA0pPfWhZ+eeul6RmI4vXc30t2bGbo19LAhtzfRp7OwPdovNIcFFUO U3tLrwoceLm6LWQiiY4g2NN9jPsPYmdxE/BIMyxL8RBOTBe5SK5WHJblHXacGCT9Dqte JBOIwLkmg6csGz3LdQ7nbUT0Nk4lqkjFW9Y1FxGNQxes/BCPF1CurUPwejZ3FO8QLwL0 e8iQ== X-Forwarded-Encrypted: i=1; AJvYcCV8uW9TxTgsd0hGW8n+miDd49N1XcuCujhPZ9R3K7pO6ZQPfm0QQRjHgIbyjBCqWlkyEAR2Nk3I+mwsJup/@vger.kernel.org X-Gm-Message-State: AOJu0YzGJhDeJu8mX4GVw1Y9a+SBFnWKpEyHm/W3X6lfe2twNfCKU45o AviwHwp5kGMaYl7iZmjJcR4eyN3sliZcPkjSpmtz3jrfXK3FrEYpCMECRURKOrF4hFE= X-Gm-Gg: ASbGncvuoRi6N3jp76rp7mCTM+vy2vlIxZKr374+mBHdEIleMvTbPm09aIbxrJODkni WG9UKKVpo8pNEUzyx0GtLa0C6Aba9/2gx23GzbXbtlMTfDcGS4mHTIUDjQzP1hyCAvO2XayRm6X uxxvUW7OL+zMf6FhbD1ZpYCXiMJ16YJ4lr66jd/BclmnagoJxe6RtA8Jkm6ZBdPqb59B+/HtWqm i/4LlJeMxGBJPGWb1ewCF2nKyRyoWp+rOigt5p30lq130x3PLDB0QxzbuV9nl+PqgMIXfd7RyoR pJrKUenGugZwbpjGR/WAsvQYSFJLPzPt1f7APUn1PCN4Irn6EOEDVH+uNszHbXEnoL4u3V2pnqb Zn07Baw5UscZjqjHI2uU5D943n/1SOZ2ZUIL4yQsI3b6fapurGauVl1C46QN6RRgNaTCjKQSi2i scKg== X-Google-Smtp-Source: AGHT+IER1czj1M603T/fh8PrgV2njv/OOVXJjWBlMXOa06xUmclYSmV1HU1IjXDssYCVHfDYAb/JPg== X-Received: by 2002:a05:6e02:e46:b0:3e3:cc1b:2b5e with SMTP id e9e14a558f8ab-3e4161b0466mr69757435ab.15.1754193594065; Sat, 02 Aug 2025 20:59:54 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:53 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 56/58] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN Date: Sat, 2 Aug 2025 21:58:14 -0600 Message-ID: <20250803035816.603405-57-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Time for some thorough CI. Also, the previous 18 patches could perhaps be replaced by a single invocation of DYNDBG_CLASSMAP_USE, from a C-file linked into all drm drivers & helpers. I didn't find such a file, nor a drm-client linkage item in the Makefile. Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig.debug | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig.debug b/drivers/gpu/drm/Kconfig.debug index fa6ee76f4d3c5..333df32c2e181 100644 --- a/drivers/gpu/drm/Kconfig.debug +++ b/drivers/gpu/drm/Kconfig.debug @@ -1,7 +1,6 @@ config DRM_USE_DYNAMIC_DEBUG bool "use dynamic debug to implement drm.debug" default n - depends on BROKEN depends on DRM depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE depends on JUMP_LABEL --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.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 E508628C2D6; Sun, 3 Aug 2025 03:59:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193598; cv=none; b=eNWbXlVpxsE9eDkL5aLmzVlH8epDlTu6AwIBZMC5MLjFWTLceiDmXgrCJWD7h8FceAY1iowcFysARpxS1u8rU41wgnPBWI5JQerpcyPbbLsdu6bKlVkRtNyUUs6oBGfzngFk76CyTklDRl6atnaSxGFDnAdLjScdacYy4nlBmWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193598; c=relaxed/simple; bh=RBjRhhJunReBYeC8UhUGgQdGfGTrqKXIFdkExPYqf1E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mDZTZJ/zk2/oax3HkHTip2/Ocq6wHOfBiKIo3R+h7+LPiEUvrSBwIMvkKwmEXU8D6tGkK0j8eV9vxBD0Z5UsPTUpT4AY7hXinZjTaC26nLcx8Wuecr8XNAUCE/7Nh84rJV7X+5FrKUAp7Eon1deTWpbtXSTvGpWNmDZ60YJ05bk= 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=YKPd0kDm; arc=none smtp.client-ip=209.85.166.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="YKPd0kDm" Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-3e3f152700fso12489645ab.0; Sat, 02 Aug 2025 20:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193596; x=1754798396; 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=1ayWtPygJ2HBDiY24yxyRlwrUyqnG3sxcO8anqfHfeE=; b=YKPd0kDmKkOfL+KhXQL6gCbLNFhGu6gaHLeYkLi6lo6vJLZDaSCQnUXmjiQ1eQqPZw X8zx/pfbcSSiVwkdysFhHU+ZB1Cr8FJK2oBXJbvBYMVDThv3kIfts/xu7ABbPhae2OBc G5OVQ2IN2hbwgAq6BEcIdd2GwVE/AWgFgBNEfsRFYWmFKfOav7ZU0lsXDbclsoYYCWCy DmwwTjcvu80OsQSlqA9Qswn/Ki8W1IB2cgeQH+S7oaO7eTV2rX3LWHXax5Wn/HJ3inWa picObxDfky8iqBaPsRRQ260cYuW6mLuJW4rRIo04Adfi7uvxvA+kH7iBM65TNtTzVton CKSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193596; x=1754798396; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1ayWtPygJ2HBDiY24yxyRlwrUyqnG3sxcO8anqfHfeE=; b=ScZJXWz+aQXcyW2A1M8rIUcC1U+MjZUTbdHNwM4y6uWtBGC93nLmjAiZqJboM3uHf1 LRL9FDwlvghy5w+BRc5x5bblhOW0KkuVX/zS6mfVS2aQmIeeOiGFo7H6/7iFMKUyZVpU PqD0ptGMAQ2fpWlSOIu1+kJitkDsyPDuevkiG7JwN8GSHRRu/ddL1S4DKFkXDJaX12GT aEsoik43q2TFAssR13erg0UaJDg4N3DjHmVqWdjWFKhxh6E5pMbrLRdUwwWVsTnXfOsY xxGFzq17Tka6tAhWyI4W9NglXPJ3avaHznvptk4iWtSoWSOnkE8/dFgPRlbG07k8T6oS G2GA== X-Forwarded-Encrypted: i=1; AJvYcCU1VMD8ylaA7pURVcFfYZNwQKL0tTd3QJt8BUBObnpj82Bxbnf/STXgrLXod6U4pmUFMrNfedcguXWqhIT+@vger.kernel.org X-Gm-Message-State: AOJu0YyYw0duHm4HPBCqbgmXo+EbTzPcg+rVXPwsyUJnf7gr0XhytSUS Skjo4KIve3+PYwMA9KAcpATDZQxJpkFXMt9qmvUTYPLx+32SEOopd4Z9VJaG60rJhQ4= X-Gm-Gg: ASbGnctHlkMriGUHAB3TQOxvuaFnH28FWblYQfDc5tVww0hB8YvAa37/PnfY9i9Seby 2rErF+lR8j+dBeyB9safRUx/EV7LU2uEbogbpM94tCncFAZcWJp32OEyFfMuzIGxbfNeIbU49+l T3IN4rqZ0JlRkq5rIEXXMF8FUrm08skyLzQmf7yOzK82kbJjWLoJXX5GvBG2j6jwRWNTY3ELgY7 Zemvc2eaovN+/nNK9yX7w9nEUEYk/GqMBo7q00gsiIOGOQ5rhkGRNzLfeAK9xkcfg8bjpDWJki+ 5kpP9mScR3cxznbvpfZOwIgWRtEfqEygIyGgYPfi8bBHMmLe2IfcNoT6geavWdjedxQTypsQDe9 SGSnSul6CtCKd/zaVzG2mDseezGQNJnBtbLbh6FMleVFckNK3oWwysRw6GRtWIAZKYwM64c5RKo 6j1HTyQkAFzs30 X-Google-Smtp-Source: AGHT+IE//iz8Ix/2Qpq304M23ozJJJm9YUKRCP4zX/GxkzB5VUsrG11JTXPFJK78GVVmx4p1MZOr2A== X-Received: by 2002:a05:6e02:3093:b0:3e4:6d6:b436 with SMTP id e9e14a558f8ab-3e41618be54mr108220825ab.12.1754193595853; Sat, 02 Aug 2025 20:59:55 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:55 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com, kernel test robot , Min Ma , Lizhi Hou , Oded Gabbay , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Subject: [PATCH v4 57/58] amdxdna: add -DDYNAMIC_DEBUG_MODULE to cflags - RFC Date: Sat, 2 Aug 2025 21:58:15 -0600 Message-ID: <20250803035816.603405-58-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable with DRM_USE_DYNAMIC_DEBUG=3Dy now un-BROKEN for configs like: CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy # CONFIG_DYNAMIC_DEBUG is not set CONFIG_DYNAMIC_DEBUG_CORE=3Dy this module gets macro breakage: from ../drivers/accel/amdxdna/aie2_ctx.c:8: ../drivers/accel/amdxdna/aie2_ctx.c: In function =E2=80=98aie2_hwctx_restar= t=E2=80=99: ../include/drm/drm_print.h:578:9: error: implicit declaration of function = =E2=80=98_dynamic_func_call_cls=E2=80=99 [-Wimplicit-function-declaration] 578 | _dynamic_func_call_cls(cat, fmt, __drm_dev_dbg, \ | ^~~~~~~~~~~~~~~~~~~~~~ ../include/drm/drm_print.h:663:9: note: in expansion of macro =E2=80=98drm_= dev_dbg=E2=80=99 663 | drm_dev_dbg(__drm_to_dev(drm), DRM_UT_DRIVER, fmt, ##__VA_A= RGS__) | ^~~~~~~~~~~ ../include/drm/drm_print.h:681:33: note: in expansion of macro =E2=80=98drm= _dbg_driver=E2=80=99 681 | #define drm_dbg(drm, fmt, ...) drm_dbg_driver(drm, fmt, ##__VA_ARG= S__) | ^~~~~~~~~~~~~~ ../drivers/accel/amdxdna/amdxdna_pci_drv.h:15:41: note: in expansion of mac= ro =E2=80=98drm_dbg=E2=80=99 15 | #define XDNA_DBG(xdna, fmt, args...) drm_dbg(&(xdna)->ddev, fmt,= ##args) | ^~~~~~~ ../drivers/accel/amdxdna/aie2_ctx.c:76:17: note: in expansion of macro =E2= =80=98XDNA_DBG=E2=80=99 76 | XDNA_DBG(xdna, "hwctx is not ready, status %d", hwc= tx->status); | ^~~~~~~~ These sources include drm_print.h, which includes dynamic_debug.h and then checks DRM_USE_DYNAMIC_DEBUG, to decide if drm_dbg() rides on dynamic-debug underneath. DRM_USE_DYNAMIC_DEBUG is possible with DYNAMIC_DEBUG_CORE alone, but dynamic_debug.h also requires DYNAMIC_DEBUG_MODULE before defining those macros above. drm/Makefile adds this to cflags on behalf of all drivers, do so for this driver. TBC: do subdir-cflags in drivers/accel/Makefile instead, for all accel/* modules. RFC: Maybe decouple from DRM, at least the DRM_USE_DYNAMIC_DEBUG itself (ie just CONFIG_DYNAMIC_DEBUG_CORE). Its not obvious that XDNA_DBG should be categorized with DRM_UT_DRIVER by default. Do we need a new DRM_UT_ACCEL category ? Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202508012015.2l89ZOLg-lkp@int= el.com/ CC: Jason Baron CC: Min Ma CC: Lizhi Hou CC: Oded Gabbay CC: dri-devel@lists.freedesktop.org CC: Maarten Lankhorst CC: Maxime Ripard CC: Thomas Zimmermann CC: David Airlie CC: Simona Vetter Signed-off-by: Jim Cromie --- drivers/accel/amdxdna/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/accel/amdxdna/Makefile b/drivers/accel/amdxdna/Makefile index 0e9adf6890a01..800f81f5a7023 100644 --- a/drivers/accel/amdxdna/Makefile +++ b/drivers/accel/amdxdna/Makefile @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only =20 +ccflags-$(CONFIG_DYNAMIC_DEBUG_CORE) +=3D -DDYNAMIC_DEBUG_MODULE + amdxdna-y :=3D \ aie2_ctx.o \ aie2_error.o \ --=20 2.50.1 From nobody Sun Oct 5 14:37:47 2025 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (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 539B028C5BA; Sun, 3 Aug 2025 03:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193599; cv=none; b=OkhOkZ+mWx0RAkX25PTZO4nKhf+PTcxMBUmeW5VzOK2Y4OXOkKv2+y94Usu4FQs7BV2wSKsw4OAdIiqmrjrL/ZOXGoOPh8CsjI8Z02BLwTYlNywnWWNjK9U5NTHaQPRha517+9x/S01B8TMDy7IN0Zakj5QxQbeW2WP3rdFgZMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754193599; c=relaxed/simple; bh=X8cJQOCd2dU0zx+9xJvSUWkDqmIMbghrLU91KjmtJP4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=euM0b2KbrVfmWEsKoyZGHTTE5jEAu1KMEF/jsU+S+ReQwMbtn6N2FpmuOkU5BIFc8PFLRZ76PQyJlss2ty5JtibMtyaw66bVV6LTqjIzkMBTaAHucXLZ0O3aRUvvZCDdWJzWpuDFxfzT5TMF847yXqmFcX+3p6ExkfVT0rPMzPk= 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=Eu7Q6Rr7; arc=none smtp.client-ip=209.85.166.179 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="Eu7Q6Rr7" Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3e3f0f29d09so9438365ab.2; Sat, 02 Aug 2025 20:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754193597; x=1754798397; 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=p6zBJEgANuVffuY9NQJyHG8/+Xeax9coZJWuW6ZJ2WM=; b=Eu7Q6Rr7877GuIUPAh84THAHkMhvHGmN7Ng2tLRUxiOUwk+tbHFxvQ3nc6vrDm3GEc 8WyJm/P4W8CpV5WsvOpG/IRg4zv6ALBn1p7/8Hjw7cHo024gcx8BDXMWbp81d6rwjUZr 9VK5D6zdS1JLDwVF9NI6qzhjWK/JF505UJeTu0a/ZUivwVNnWXcG3gSr591KNq7aIwTc ChVma8x6v0dsNlsqr+I7IW630eDbkhtEi7F87LG9OB2fIym7UbGm8uhvedz+qV8teWwq 39hUl6Sz3fFYR6m2wuFtwgfNI91WlHsXVKOdePEORy4erce0cKW9h1MDeZmapRPz3OYR i3Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754193597; x=1754798397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p6zBJEgANuVffuY9NQJyHG8/+Xeax9coZJWuW6ZJ2WM=; b=KGoiXYDhZytjKj4hlOmJvZBCGZEXyKgf+XwVAD+U/rUIXPCIDixYlaofHM4Zi0ITVQ JE0Xo+XCzGOcWnCop5A8xuqj0OAeDSI6VjNprOhunEYyAYZlFXPTr2ZyWnrMdrf/Hp1X VEFTsrmvrw91NKnNN2i/YmsBZDNQdHvjzILywOEgruNKcX256dMCfLdkOVjQQXzSOSbf rYZFke/lOV2fC8JdN4xkLVy7sR34QAFoqto9TiW4hjVDOiM7Vz+4OImO1P94hjXyXQ3C ABfdk8nWBI33+zuNmCJzYiZLrZLvZGlnk0eMbQNGKu3R/CVIKnpHzD1RDKZHuOcwAK94 Ao3w== X-Forwarded-Encrypted: i=1; AJvYcCUhQ550pJeLN8L3p0HCDs9/85RRZ+I4N0L/YJtZ+YBbfDoqkQuLMq8e0FrF6445j187mKwggocbiFS87ikE@vger.kernel.org X-Gm-Message-State: AOJu0YxkpSRKZoq3f/XB0ib0qDeWAkKAf1N4pOeu0VJ8LgBK27ck4H4w hy5C/z+qe2097xGmazpfHj2XDgWUZRpDXN9zoKTVm19GIU21EgDa82r/laU/vfMgZoA= X-Gm-Gg: ASbGncvgPs91LvsgyV1b3yHm6GHc6SewBvLzjqVJ1ftWMe9NoBF7lm7NW3v6teuAwxU Ak2IHYFfGnBn/A8CB7RJlFweTK0IRNSRrjBZGvLFPThr6ryoWPPwdmaJUf1c4xxbQ2/d9eQuj6g jPW3P1th3taAkf7jktjbC0BtxBmumWZW8uyb8kzcwYCmlNtTlxYVxBf7DjZc3SYSgKZ61I0w3q8 7OqIvBmUlRa7P4814arTfiewVXL0v8EmPvvicssRKef2NWXnJfyX4+W4/eS6a1TUDWG2KxmbZBP SFEw1x/4lIRjWswJryq8HIwKqOJSMSOOFyZ+gGK3/fBVZ1EdXQv3EQHYpb/TyVSt2pZCtZBIaxI W0b/Lq40r0DdDF6NgZJMDzEK3y+PsVGfOjGb5wNZ6P8GT+HgKob0wC8KYK8UQN76PJ6c7UoSNqS d7kf4qhap+qjja X-Google-Smtp-Source: AGHT+IGUOgHvStYGi2AGuiva7QKSCj6X9DfG9+bxlaldERvaqq+8SW2QK11YiYCBPzmbmAT64CKkJw== X-Received: by 2002:a05:6602:6c01:b0:881:4a70:4651 with SMTP id ca18e2360f4ac-88168309e74mr805665539f.3.1754193597187; Sat, 02 Aug 2025 20:59:57 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-50a55df0940sm2268319173.106.2025.08.02.20.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Aug 2025 20:59:56 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org, louis.chauvet@bootlin.com Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, quic_saipraka@quicinc.com, will@kernel.org, catalin.marinas@arm.com, quic_psodagud@quicinc.com, maz@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, mingo@redhat.com, jim.cromie@gmail.com Subject: [PATCH v4 58/58] accel: add -DDYNAMIC_DEBUG_MODULE to subdir-cflags - RFC Date: Sat, 2 Aug 2025 21:58:16 -0600 Message-ID: <20250803035816.603405-59-jim.cromie@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250803035816.603405-1-jim.cromie@gmail.com> References: <20250803035816.603405-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" Currently amdxdna uses drm_dbg, so it needs this cflag in order to compile; it currently gets the cflag from its own Makefile. If other accel modules want to use DRM.debug, they will need this flag too, so add it in accel/Makefile. NOTE: ivpu has its own CLASS-ish dbg system: ./drivers/accel/ivpu$ grep IVPU_DBG_ * ivpu_drv.c:MODULE_PARM_DESC(dbg_mask, "Driver debug mask. See IVPU_DBG_* ma= cros."); ivpu_drv.h:#define IVPU_DBG_REG BIT(0) ivpu_drv.h:#define IVPU_DBG_IRQ BIT(1) ivpu_drv.h:#define IVPU_DBG_MMU BIT(2) ivpu_drv.h:#define IVPU_DBG_FILE BIT(3) ivpu_drv.h:#define IVPU_DBG_MISC BIT(4) ivpu_drv.h:#define IVPU_DBG_FW_BOOT BIT(5) ivpu_drv.h:#define IVPU_DBG_PM BIT(6) ivpu_drv.h:#define IVPU_DBG_IPC BIT(7) ivpu_drv.h:#define IVPU_DBG_BO BIT(8) ivpu_drv.h:#define IVPU_DBG_JOB BIT(9) ivpu_drv.h:#define IVPU_DBG_JSM BIT(10) ivpu_drv.h:#define IVPU_DBG_KREF BIT(11) ivpu_drv.h:#define IVPU_DBG_RPM BIT(12) ivpu_drv.h:#define IVPU_DBG_MMU_MAP BIT(13) ivpu_drv.h: if (unlikely(IVPU_DBG_##type & ivpu_dbg_mask)) = \ ./drivers/accel/ivpu$ grep ivpu_dbg * | cut -f1,2 -d, | cut -d: -f2- | perl= -pe 's/\s+/ /' | sort -u extern int ivpu_dbg_mask; if (unlikely(IVPU_DBG_##type & ivpu_dbg_mask)) \ int ivpu_dbg_mask; ivpu_dbg_bo(vdev, bo ivpu_dbg(vdev, BO ivpu_dbg(vdev, FILE ivpu_dbg(vdev, FW_BOOT ivpu_dbg(vdev, IPC ivpu_dbg(vdev, IRQ ivpu_dbg(vdev, JOB ivpu_dbg(vdev, JSM ivpu_dbg(vdev, KREF ivpu_dbg(vdev, MISC ivpu_dbg(vdev, MMU ivpu_dbg(vdev, MMU_MAP ivpu_dbg(vdev, PM ivpu_dbg(vdev, REG module_param_named(dbg_mask, ivpu_dbg_mask static inline void ivpu_dbg_bo(struct ivpu_device *vdev, struct ivpu_bo *bo This looks readily convertible to a dyndbg classmap and controlling kparam. Signed-off-by: Jim Cromie --- drivers/accel/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/accel/Makefile b/drivers/accel/Makefile index a301fb6089d4c..e437549cba8ac 100644 --- a/drivers/accel/Makefile +++ b/drivers/accel/Makefile @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only =20 +subdir-cflags-$(CONFIG_DYNAMIC_DEBUG_CORE) =3D=3D -DDYNAMIC_DEBUG_MODULE + obj-$(CONFIG_DRM_ACCEL_AMDXDNA) +=3D amdxdna/ obj-$(CONFIG_DRM_ACCEL_HABANALABS) +=3D habanalabs/ obj-$(CONFIG_DRM_ACCEL_IVPU) +=3D ivpu/ --=20 2.50.1