Message ID | 20231013224818.3456409-21-jim.cromie@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp2194299vqb; Fri, 13 Oct 2023 15:50:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELmF4FzKnZPx81nX9BfKFDvM1CMXTqecS0JdsEAv+Wi7DkalaRgC99yb2hif7WL2xwclKe X-Received: by 2002:a17:902:da8d:b0:1c1:fbec:bc3f with SMTP id j13-20020a170902da8d00b001c1fbecbc3fmr30863320plx.5.1697237456871; Fri, 13 Oct 2023 15:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697237456; cv=none; d=google.com; s=arc-20160816; b=wiApYH12Ukd54gEGwckepIkrx5VpoLo1DF9Ngceew+02c2S4R13EEGT9rjTFzz6e7U vFITBuyKsVDkplUn5sf0XLIr3mcyKL5MvZP9kOkkLLXa3t4U6YXymDWj+RnVOmJgaUBk CsM2qgcEcOlu0Zy88Kj5N22pYAwOLK/nH1BjfG4sJrAkqczf/m1nWHNhitNNpo8eeMRp lMRybJP2hCdTXWDQ2gjLS0dNsTqGGJ4b1CMqAO38yLIaYdtZCzGvJvejGjNQpHL0b0id Efk50WJKRIuvlwAel1Hq7kCix4C1X7Sr1vvW3j1XKNGf3qgcWie7QRRGBk/4SLOXe7Iq XLew== 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=PdhZKvxYwXdkWkdLVl73JQfyJJ5FbxfJO6rydQUwjqs=; fh=z8A2UgI9Ozi/zM+meU3S7fSTeKB52ixSkA1q1cGr6xs=; b=uSIMqnr1q9eIdcf67W8p0CLE/+Stw33oW/dAOSM3U0gSXPO2hz9n2j8aH2VG9Lw93h y+TfvBwHeb5Rli2/xcVWnXGiZfzBNfB4AgcPZhn1gMotGakfgEU0HQJ61rEcT+gUNfII 5REExFqLTEbG+Z/AZg3WBymgaFfjg+gKe3NdF3boSzgDbNELQ0tqRc9LkLo+qrLSeMIM /z1yXWgokUZmc1cu2xwExj8TeT8ByFEWqt3zd8oqH1W8yE1CnGe8t5KTrASt1ELfm7EY UYL9go1VSulIlNygXz/IbugfnnzZnzofiupsbQigoSlTFUXJu0/ye538CqhSGrJCm0ir qkzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fkCgiM1q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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. [23.128.96.34]) by mx.google.com with ESMTPS id l3-20020a170903244300b001c1f1394bf9si6086773pls.357.2023.10.13.15.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 15:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fkCgiM1q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 9DE168072A1F; Fri, 13 Oct 2023 15:50:51 -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 S232717AbjJMWuC (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Fri, 13 Oct 2023 18:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232769AbjJMWtc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 13 Oct 2023 18:49:32 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D69EA122; Fri, 13 Oct 2023 15:48:56 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-3528bc102adso9321425ab.2; Fri, 13 Oct 2023 15:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697237334; x=1697842134; 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=PdhZKvxYwXdkWkdLVl73JQfyJJ5FbxfJO6rydQUwjqs=; b=fkCgiM1qHGJeYwxsBCWruuxcsveP966l3+Fbdau9D1xmWPuOIIjfnud/a3R2w86XaD rIVAH9jSotzJ0ZJyLtvm7oU5mhuRrtcSelBBW/YT7hFTI2Ed2bKxoSJZPTbHfANihyI7 fSuU2dj2fzOHQpkBCczo9LqVeBCiBiudSunMoiRjBqiIgeiQhBqkhZmW+TY+CA+EMe2L lZCo5F2pbax68ZKHUMNsiFFBKt92zGCqCwxZ4wS8PhpckISWoAxmLeG3ny8q6iAs1NPF B0hO+ZdSXyP5E6wWfZBPnGCCSbAsXW0pJ195AzhxsGbLtYOV8k/j5voJ74WImEsqFTzF K+Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697237334; x=1697842134; 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=PdhZKvxYwXdkWkdLVl73JQfyJJ5FbxfJO6rydQUwjqs=; b=ZEAqthY9WBdy7DzSFmB9/jr9wNkTaaRBlrTaCo/E9wMSnePhFKf848qJEySHYzejSO FFGeAsIksle9xTj2vGQ9k8cuI9MxLoatu3fOXM7uxJeuA97vn4o+6rGhvKp0w25mspGC N1IRt8YrqThdEsu9Xwzt4b+gN2+5r4F/Il9XUaw23W1fRHOFSPth1lqfhFh2xEo52Ei0 /2OHyM+GUZ6C2wvfwjQdmkrZ6Wi1Irs+UZzqgMbRhpOpusJTpOxuTkC3ssPk+jIaa5wh XoJ6I+0bMUWdrZ5QVxueUYW+VyafrGEEzVXCkImQf+Ia8uNKh2w60qC4LJg2FeXCbOHe fq1A== X-Gm-Message-State: AOJu0Yy2+RPyd+3iBUEk4RnzmjRmL6r4p0iFFEnsGr7SjHQHgw9k7bq2 7yCHgj0j6IpfzLxHeTU7R4znsR/Kvmgvjg== X-Received: by 2002:a05:6e02:1c28:b0:34b:ba9f:679c with SMTP id m8-20020a056e021c2800b0034bba9f679cmr37397493ilh.16.1697237334576; Fri, 13 Oct 2023 15:48:54 -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 t10-20020a92dc0a000000b003512c3e8809sm1683071iln.71.2023.10.13.15.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 15:48:54 -0700 (PDT) From: Jim Cromie <jim.cromie@gmail.com> To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: lb@semihalf.com, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, daniel.vetter@ffwll.ch, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, Jim Cromie <jim.cromie@gmail.com> Subject: [PATCH v7b 20/25] dyndbg: add _DPRINTK_FLAGS_INCL_LOOKUP Date: Fri, 13 Oct 2023 16:48:12 -0600 Message-ID: <20231013224818.3456409-21-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013224818.3456409-1-jim.cromie@gmail.com> References: <20231013224818.3456409-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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]); Fri, 13 Oct 2023 15:50:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779682463459348657 X-GMAIL-MSGID: 1779682463459348657 |
Series |
fix DRM_USE_DYNAMIC_DEBUG=y regression
|
|
Commit Message
Jim Cromie
Oct. 13, 2023, 10:48 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 retrieved 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.
doesn't 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 927cb14f24e0..2237d454bc19 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