From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53DFFCDB46E for ; Thu, 12 Oct 2023 19:48:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A5ED38D014D; Thu, 12 Oct 2023 15:48:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 970B98D0002; Thu, 12 Oct 2023 15:48:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8110F8D014D; Thu, 12 Oct 2023 15:48:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 702908D0002 for ; Thu, 12 Oct 2023 15:48:45 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3D685B5628 for ; Thu, 12 Oct 2023 19:48:45 +0000 (UTC) X-FDA: 81337847010.14.92A1514 Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by imf09.hostedemail.com (Postfix) with ESMTP id 78C1E140038 for ; Thu, 12 Oct 2023 19:48:43 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=DVFVylqN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of jim.cromie@gmail.com designates 209.85.166.48 as permitted sender) smtp.mailfrom=jim.cromie@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697140123; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aeZlT3fWkSsRBBC0KH8nwdyunCgP5eGN9Bq/f3gwBO4=; b=Z5QAA59B59IqBk/LRh6IQKXW059YfJeXnlELNgzCRR6unBWUOWnR40y5ekqC3gMKnLUmS6 16WgzZDeoxKYbzwYBaS6icJJ2Eum6CHpEVSDQ3IFvwSxQ8uewdslEQFLpu90+uWqPTpObM +50hH8PGV2eDSG+u9t3Pzjjq5xAVvTc= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=DVFVylqN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of jim.cromie@gmail.com designates 209.85.166.48 as permitted sender) smtp.mailfrom=jim.cromie@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697140123; a=rsa-sha256; cv=none; b=M+E8NAxgpAaa19cV1Gi7EpxPrjMzxYaVPGcD+is/zlMEu6HJIME3JF+izUzzwjjEUz/4Gr s2SFqIXKLIwyIjAzDBBzZF7aYzTKoUloS8Hm+lFCPvR3v84NWtbyL2HzLmVhrhDqQdenHO joR+AiC6ljwfgizUQkqCtyD7EdEUkHQ= Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7a5d26511f7so41961839f.2 for ; Thu, 12 Oct 2023 12:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697140122; x=1697744922; darn=kvack.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=aeZlT3fWkSsRBBC0KH8nwdyunCgP5eGN9Bq/f3gwBO4=; b=DVFVylqN2RSlEM3vyNulmiLE5NNo5OVJfRJQnhzk4D8WlcmWalvCV9OpC6oh9cAX+8 rKrfIhSgHacze3fmUkBOtVUIHMgUQctdI0hvxiOwtTAjllGqy7QHpbsW5syQOVb4AHIl nBnNMio129o270QCNNolAdYQ2CR8Rhdx9m3Tbeb4TErnDQluyW5J52lP3IOyJqaacA6l MEWIBTA1GiWOAhFVENfz+EXDLZPTcbt5s5lK9jPTReAKV4w/ibdLWmxCYNsnoCHeBLjP 5x4hEbmWEpvEApRKJbUV8Ks3mKFv1G1m3A6yD/BK3o3Z7KXPNiCn9iYGJkQKjCWiZlx9 AJMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697140122; x=1697744922; 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=aeZlT3fWkSsRBBC0KH8nwdyunCgP5eGN9Bq/f3gwBO4=; b=DJiYIbKipgGjK1b2fidFPQ7L0lWHstpLIhLZPyLkGRpD0UiISlF2sbe3T5D56SrUkI 5ZLO8tbCgmOb8ykYs8x+bbrydk4tTGWHTldzn7MbaAUUm0IP9g0Tp28cBf+hPPPhSJoq zFX3BRIapWhQUMmmHeC5ujGawQoPueu2kEXUZwhAxW4aH1nYDHtNAIs0pWKQpCvtPX+D kGIKe0O3dx8GTg99CHq/wRK8qdbezCnwrZJBiU5j/ZsvJtVDwwAKaYp56VzuOBa3E8Fe ygSiuSDyDxsnC9uBDKrYnA19eo5rk/28mcbQDY2jtl0QSiyFsxryEEBQlJho1xS9GcA3 l7zQ== X-Gm-Message-State: AOJu0YwhBh7vbzjjdLIl3GPNXH4aoDd+v7vyRCREJBJ/lzGSQvlEH2yW hWmquK7qBi2ob/FknCB4JZE= X-Google-Smtp-Source: AGHT+IFFhJf/S6gN8jP4a20rhHTQC/HvlBHfDKD0Jy1c5AB7c08SdgSogYnGLzu7Mmjg+FissnHXPA== X-Received: by 2002:a5e:8c0c:0:b0:794:efb0:83d6 with SMTP id n12-20020a5e8c0c000000b00794efb083d6mr30403278ioj.12.1697140122710; Thu, 12 Oct 2023 12:48: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 h6-20020a5d9e06000000b007a25540c49bsm4307891ioh.27.2023.10.12.12.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:48:42 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: david@redhat.com, lb@semihalf.com, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, Liam.Howlett@Oracle.com, linux-mm@kvack.org, Jim Cromie Subject: [RFC PATCH 06/10] dyndbg: add site_*() macros to avoid using _ddebug.site Date: Thu, 12 Oct 2023 13:48:30 -0600 Message-ID: <20231012194834.3288085-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231012194834.3288085-1-jim.cromie@gmail.com> References: <20231012194834.3288085-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 78C1E140038 X-Stat-Signature: 8mo3iftacgmizrsxpeyc1ihfwrn4qpdk X-HE-Tag: 1697140123-280686 X-HE-Meta: U2FsdGVkX193KdYwNAenM7cBWfw575k8NfFGldjwBozF1BQBKgwcdAdt/HlAvRPD0Y88zrNrZtX1KdlPyXiLU8znggESCQcfQtLNckdss54eBMDQtnMyznhKujHgBku+BWhnyCc8aZHQyqLW55eDEzTD0DjkkeQ6LbnHjbVsJqmVQVMOSNldnuPzoQDyHBz4peHneQnux7jEcVG2SkRqIqwIaHd17ALp56xQii8aWIOh95wtmHNJcGm28vVYh+iUrT4dwcF+CkwQ6Ht7+m3Q2OK9sHndxEbyMqbihpUl+uTEYV9m5PtD7pM17JlRLZoa3g7KajdVPvFrDCXaDz8jYpkgmUmEngZBBN62n8rzkPhEl6jbRNmFtgkW9yyMCDSFklXRMtEP6PAGIJcCGKjC5n9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F3mGzPalXNLQu9MeXR76N4jB8esFj69ADXaNQrMvXmoGP9LJhxqcpKspu6TCIaAPS3Zbs3fhOoqaMsb3COb+IYombSqJUpGO4/oE6X0INyXjFyTg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: adjust ddebug_condense_sites() and dynamic_debug_init() to replace desc_*() uses with new site_*() macros which avoid the _ddebug.site pointers by relying upon site* cursors instead. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 563d373224ba..48564625a37e 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1426,6 +1426,9 @@ static void dd_store_range(struct maple_tree *mt, const struct _ddebug *start, v4pr_info(" ok %s at %lx\n", val, first); } +#define site_function(s) (s)->_function +#define site_filename(s) (s)->_filename +#define site_modname(s) (s)->_modname static void ddebug_condense_sites(struct _ddebug_info *di) { @@ -1440,27 +1443,27 @@ static void ddebug_condense_sites(struct _ddebug_info *di) BUG_ON(site_function(cur_ds) != desc_function(cur_dd)); - if (!strcmp(desc_function(cur_dd), desc_function(func_dd))) + if (!strcmp(site_function(cur_ds), site_function(func_ds))) continue; - dd_store_range(&mt_funcs, func_dd, cur_dd, "func", desc_function(func_dd)); + dd_store_range(&mt_funcs, func_dd, cur_dd, "func", site_function(func_ds)); func_dd = cur_dd; func_ds = cur_ds; - if (!strcmp(desc_filename(cur_dd), desc_filename(file_dd))) + if (!strcmp(site_filename(cur_ds), site_filename(file_ds))) continue; - dd_store_range(&mt_files, file_dd, cur_dd, "file", desc_filename(file_dd)); + dd_store_range(&mt_files, file_dd, cur_dd, "file", site_filename(file_ds)); file_dd = cur_dd; file_ds = cur_ds; - if (!strcmp(desc_modname(cur_dd), desc_modname(mod_dd))) + if (!strcmp(site_modname(cur_ds), site_modname(mod_ds))) continue; - dd_store_range(&mt_mods, mod_dd, cur_dd, "mod", desc_modname(mod_dd)); + dd_store_range(&mt_mods, mod_dd, cur_dd, "mod", site_modname(mod_ds)); mod_dd = cur_dd; mod_ds = cur_ds; } - dd_store_range(&mt_funcs, func_dd, cur_dd, "func:", desc_function(func_dd)); - dd_store_range(&mt_files, file_dd, cur_dd, "file:", desc_filename(file_dd)); - dd_store_range(&mt_mods, mod_dd, cur_dd, "mod:", desc_modname(mod_dd)); + dd_store_range(&mt_funcs, func_dd, cur_dd, "func:", site_function(func_ds)); + dd_store_range(&mt_files, file_dd, cur_dd, "file:", site_filename(file_ds)); + dd_store_range(&mt_mods, mod_dd, cur_dd, "mod:", site_modname(mod_ds)); } /* @@ -1688,13 +1691,13 @@ static int __init dynamic_debug_init(void) } site = site_mod_start = di.sites; - iter = iter_mod_start = __start___dyndbg; - modname = desc_modname(iter); + iter = iter_mod_start = di.descs; + modname = site_modname(site); i = mod_sites = mod_ct = 0; for (; iter < __stop___dyndbg; iter++, site++, i++, mod_sites++) { - if (strcmp(modname, desc_modname(iter))) { + if (strcmp(modname, site_modname(site))) { mod_ct++; di.num_descs = mod_sites; di.num_sites = mod_sites; @@ -1705,7 +1708,7 @@ static int __init dynamic_debug_init(void) goto out_err; mod_sites = 0; - modname = desc_modname(iter); + modname = site_modname(site); iter_mod_start = iter; site_mod_start = site; } -- 2.41.0