From patchwork Thu Oct 12 19:47:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13419731 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 CD67CCDB46E for ; Thu, 12 Oct 2023 19:47:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 860F38D0142; Thu, 12 Oct 2023 15:47:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 811288D0002; Thu, 12 Oct 2023 15:47:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B3958D0142; Thu, 12 Oct 2023 15:47:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 580AD8D0002 for ; Thu, 12 Oct 2023 15:47:30 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 30D3F1407E7 for ; Thu, 12 Oct 2023 19:47:30 +0000 (UTC) X-FDA: 81337843860.16.B780D41 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by imf30.hostedemail.com (Postfix) with ESMTP id 48CFB80013 for ; Thu, 12 Oct 2023 19:47:28 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CPCh8I40; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of jim.cromie@gmail.com designates 209.85.166.46 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=1697140048; 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=LsLPZb88n4vQg0pUIOG8RKXDQhM3h890onzf98JeoyodzuLfyb/N+IMjxEJpMc5gRZyMuD ow8XX0HVkNj6uoiihgds3pzPP/wReF5e1efzLEcxm3jAy85aorb4x29fyzkGO49uchep3h eeJ3SezHEpZjQK6anS/HjETUzgMGmOY= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CPCh8I40; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of jim.cromie@gmail.com designates 209.85.166.46 as permitted sender) smtp.mailfrom=jim.cromie@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697140048; a=rsa-sha256; cv=none; b=S49EOHyIuHcIFiF7YEaaaj/drQM1KCaTrCApqLOdLmXXORDl18KeLOX8M+k1tNKPCF8bR3 wxGHf9fsT0SPC946OxGUPFCOzpeH7ztZjQ7OGy/dkYGBM/CdE1/4ZyY7HSPnmsXb78rts8 qCXyX3w5e2VVpe30mVpfNNGB+4tnx8o= Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-79f9acc857cso49087739f.2 for ; Thu, 12 Oct 2023 12:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697140047; x=1697744847; 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=CPCh8I40AHbU492um9XEvDM+bKx4EYQ0MvbcrG8fiOWDPKTrpVcXJWwFdLkjGuOIvf cjkcQP2D8wkFIX9HIVKFj5MRnOAeq7pjo/aGYOGxR2HDXSCRzNo56GCzAzpQP7cOf7Nz eGMI2VBmH6ga6m7opvyaKtJifOaSuho3lCSPAQ+srTGqQsQUtU/UatbTSrzXFycoMrI2 ViJ8SPVUwB+c+1OtI2HcicjNdkOEEkg+KQHqx4tW5tVpWkgqOaiprPFm6QaLCyN3zwKj 20LCAh1qsvZsfoYt0E/uQxEV/jbBULPTMA1g2uPBDvpMX4AxyQ3hW6OK2hKAr6eFhQQB ALsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697140047; x=1697744847; 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=w8GsBk5Z8IFRwsDbTPJPpgipU0OKI+YR7sCeOZSNKH8i8OHdHMIuA6q2YAPzderTHP 649eZYFX7HOIBt9DcRM3f9NweIXcSXGRcI9Xx7PlAakpKqUg+UguxMFgaQxUFU0VCZST qIKM218nniQO4Ocu/2o+kGZfB0QUMSb/r7sAKm6UQRxg0XFv97klONq2+465LOWhWqi4 Ua3FFpoA8piLrX1zYeqq08hb58VdWR3YtBI4jfQpEjaRnkHd7BmAWNd0ss+Cysb6/9vO Z30bIKFerpxbI3sJyuRPrijYkMOoH2K30OvMx0q6nRkEuxB1fzpQijFFqtJDwcqmwGq0 ijKA== X-Gm-Message-State: AOJu0YwgitawW22kLtoroZ5op5MGcDvCP/3x6CgpW2RKOPHGha60D5bb yFQlAX1cY1s2RYETgGAa/pY= X-Google-Smtp-Source: AGHT+IHn7mDbO0S9A1+0b66S1qg4vsjED53qQ+O/oQTsPg5mse541WjW5llcVGB1QOru72YgI0Y3oA== X-Received: by 2002:a6b:f30b:0:b0:794:e015:585e with SMTP id m11-20020a6bf30b000000b00794e015585emr27649805ioh.21.1697140047466; Thu, 12 Oct 2023 12:47: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 z7-20020a5ec907000000b0079fbb834232sm4351002iol.19.2023.10.12.12.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:47:26 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org Cc: david@redhat.com, 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:47:07 -0600 Message-ID: <20231012194711.3288031-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231012194711.3288031-1-jim.cromie@gmail.com> References: <20231012194711.3288031-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 48CFB80013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 8mo3iftacgmizrsxpeyc1ihfwrn4qpdk X-HE-Tag: 1697140048-280666 X-HE-Meta: U2FsdGVkX1/04fuHwctpEnekDgUKeMJ1w4T0l5kbWpd0O8GQ31VyTrO7/R6QNSf7dMBOxoP5zgwWaQaFudY9XdfhbIXEtnsmPMHnfZKAK9r9WiE0UgYPdhnG9bCtZ4IOAsMtk2EqTOwUVq/GCGkmEb+Qr/uxY3WNx/QMJZ/rrfFdCekIaA0zQDnpR1nQAsBuHrJzmkRhOnwuZZDxj6HjXi9BjEc3jIeuDv1X1L+1mPZ30hwJk/TWES1Tyq3FGGSyIlaJcUecV8mZT6JeGdzIgRR5B0I4C89RXh29oeBg+QvY4dPyvpiHzG7diZp6J7HNhzC9WmzmjPHOX+Qdk4JZ+RduAHWcC3mjMmIomi2c/vbFhIocc4hwZZy5tpcqLw7YMcNUiL9dcu66KVN/VLK82bpySjAWNdzbknh21SKkSCHUM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ZlB+IYfMOwgNdw+G4ZWHebH0PYXdmq/guQTE1GfkFhRMGNra3PVbFnL6SDnZZyHrOL7f5eOsc5jcWyiafi9Vdw== 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; }