From patchwork Mon Apr 29 19:39:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48CB4C4345F for ; Mon, 29 Apr 2024 19:39:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9366F10EB6D; Mon, 29 Apr 2024 19:39:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Tbj67/dY"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75BBA10E479; Mon, 29 Apr 2024 19:39:28 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7d5e19d18fbso202241039f.2; Mon, 29 Apr 2024 12:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419567; x=1715024367; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JIz+6Oy1eqH41GGZgxlPQbWfghUp3j8MpQZmEvPSsQ0=; b=Tbj67/dY2GhTTyWpGUvXbIw0IKVoZOTdtwt0CJAxjDJotSPQWe+hnOI8cZd/2BKB5V z5SDBCk/dElUOPjVUonvXeUS4uX0jRtB9WJJUIRSow5PhC05d9IpMAwJuyWu0stmNKp5 y7AkAvCrax9fC36oXscuSeDS8oVPecH+IBtb/rsTaxjD2qErXBFC83QMQnNWLMAjbar0 wZD+kiBnTEpJnPxwBSRVzbJssBw/WOKMKYRmn0aSmhLKcli1ckGfAzWlBAs15Io/u7FO Q1efOIZI1cL5II/ich9rFmgAsvCfkRCpdWRbaPQ+FZgjGAKBagPtC6erhMj3bRLV9uuN eoiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419567; x=1715024367; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JIz+6Oy1eqH41GGZgxlPQbWfghUp3j8MpQZmEvPSsQ0=; b=xHkUzWvgdO56H4uQy85qCb0fSQeo/rlyNjcARumr/Pzs9gJ2UkvS1mB1RjrQvRb264 Y5urZKCqLFt366JZz5wsI2gWQkPTQVnV7mraIcMewnPf7zFqTwh+IZmj9OhE3U087DbX gD4WK06zmaLBITMrKd/tnpUQ2brurTb098Sd0m2TnA6FFEDkDvUxUacmKrVFrlW7VoiL YqrovvEorvGuQEUOQYOdVnETOtZX/mFkzXg46paiTyR9xGDkJAuxxa38KP7DJdDoohz3 vHuTddoQ1glTFhv8wD5sviW616TsAYrdPTICaUTX6WgKNoDP3h5GySEuk5KpE/Go09VU s+tg== X-Forwarded-Encrypted: i=1; AJvYcCU1Jy39mbAm6V7j6lnWl8gdaCcM+AVjoDm5MWGRIFkWQfNP7PU24LXV2s7u7MoJ1yuXTrwVHEMXwsMkBvfpBMcVWXcf84yui8+ZbO1IGGqqWIVT7WjVra37uBAelQTDT1k65jUvFG0W2Ztw6l/spCX0dJ/mHEixr0GT64IhHhPn4EF+PlAtLzhpfnxZ1K5xW59hWVcQk7PBhav37WiVzq5uflDXlJAV8b5CKbgC5Zh2wCao+Q8= X-Gm-Message-State: AOJu0Yx2arlYNcTRW3eucjNONt85YBiL4wmBC1CAR877LBmBTtrei03f ScLu6SeS6IrLLCx9tpxAxsRV5RfsFGe/n33nqOlEOF/EMzUiJ7zc X-Google-Smtp-Source: AGHT+IFThzWVB3vIE8LFgGpixsEhbHUun9+9i1vLB9kJbGTkJx0mvT+Q90khSTqWjq6hpXuEXvfcOQ== X-Received: by 2002:a05:6602:1cca:b0:7de:8d0d:8836 with SMTP id hg10-20020a0566021cca00b007de8d0d8836mr9390488iob.7.1714419567644; Mon, 29 Apr 2024 12:39:27 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:27 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 20/35] dyndbg-doc: add classmap info to howto Date: Mon, 29 Apr 2024 13:39:06 -0600 Message-ID: <20240429193921.66648-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Describe the 3 API macros providing dynamic_debug's classmaps DYNDBG_CLASSMAP_DEFINE - create, exports a module's 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 cc: linux-doc@vger.kernel.org Signed-off-by: Jim Cromie --- v5 adjustments per Randy Dunlap v7 checkpatch fixes v8 more --- .../admin-guide/dynamic-debug-howto.rst | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 6a8ce5a34382..742eb4230c6e 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -225,7 +225,6 @@ the ``p`` flag has meaning, other flags are ignored. Note the regexp ``^[-+=][fslmpt_]+$`` matches a flags specification. To clear all flags at once, use ``=_`` or ``-fslmpt``. - Debug messages during Boot Process ================================== @@ -375,3 +374,65 @@ 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 +======================= + +Dyndbg allows selection/grouping of *prdbg* callsites using structural +info: module, file, function, line. Classmaps allow authors to add +their own domain-oriented groupings using class-names. Classmaps are +exported, so they referencable from other modules. + + # enable classes individually + :#> ddcmd class DRM_UT_CORE +p + :#> ddcmd class DRM_UT_KMS +p + # or more selectively + :#> ddcmd class DRM_UT_CORE module drm +p + +The "class FOO" syntax protects class'd prdbgs from generic overwrite:: + + # IOW this doesn't wipe any DRM.debug settings + :#> ddcmd -p + +To support the DRM.debug parameter, DYNDBG_CLASSMAP_PARAM* updates all +classes in a classmap, mapping param-bits 0..N onto the classes: +DRM_UT_<*> for the DRM use-case. + +Dynamic Debug Classmap API +========================== + +DYNDBG_CLASSMAP_DEFINE - modules use this to create classmaps, naming +each of the classes (stringified enum-symbols: "DRM_UT_<*>"), and +type, and mapping the class-names to consecutive _class_ids. + +By doing so, modules tell dyndbg that they have prdbgs with those +class_ids, and they authorize dyndbg to accept "class FOO" for the +module defining the classmap, and its contained classnames. + +DYNDBG_CLASSMAP_USE - drm drivers invoke this to ref the CLASSMAP that +drm DEFINEs. This shares the classmap definition, and authorizes +dyndbg to apply changes to the user module's class'd pr_debugs. It +also tells dyndbg how to initialize the user's prdbgs at modprobe, +based upon the current setting of the parent's controlling param. + +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) + +DYNDBG_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. + +This interface also enforces the DD_CLASS_TYPE_LEVEL_NUM relation +amongst the contained classnames; all classes are independent in the +control parser itself. + +Modules or module-groups (drm & drivers) can define multiple +classmaps, as long as they share the limited 0..62 per-module-group +_class_id range, without overlap. + +``#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. From patchwork Mon Apr 29 19:39:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B55F3C04FFE for ; Mon, 29 Apr 2024 19:39:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99C6E10E514; Mon, 29 Apr 2024 19:39:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aIqSfr45"; dkim-atps=neutral Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9332D10E514; Mon, 29 Apr 2024 19:39:29 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7decef0e157so58219239f.1; Mon, 29 Apr 2024 12:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419569; x=1715024369; darn=lists.freedesktop.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=OThLtlQLHmt6Xu/dLjE7jt3V84uDU3HgUSM9F2dF2XI=; b=aIqSfr45uQxu6jkqW7Y1GPky1eaK32rJvZy4IQaVw5hk+78ARuJ02N/FdGeDfhfYRY UU+lZqiZZIIMPFwQ+4cgiLWk8Tk0zPKHvy/qlpglYKu3+jKNJVEzhk9/fJZ8TosfmYlR gfVVGri1DGmTcSgw4PlxxZI53W0JRGEw/sykWzyvMlOMUEF97JiM95WJgbt+VGswlAHe BVIjlQQJdQ40f+D5CZqXuYGkrEITWZ2gfIhX+cxMybD/AoTb0DLLWj0dUMTGQDX8EuIC WurPs/SVcpGessDLGdD8k5y/HtcMVIJFoxcvIphuGfja9WZIytPLzzIerKbZNrp1y0EB 2zUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419569; x=1715024369; 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=OThLtlQLHmt6Xu/dLjE7jt3V84uDU3HgUSM9F2dF2XI=; b=xDOUAtBCkcWeHbtUdNL4kEbFLAoI1PG+UvDjQOsEXqReoaKKomML6d81hHeKtHDSfS 8yRwf0f+DXjeZ/DvaEujsC7HHS4+e4IdM7ILi0ad0fssBOa6S2KAReBGVUAJyxFxSAXa t+gVClAzY1J19ZCOCsiOJSCNVzna8Bdk/G3iQ2EyJZhpuPpJ54Kasfb7cE3wzAein2Nn yXktQQpiGNZYyIQljx8JNvSQ8mTEClaMSsWD57G6YmPw5B1IkijPpdKOnz+ZSKrNxGYG KnNpCibJ1oAbF0WSq9WLtfqhpTtumADHAyGvNHjBpQNYOZGh+cfsCt/QJdGvuavwYmKK 3Lmw== X-Forwarded-Encrypted: i=1; AJvYcCX/bWA7z+a4JEEe0/n+gpC8Yzv8GIdFSWWBXR2fyWFarAvAZm4fhdOQMUGg5C9GAZU1FQGThs67+LAfb4fCKXlVkZ18lNotCVwlWr7XothU2bk9E0PIzeSQsyYxebhujxPM1+L97sIXDVG+dg6xGxajG3ZXITeM3m0ySpiGtJCp2YAfvo/A5cMBPNelkLvOT1Pps9KdRHp8Hqpx6D0T+jL/HGRD/iyjBHl2hjlBOL87PPv6fsY= X-Gm-Message-State: AOJu0Yxj0uFGEXcsRpdGrqdnCYJ+xecLtndx7oPUlQj6lJX4NHK38nVb TepuLEFi6GQYfE1RXs1Rskux6HCXAVxAetfU4eNm+te/Jfa1+jdK X-Google-Smtp-Source: AGHT+IG8SYyWWKZD11FY0NPPG/D9eJB+PcSN6dz+CzhLKof+BDDE1ptiGYSje0vARpyD55y/WCWs2A== X-Received: by 2002:a05:6602:14f:b0:7d9:6568:144e with SMTP id v15-20020a056602014f00b007d96568144emr14013964iot.8.1714419568763; Mon, 29 Apr 2024 12:39:28 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:28 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 21/35] dyndbg: treat comma as a token separator Date: Mon, 29 Apr 2024 13:39:07 -0600 Message-ID: <20240429193921.66648-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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=class,DRM_UT_CORE,+p\;class,DRM_UT_KMS,+p or as a boot arg: drm.dyndbg=class,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="class D2_CORE +p" new format: modprobe test_dynamic_debug dyndbg=class,D2_CORE,+p Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- lib/dynamic_debug.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 31fd67597928..c1bc728cb050 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -290,6 +290,14 @@ static int ddebug_change(const struct ddebug_query *query, return nfound; } +static char *skip_spaces_and_commas(const char *str) +{ + str = skip_spaces(str); + while (*str == ',') + str = skip_spaces(++str); + return (char *)str; +} + /* * Split the buffer `buf' into space-separated words. * Handles simple " and ' quoting, i.e. without nested, @@ -303,8 +311,8 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) while (*buf) { char *end; - /* Skip leading whitespace */ - buf = skip_spaces(buf); + /* Skip leading whitespace and comma */ + buf = skip_spaces_and_commas(buf); if (!*buf) break; /* oh, it was trailing whitespace */ if (*buf == '#') @@ -320,7 +328,7 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) return -EINVAL; /* unclosed quote */ } } else { - for (end = buf; *end && !isspace(*end); end++) + for (end = buf; *end && !isspace(*end) && *end != ','; end++) ; if (end == buf) { pr_err("parse err after word:%d=%s\n", nwords, @@ -592,7 +600,8 @@ static int ddebug_exec_queries(char *query, const char *modname) if (split) *split++ = '\0'; - query = skip_spaces(query); + query = skip_spaces_and_commas(query); + if (!query || !*query || *query == '#') continue; From patchwork Mon Apr 29 19:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647616 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBCFCC4345F for ; Mon, 29 Apr 2024 19:39:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B06610E479; Mon, 29 Apr 2024 19:39:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AzwSYirC"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id CDC3E10F0B9; Mon, 29 Apr 2024 19:39:30 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7dec786b0a7so49973439f.1; Mon, 29 Apr 2024 12:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419570; x=1715024370; darn=lists.freedesktop.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=tsc/9WsGromIBMCX1IbPd4mLGTopgfHgqr35jw6ogHo=; b=AzwSYirCdL3dfV2cldbHqtlpWj5njzQkcpb81qeKBGVDA/6gTKGLOUIab3vU1MuGVn 89WoWUO+JY5fREeCwWExqZPirm8TvH7tIH01ZniCC0RrggIpHDMNhtzg1xtWjX6ucFSr 8Mpexh6I3mL+xjKtfNBZyD0wLvlNM8eCh9XfqLns7KFWzEg3HR43OBvtfwNL2qdWqTGH 15Y/HR50OkXKt4sO/mMe8pph5oS1sugTRQV/2f4/Hzp3GgFgR2AhPkXvcf4SGqtqh4H6 yF8jbSBZKDpiyP2GVlhMXNMeMUwQiqWiJqA51Rp+hgaoPjDurjW2i5MhhPpxwKvnKbf6 hfow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419570; x=1715024370; 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=tsc/9WsGromIBMCX1IbPd4mLGTopgfHgqr35jw6ogHo=; b=gHp8RZdVj9Kb/ZUSZvpRpDdgidF/1DC/ten7lOmq1ZVhhxlNBAZDjEIsgeTCXXWfdp ocY2fEAJ/aU/Zw8PIc5iyw5tZy1nOuxqGlqCVQ5sPYS5mrp5a+Vppu+hocRM8Lw/nSen fDw4J59tSq2StXJKG7rP5OBkNlfb0LpubjWAbrmvydQEWIpFJPp4KZRz/jnLRWHMGlsa WxMBiFcOfx1l3u7/gjMudeceyt8zoIZzU6arqDr4Y43vEQoEEwqb5gt4s/onQOkkEgqs 0vYJQId6yeNB6GFK1CvKSMDKR+N1AHnB/DyZFXGx7B45MpftROo15qfB95+7MgsKld7k qBhA== X-Forwarded-Encrypted: i=1; AJvYcCX0ErhGrgAKHGh/JfHhfSzv2zrmXPfzInJRhXVYigE5IA7Nuzqy/7T0x1d1U5QcB90gnyh2rVN4/zfte3TbpEixNxy86b68+1YpDjpZraD00ufATFH8M9+LaqENZSqsHf7pizC1uD6vbjuIvMVoD9uTlJaesBOKPuCXopT+RQLeMdohy4sTiZCjaWnfjNPGXxookbbDNp61Tk/j8EgqQx5tY1bRO6Oz98cH7T1lw2jru95KDto= X-Gm-Message-State: AOJu0YzGreKyk5FXo0e3Ro2VNGGzsZTgSC1jTcpvGZYCAMBQuQb1GmNN Ote59wyI0FQzti3vDxCcstGIQyLwWXqp/BJbaYiKa1Sndu//Bn1q X-Google-Smtp-Source: AGHT+IGSjAuBVUKjB/XBUA0dptA+ZKvZmIfrYhF8kqBK8ypwvGZwurqlZkqnE/Ouq9b/MO+XR7xJBQ== X-Received: by 2002:a05:6602:2772:b0:7dd:c59c:83a5 with SMTP id l18-20020a056602277200b007ddc59c83a5mr574201ioe.9.1714419569961; Mon, 29 Apr 2024 12:39:29 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:29 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 22/35] selftests-dyndbg: add comma_terminator_tests Date: Mon, 29 Apr 2024 13:39:08 -0600 Message-ID: <20240429193921.66648-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- .../selftests/dynamic_debug/dyndbg_selftest.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index cb77ae142520..7a7d437e948b 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -217,9 +217,23 @@ EOF ddcmd =_ } +function comma_terminator_tests { + echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + # try combos of spaces & commas + check_match_ct '\[params\]' 4 -r + ddcmd module,params,=_ # commas as spaces + ddcmd module,params,+mpf # turn on module's pr-debugs + check_match_ct =pmf 4 + ddcmd ,module ,, , params, -p + check_match_ct =mf 4 + ddcmd " , module ,,, , params, -m" # + check_match_ct =f 4 + ddcmd =_ +} tests_list=( basic_tests + comma_terminator_tests ) # Run tests From patchwork Mon Apr 29 19:39:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2BBF0C25B10 for ; Mon, 29 Apr 2024 19:39:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 411F910FF9B; Mon, 29 Apr 2024 19:39:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X45DPMQ6"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id D22E410F0B9; Mon, 29 Apr 2024 19:39:31 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7d86adab5a7so222209839f.3; Mon, 29 Apr 2024 12:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419571; x=1715024371; darn=lists.freedesktop.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=0LYQlvE+T8WA65CtT3d9bMBQ65wsAHik/vFXXFGgqX8=; b=X45DPMQ6KewPGkYH7JB/a++w83BK3I0oPE22MHBao9o0PJ/ADJbswC0tVQ6jjmH19l cjVeN8EjpwOQ9E5RlBd497AJUPSe0rgw5CJfVBRjNCJF/5SzXKyCpZIx44mMoRAX75xz iKtPW5E05ff6CYk1WnWkb98WvHYKmD430gThRONI2NDObO51KwWvHyGlznzuzPwItryd vqqHBoE67UkzX2N3FU7Bl+YrdVoR+zUQyWmcM+IfPVLIAnurffUFLf55c7ss4WC7/PkY 8WsssMDDoqEp+b1ialNfUfB6Cu+pSybJiJ0QbT8i7siDcpxAErEdSbT9kiiiKvE68M3x 9ZLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419571; x=1715024371; 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=0LYQlvE+T8WA65CtT3d9bMBQ65wsAHik/vFXXFGgqX8=; b=UN8UM7Qbg90C/fuTNMDjCQhw6eha03oWQI8mZPpuiWEoigBl+gNjp1hqROxZW1tVF7 ya3MFTWKZFqn6J5/xsP1Em1i+qZeXpbmseipVUXxYzSr2OoqIoSUdEk1ksWFx2P4/zbK KtAGOS+Yn4BDDGZrOYYP4T/yB9pwtfJWA/QqrtdbVaukuL69OC7ESC1bLRfaf52nvTIF LW+zGdMOmOxNxwBxtV55hjrKIo9BXlQdkcd9ndQyScck77FknyKfsCi41ESVsvaN5Cz9 n/HZNYwGd7k+ndfJpUcb/+Fh/Cuui0Q3UAUkvq6HtvUxp0y/h5XWg3eaS3akzNEJ7Cvg ffEg== X-Forwarded-Encrypted: i=1; AJvYcCX9KBMeIztWx2zGE3kWtu/Xv+L2rexSVBXSLm/uagKQORyLsWamaZ+tEieSziuFuyKYCAqayI2p5H0NMqKlcCZuKcEQZNy4ybbJwZtJEhBRwfXaGtfft7V7vwnWGKGr7zr9g484UkjSv4PzRQ44qfB+WVdd+p2ZTJHFm2fvV+TooN0loU0RVFJ7J45PmfmZ2BQ/Hv73Jq4L4+oyyGkx98toU7wSBqROxqpO3UMpQBF+43UmbTE= X-Gm-Message-State: AOJu0Ywxj+B4zexxMrMUnG3NiNYT6xzvrPjaVtKyp7A2bcg/qAQxLxt/ OQyWhGwFItfoSdGkp32ARrXcnQ7NIu0NF46mS9CxyjsGsRX4plXU X-Google-Smtp-Source: AGHT+IF6th92SlL7HDkoTDaUnOqtPhi3umBEhatRUoNm9PW/+KDNrLLSMW7oFL47yK2VDF4hmnRS1w== X-Received: by 2002:a05:6602:1c92:b0:7d7:56a:1d75 with SMTP id hf18-20020a0566021c9200b007d7056a1d75mr14087995iob.10.1714419571016; Mon, 29 Apr 2024 12:39:31 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:30 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 23/35] dyndbg: split multi-query strings with % Date: Mon, 29 Apr 2024 13:39:09 -0600 Message-ID: <20240429193921.66648-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Multi-query strings have long allowed: modprobe drm dyndbg="class DRM_UT_CORE +p; class DRM_UT_KMS +p" modprobe drm dyndbg=< [ 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. 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 c1bc728cb050..625838bd74aa 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -596,7 +596,7 @@ static int ddebug_exec_queries(char *query, const char *modname) int i, errs = 0, exitcode = 0, rc, nfound = 0; for (i = 0; query; query = split) { - split = strpbrk(query, ";\n"); + split = strpbrk(query, "%;\n"); if (split) *split++ = '\0'; From patchwork Mon Apr 29 19:39:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30D1EC4345F for ; Mon, 29 Apr 2024 19:39:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BE0110FFA2; Mon, 29 Apr 2024 19:39:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ka80K7hr"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id E40BE10E479; Mon, 29 Apr 2024 19:39:32 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7ded607b62bso26393939f.0; Mon, 29 Apr 2024 12:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419572; x=1715024372; darn=lists.freedesktop.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=vg38OZx3YLIwABtnQGkinhhYjsiQa4opg6MoojqE7Ag=; b=Ka80K7hr2YoRhvOBu1iZn93MW1I0fcho/LGVnkLjwueIaJrOqldo5TR7sgfbCjbMSE I4Y1sA3uwwIQrSrb1CApadxVYpJhPkQvM6W1Tum6WCLtbFAgrDM4CL98jB+4dBphpaVT qi7QVKVVx3Dfu7aeetg+HPsafXlfCCgJkZN6PUXf6g6bKYjnG06DtGNfGCZ5vsaoL5N8 y2oJ2bjAPY4m3nQGPkFruDKltPqKNs7slEF2lSzNWXj9mvgeYPP7yPa7KxcjgwHYrD1X YxCx9e2qrkWK2NrfFRzkHKIFofarF491UNmatpDLtN285qa8nwypyNTahTyuClhxi6RI xURw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419572; x=1715024372; 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=vg38OZx3YLIwABtnQGkinhhYjsiQa4opg6MoojqE7Ag=; b=xIvOmeDlIFba68kbwezU6rnnlJu1J6f96DJ005ikw2prUsDmamSgZnDV+enWFrHtP+ dC9TO5NUyCB3IqIw2Ia8wJKjkRq8ODbRFZH3uduIIed1h0t99jshcpEVl8o3aR52sheQ h/0lUVLdr1vJZcXx8EjtAu7S+aanFM1FXWB6qs5NKfizNZCzHMQGw7YgW2/PhIThxIMs hZmXwngTCK18rx2ufUc96wLPDFzqiuZooFxFTQIqwKEPhD18yBH4n2cSNEqgQ6EV7taM BIlOfrs4TOthuqZOP96QatOcy+6Izy6vi22L3YGb7GVW5Qp8HtQ1t0J2huaK9TWmFAtJ fFWg== X-Forwarded-Encrypted: i=1; AJvYcCUvz1+Dn/YMNbDJpUUcP6vLY8nJSeUQLfO+dJvvxKiflDaelgFjGx+hUaqo6pZxljBPBvvg1Uid0c+n2BJEWewxJnDiMTZZ1/yuC3pxOnZWCMF66AxNe8tjRpuK805Mb5NINQnxU9jN0JqvhJ9FoMLq6iRCbIHRApvZZQunMcnTNANhdGkjmOjWASfPjKSO28wACH3nCIgYCVxzI/+Mw1Qi7QjvccJ7L4r4Gv+P2XJa6KjUyY8= X-Gm-Message-State: AOJu0Yx5lurAyAqK7zptMbo2hG+GMP/k0MeK9HBdonTYKzAis+8icxUh Wj6qDW0cIl2Xh/PQMjZWjERa8NZ75zGDJYPsKgekTZpdKQMi9IPD X-Google-Smtp-Source: AGHT+IFXbmxQz+e05jyizma4wMrqd8m0n5WRNSC7YJxpdev35A3a5dS216xqpdnTF1y2LwkPes/sYQ== X-Received: by 2002:a6b:cf14:0:b0:7de:cb34:98ad with SMTP id o20-20020a6bcf14000000b007decb3498admr583501ioa.1.1714419572068; Mon, 29 Apr 2024 12:39:32 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:31 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 24/35] selftests-dyndbg: test_percent_splitting multi-cmds on module classes Date: Mon, 29 Apr 2024 13:39:10 -0600 Message-ID: <20240429193921.66648-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" New fn tests multi-queries composed with % splitters. It uses both test_dynamic_debug and test_dynamic_debug_submod, and manipulates several classes at once. So despite the syntactic-oriented name, it also tests classmaps. Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 7a7d437e948b..ddb04c0a7fd2 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -231,9 +231,29 @@ function comma_terminator_tests { ddcmd =_ } +function test_percent_splitting { + echo -e "${GREEN}# TEST_PERCENT_SPLITTING - multi-command splitting on % ${NC}" + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =_ + modprobe test_dynamic_debug dyndbg=class,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 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 =pmf 1 + check_match_ct =plt 1 + check_match_ct =pml 1 + check_match_ct test_dynamic_debug 23 -r + ifrmmod test_dynamic_debug +} + tests_list=( basic_tests comma_terminator_tests + test_percent_splitting ) # Run tests From patchwork Mon Apr 29 19:39:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83178C4345F for ; Mon, 29 Apr 2024 19:40:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B879410FFAC; Mon, 29 Apr 2024 19:40:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hLeEBPjc"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 169F310E514; Mon, 29 Apr 2024 19:39:34 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7da09662332so160424339f.0; Mon, 29 Apr 2024 12:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419573; x=1715024373; darn=lists.freedesktop.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=RXI+MXWRKKGIldf/Embfy128LRyyxhcJagthHMuW3ts=; b=hLeEBPjcoyCX05xdi9mqHM3Q9YWLDWpzICx09gne3Ikzrn4UCjnjrjG/tpgum6rH91 lVC8e4CWOgUmzd0hguGAExVigetFTqim8MRVg9yOuZnj0zDclp6wcgtb5jrBFmuCibMT zbtnJ2b2J2XBOkEZHhUqSekUobuBHUWahix1m9IW7iWsBeFqUFyUcidW5ph9PyK36qsI NG/7jCn4Bb1oiaZTSj/zVu+ovtSp0MUUS8Ek9moIwGIzX0xXmwBRCB3U2JU+Wl2KCz0P uYRHYVTBnvC9cIgasNS5U5FKb4GFWWBudLoAHMzRdLTCTKlViUeLrmbfN6IeWoIQ5DoU TRhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419573; x=1715024373; 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=RXI+MXWRKKGIldf/Embfy128LRyyxhcJagthHMuW3ts=; b=NTE5WT29xebakZAHpmgUDDme+nufnwgYGD4xIwjT6ObMv2NizHInZKH/D40K5GAdQ4 3ATg8PFukpsQ65UU1M/YfYfrOuN2IAJnh8ErttILFONTDT0eWXTSqaxmAGcMTUsF0I0N 10fx62aWqUsC61oyR6ZYeWKDzWFTOEsLyhBA7SWUDxHzjqp5boS+m+e9YeeOY6iIjMGq KX19Xvl4tPSFaMxAFMElU8EeuvN3GivTHeDKuCRrZ/tRScdisLkVP6rn8RJa/p49tvNc IDMW8U7iYoY2+M3ykTAMFaiAoI7T0jIxixG73WfD9LsMTOiIkzinDzYpxGxnSQHaHZIr 605Q== X-Forwarded-Encrypted: i=1; AJvYcCUCpAZNNPP6cm9IHWf4Jq1H9gbOEtavaX3OmJbBo25yFul8VU/h6HLJzS9fHvWPd11Sobcsa2KWC+HpKIvP81y/23RLQRg8fUOMF3ugLePWBitUN6AFjVYYOLQ/Eea0OCe4VlK+FfkAwlNYVPS5sF9uSaqP5aaTAv1kobbeGT58ADNnoIzeYvsz4kEJQAFe4kthwSFHxhQuCi+dRwVo0QlTX33toXP2/ZeN2A1NWYRYc/Z3/eg= X-Gm-Message-State: AOJu0Ywz00BpiKRRJbZT6P7ab8zHo40d9jm7PWuB0aqsChXyA1oGNz9b pbHEmv18BuliWwZlDvzqQXpzk87hRbV3gxiik7sp8O3oXhOcDxR8fpp9Mck6 X-Google-Smtp-Source: AGHT+IGWpfjvznK6WhTujjscD4YN6L0AQxbNzmm1AE5SspjD0rno7TIevntaxjo8L0b9AeQnuOA3fw== X-Received: by 2002:a6b:db05:0:b0:7da:1a22:e832 with SMTP id t5-20020a6bdb05000000b007da1a22e832mr584954ioc.0.1714419573239; Mon, 29 Apr 2024 12:39:33 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:32 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 25/35] docs/dyndbg: explain new delimiters: comma, percent Date: Mon, 29 Apr 2024 13:39:11 -0600 Message-ID: <20240429193921.66648-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add mention of comma and percent delimiters into the respective paragraphs describing their equivalents: space and newline. Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 742eb4230c6e..7b570f29ae98 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -73,16 +73,18 @@ Command Language Reference ========================== 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:: :#> 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 -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``:: - :#> 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 <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p @@ -104,7 +106,6 @@ The match-spec's select *prdbgs* from the catalog, upon which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". - A match specification is a keyword, which selects the attribute of the callsite to be compared, and a value to compare against. Possible keywords are::: @@ -128,7 +129,6 @@ keywords are::: ``line-range`` cannot contain space, e.g. "1-30" is valid range but "1 - 30" is not. - The meanings of each keyword are: func @@ -153,9 +153,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 ``_``. + + Examples:: - module sunrpc + module,sunrpc # with ',' as token separator module nfsd module drm* # both drm, drm_kms_helper From patchwork Mon Apr 29 19:39:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7C16C04FFE for ; Mon, 29 Apr 2024 19:39:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F15E10FFAB; Mon, 29 Apr 2024 19:39:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XgWhOyZe"; dkim-atps=neutral Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id DA86E10F0B9; Mon, 29 Apr 2024 19:39:35 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7dad81110cfso207101739f.1; Mon, 29 Apr 2024 12:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419575; x=1715024375; darn=lists.freedesktop.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=f7XDhXTeJoMWhkzTMSqQ0RhDu3HmDRaZUb49U4GCNsc=; b=XgWhOyZezg8NXQTZv+o2Z9Pr4dWCVoVWSvJQ4ApK8Ra6n/ULLXjUbbZEvyehYlLQak SOo0Ypl7/XV3jcAkuAFaG/TIMzfI/l7LODD3vynUAUPvJFibbliZunpLov+WZ3mZTgPh rJ8PHhuTe+QMtuGcidPm5D13MrxHO83q1c7mJeFA5GSEWs5qWQdU+BIPRwBYt8RT3LN6 EXZw6+D0TEMcRD2hioqmhwgiMDhckBAIPaXw8tYUFv9B67O6YxEpBBNU78iK1/enf/vm 7d8ky/nzuV5Pqdv8vSEQPrmZFdjMrUJs0CNYQKZGDFQNJ294wFG9eJ4SkZRix1KQoovG ZbBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419575; x=1715024375; 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=f7XDhXTeJoMWhkzTMSqQ0RhDu3HmDRaZUb49U4GCNsc=; b=E1iTSdSNcXW57BQx1ZkZNdRpproIuuYxVs3TJsFwUntZU3Y8mJgYd9LPsaJRis8S8x LGGMDKPKc7Jm0FxZ52lWg6e1RqjD6rMxPSajeNubsxJAq4PTN0WotGB2SqDJdEM9y4Lb pDOKCfTlljiVr0Vn0bc232BDJr23Y/qsNMKD630dMCOXs3r/77v4kWBhLDgz0Hf5lljx BT8ckR1FnN9dsj2qGFJ7EUtIJ6WejNrFMV2m2tndQN7ecuOD8VFayBWcR/Ib6tTlksnr aRJkqkCgQyZnwYDIL3SyunVIUNGPxwj4e1wl/AN4D19c/JFkeZb9B2CGZW8Z/OBHcnNb 5HCA== X-Forwarded-Encrypted: i=1; AJvYcCW1f3+Jl9idoh6jMiJQUUXq1DrRq0OijbnT60+nmn0YYo4WMhxubHOWP9UQIrRVDJrFUVx31yUZc3+Md3z/Jm4ghAHvyrZB+dSPLonDi3BNwkt5o7z8QJf7kxdmYgp9kFAQqHfdcE2iiTH84oa9WxOCaKfnNcrqCsJUxlsEya/UAhrxMDw4hZy2ZLpaHFinqGVU+VcAijKzC4HPIA52y4TKEJ2X10cEhkfNCUbIL5K+J630/lo= X-Gm-Message-State: AOJu0YzHltSqBvAtdqVJNCkqdlmjtaOGEyMCNHpFWvKslPK32wI2q9hb xv6K/xG+M+Ys24v2b61sx7liOnr/4hXSSR8E/s2Y/k20sM2psZuT X-Google-Smtp-Source: AGHT+IHJ/J5CefPQItxbTqpcVctn5XpjkZ7VwJHP2udddod5gEHQAu9X47g8K13Y1gCMh2a+kWL2bg== X-Received: by 2002:a5e:d717:0:b0:7de:da98:4d10 with SMTP id v23-20020a5ed717000000b007deda984d10mr998566iom.17.1714419575074; Mon, 29 Apr 2024 12:39:35 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:33 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 26/35] selftests-dyndbg: add test_mod_submod Date: Mon, 29 Apr 2024 13:39:12 -0600 Message-ID: <20240429193921.66648-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg= 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=y failure. 1. 2 modprobes (super then sub), with separate dyndbg=class-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=setting (like drm.debug=0x1ef) 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 --- .../dynamic_debug/dyndbg_selftest.sh | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index ddb04c0a7fd2..54acee58cb4e 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -250,10 +250,70 @@ function test_percent_splitting { ifrmmod test_dynamic_debug } +function test_mod_submod { + echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =_ + + # modprobe with class enablements + modprobe test_dynamic_debug dyndbg=class,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 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 + + # change classes again, this time submod too + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add some prefixes" + check_match_ct =pmf 1 -v + check_match_ct =plt 1 -v + check_match_ct =pml 1 -v + # submod changed too + check_match_ct =mf 1 -v + check_match_ct =lt 1 -v + check_match_ct =ml 1 -v + + # 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 =p 8 -v + 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 =p 4 -v + 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 =p 6 -v + + # 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=0x16 p_level_num=5 + check_match_ct =p 7 -v + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =p 14 -v +} + tests_list=( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) # Run tests From patchwork Mon Apr 29 19:39:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BC3CC4345F for ; Mon, 29 Apr 2024 19:40:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30DD210F0B9; Mon, 29 Apr 2024 19:40:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GmMFBcVO"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1D75B10FF9B; Mon, 29 Apr 2024 19:39:37 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7da09662332so160425639f.0; Mon, 29 Apr 2024 12:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419576; x=1715024376; darn=lists.freedesktop.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=xsk6wFmyYbt14YO4ncMIjEQV7uyunoDHYxXESUpDG9U=; b=GmMFBcVODW6r98+jVVhJVc3EUOtCrjHRTRYVIp3OqUo2Zt9T1DWDfxs+4RBAwMPSjM Q4hx7vCMGTfcep8gZTsi9JCGo41XL0edB/+5slY+EExLmGaFTupjNxXwSltl6rUrBld9 lwv/rYUEHoSkmMxnrCNzkawwj/s2xf+okReaqpVEc+hUpQI0MpX9mMgP1+letiehg7vx trpD4Er66AOizYhHyaJoj2uLnt2MSvyABqOvf4YJh1e/1stnny9ETtm+iypt4mgwS+kN CxQ6250o6xUIA2PS2ThIUyohVbW4vOywLhAKKgyw+zeAMbREOy0miGxGJ+lYAUlikECI YmvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419576; x=1715024376; 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=xsk6wFmyYbt14YO4ncMIjEQV7uyunoDHYxXESUpDG9U=; b=Xrwzfn9yS9zDvKF0kzWhmK7osM4O/DREe9HrOd5E69pF8Fb8lffESWX5V/usLSLVaZ +RTRnYCyu1Jwjixkqbj5qGVHxQLyTL5uiA3fc9IBlYFd0VmDurF79vRxKIA/wSs//LI7 VbPn+ZBOzCxC4oU/e5wbwtdklOcFuWqAz0YODeSQt1jYD1Aq767Xo776e0vMMPTi6y65 RdkEGAWU4DIihCI/3IG1aeXjncQ/ZzOnpbkdaXQWsVgIcjnJkvvTDc+lYnUUk6UV5j/t b4R8KChOYkENIpyqq2ypov4pg/GRHFvDmT5hMc1uOAtC0Tv8z9AA9mwDrAOHdmK1WKt9 nEJQ== X-Forwarded-Encrypted: i=1; AJvYcCVnAe4jjYRqgMowl7NVgvLB1vZ7JcXazvJXhoeZYRiRhKocjtUGYA5CgOjbFpvboCMEcHhzG0lMyDbt3hr2rPYyPXX4dkNYw8vzUdO9tRH3rx2z9+FQ98GfONK4z9kW3uRAokzBQFxBXv6tcMIlNh629k8hJH9+FpAI/ZWnhpw9VZzSYxbe+FoTnQTEmHmRICG3zojKtD2u/cyg9Dgaj76rtRLqc080u9zPDy4TNUtaZ2N/z8I= X-Gm-Message-State: AOJu0YywbStkOtSFTgw3X2BdH/uWlvi5VsxnomuXVB1e9XrIg+Qr780X PmFdn4ir1LCECZ3oC2sxyR/9K2rBDFPgmjUVwMCj7CdtGAFJzCSi X-Google-Smtp-Source: AGHT+IFLCml7VJa3thVzim744t9VtphWf2fPKNQQnr7CEhnJRINbvibP9AjA+PIPiDOlMLU7xx3G4w== X-Received: by 2002:a6b:d20c:0:b0:7de:cf4d:b7c6 with SMTP id q12-20020a6bd20c000000b007decf4db7c6mr585980iob.4.1714419576271; Mon, 29 Apr 2024 12:39:36 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:35 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 27/35] selftests-dyndbg: test dyndbg-to-tracefs Date: Mon, 29 Apr 2024 13:39:13 -0600 Message-ID: <20240429193921.66648-8-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a series of trace-tests: test_actual_trace() etc, to validate that the dyndbg-to-tracefs feature (using +T flag) works as intended. The 1st test uses the global tracebuf, the rest use/excercise private tracebufs. These tests are currently optional, via "TRACE" arg1, because the feature code is in-the-lab. But its an objective test, and pretty user-interface oriented. IOW this passes: :#> ./tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh but this fails: :#> ./tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh TRACE So its won't break selftests success. This allows the patch to be committed now w/o inducing selftest failures, and the tests enabled later, with the promised code. Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- .../dynamic_debug/dyndbg_selftest.sh | 435 ++++++++++++++++++ 1 file changed, 435 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 54acee58cb4e..65f31418870f 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -308,6 +308,405 @@ function test_mod_submod { check_match_ct =p 14 -v } +# tests below here are all actually using dyndbg->trace, +# and verifying the writes + +function test_actual_trace { + echo -e "${GREEN}# TEST_ACTUAL_TRACE ${NC}" + ddcmd =_ + echo > /sys/kernel/tracing/trace + echo 1 >/sys/kernel/tracing/tracing_on + echo 1 >/sys/kernel/tracing/events/dyndbg/enable + modprobe test_dynamic_debug dyndbg=class,D2_CORE,+T:0 + search_trace "D2_CORE msg" + search_trace_name 0 1 "D2_CORE msg" + check_match_ct =T 1 + tmark "trace-mark" + search_trace "trace-mark" + doprints + search_trace "D2_CORE msg" + ifrmmod test_dynamic_debug +} + +function self_start { + echo \# open, modprobe +T:selftest + ddcmd open selftest + check_trace_instance_dir selftest 1 + is_trace_instance_opened selftest + modprobe test_dynamic_debug dyndbg=+T:selftest.mf + check_match_ct =T:selftest.mf 5 +} + +function self_end_normal { + echo \# disable -T:selftest, rmmod, close + ddcmd module test_dynamic_debug -T:selftest # leave mf + check_match_ct =:selftest.mf 5 -v + ddcmd module test_dynamic_debug +:0 + ddcmd close selftest + is_trace_instance_closed selftest + ifrmmod test_dynamic_debug +} + +function self_end_disable_anon { + echo \# disable, close, rmmod + ddcmd module test_dynamic_debug -T + check_match_ct =:selftest.mf 5 + ddcmd module test_dynamic_debug +:0 + ddcmd close selftest + is_trace_instance_closed selftest + ifrmmod test_dynamic_debug +} + +function self_end_disable_anon_mf { + echo \# disable, close, rmmod + ddcmd module test_dynamic_debug -Tf + check_match_ct =:selftest.m 5 + ddcmd module test_dynamic_debug +:0 + ddcmd close selftest + is_trace_instance_closed selftest + ifrmmod test_dynamic_debug +} + +function self_end_nodisable { + echo \# SKIPPING: ddcmd module test_dynamic_debug -T:selftest + ddcmd close selftest fail # close fails because selftest is still being used + check_err_msg "Device or resource busy" + check_match_ct =T:selftest.mf 5 + rmmod test_dynamic_debug + ddcmd close selftest # now selftest can be closed because rmmod removed + # all callsites which were using it + is_trace_instance_closed selftest +} + +function self_end_delete_directory { + del_trace_instance_dir selftest 0 + check_err_msg "Device or resource busy" + ddcmd module test_dynamic_debug -mT:selftest + check_match_ct =:selftest.f 5 + del_trace_instance_dir selftest 0 + check_err_msg "Device or resource busy" + ddcmd module test_dynamic_debug +:0 + ddcmd close selftest + check_trace_instance_dir selftest 1 + is_trace_instance_closed selftest + del_trace_instance_dir selftest 1 + check_trace_instance_dir selftest 0 +} + +function test_early_close () { + ddcmd open kparm_stream + ddcmd module usbcore +T:kparm_stream.mf + check_match_ct =T:usb_stream.mf 161 + echo ":not-running # ddcmd module usbcore -T:kparm_stream.mf" + ddcmd close kparm_stream +} + +function self_test_ { + echo "# SELFTEST $1" + self_start + self_end_$1 +} + +function cycle_tests_normal { + echo -e "${GREEN}# CYCLE_TESTS_NORMAL ${NC}" + self_test_ normal # ok + self_test_ disable_anon # ok + self_test_ normal # ok + self_test_ disable_anon_mf # ok +} + +function cycle_not_best_practices { + echo -e "${GREEN}# CYCLE_TESTS_PROBLEMS ${NC}" + self_test_ nodisable + self_test_ normal + self_test_ delete_directory +} + +# proper life cycle - open, enable:named, disable:named, close +function test_private_trace_simple_proper { + echo -e "${GREEN}# TEST_PRIVATE_TRACE_1 ${NC}" + # ddcmd close kparm_stream + ddcmd open kparm_stream + ddcmd module params +T:kparm_stream.mf + check_match_ct =T:kparm_stream.mf 4 + ddcmd module params -T:kparm_stream.mf + check_match_ct =T:kparm_stream.mf 0 + is_trace_instance_opened kparm_stream + ddcmd module params +:0 + ddcmd close kparm_stream + is_trace_instance_closed kparm_stream + ddcmd =_ + check_trace_instance_dir kparm_stream 1 + is_trace_instance_closed kparm_stream + del_trace_instance_dir kparm_stream 1 + check_trace_instance_dir kparm_stream 0 +} + +function test_private_trace_2 { + echo -e "${GREEN}# TEST_PRIVATE_TRACE_2 ${NC}" + ddcmd =_ + echo > /sys/kernel/tracing/trace + echo 1 >/sys/kernel/tracing/tracing_on + echo 1 >/sys/kernel/tracing/events/dyndbg/enable + ddcmd open foo + is_trace_instance_opened foo + check_trace_instance_dir foo 1 + + modprobe test_dynamic_debug + ddcmd class,D2_CORE,+T:foo.l,%class,D2_KMS,+fT:foo.ml + check_match_ct =T:foo.l 1 + check_match_ct =T:foo.mfl 1 + + # purpose ? + echo 1 >/sys/kernel/tracing/tracing_on + echo 1 >/sys/kernel/tracing/events/dyndbg/enable + + tmark test_private_trace about to do_prints + search_trace "test_private_trace about to do_prints" + search_trace_name "0" 1 "test_private_trace about to do_prints" + + doprints + ddcmd class,D2_CORE,-T:foo + ddcmd close foo fail + check_err_msg "Device or resource busy" + ddcmd class,D2_KMS,-T:foo + ddcmd close foo + check_trace_instance_dir foo 1 + is_trace_instance_closed foo + ddcmd close bar fail + check_err_msg "No such file or directory" + ifrmmod test_dynamic_debug + search_trace_name foo 2 "D2_CORE msg" + search_trace_name foo 1 "D2_KMS msg" + del_trace_instance_dir foo 1 + check_trace_instance_dir foo 0 +} + +function test_private_trace_3 { + echo -e "${GREEN}# TEST_PRIVATE_TRACE_3 ${NC}" + ddcmd =_ + echo > /sys/kernel/tracing/trace + echo 1 >/sys/kernel/tracing/tracing_on + echo 1 >/sys/kernel/tracing/events/dyndbg/enable + ddcmd open foo \; open bar + is_trace_instance_opened foo + is_trace_instance_opened bar + modprobe test_dynamic_debug + ddcmd class,D2_CORE,+T:foo + ddcmd class,D2_KMS,+T:foo + ddcmd class D2_CORE +T:foo \; class D2_KMS +T:foo + ddcmd "class,D2_CORE,+T:foo;,class,D2_KMS,+T:foo" + ddcmd class,D2_CORE,+T:foo\;class,D2_KMS,+T:foo + check_match_ct =T 2 -v + check_match_ct =Tl 0 + check_match_ct =Tmf 0 + echo 1 >/sys/kernel/tracing/tracing_on + echo 1 >/sys/kernel/tracing/events/dyndbg/enable + tmark test_private_trace_2 about to do_prints + doprints + rmmod test_dynamic_debug + ddcmd "close bar;close foo" + is_trace_instance_closed bar + is_trace_instance_closed foo + search_trace_name foo 2 "D2_CORE msg" + search_trace_name foo 1 "D2_KMS msg" + del_trace_instance_dir foo 1 + check_trace_instance_dir foo 0 + search_trace "test_private_trace_2 about to do_prints" + del_trace_instance_dir bar 1 + check_trace_instance_dir bar 0 +} + +function test_private_trace_4 { + echo -e "${GREEN}# TEST_PRIVATE_TRACE_4 ${NC}" + ddcmd =_ + echo > /sys/kernel/tracing/trace + echo 1 >/sys/kernel/tracing/tracing_on + echo 1 >/sys/kernel/tracing/events/dyndbg/enable + + ddcmd open foo + modprobe test_dynamic_debug dyndbg=class,D2_CORE,+T:foo%class,D2_KMS,+T:foo + check_match_ct =Tl 0 + check_match_ct =Tmf 0 + check_match_ct =T 2 + + # are these 2 doing anything ? + echo 1 >/sys/kernel/tracing/tracing_on + echo 1 >/sys/kernel/tracing/events/dyndbg/enable + + tmark should be ready + search_trace_name "0" 0 "should be ready" # in global trace + + doprints + search_trace_name foo 2 "D2_CORE msg" # in private buf + search_trace_name foo 1 "D2_KMS msg" + + # premature delete + del_trace_instance_dir foo 0 + check_trace_instance_dir foo 1 # doesn't delete + ifrmmod test_dynamic_debug + + ddcmd "close foo" + is_trace_instance_closed foo + del_trace_instance_dir foo 1 # delete works now + + check_trace_instance_dir foo 0 + search_trace "should be ready" +} + +# $1 - trace-buf-name (or "0") +# $2 - reference-buffer +function search_in_trace_for { + bufname=$1; shift; + ref=$2; + ref2=$(echo $ref | cut -c20-) + echo $ref2 +} + +function test_private_trace_mixed_class { + echo -e "${GREEN}# TEST_PRIVATE_TRACE_5 ${NC}" + ddcmd =_ + ddcmd module,params,+T:unopened fail + check_err_msg "Invalid argument" + is_trace_instance_closed unopened + check_trace_instance_dir unopened 0 + + ddcmd open bupkus + is_trace_instance_opened bupkus + check_trace_instance_dir bupkus 1 + modprobe test_dynamic_debug \ + dyndbg=class,D2_CORE,+T:bupkus.mf%class,D2_KMS,+T:bupkus.mf%class,V3,+T:bupkus.mf + + # test various name misses + ddcmd "module params =T:bupkus1" fail # miss on name + check_err_msg "Invalid argument" + ddcmd "module params =T:unopened" fail # unopened + check_err_msg "Invalid argument" + + ddcmd "module params =mlfT:bupkus." # we allow dot at the end of flags + ddcmd "module params =T:bupkus." + ddcmd "module params =:bupkus." + ddcmd "module params =:0." + + check_match_ct =T:bupkus.mf 3 # the 3 classes enabled above + # enable the 5 non-class'd pr_debug()s + ddcmd "module test_dynamic_debug =T:bupkus" + check_match_ct =T:bupkus 8 -r # 8=5+3 + + doprints + ddcmd close,bupkus fail + check_err_msg "Device or resource busy" + ddcmd "module * -T:0" # misses class'd ones + ddcmd close,bupkus fail + + ddcmd class,D2_CORE,-T:0%class,D2_KMS,-T:0%class,V3,-T:0 # turn off class'd and set dest to 0 + ddcmd close,bupkus + is_trace_instance_closed bupkus + + # check results + eyeball_ref=< X-Patchwork-Id: 13647620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A3A6C4345F for ; Mon, 29 Apr 2024 19:39:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D18A510FFA8; Mon, 29 Apr 2024 19:39:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hDYgw1fv"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 196A110FF4F; Mon, 29 Apr 2024 19:39:38 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7da4373f850so240096239f.3; Mon, 29 Apr 2024 12:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419577; x=1715024377; darn=lists.freedesktop.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=8dgWj2cFA2MU3UxaMwN/AH6DmAyC9gLaTAViD4Tt0Ck=; b=hDYgw1fvpXzbCzRRvbbCYEzqtsP799slftZXb8x+vVFyOg1MiE1n5PTckXQGF4FXR/ qmQrKj3ANXkn/p8L64fiR7/j6xngeXS0a+lGttW/USUEpKkVCkDzF9rQ2108w95/beJi YvSWToxljoRCVYTNGKQRdIaN+qOQ8LYsr+DZ3SqxiUaeClyrXBMPhPFu8M+2fYz9aD0I c/j+nk1o8RG2BmX4dXzv9Xfylcx8Eqvk0YS6Eca0FgTvpdg2admIXGrW4eDqKJB07zlc k40lwf6KdMYWwPYuIG1MXcVRANqKKW7jDrO13tTyjPTwCbje39FXq+X38vNARjRInQJr PWLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419577; x=1715024377; 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=8dgWj2cFA2MU3UxaMwN/AH6DmAyC9gLaTAViD4Tt0Ck=; b=XBtrX6cWu17/50gQNz1UCkiUnk6+4XsCszVnXwmZ5oxgf2WHId0npfX6d+bOhH/bAq xQF2xQlC8Gps38WDUH6HP0e7WBVsk45lbSeHm6kfCC3xyhj6cEU/Ms83Q7HgLc2IsB66 2nfBFM6imk7gW+3g42ae1raMM9JyxGQ17Qvz3m2rFpSjOuZ74DRPBlvvF0DGTTHJaqzz eapkEP46fgVdLKJn8B2l1PEJ8KK2nkxQHSvyyb1R+Tzqwoeos+yQ23O1TgFeeV2211IG Fi3xreyjYr6Tz3TlY3GZPzrDq4f5bdq9wLgG1qdMKHJye6dPVA8mSUe+T+Ek1UdIArGh cUng== X-Forwarded-Encrypted: i=1; AJvYcCUhV92bkMrOMXR3roS/5JvR6gwFZIATN4gXvKMqHDy44uEthTm+lbE2qVLq/24+AyLcQY2r+PzXV4SJSRBQWOf79VDhg35m/N1PUSAknm5pk9XTyhzavi5IWpd0PucPNM+KZF4dsaY0444ZmF13LpnYsIZMvZQRbh9cNpu+qSE7qCgjv3MqU1Zv6NevRSI5hmew9/NBkGcU/Et5FeGix5X6MNILL5BlKZ9pKoEzuJNZk7L5PAI= X-Gm-Message-State: AOJu0YweJwEwaqgKAi7xv/PqHTCiYrDr7thmwdwTh5gcJukLnG5YMjF2 pwy2SriYpbmkQUaXv8rAHHBnYpfhM0DCZvPUdFvhsvr8e3XJt5nv X-Google-Smtp-Source: AGHT+IEs24YTwILUt5MHKr0F0OyxCq+SxhIGz3ARX0AwMIA0GR+8INeYUiHTkHCKHU43qMQt+OxxMA== X-Received: by 2002:a05:6602:4b0f:b0:7de:c308:76e2 with SMTP id eo15-20020a0566024b0f00b007dec30876e2mr976745iob.3.1714419577342; Mon, 29 Apr 2024 12:39:37 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:36 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 28/35] dyndbg-doc: explain flags parse 1st Date: Mon, 29 Apr 2024 13:39:14 -0600 Message-ID: <20240429193921.66648-9-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When writing queries to >control, flags are parsed 1st, since they are the only required field. So if the flags draw an error, then keyword errors aren't reported. This can be mildly confusing/annoying, so explain it instead. This note could be moved up to just after the grammar id's the flags, and before the match-spec is detailed. Opinions ? Signed-off-by: Jim Cromie --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 7b570f29ae98..ccf3704f2143 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -106,6 +106,16 @@ The match-spec's select *prdbgs* from the catalog, upon which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". +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 + A match specification is a keyword, which selects the attribute of the callsite to be compared, and a value to compare against. Possible keywords are::: From patchwork Mon Apr 29 19:39:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C1CDC4345F for ; Mon, 29 Apr 2024 19:39:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 797CB10FFB2; Mon, 29 Apr 2024 19:39:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mr3rkAIa"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 36F5910FF53; Mon, 29 Apr 2024 19:39:39 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7dec786b0a7so49976739f.1; Mon, 29 Apr 2024 12:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419578; x=1715024378; darn=lists.freedesktop.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=gz40dojOamaMr3XzSBo+G+I5OCec93qZ3mLYpBVy9xE=; b=mr3rkAIaNi32nMjpvoOpw2L5XzTA23BR4VDTOo01yob2hmUN9ZQiut+mUJeg4Pc4lA 2dOu1CukidEG1WlftpyfVDsGouVwk0K9OXyxjmbFWes5A5rSxZSEZDAzPV99zs++zz8p wyjcG8ASPM9m3eaEX7n7DfD7ibPZW7WGC3KGl+p+d5HxIh0BCzZT5BnrlendBpkYqcVr vHFI3FwNK5jZz4QFHfXDxGD8k/Sv09tWxKX65GXhr2a1O/BCI7rRooKrDbAwEukxe5Av KTCQWOYn9cMudGOvEDHk0aKKAVs9DFaRIQobOu+PfbGwSMjkqizDtZR5/3tciBqjZnun 6QUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419578; x=1715024378; 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=gz40dojOamaMr3XzSBo+G+I5OCec93qZ3mLYpBVy9xE=; b=M4fqXfoMrnQ7HS6PciXuzppINlv9ZNP+ZwWBei3jyRvJTXt/lLkv6xg+cUvhH6Bsnw VADK0hxBV/wVbVFD/bN3msqlvEuKyAz+OZrfZ0KBuo3p0GyIGuYdj4VLTmNArFC6T3xE JBus94zj54SWc3UrcURMqH8ZbIH6e1makHp2nPMBHX2W6BLuhSVoQVoDFbSvHmvetceE WHcRABRXMvJ1uAlHpA3vZtcBcEl7TKYpn1jWpnjzDMj4lxdnu3COPl/4zBVvSXN0I7VG HcQ64PYrhm6CkbBLgGLP27JiNjkUE+fg3+SHYpHN7rT6eWVM+355wUilNO3VysdN2tzY xb3g== X-Forwarded-Encrypted: i=1; AJvYcCU/kcwUoY/0ECQDkv5IEhmHNbdRke4BDhYtloTAjrwoPapceLY81IIrsFIvhpxDlFf8Spk1HjPe5wJAFiA+RITdWizIo4tP9+Rf3tt5S24y9BWp0NIDoDfeYtOwHJoLqBQC3qvmIBFAfLdeFeJ51fIQHCeqouLUEOdzpUh/U2fMzDfZGri+whpWOxJcdux7PPZeCoDQZjsxcou17sjFD84ieYQfwCFIV9G68y1AWVKbgD2W4u0= X-Gm-Message-State: AOJu0Yz46EWeFzujgWZ25YgPvAVmNdB7Y3iYEKsrUcI7zSU1XHNtjUjh tbXAVWmSyWrFxseB6My8SKikdnqLIpln03jz+bYmnvudRDwuaIh/ X-Google-Smtp-Source: AGHT+IEwjLTZjJthckf74C1CX3uaiE3oCQMny0EnG/l4mAH8Dbjs9ZTAj5NSSjRC7OpGprs2S+b1UA== X-Received: by 2002:a6b:6814:0:b0:7de:c47d:a740 with SMTP id d20-20020a6b6814000000b007dec47da740mr558970ioc.8.1714419578408; Mon, 29 Apr 2024 12:39:38 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:38 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 29/35] dyndbg: add __counted_by annotations Date: Mon, 29 Apr 2024 13:39:15 -0600 Message-ID: <20240429193921.66648-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Tell the compiler about our vectors (array,length), in 2 places: h: struct _ddebug_info, which keeps refs to the __dyndbg_* ELF/DATA sections, these are all vectors with a length. c: struct ddebug_table, which has sub-refs into _ddebug_info.* Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 6 +++--- lib/dynamic_debug.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 090fe9554db7..c54d2a4e1d48 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -146,9 +146,9 @@ struct ddebug_class_user { /* encapsulate linker provided built-in (or module) dyndbg data */ struct _ddebug_info { - struct _ddebug *descs; - struct ddebug_class_map *classes; - struct ddebug_class_user *class_users; + struct _ddebug *descs __counted_by(num_descs); + struct ddebug_class_map *classes __counted_by(num_classes); + struct ddebug_class_user *class_users __counted_by(num_class_users); unsigned int num_descs; unsigned int num_classes; unsigned int num_class_users; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 625838bd74aa..390a35508fb6 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -49,9 +49,9 @@ extern struct ddebug_class_user __stop___dyndbg_class_users[]; struct ddebug_table { struct list_head link; const char *mod_name; - struct _ddebug *ddebugs; - struct ddebug_class_map *classes; - struct ddebug_class_user *class_users; + struct _ddebug *ddebugs __counted_by(num_ddebugs); + struct ddebug_class_map *classes __counted_by(num_classes); + struct ddebug_class_user *class_users __counted_by(num_class_users); unsigned int num_ddebugs, num_classes, num_class_users; }; From patchwork Mon Apr 29 19:39:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E7ACC04FFE for ; Mon, 29 Apr 2024 19:39:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0589110FFB7; Mon, 29 Apr 2024 19:39:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kOt8T5El"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id BDFD910FF53; Mon, 29 Apr 2024 19:39:40 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7da939572b5so197143339f.2; Mon, 29 Apr 2024 12:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419580; x=1715024380; darn=lists.freedesktop.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=a0MeHEZcsgFBBOIcW96muUaq6331rE39MA9kEHJFHdU=; b=kOt8T5EllfqszsLdIFu2f8VrOUWEoAvk1kIBh2Ic2P8r3KGRAgXjpG7S65HBtbx9qk 7ZeYEJVNdX6ugUf9ma9Q0/mh0y7Si/0tVeEX0NjaeoJvUF2lSBIRnZ2SdaXWjQjuEOb6 NiIw3GTnnClgVJrh3HbeaNdWf75H7vfNARQLQJl+webThAAingaP1PNQDXIweeiUMcUw AU5iZEacoUEiBbBhhXP2o/E9kLmYwhySS6rca0ZtRttQCT5+lVilVwljU32nqFV2rZj5 j8wlhbMbO846Gx7UB+HH3IjSb2vAHkm74LfEY/+0YtquUJBuMYbbRqfRjnJRW7Ky2G0O ndiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419580; x=1715024380; 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=a0MeHEZcsgFBBOIcW96muUaq6331rE39MA9kEHJFHdU=; b=q5oG4exoeSTSg5mmgu4qGHwsnjoPpPwQZ+ZgbF48vDAJ4ZRkme9gDAZx3d9/STAV5w /zXnGlAFT1e61JdrV+gfP57tSzcxX94xbNqfuWH589mWp/4h8ZwO0b27vBM0rmcqwmaY TqW81sa1es4/VMWqC6RMV/a+aDmyVHTu0C1JHgp/L3gg0Cr0DvIg3V4fx2k/4GYS7kD0 odBVxKLUviKgbGG82eeYZdQFl38Z56sQlMkdKtxY1TJlIKvkrFfDHmcstNS52tiS7XMP pBpO+qy/AGGF0yx2qQD7Fg85knSdbF32vW2q1P4ryLucvFsuzTU9l+k14PUWa6ksk1Tu 7GmQ== X-Forwarded-Encrypted: i=1; AJvYcCXyy2BThTN8/kMtWAzBpUakoVK/j3MIr8EDjDcxqQdFrBAyEewb975ycFvh/uosjCwPk2wPDWyEbaMHezDGLCam5i3YDnAx9UtLhSGF8UJ6KTKyhFIAvwlXDq3aURQAglRS6ClKPeJLiqu+oGHv51jr/XLg33+UpXh7LFMNByVEsdne1pFuXsA+c1wciRwjfbUcEBooRfl1GiZQFUBh5V2MM2iaGrlV3VhBT8jpTRtuzBrkoAs= X-Gm-Message-State: AOJu0Yw40Zk+uCJxJTMX3TwY6XkdymIISVzus7hS91NxNZzqS/py2EOP EsjFs13pd9ZQ+lMzTXZ7ZCrEVWb+eGRhW1Zw5JX8KHgSwVrM9ryP X-Google-Smtp-Source: AGHT+IHlUVq3kyXnqc/U6UIcx1yMtr80xS3S0rVakdXkFmPbZcga6S+Hk2XVAzZ4ytI76/jmWP6Ckg== X-Received: by 2002:a05:6602:275a:b0:7de:d935:de0a with SMTP id b26-20020a056602275a00b007ded935de0amr1639049ioe.0.1714419579920; Mon, 29 Apr 2024 12:39:39 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:39 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 30/35] drm+drivers: adapt to use DYNDBG_CLASSMAP_{DEFINE, USE} Date: Mon, 29 Apr 2024 13:39:16 -0600 Message-ID: <20240429193921.66648-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Follow dynamic_debug API change from DECLARE_DYNDBG_CLASSMAP to DYNDBG_CLASSMAP_{DEFINE,USE}. Prior to this, we used DECLARE_DYNDBG_CLASSMAP, which was preserved to decouple DRM conversion. I'm unsure of the full functionality in-between, a round of lkp-testing will help. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Signed-off-by: Jim Cromie --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 +----------- drivers/gpu/drm/display/drm_dp_helper.c | 12 +----------- drivers/gpu/drm/drm_crtc_helper.c | 12 +----------- drivers/gpu/drm/drm_print.c | 25 +++++++++++++------------ drivers/gpu/drm/i915/i915_params.c | 12 +----------- drivers/gpu/drm/nouveau/nouveau_drm.c | 12 +----------- include/drm/drm_print.h | 8 ++++++++ 7 files changed, 26 insertions(+), 67 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index e4277298cf1a..b287f0cfd8fa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -217,17 +217,7 @@ int amdgpu_damage_clips = -1; /* auto */ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work); -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); struct amdgpu_mgpu_info mgpu_info = { .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex), diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index f5d4be897866..d3a7df09846f 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -41,17 +41,7 @@ #include "drm_dp_helper_internal.h" -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); struct dp_aux_backlight { struct backlight_device *base; diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 2dafc39a27cb..e9d229a393f4 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -50,17 +50,7 @@ #include "drm_crtc_helper_internal.h" -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); /** * DOC: overview diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 699b7dbffd7b..4a5f2317229b 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 each 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"); static struct ddebug_class_param drm_debug_bitmap = { .bits = &__drm_debug, diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index de43048543e8..dccf12d05105 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" -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); #define i915_param_named(name, T, perm, desc) \ module_param_named(name, i915_modparams.name, T, perm); \ diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index a947e1d5f309..27995c0c9b31 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -72,17 +72,7 @@ #include "nouveau_uvmm.h" #include "nouveau_sched.h" -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); MODULE_PARM_DESC(config, "option string to pass to driver core"); static char *nouveau_config; diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 9cc473e5d353..905fc25bf65a 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -140,6 +140,14 @@ enum drm_debug_category { DRM_UT_DRMRES }; +#ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG +#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) +#define DRM_CLASSMAP_USE(name) DYNDBG_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)); From patchwork Mon Apr 29 19:39:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F37FC25B10 for ; Mon, 29 Apr 2024 19:40:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FD7410FFA5; Mon, 29 Apr 2024 19:40:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="W20IkYUN"; dkim-atps=neutral Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA03910FFA2; Mon, 29 Apr 2024 19:39:41 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7deb424da41so138740739f.1; Mon, 29 Apr 2024 12:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419581; x=1715024381; darn=lists.freedesktop.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=ulaYyaVft/YyoU0+fiQtajkDbj/WJZ88JMn79Ec/vX0=; b=W20IkYUNuHOJUTYYbGTbzN2dhnqXA8o4KDFIkUp9nnB+89+Egef0v9VQfFWnmfLf83 ILVI6pBdtQDOCFIr2/tW9Ex6JePiZ7aQgvrJvNQbOCRaMRX58YjiJE7p6tiaIzflzNji rmBRS6WRrROc0nLUGZpcK1v53ToqViHAVYcJd/IaHMDrEWpYbUNkNBy5wHIo+3XkDGzi v/yDRciZsS3/CyX3N7WabvkDzGlonc3Yf8c+zQ5SqsNh9wLXEcGzLh6nZ3CHrcv8WPMG ARAD1najJjkECMTh/oKOl+xyiNOe/dIkvgoe2ct9HKBjeqNQ0cr3jd2biQSopz0wKcRN vcng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419581; x=1715024381; 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=ulaYyaVft/YyoU0+fiQtajkDbj/WJZ88JMn79Ec/vX0=; b=itNy4Rhos8D/wXdZXUxGGjdSUbBis3TxR6QsOglrUlNJlqhFELDWO+of4LHgRxG/0i Xm7dHQ3AL2h9aWx+RdhXp4hmRSo1/CM6Uz4mA8qLRaJ03ZdfkLnuQxxVXkhe7hvOPkvV X2pIQsQ++UejIuEYBzi0BvospYxRvCmUoMMyT/dlWe2yDYBV7y//1z9vIWdgOD1y8hyC ke7o+yttV827m6Y8d2r92GzfmPPwPZXL2yvUwa61IEF9Ox8hpgqLkH7iNvm/LgZokOrj eAyjZy01TBjBw0ls+l8pMlEauj0hzcA/UgKk3CItUONENc1pe8AgRlRVTN9/EgRjEBKD DIBA== X-Forwarded-Encrypted: i=1; AJvYcCW9+bF0vO5OLogTclhnZH25r/cY+Ng3qwTDpIabLiQSnbHFXOkRI6vgCn1RkjqDCe/DG5MA9f2MKpbPitmGE77+wdnqSFNsp/sc49Rq39SelbIWD1guE32EQmRK2Qe9KgN6zVu1qsASEWJ06HyOe75KaQ65LQ4WEiLDt4IkEeIMLkHWHnG/GIhkYtzMnwVWjEx2agt8f2rYy9zXMeZ5beKQBvDSchHDzKR+zLrXC0qTGC0TrQ8= X-Gm-Message-State: AOJu0YxyRz/LwPGD8s0/PSQazPqNAhvNDpSmniR682hbCLQVt0KfV1gI xfB4Om9sYDqIpD4N0mdXaj90jLA6sTJLaDtVbe2BtYB7r3umAGHY X-Google-Smtp-Source: AGHT+IHyNsWP7Nzkt9gGnd6X8Rl4lpNvOOIYqiWNC2SKAWyiinyhoOsXf738AKl1GY5d/CNNu9onOw== X-Received: by 2002:a05:6602:25c2:b0:7da:18b8:a4fb with SMTP id d2-20020a05660225c200b007da18b8a4fbmr13508509iop.9.1714419581091; Mon, 29 Apr 2024 12:39:41 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:40 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 31/35] drm-dyndbg: adapt to use DYNDBG_CLASSMAP_PARAM Date: Mon, 29 Apr 2024 13:39:17 -0600 Message-ID: <20240429193921.66648-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" use new export --- drivers/gpu/drm/drm_print.c | 8 ++------ include/drm/drm_print.h | 6 ++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 4a5f2317229b..efdf82f8cbbb 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_DISJOINT_BITS, "DRM_UT_DP", "DRM_UT_DRMRES"); -static struct ddebug_class_param drm_debug_bitmap = { - .bits = &__drm_debug, - .flags = "p", - .map = &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 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 905fc25bf65a..95c667934bbb 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -141,11 +141,13 @@ enum drm_debug_category { }; #ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG -#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) -#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) +#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) DYNDBG_CLASSMAP_PARAM_REF(__VA_ARGS__) #else #define DRM_CLASSMAP_DEFINE(...) #define DRM_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) #endif static inline bool drm_debug_enabled_raw(enum drm_debug_category category) From patchwork Mon Apr 29 19:39:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647626 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4E8EC4345F for ; Mon, 29 Apr 2024 19:40:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21F9310FF9A; Mon, 29 Apr 2024 19:40:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="g6wLd2xR"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F4B710FFAC; Mon, 29 Apr 2024 19:39:43 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7dedc577011so3530439f.3; Mon, 29 Apr 2024 12:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419582; x=1715024382; darn=lists.freedesktop.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=Ie5rZ4dsMUbEYAulp2798W3AJ6+dgFCJhLzBPJXIbz8=; b=g6wLd2xR6V9IewlgLy3LyRp28Rv7A04Xw0q8Q03WqmLM10VrmTHvbBkU00KU7rKp8r xy5ucQ0x3s4wG1zQF0L6EgFt4+sSoXkdkRFfApLmvSahuk4Go4yIRgwPuIBWsrG7nhHY msOPKZRHBPo7C4pnlBKhhgUweBfve4YC3iu+erhhgjHfjfML/Zlsfy8ww35zZB63n58t a/wrZHhTuSQr4QCG4BRR+kpo3xEQWTrynHxp01z7wOXcFDCVv3ycAMs0IbWKjHgUb980 BQm01aNBuku5fiEfuLmEDk8+//5C2rVca5wPfPNn7jjoVOzD7W0i5J43Vqem1xEWL2HX PAmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419582; x=1715024382; 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=Ie5rZ4dsMUbEYAulp2798W3AJ6+dgFCJhLzBPJXIbz8=; b=Csy9jO5KF14tSVDfxBOK0F2CDVYFDIhDdmrJ7pWKN733LoIV/SYM3xr2Be6sqJazzO XWluNbR6homHJZEgygerEbGNf+37FhYO4gnL1KDjwSvjytKyPi9LnHFaOOxPyBH0FBnp ufb0hBl3r8EgF08NkGZAK8kBwpktN+K65SFHmtSNBFy+PpMWBSlVS7tC2nt9pw176vtu f+yhq5jQxpJ4Gt0efnqSr8Kr9iovPks1WEPYLnG2M4aBpfoiBX9NIRR0/PwDX9bZ/UTv ZYBdnGD9WtI0GRujTWpMUBqqnLlHhUdHAN2GWtEFPmZMKcAnNsVLvPBaruzzkMbnd23L AhiQ== X-Forwarded-Encrypted: i=1; AJvYcCVakxKi732kmpQWRfdF4Igb/RKvCNXulhd4naT6l4+GibvyPrJRvZvbA7XhGz9zaflEk0KtonkGo8Le6vRf+EMg99o7/tjn988GipAYKl5HYyMw4Az8hSm6k1jsYSPRaCdau+kqYnDDNc/Na9iotK9mUbJTSfI8/G6X2tVndaIbrRNNaQInTw7iI1Kdu3hmdjhSKaj28ZcBapa88uNWh/4Btq78WsTC4dtWHC14m8w66xLTWDE= X-Gm-Message-State: AOJu0Yyhja8DjXACSxSkr3MmfMmlQQwDM2vHuQSGeMrTceOiRh70GLWD 1Lbg1EHMKYwBRlxocyZAhfd3gzAE6MTeI8jC9zytbbAhE+x5nn9v X-Google-Smtp-Source: AGHT+IGrQCUh7NJG66NLfClNiBakmvFViipsgTmeiMMctP+y/nuBqnI1oha451gFi7fkgh3cY29+VA== X-Received: by 2002:a05:6602:2759:b0:7d5:c987:3239 with SMTP id b25-20020a056602275900b007d5c9873239mr888946ioe.16.1714419582384; Mon, 29 Apr 2024 12:39:42 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:41 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 32/35] drm: use correct ccflags-y spelling Date: Mon, 29 Apr 2024 13:39:18 -0600 Message-ID: <20240429193921.66648-13-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which broke builds with: CONFIG_DRM_USE_DYNAMIC_DEBUG=y CONFIG_DYNAMIC_DEBUG_CORE=y CONFIG_DYNAMIC_DEBUG=n Also add subdir-ccflags so that all drivers pick up the addition. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg descriptor factory 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 104b42df2e95..313516fc2ad5 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. -CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE +ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE +subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE drm-y := \ drm_aperture.o \ From patchwork Mon Apr 29 19:39:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647624 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0E70C4345F for ; Mon, 29 Apr 2024 19:40:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1502D10FF53; Mon, 29 Apr 2024 19:40:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Gc4wGMjO"; dkim-atps=neutral Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id E46C210FFA5; Mon, 29 Apr 2024 19:39:44 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7dea2de1301so209158339f.3; Mon, 29 Apr 2024 12:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419584; x=1715024384; darn=lists.freedesktop.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=KB/nTGsL6ro7Z1JHc0QfHBM4CeEa1MsqmgZl/vui59g=; b=Gc4wGMjOFzrLhiAtP9Xs5An0Q+2j/fsgGzrUP1z+h849tkIvCABYlRerNiEdpCrtXA d0OutzKRnVL/z7MGUeldaMN4AJnrhKavZu4w61ovgixdT3Vr2igMaUsqLTvhMKdjHUvC 6tQwyJwmtEGZ8OZqUFtFXjXOImAqfQsqoW9ui6RjII8P99H6DOdShWThMztwFGu8LbMj k5bWgB2rV5RlF3Fc83+luP+m4GF4QcxUdVxKsBusp8OdrMyfbTCRIWHro1zxuNLASxO1 kBFRI/S/X55QaemX+tmt7ImKyqavuslFLIiqO7PNxSBMan5+h/8O+Xo+uD/wkPdOeClK yCWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419584; x=1715024384; 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=KB/nTGsL6ro7Z1JHc0QfHBM4CeEa1MsqmgZl/vui59g=; b=Qs2BTsd595qALxMuhMf4NOLWRuEQYIS9oXlKmRqVc/WqpXJeDJ6Bkr5amW+I1sGdf2 COQnnzak9YRAcmk4q6LsVR1Se4iVzFsRXHDPyFLmGYiGB6h7Pq82tgrw4bXHcuzfnpq3 Uc97kaUR04aOizr/6GIZMInJpIIfklnQ5FloKPti4EXtWaAqm8KmH94hy2jopjGdnxPY NmVEd7D87vXY+UNBf3M0qSRk1ECe0fIN6XJwS3uNhXs5tJsfi6xE+z35tXjAclvkGX/X nldbpZHzEqB3MDB+dmwLOZvHBmhDxuqagplzUO7/mKoKwQ5bq8fQCayovwcv9EZ2o5gx IcLA== X-Forwarded-Encrypted: i=1; AJvYcCWHBeWYqf6QBn9tXuPQfqE6w2uA92VZL0FCZRqrVTLEtekSWNnrLzeF54UmvR5jZoNmWZ+jMhegi5S5LAVDyidfmbvI5CXFStmbmCPdfXfGJWwOnKBU+NEgf7iNpJnBumrbsCvJpCpe96L7pWM/Qk54LlAMsLoay2XO1TNfQ28GUZ+fvmwNQZuaebyP5P0H1z97GhrxeU+9605Eiuv7OIEpmHS+1P91q9dfVtoUbNqlZw88kts= X-Gm-Message-State: AOJu0Yy1k3XLWwUYPKjjWZ4VN+AacpIhrnO+r0mN4W9pe9hXgHXhjkRu 4hqZB/dILnmkgLWC1taps5kUFim9yD6xp2Z8KSFQBDFFKtEwLZ9L X-Google-Smtp-Source: AGHT+IGe/WUrOgGW0kG9oegUnAjv9bfEDL/4OVg1gOQS+PzK/bL9RrP/0QWZjIHz6Za9U9E0MJD4uQ== X-Received: by 2002:a6b:7611:0:b0:7de:a511:9edb with SMTP id g17-20020a6b7611000000b007dea5119edbmr10188869iom.10.1714419583976; Mon, 29 Apr 2024 12:39:43 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:43 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 33/35] drm-drivers: DRM_CLASSMAP_USE in 2nd batch of drivers, helpers Date: Mon, 29 Apr 2024 13:39:19 -0600 Message-ID: <20240429193921.66648-14-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a DRM_CLASSMAP_USE declaration to 2nd batch of helpers and *_drv.c files. For drivers, add the decl just above the module's PARAMs, since it identifies the "inherited" drm.debug param. Note: with CONFIG_DRM_USE_DYNAMIC_DEBUG=y, a module not also declaring DRM_CLASSMAP_USE will have its class'd prdbgs stuck in the initial (disabled, but for DEBUG) state. The stuck sites are evident in /proc/dynamic_debug/control as: class:_UNKNOWN_ _id:N # control's last column rather than a proper "enumeration": class:DRM_UT_CORE TLDR: This set of updates was found by choosing M for all DRM-config items I found (not allmodconfig), building & modprobing them, and grepping "class unknown," control. There may yet be others. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ drivers/gpu/drm/gud/gud_drv.c | 2 ++ drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++ drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ drivers/gpu/drm/radeon/radeon_drv.c | 2 ++ drivers/gpu/drm/udl/udl_main.c | 2 ++ drivers/gpu/drm/vkms/vkms_drv.c | 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++ 8 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index e435f986cd13..066d906e3199 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -23,6 +23,8 @@ #include #include +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_IMPORT_NS(DMA_BUF); /** diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 9d7bf8ee45f1..5b555045fce4 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -31,6 +31,8 @@ #include "gud_internal.h" +DRM_CLASSMAP_USE(drm_debug_classes); + /* Only used internally */ static const struct drm_format_info gud_drm_format_r1 = { .format = GUD_DRM_FORMAT_R1, diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c index 573dbe256aa8..88c5e24cc894 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -25,6 +25,8 @@ static int mgag200_modeset = -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, mgag200_modeset, int, 0400); +DRM_CLASSMAP_USE(drm_debug_classes); + int mgag200_init_pci_options(struct pci_dev *pdev, u32 option, u32 option2) { struct device *dev = &pdev->dev; diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index beee5563031a..1971bfa8a8a6 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -65,6 +65,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); +DRM_CLASSMAP_USE(drm_debug_classes); + static struct drm_driver qxl_driver; static struct pci_driver qxl_pci_driver; diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 7bf08164140e..d22308328c76 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -247,6 +247,8 @@ int radeon_cik_support = 1; MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)"); module_param_named(cik_support, radeon_cik_support, int, 0444); +DRM_CLASSMAP_USE(drm_debug_classes); + static struct pci_device_id pciidlist[] = { radeon_PCI_IDS }; diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index 3ebe2ce55dfd..ba57c14454e5 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -19,6 +19,8 @@ #define NR_USB_REQUEST_CHANNEL 0x12 +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 diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index dd0af086e7fa..086797c4b82b 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -39,6 +39,8 @@ static struct vkms_config *default_config; +DRM_CLASSMAP_USE(drm_debug_classes); + static bool enable_cursor = true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 58fb40c93100..c159f4d186a3 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -275,6 +275,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); +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"); From patchwork Mon Apr 29 19:39:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 839ADC04FFE for ; Mon, 29 Apr 2024 19:40:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE22910FFB1; Mon, 29 Apr 2024 19:40:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hXUGmLaW"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id E032410FF4F; Mon, 29 Apr 2024 19:39:45 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7d9480d96bdso272423139f.1; Mon, 29 Apr 2024 12:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419585; x=1715024385; darn=lists.freedesktop.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=nJYPCWLWtk5u9OuODPiVoHDlhD50vJ4NXaKLOLuEW/c=; b=hXUGmLaWJ4ylcYS6iNbGV7zXP78WT8a5zRSqb/1o+0Hree6JYfNyDwxZdGyCtUopep 2rtPv6xsZZ22II+oGWD2gZwG88OlEf/vcexnBkgC9af/Prl09N1fqF4l7DkgblpIY0lw 2xMmTEuJ+1nXgbIZDYnjJZ0Jgm85oj1Hq5xneU8R7OJHlXQsYuK0LCTKHIcZYOrcNutS 6cz24poVylHQDS76v5O69voo4mzGtl92QvuS8B+Dkzs/GbFAQ6di2SygjaiAr1trXPbC 9Jha0CQcY0BkAIg/bSlbBWEA8PHpeVhTw5bZSwc1+WODkCb/MK0tC3mXZdDwMmS+iKVH A1wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419585; x=1715024385; 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=nJYPCWLWtk5u9OuODPiVoHDlhD50vJ4NXaKLOLuEW/c=; b=SQZ5sEO+eUVBlluQ+rFS2uyk/OhnYlRSRttyzzkMURoWhZK0Z6um7uZMZfs19B/Plm bgTNAmocTZVBtyrASbf2qRc3KY4/wlUuVEAGseyN20e06qJ3lWbx1/g50x3WvUCZ+AuO czAXCa2lhWte7UgmnoZgYtjfc5AWING79LDFaL+ywU7+Yn2+xcZLjBUrF+A8MvZNpyeE ZxxXpXnKB92vrTfBw5VKCvQ1GGbKlyebD+4fncwD03hQTezPPU5fde6oxS/z5jc/3DGu cDP9EWAY9eNpSsBlcj2+Hmb7qd/AkpcqudHfv1bOqIwFa7nRYTwpaKgHnpF8wbh3fJ3o 9FxQ== X-Forwarded-Encrypted: i=1; AJvYcCXsud6FgNExKWz1Gf4OEd5AE3K5PFas4GfH1DVnTZYlnAa76a8Xt5Ywcau3fyElLmq3I8SQjRT9Oc+wVFq6OCscxFJHtmHtnN94bTO8ayfa/P5C5iQmbB4KE6ck2fkBIMmuUjgm3ZYBLwzFIQ36/LPzPqFtQ8/WO96CZLVbEcn0Wf7QC3pW7dJlCxQKajFJZq27okZJCDaBnUIgjScEphh+wJST+C8h9Zh7F5lG9siRdAK+rS8= X-Gm-Message-State: AOJu0YxUrrtj6vldNCgLkFjX8n2VA4m9+R8N9aT2pmtorbJiargo2YmS iJVYdLbRTvCKoWaCXCqIPkTnu3BDyhpILAT1q6jRFnAIABf7ELZh X-Google-Smtp-Source: AGHT+IHjOhQgOCcXtw7/jegYglzMKIrb6oRCN1PRx9oGSN8qw5xCJw9DpglxKehiLtweVV/J2JilLg== X-Received: by 2002:a5e:9742:0:b0:7de:da61:7a3a with SMTP id h2-20020a5e9742000000b007deda617a3amr906777ioq.20.1714419585057; Mon, 29 Apr 2024 12:39:45 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:44 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 34/35] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN Date: Mon, 29 Apr 2024 13:39:20 -0600 Message-ID: <20240429193921.66648-15-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Time for some quality CI Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 5a0c476361c3..b2ea73ae48f0 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -54,8 +54,7 @@ config DRM_DEBUG_MM config DRM_USE_DYNAMIC_DEBUG bool "use dynamic debug to implement drm.debug" - default n - depends on BROKEN + default y depends on DRM depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE depends on JUMP_LABEL From patchwork Mon Apr 29 19:39:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13647630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E317C25B4F for ; Mon, 29 Apr 2024 19:40:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1345A10FFB5; Mon, 29 Apr 2024 19:40:12 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RJP7Jamh"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id DBEF310FF4F; Mon, 29 Apr 2024 19:39:46 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7da939572b5so197147339f.2; Mon, 29 Apr 2024 12:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714419586; x=1715024386; darn=lists.freedesktop.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=bvtcoSNmHJyPK9Yxvdf/16D7QT7gwaP1R4zyZ6VaX/E=; b=RJP7Jamh9Y3XjS9TpXfZHYsUIpDzY5eJVOWujCo2FgCiQrxUX8Wvgv9dSqE2Few78z XhO9m9BZsPwjL5La5ZKoWudclWue6rTj3PJqSeJGoi3k7giBRefFSs4b+45nhqskOcaL a6UyxPPBMRsnx1l0ZR87y/g1LR6nFbbFGk0wPGM/7t4b34GLUSI+S7e+CwVmPUV6KykB DFT2mP7V5fyYhxJu3C7izONLu8svPGrFFq7agSUepcl0cxUAtNkJyHsJdE2liNw5r/F/ HQRztQ9Y9g8NsyNne/WSVe65KdDI6fgXEG9/wvdFATSuMQ+7ptcH5FauW7I22gWRr9+P gN+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419586; x=1715024386; 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=bvtcoSNmHJyPK9Yxvdf/16D7QT7gwaP1R4zyZ6VaX/E=; b=e2kgRNpDTFSwj1Po6sg0EP4i5c9DKU25rAaAk8Td9DrNdmb7yHQ2c2jLOMtxu495SB jchiForJMsJgI+xujYb8ECqBiOebbO52F3NKjqcTW46NioLAQ66tGXnxLfruudFPASbQ bq50GZr1ywc5nQKNsjJgFKlWjCGabdfD9Jqrz2bG1mkZ/kEsev/mhvuMpHKB1xnEQrYx VoENUlBxd42AyOkwuXy5qIyoCulnIpMr3KsybDWTMjU94JRvx+JLzXfMV7BBK1CqMbbT V5lxg6iUOPjx9IW+rcIiJpamkp8TGZJCpG7JQbgoNzsUAEnsEcqlu0ElgPOfo0hJAk8v 1HOQ== X-Forwarded-Encrypted: i=1; AJvYcCVB6eHjWtbTqDNryZjsrTyx98mBhItWVtvWfokSznM7AAwlXtlt8tINbQLDxLJdU1bjm1d6ww/KBNTSADmxGZbv0rt4YjMBPSGj6MWLBJapeRoeF69yXCvX4VRad8uXk/H1N8zMhkl4qwM6e10AbdVxSCykFxiawRSjlcV9iD0JrTmfY7mXOhMs12rwFz6wlMa0s7WpmE4gCGEfYmLo6r89Lp3tIaCQ8/lOEonV5kWL0wtM4qc= X-Gm-Message-State: AOJu0Yyg5IGfgND9zgzqh0QsR3xK78i0A/H2/JFVLEG4A3YpcgyqJqV7 GwQ8DHZfmzm/7UriXEOS/v97mXta67nYnVxchF6k9Ta/jX1h+uuT X-Google-Smtp-Source: AGHT+IHSnDWahXuoiSDXC0PbzHzDdWYaT2zAER4xc4v4brlYZetM7hGw+hMRIEMbRLILknW0hU1xag== X-Received: by 2002:a5d:9492:0:b0:7da:67fa:7da7 with SMTP id v18-20020a5d9492000000b007da67fa7da7mr14361568ioj.3.1714419586086; Mon, 29 Apr 2024 12:39:46 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id y16-20020a056602165000b007de9f92dc57sm2325105iow.16.2024.04.29.12.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:39:45 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: ukaszb@chromium.org, linux-doc@vger.kernel.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, Jim Cromie Subject: [PATCH v8 35/35] drm-print: workaround compiler meh Date: Mon, 29 Apr 2024 13:39:21 -0600 Message-ID: <20240429193921.66648-16-jim.cromie@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429193921.66648-1-jim.cromie@gmail.com> References: <20240429193921.66648-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" For some reason I cannot grok, I get an unused variable 'category' warning/error, though the usage follows immediately. This drops the local var and directly derefs in the macro-call, which somehow avoids the warning. commit 9fd6f61a297e ("drm/print: add drm_dbg_printer() for drm device specific printer") CC: Jani Nikula Signed-off-by: Jim Cromie --- 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 efdf82f8cbbb..c400441cd77e 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -183,11 +183,10 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va_format *vaf) { const struct drm_device *drm = p->arg; const struct device *dev = drm ? drm->dev : NULL; - enum drm_debug_category category = p->category; const char *prefix = p->prefix ?: ""; const char *prefix_pad = p->prefix ? " " : ""; - if (!__drm_debug_enabled(category)) + if (!__drm_debug_enabled(p->category)) return; /* Note: __builtin_return_address(0) is useless here. */