Message ID | 20230911230838.14461-20-jim.cromie@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp229006vqx; Tue, 12 Sep 2023 00:18:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFALHL98hBQwiZN3m0RA5Y13bRDPOl3FR5FfPL6ceVdx5uebc9pxtPfOEwfMvuUiWe4Gnf7 X-Received: by 2002:a17:903:4285:b0:1c3:3c0f:3dee with SMTP id ju5-20020a170903428500b001c33c0f3deemr9226571plb.31.1694503081454; Tue, 12 Sep 2023 00:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694503081; cv=none; d=google.com; s=arc-20160816; b=Ohnvy94FDztRHZLW16s+8hR4SRRs9f3a8Z04Nl7rPpUum8qAp+lAeBPteNmuQWKZ4j b1VU60LUSpbQjyHbYykK+eo+Vdnu7Uswp053dgVLQkaEyW5xy+2VTp+zFUeIixcFLVus k89BJ0CH2B3oSPjU2stuJmvve7qpBf2z6Vs5GQ8mTOeeanIVPQfCv8RaSN+I1mabipYE 1D2KxdbhFcoqvYdihp30sNaZW9eCNdWKQbI3gs91TFlQl+4STiqD0+ok+ODvib50SKWN P7Ax+F+Rssp67mbYgKgQhppPGZo/i5z3rBSwDZu80Qd3fsbIDiOhWq7zrPBCB0AwUN/d UDmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ESkE1bZNfU1HWAKelmlyxfVO/PhQytfAXhWjbkh3sXk=; fh=lxaKKEVRHc4DKNzSwZQ1vuzFBPp/LFY0Le4b1Q6OMeE=; b=TJh10zmPZyYPwcTM7sdSDOf0B09mIK7y14kyFb0H96lUZTbd0FsTWV/dlb4gGNb5uA xHtU91bvZuqn/exc9cNMGQdwHYZi9FRjNF7pQaHUjMEcEN+lQTPgWCRZAJkPC1lOw9EU eU4QZ7spHPzf7pd8zM/RkSWi7uLT8DWql7MsYa81HBREXrYER4WjGH0ZWkN1pRj+QMG/ fuX1BFjFG38q6q6R+45LPlBx/jGV32D3rfZY3KdTCXcKh0mom413SdR6fj3+RDF6AbbC QNi1fwL7usp55zQCu12etDpy3g3m/RQogQV3J0L7oT7fuQXEyiZtYGlcx3xJW8wOFBuC 3wUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Lcjj5t0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q9-20020a17090311c900b001bbaa5e95fdsi7640689plh.102.2023.09.12.00.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Lcjj5t0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5811A828F495; Mon, 11 Sep 2023 21:31:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239144AbjILCeU (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 82 others); Mon, 11 Sep 2023 22:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239323AbjILCeG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 11 Sep 2023 22:34:06 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 506C989A96; Mon, 11 Sep 2023 16:10:44 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-79536bc6697so181327839f.1; Mon, 11 Sep 2023 16:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694473746; x=1695078546; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ESkE1bZNfU1HWAKelmlyxfVO/PhQytfAXhWjbkh3sXk=; b=Lcjj5t0jnyL1eJYPppc/vIAmycCSJaxf2llQpcpyHfWJ94OcmpNlA6vCAdW3rWj4za H6ql6yiPFYV0tF+aKqeJCuJaynXZs7Uca+2Hy5rbiW/t5s3ECXygnkiRKEFurUtXYJ+H 3ltRwRTp/ZBHYbsd2wG5OxmJvxOUz850ef7Vj9Zm54Nk1ybtgaecHGb/ERr76Ai8HZfe 3BntSBWn7IugX8H6yvMttDV9Qy+kCe8+0Rj2NhpxS5kJr3bsp+MOsvc5mzWSM0QzijT5 oy3bQGrnq4AcdOb+3XXBGKBpEc4Jh61YP4idJkNEIKbCqV4vxU94UCELLKOxnrzm0IuT AlcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694473746; x=1695078546; 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=ESkE1bZNfU1HWAKelmlyxfVO/PhQytfAXhWjbkh3sXk=; b=gdrR4WU/24L3gJ94tQOEV3tSX8rKFNxRhIPnHt8o7JmoXITY5kWba5v5opz4ixTyxJ 5PUu5W9fdjrXP3mEmdEQJg9xz8VBzyi5K7lxnkqygoGuGDhTyGL8HW6tJZ08QvpkhmN0 AF6zGfdSBWBBZRo3e+c/V150Q4XtorlC2suL59FVZWZ1hJ8cb7Nv31ZCDtpMoiDkN00i 2w9gAOJwmIuM0CaFOvtq0qAWVoqZCPJ0z7KGOnDcWRioY8a3JyIaxMb2auSKwjDxKuYG ZJTOCarwMVZGKENojw5MsD6F2bS8ZzSwRjQuB6jG54R24SgnzXM+kLB2gVf8cyGg2HID Nq+Q== X-Gm-Message-State: AOJu0Yzmp6yna0yNr6gf2iH/foCer524FjFBzwouOxzJ0sMY7E4W3VDj uCe4PiB6D3zzkCe+9i7DTPw= X-Received: by 2002:a05:6e02:1bae:b0:34c:c8e8:ca87 with SMTP id n14-20020a056e021bae00b0034cc8e8ca87mr14120307ili.20.1694473746384; Mon, 11 Sep 2023 16:09:06 -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 z4-20020a029f04000000b00423240c7296sm2512607jal.69.2023.09.11.16.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 16:09:06 -0700 (PDT) From: Jim Cromie <jim.cromie@gmail.com> To: jbaron@akamai.com, gregkh@linuxfoundation.org, mcgrof@kernel.org, daniel.vetter@ffwll.ch Cc: 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, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, linux-doc@vger.kernel.org, Jim Cromie <jim.cromie@gmail.com> Subject: [PATCH v6 19/22] dyndbg: add _DPRINTK_FLAGS_INCL_LOOKUP Date: Mon, 11 Sep 2023 17:08:35 -0600 Message-ID: <20230911230838.14461-20-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230911230838.14461-1-jim.cromie@gmail.com> References: <20230911230838.14461-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 11 Sep 2023 21:31:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776815263128471312 X-GMAIL-MSGID: 1776815263128471312 |
Series |
fix DRM_USE_DYNAMIC_DEBUG regression
|
|
Commit Message
Jim Cromie
Sept. 11, 2023, 11:08 p.m. UTC
dyndbg's dynamic prefixing (by +tmfsl flags) is needlessly expensive.
When an enabled (with +p) pr_debug is called, _DPRINTK_FLAGS_INCL_ANY
prefix decorations are sprintf'd into stack-mem for every call.
This string (or part of it) could be cached once its 1st generated,
and retreived thereafter, as long as its deleted any time the
callsite's flags are changed afterwards.
So consider the prefix/decoration flags: 'tmfsl', and what should be
in the cache:
-t thread-id. not part of the "callsite" info, derived from current.
doesnt belong in the cache. it would be wrong.
can be done in outer: dynamic_emit_prefix()
-l line number
this could be part of the prefix, but would bloat the cache
can also be done in outer: dynamic_emit_prefix()
-mfs module, function, source-file
we cache these, composed into a sub-string.
they are "lookups", currently to descriptor fields,
could be accessor macros to "compressed" tables.
cache saves more access work.
All enabled together, they compose a prefix string like:
# outer -----inner---------- outer
"[tid] module:function:sourcfile:line: "
So this patch extracts _DPRINTK_FLAGS_INCL_LOOKUP macro out of
_DPRINTK_FLAGS_INCL_ANY macro, then redefs latter.
Next re-refactor dynamic_emit_prefix inner/outer fns accordingly.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
include/linux/dynamic_debug.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index bdb0d12b13ec..c5609560ca1b 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -40,10 +40,12 @@ struct _ddebug { #define _DPRINTK_FLAGS_INCL_SOURCENAME (1<<5) #define _DPRINTK_FLAGS_PREFIX_CACHED (1<<7) -#define _DPRINTK_FLAGS_INCL_ANY \ - (_DPRINTK_FLAGS_INCL_MODNAME | _DPRINTK_FLAGS_INCL_FUNCNAME |\ - _DPRINTK_FLAGS_INCL_LINENO | _DPRINTK_FLAGS_INCL_TID |\ +#define _DPRINTK_FLAGS_INCL_LOOKUP \ + (_DPRINTK_FLAGS_INCL_MODNAME | _DPRINTK_FLAGS_INCL_FUNCNAME | \ _DPRINTK_FLAGS_INCL_SOURCENAME) +#define _DPRINTK_FLAGS_INCL_ANY \ + (_DPRINTK_FLAGS_INCL_LINENO | _DPRINTK_FLAGS_INCL_TID | \ + _DPRINTK_FLAGS_INCL_LOOKUP) #if defined DEBUG #define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT